]> git.puffer.fish Git - matthieu/frr.git/commitdiff
topotests: Adapt docker changes for integrated tests
authorChristian Franke <chris@opensourcerouting.org>
Thu, 29 Nov 2018 14:22:23 +0000 (15:22 +0100)
committerChristian Franke <chris@opensourcerouting.org>
Thu, 29 Nov 2018 15:51:27 +0000 (16:51 +0100)
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Makefile.am
tests/topotests/Dockerfile
tests/topotests/docker/build.sh
tests/topotests/docker/frr-topotests.sh
tests/topotests/subdir.am [new file with mode: 0644]

index d12d45264500d691fb11396be5c9c81bfccaf786..c56a551aa50d7afb24307d9e25eb95f1989271ef 100644 (file)
@@ -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@
index 4a07336a19fc9446ae23d235fd468228e48eb39b..72a876ed83cc2b6c7f79defa104c64a694b4b6f7 100644 (file)
@@ -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"
index 47b14df0b0c45970295be1c040edf8cfa2d14efb..344fb2ffcba97958d52e8e152a8fad1752ec72f9 100755 (executable)
@@ -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 \
                  .
index 6ddfdc94848918b67e1ccf037699e0f6635c688c..9a157c49a81678c4593eea4c36af5cce04f0f538 100755 (executable)
@@ -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 (file)
index 0000000..e489f92
--- /dev/null
@@ -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