mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-09 13:19:54 +00:00
Merge pull request #3409 from opensourcerouting/feature/cleanup-topotest-docker-docs
Feature/cleanup topotest docker docs
This commit is contained in:
commit
d801bfae85
@ -1 +1,7 @@
|
|||||||
.git
|
.git
|
||||||
|
**/*.a
|
||||||
|
**/*.o
|
||||||
|
**/*.la
|
||||||
|
**/*.lo
|
||||||
|
**/*.so
|
||||||
|
**/.libs
|
||||||
|
@ -70,7 +70,7 @@ RUN echo "" >> /etc/security/limits.conf; \
|
|||||||
echo "root hard core unlimited" >> /etc/security/limits.conf
|
echo "root hard core unlimited" >> /etc/security/limits.conf
|
||||||
|
|
||||||
# Copy run scripts to facilitate users wanting to run the tests
|
# Copy run scripts to facilitate users wanting to run the tests
|
||||||
COPY docker/inner /opt/topotests
|
COPY tests/topotests/docker/inner /opt/topotests
|
||||||
|
|
||||||
WORKDIR /root/topotests
|
WORKDIR /root/topotests
|
||||||
ENV PATH "$PATH:/opt/topotests"
|
ENV PATH "$PATH:/opt/topotests"
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
# FRRouting Topology Tests with Mininet
|
# FRRouting Topology Tests with Mininet
|
||||||
|
|
||||||
|
## Running tests with docker
|
||||||
|
|
||||||
|
There is a docker image which allows to run topotests. Instructions can be
|
||||||
|
found [here](docker/README.md).
|
||||||
|
|
||||||
## Guidelines
|
## Guidelines
|
||||||
|
|
||||||
Instructions for use, write or debug topologies can be found in the
|
Instructions for use, write or debug topologies can be found in the
|
||||||
@ -11,11 +16,6 @@ that does what you need. If nothing is similar, then you may create a
|
|||||||
new topology, preferably, using the newest
|
new topology, preferably, using the newest
|
||||||
[template](example-test/test_template.py).
|
[template](example-test/test_template.py).
|
||||||
|
|
||||||
## Running tests with docker
|
|
||||||
|
|
||||||
There is a docker image which allows to run topotests. Instructions can be
|
|
||||||
found [here](docker/README.md).
|
|
||||||
|
|
||||||
## Installation of Mininet for running tests
|
## Installation of Mininet for running tests
|
||||||
Only tested with Ubuntu 16.04 and Ubuntu 18.04 (which uses Mininet 2.2.x)
|
Only tested with Ubuntu 16.04 and Ubuntu 18.04 (which uses Mininet 2.2.x)
|
||||||
|
|
||||||
|
@ -3,34 +3,43 @@
|
|||||||
## Quickstart
|
## Quickstart
|
||||||
|
|
||||||
If you have Docker installed, you can run the topotests in Docker.
|
If you have Docker installed, you can run the topotests in Docker.
|
||||||
The easiest way to do this, is to use the `frr-topotests.sh` script
|
The easiest way to do this, is to use the make targets from this
|
||||||
from this repository:
|
repository.
|
||||||
|
|
||||||
|
Your current user needs to have access to the Docker daemon. Alternatively
|
||||||
|
you can run these commands as root.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
wget -O /usr/local/bin/frr-topotests \
|
make topotests-build
|
||||||
https://raw.githubusercontent.com/frrouting/topotests/master/docker/frr-topotests.sh
|
make topotests
|
||||||
chmod +x /usr/local/bin/frr-topotests
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Once this script is in place, simply run it while you are inside your FRR repository:
|
The first command will build a docker image with all the dependencies needed
|
||||||
|
to run the topotests.
|
||||||
|
|
||||||
```console
|
The second command will spawn an instance of this image, compile FRR inside
|
||||||
frr-topotests
|
of it, and run the topotests.
|
||||||
```
|
|
||||||
|
|
||||||
## Advanced Usage
|
## Advanced Usage
|
||||||
|
|
||||||
There are several environtment variables which can be used to modify the behavior of
|
Internally, the topotests make target uses a shell script to spawn the docker
|
||||||
the image. Those can be listed using `frr-topotests -h`.
|
container.
|
||||||
|
|
||||||
|
There are several environment variables which can be used to modify the behavior
|
||||||
|
of the script, these can be listed by calling it with `-h`:
|
||||||
|
|
||||||
|
```console
|
||||||
|
./tests/topotests/docker/frr-topotests.sh -h
|
||||||
|
```
|
||||||
|
|
||||||
For example, a volume is used to cache build artifacts between multiple runs
|
For example, a volume is used to cache build artifacts between multiple runs
|
||||||
of the image. If you need to force a complete recompile, you can set `TOPOTEST_CLEAN`:
|
of the image. If you need to force a complete recompile, you can set `TOPOTEST_CLEAN`:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
TOPOTEST_CLEAN=1 frr-topotests
|
TOPOTEST_CLEAN=1 ./tests/topotests/docker/frr-topotests.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
By default, `frr-topotests` will build frr and run pytest. If you append
|
By default, `frr-topotests.sh` will build frr and run pytest. If you append
|
||||||
arguments and the first one starts with `/` or `./`, they will replace the call to
|
arguments and the first one starts with `/` or `./`, they will replace the call to
|
||||||
pytest. If the appended arguments do not match this patttern, they will be provided to
|
pytest. If the appended arguments do not match this patttern, they will be provided to
|
||||||
pytest as arguments.
|
pytest as arguments.
|
||||||
@ -38,11 +47,11 @@ pytest as arguments.
|
|||||||
So, to run a specific test with more verbose logging:
|
So, to run a specific test with more verbose logging:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
frr-topotests -vv -s all-protocol-startup/test_all_protocol_startup.py
|
./tests/topotests/docker/frr-topotests.sh -vv -s all-protocol-startup/test_all_protocol_startup.py
|
||||||
```
|
```
|
||||||
|
|
||||||
And to compile FRR but drop into a shell instead of running pytest:
|
And to compile FRR but drop into a shell instead of running pytest:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
frr-topotests /bin/bash
|
./tests/topotests/docker/frr-topotests.sh /bin/bash
|
||||||
```
|
```
|
||||||
|
@ -22,9 +22,10 @@
|
|||||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
cd "$(dirname "$0")"/..
|
cd "$(dirname "$0")"/../../..
|
||||||
|
|
||||||
exec docker build --pull \
|
exec docker build --pull \
|
||||||
--compress \
|
--compress \
|
||||||
-t frrouting/frr:topotests-latest \
|
-t frrouting/frr:topotests-latest \
|
||||||
|
-f tests/topotests/Dockerfile \
|
||||||
.
|
.
|
||||||
|
@ -40,7 +40,10 @@ chmod 1777 /tmp
|
|||||||
if [ $# -eq 0 ] || ([[ "$1" != /* ]] && [[ "$1" != ./* ]]); then
|
if [ $# -eq 0 ] || ([[ "$1" != /* ]] && [[ "$1" != ./* ]]); then
|
||||||
export TOPOTESTS_CHECK_MEMLEAK=/tmp/memleak_
|
export TOPOTESTS_CHECK_MEMLEAK=/tmp/memleak_
|
||||||
export TOPOTESTS_CHECK_STDERR=Yes
|
export TOPOTESTS_CHECK_STDERR=Yes
|
||||||
set -- pytest --junitxml /tmp/topotests.xml "$@"
|
set -- pytest \
|
||||||
|
--junitxml /tmp/topotests.xml \
|
||||||
|
-o cache_dir=/tmp \
|
||||||
|
"$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user