From: Christian Franke Date: Sat, 1 Dec 2018 15:33:34 +0000 (+0100) Subject: tests/topotests: Update documentation X-Git-Tag: frr-7.1-dev~137^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b25e517b61dec86eac51f1309ddad3def78cafb1;p=mirror%2Ffrr.git tests/topotests: Update documentation The documentation needs an update to match the integrated version. Signed-off-by: Christian Franke --- diff --git a/tests/topotests/README.md b/tests/topotests/README.md index 3f1323c218..a495675ee9 100644 --- a/tests/topotests/README.md +++ b/tests/topotests/README.md @@ -1,5 +1,10 @@ # 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 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 [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 Only tested with Ubuntu 16.04 and Ubuntu 18.04 (which uses Mininet 2.2.x) diff --git a/tests/topotests/docker/README.md b/tests/topotests/docker/README.md index 918594e6a3..cdc41fad52 100644 --- a/tests/topotests/docker/README.md +++ b/tests/topotests/docker/README.md @@ -3,34 +3,43 @@ ## Quickstart 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 -from this repository: +The easiest way to do this, is to use the make targets from this +repository. + +Your current user needs to have access to the Docker daemon. Alternatively +you can run these commands as root. ```console -wget -O /usr/local/bin/frr-topotests \ - https://raw.githubusercontent.com/frrouting/topotests/master/docker/frr-topotests.sh -chmod +x /usr/local/bin/frr-topotests +make topotests-build +make 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 -frr-topotests -``` +The second command will spawn an instance of this image, compile FRR inside +of it, and run the topotests. ## Advanced Usage -There are several environtment variables which can be used to modify the behavior of -the image. Those can be listed using `frr-topotests -h`. +Internally, the topotests make target uses a shell script to spawn the docker +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 of the image. If you need to force a complete recompile, you can set `TOPOTEST_CLEAN`: ```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 pytest. If the appended arguments do not match this patttern, they will be provided to pytest as arguments. @@ -38,11 +47,11 @@ pytest as arguments. So, to run a specific test with more verbose logging: ```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: ```console -frr-topotests /bin/bash +./tests/topotests/docker/frr-topotests.sh /bin/bash ```