]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Netlab tests can be called from this repository.
authorMaria Matejka <mq@ucw.cz>
Tue, 8 Nov 2022 10:26:11 +0000 (11:26 +0100)
committerMaria Matejka <mq@ucw.cz>
Wed, 9 Nov 2022 10:39:01 +0000 (11:39 +0100)
To allow this, I added bird-tools as a submodule (aux-tools). To run
netlab tests, call

make aux-test-prepare
make netlab-tests

and wait patiently until all the tests finish.

You may also request single netlab tests:

make netlab-test-ospf-base

To rerun the tests, run

make netlab-tests-reset

and all the test results are wiped to run a fresh batch.

.gitlab-ci.yml
.gitmodules [new file with mode: 0644]
Makefile.in
aux-tools [new submodule]
configure.ac

index dae59c75078505e0e0d197ffaf1e60fc510f05e5..6952239cebcbeb98a0079a6ae4585ea80484d82d 100644 (file)
@@ -4,7 +4,6 @@ variables:
   GIT_STRATEGY: fetch
   DOCKER_CMD: docker --config="$HOME/.docker/$CI_JOB_ID/"
   IMG_BASE: registry.nic.cz/labs/bird
-  TOOLS_DIR: /var/lib/gitlab-runner/bird-tools
   STAYRTR_BINARY: /var/lib/gitlab-runner/stayrtr-0.1-108-g8d18a41-linux-x86_64
 
 stages:
@@ -526,13 +525,8 @@ build-birdlab:
   script:
     - DIR=$(pwd)
     - autoreconf
-    - ./configure
-    - make
-    - cd $TOOLS_DIR
-    - sudo git clean -fx
-    - git pull --ff-only
-    - mv $DIR/bird $DIR/birdc netlab/common
-    - ln -s $STAYRTR_BINARY netlab/common/stayrtr
+    - ./configure --with-stayrtr=$STAYRTR_BINARY
+    - make aux-test-prepare
 
 .test: &test-base
   stage: test
@@ -541,146 +535,145 @@ build-birdlab:
     - birdlab
     - amd64
   script:
-    - cd $TOOLS_DIR/netlab
-    - sudo ./stop
-    - sudo ./runtest -s v2 -m check $TEST_NAME
+    - cd aux-tools/netlab
+    - make -f tests-v2.mk NETLAB_TEST_SHOW_OUTPUT=1 netlab-test-$TEST_NAME
 
 test-ospf-base:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ospf-base
+    TEST_NAME: ospf-base
 
 test-ospf-default:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ospf-default
+    TEST_NAME: ospf-default
 
 test-ospf-priority:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ospf-priority
+    TEST_NAME: ospf-priority
 
 test-ospf-nbma:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ospf-nbma
+    TEST_NAME: ospf-nbma
 
 test-ospf-ptmp:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ospf-ptmp
+    TEST_NAME: ospf-ptmp
 
 test-ospf-authentication:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ospf-authentication
+    TEST_NAME: ospf-authentication
 
 test-ospf-bfd:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ospf-bfd
+    TEST_NAME: ospf-bfd
 
 test-ospf-custom:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ospf-custom
+    TEST_NAME: ospf-custom
 
 test-ospf-area:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ospf-area
+    TEST_NAME: ospf-area
 
 test-ospf-vrf:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ospf-vrf
+    TEST_NAME: ospf-vrf
 
 test-bgp-base:
   <<: *test-base
   variables:
-    TEST_NAME: cf-bgp-base
+    TEST_NAME: bgp-base
 
 test-bgp-auth:
   <<: *test-base
   variables:
-    TEST_NAME: cf-bgp-auth
+    TEST_NAME: bgp-auth
 
 test-bgp-int:
   <<: *test-base
   variables:
-    TEST_NAME: cf-bgp-int
+    TEST_NAME: bgp-int
 
 test-bgp-merged:
   <<: *test-base
   variables:
-    TEST_NAME: cf-bgp-merged
+    TEST_NAME: bgp-merged
 
 test-bgp-flowspec:
   <<: *test-base
   variables:
-    TEST_NAME: cf-bgp-flowspec
+    TEST_NAME: bgp-flowspec
 
 test-bgp-rs-multitab:
   <<: *test-base
   variables:
-    TEST_NAME: cf-bgp-rs-multitab
+    TEST_NAME: bgp-rs-multitab
 
 test-ebgp-loop:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ebgp-loop
+    TEST_NAME: ebgp-loop
 
 test-ebgp-star:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ebgp-star
+    TEST_NAME: ebgp-star
 
 test-ebgp-role:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ebgp-role
+    TEST_NAME: ebgp-role
 
 test-ebgp-graceful:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ebgp-graceful
