From ff37641ba2e8272ed4f58a88a9f837d5ff9bb560 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Thu, 29 Nov 2018 15:22:23 +0100 Subject: [PATCH] topotests: Adapt docker changes for integrated tests Signed-off-by: Christian Franke --- Makefile.am | 1 + tests/topotests/Dockerfile | 1 - tests/topotests/docker/build.sh | 4 +++- tests/topotests/docker/frr-topotests.sh | 10 ++-------- tests/topotests/subdir.am | 7 +++++++ 5 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 tests/topotests/subdir.am diff --git a/Makefile.am b/Makefile.am index d12d452645..c56a551aa5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -149,6 +149,7 @@ include yang/libyang_plugins/subdir.am include vtysh/subdir.am include tests/subdir.am +include tests/topotests/subdir.am if PKGSRC rcdir=@pkgsrcrcdir@ diff --git a/tests/topotests/Dockerfile b/tests/topotests/Dockerfile index 4a07336a19..72a876ed83 100644 --- a/tests/topotests/Dockerfile +++ b/tests/topotests/Dockerfile @@ -71,7 +71,6 @@ RUN echo "" >> /etc/security/limits.conf; \ # Copy run scripts to facilitate users wanting to run the tests COPY docker/inner /opt/topotests -COPY . /root/topotests WORKDIR /root/topotests ENV PATH "$PATH:/opt/topotests" diff --git a/tests/topotests/docker/build.sh b/tests/topotests/docker/build.sh index 47b14df0b0..344fb2ffcb 100755 --- a/tests/topotests/docker/build.sh +++ b/tests/topotests/docker/build.sh @@ -22,7 +22,9 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +cd "$(dirname "$0")"/.. + exec docker build --pull \ --compress \ - -t frrouting/topotests \ + -t frrouting/frr:topotests-latest \ . diff --git a/tests/topotests/docker/frr-topotests.sh b/tests/topotests/docker/frr-topotests.sh index 6ddfdc9484..9a157c49a8 100755 --- a/tests/topotests/docker/frr-topotests.sh +++ b/tests/topotests/docker/frr-topotests.sh @@ -61,9 +61,6 @@ if [[ "$1" = "-h" ]] || [[ "$1" = "--help" ]]; then TOPOTEST_OPTIONS These options are appended to the docker-run command for starting the tests. - TOPOTEST_PATH If set, don't use the tests built into the image - but the ones at the given path. - TOPOTEST_SANITIZER Controls whether to use the address sanitizer. Enabled by default, set to 0 to disable. @@ -136,6 +133,7 @@ fi set -- --rm -ti \ -v "$TOPOTEST_LOGS:/tmp" \ -v "$TOPOTEST_FRR:/root/host-frr:ro" \ + -v "$TOPOTEST_FRR/tests/topotests:/root/topotests:ro" \ -v "$TOPOTEST_BUILDCACHE:/root/persist" \ -e "TOPOTEST_CLEAN=$TOPOTEST_CLEAN" \ -e "TOPOTEST_VERBOSE=$TOPOTEST_VERBOSE" \ @@ -143,10 +141,6 @@ set -- --rm -ti \ -e "TOPOTEST_SANITIZER=$TOPOTEST_SANITIZER" \ --privileged \ $TOPOTEST_OPTIONS \ - frrouting/topotests "$@" - -if [ -n "$TOPOTEST_PATH" ]; then - set -- -v "$TOPOTEST_PATH:/root/topotests:ro" "$@" -fi + frrouting/frr:topotests-latest "$@" exec docker run "$@" diff --git a/tests/topotests/subdir.am b/tests/topotests/subdir.am new file mode 100644 index 0000000000..e489f92bfa --- /dev/null +++ b/tests/topotests/subdir.am @@ -0,0 +1,7 @@ +TOPOTESTS_DIR = tests/topotests + +topotests-build: ## Builds docker images for topotests + $(TOPOTESTS_DIR)/docker/build.sh + +topotests: ## Runs topotests + $(TOPOTESTS_DIR)/docker/frr-topotests.sh -- 2.39.5