From 01021b2e54fc11cf41cb181ba77c4a06f3928711 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Tue, 8 Nov 2022 11:26:11 +0100 Subject: [PATCH] Netlab tests can be called from this repository. 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 | 71 +++++++++++++++++++++++--------------------------- .gitmodules | 3 +++ Makefile.in | 13 +++++++++ aux-tools | 1 + configure.ac | 8 ++++++ 5 files changed, 57 insertions(+), 39 deletions(-) create mode 100644 .gitmodules create mode 160000 aux-tools diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dae59c75..6952239c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 index 00000000..e02db1bf --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "aux-tools"] + path = aux-tools + url = https://gitlab.nic.cz/labs/bird-tools.git diff --git a/Makefile.in b/Makefile.in index fa534872..6cb21b0d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 index 00000000..646d38aa --- /dev/null +++ b/aux-tools @@ -0,0 +1 @@ +Subproject commit 646d38aa85d41781ed2428d2e86ac7e078a568ff diff --git a/configure.ac b/configure.ac index 64181d29..88eeaaae 100644 --- a/configure.ac +++ b/configure.ac @@ -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