+    TEST_NAME: ebgp-graceful
 
 test-ebgp-import-limit:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ebgp-import-limit
+    TEST_NAME: ebgp-import-limit
 
 test-ibgp-loop:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ibgp-loop
+    TEST_NAME: ibgp-loop
 
 test-ibgp-loop-big:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ibgp-loop-big
+    TEST_NAME: ibgp-loop-big
 
 test-ibgp-flat:
   <<: *test-base
   variables:
-    TEST_NAME: cf-ibgp-flat
+    TEST_NAME: ibgp-flat
 
 test-babel-base:
   <<: *test-base
   variables:
-    TEST_NAME: cf-babel-base
+    TEST_NAME: babel-base
 
 test-babel-auth:
   <<: *test-base
   variables:
-    TEST_NAME: cf-babel-auth
+    TEST_NAME: babel-auth
 
 test-rip-base:
   <<: *test-base
   variables:
-    TEST_NAME: cf-rip-base
+    TEST_NAME: rip-base
 
 test-kernel-learn:
   <<: *test-base
   variables:
-    TEST_NAME: cf-kernel-learn
+    TEST_NAME: kernel-learn
diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..e02db1b
--- /dev/null
@@ -0,0 +1,3 @@
+[submodule "aux-tools"]
+       path = aux-tools
+       url = https://gitlab.nic.cz/labs/bird-tools.git
index fa53487292fc16ab9d86d27b2c7fff1ba7e3276e..6cb21b0d113c0e87e14f3904d13405889b52714b 100644 (file)
@@ -23,6 +23,9 @@ INSTALL=@INSTALL@
 INSTALL_PROGRAM=@INSTALL_PROGRAM@
 INSTALL_DATA=@INSTALL_DATA@
 
+STAYRTR_BINARY=@STAYRTR_BINARY@
+NETLAB_DATA_SUFFIX=v2
+
 client=$(addprefix $(exedir)/,@CLIENT@)
 daemon=$(exedir)/bird
 protocols=@protocols@
@@ -185,6 +188,16 @@ check: tests tests_run
 tests: $(tests_targets)
 tests_run: $(tests_targets_ok)
 
+aux-test-prepare: all
+       $(E)echo Preparing netlab test suite ...
+       $(Q)cd $(srcdir) && git submodule update --init --force --checkout aux-tools
+       $(Q)cd $(srcdir)/aux-tools && git clean -fxdq || true
+       $(Q)cd $(srcdir)/aux-tools/netlab/common && ln $(shell readlink -f $(exedir)/bird) && ln $(shell readlink -f $(exedir)/birdc)
+       $(Q)cd $(srcdir)/aux-tools/netlab/common && ln -s $(STAYRTR_BINARY) stayrtr
+       $(E)echo Netlab test suite prepared. 
+
+-include $(srcdir)/aux-tools/netlab/tests-$(NETLAB_DATA_SUFFIX).mk
+
 STATIC_CHECKERS_ENABLE := nullability.NullableDereferenced nullability.NullablePassedToNonnull nullability.NullableReturnedFromNonnull optin.portability.UnixAPI valist.CopyToSelf valist.Uninitialized valist.Unterminated
 STATIC_CHECKERS_DISABLE := deadcode.DeadStores
 STATIC_SCAN_FLAGS := -o $(objdir)/static-scan/ $(addprefix -enable-checker ,$(STATIC_CHECKERS_ENABLE)) $(addprefix -disable-checker ,$(STATIC_CHECKERS_DISABLE))
diff --git a/aux-tools b/aux-tools
new file mode 160000 (submodule)
index 0000000..646d38a
--- /dev/null
+++ b/aux-tools
@@ -0,0 +1 @@
+Subproject commit 646d38aa85d41781ed2428d2e86ac7e078a568ff
index 64181d2972cad2b6dbe6e997b5562639f5487d86..88eeaaaed577ab2334de09d1073f1325e3165676 100644 (file)
@@ -74,10 +74,18 @@ AC_ARG_WITH([iproutedir],
   [given_iproutedir="yes"]
 )
 
+AC_ARG_WITH([stayrtr],
+  [AS_HELP_STRING([--with-stayrtr=PATH], [path to stayrtr built binary for RPKI testing @<:@/usr/bin/stayrtr@:>@])],
+  [],
+  [with_stayrtr="/usr/bin/stayrtr"]
+)
+
 AC_ARG_VAR([FLEX], [location of the Flex program])
 AC_ARG_VAR([BISON], [location of the Bison program])
 AC_ARG_VAR([M4], [location of the M4 program])
 
+AC_SUBST([STAYRTR_BINARY], [${with_stayrtr}])
+
 if test "$enable_debug_expensive" = yes; then
   enable_debug=yes
 fi