From 84545a26cc3f7ce68408a663c1ad4a50edccdacc Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Tue, 8 Nov 2022 10:20:55 +0100 Subject: Added more netlab tests for automatic run. This commit uses bird-tools in version f35e8bce829f4bff61ec7eb07ec9c67aa867bc9a --- .gitlab-ci.yml | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7809fecd..dae59c75 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,7 @@ variables: 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: - image @@ -531,6 +532,7 @@ build-birdlab: - sudo git clean -fx - git pull --ff-only - mv $DIR/bird $DIR/birdc netlab/common + - ln -s $STAYRTR_BINARY netlab/common/stayrtr .test: &test-base stage: test @@ -541,7 +543,7 @@ build-birdlab: script: - cd $TOOLS_DIR/netlab - sudo ./stop - - sudo ./runtest -m check $TEST_NAME + - sudo ./runtest -s v2 -m check $TEST_NAME test-ospf-base: <<: *test-base @@ -613,6 +615,16 @@ test-bgp-merged: variables: TEST_NAME: cf-bgp-merged +test-bgp-flowspec: + <<: *test-base + variables: + TEST_NAME: cf-bgp-flowspec + +test-bgp-rs-multitab: + <<: *test-base + variables: + TEST_NAME: cf-bgp-rs-multitab + test-ebgp-loop: <<: *test-base variables: @@ -623,12 +635,32 @@ test-ebgp-star: variables: TEST_NAME: cf-ebgp-star +test-ebgp-role: + <<: *test-base + variables: + TEST_NAME: cf-ebgp-role + +test-ebgp-graceful: + <<: *test-base + variables: + TEST_NAME: cf-ebgp-graceful + +test-ebgp-import-limit: + <<: *test-base + variables: + TEST_NAME: cf-ebgp-import-limit + test-ibgp-loop: <<: *test-base variables: TEST_NAME: cf-ibgp-loop -test-ibgp-star: +test-ibgp-loop-big: + <<: *test-base + variables: + TEST_NAME: cf-ibgp-loop-big + +test-ibgp-flat: <<: *test-base variables: TEST_NAME: cf-ibgp-flat @@ -647,3 +679,8 @@ test-rip-base: <<: *test-base variables: TEST_NAME: cf-rip-base + +test-kernel-learn: + <<: *test-base + variables: + TEST_NAME: cf-kernel-learn -- cgit v1.2.3 From 371eb49043d225d2bab8149187b813a14b4b86d2 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Wed, 9 Nov 2022 21:09:16 +0100 Subject: Conf: Free stored old config before parsing new one BIRD keeps a previous (old) configuration for the purpose of undo. The existing code frees it after a new configuration is successfully parsed during reconfiguration. That causes memory usage spikes as there are temporarily three configurations (old, current, and new). The patch changes it to free the old one before parsing the new one (as user already requested a new config). The disadvantage is that undo is not available after failed reconfiguration. --- conf/conf.c | 17 +++++++++++++++++ conf/conf.h | 1 + doc/bird.sgml | 5 +++++ sysdep/unix/main.c | 4 ++++ 4 files changed, 27 insertions(+) diff --git a/conf/conf.c b/conf/conf.c index 11c136e7..4e31de29 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -201,6 +201,23 @@ config_free(struct config *c) rfree(c->pool); } +/** + * config_free_old - free stored old configuration + * + * This function frees the old configuration (%old_config) that is saved for the + * purpose of undo. It is useful before parsing a new config when reconfig is + * requested, to avoid keeping three (perhaps memory-heavy) configs together. + */ +void +config_free_old(void) +{ + tm_stop(config_timer); + undo_available = 0; + + config_free(old_config); + old_config = NULL; +} + void config_add_obstacle(struct config *c) { diff --git a/conf/conf.h b/conf/conf.h index 5ec924b0..b409750e 100644 --- a/conf/conf.h +++ b/conf/conf.h @@ -70,6 +70,7 @@ struct config *config_alloc(const char *name); int config_parse(struct config *); int cli_parse(struct config *); void config_free(struct config *); +void config_free_old(void); int config_commit(struct config *, int type, uint timeout); int config_confirm(void); int config_undo(void); diff --git a/doc/bird.sgml b/doc/bird.sgml index c78b8300..47848f82 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -1173,6 +1173,11 @@ This argument can be omitted if there exists only a single instance. restarted otherwise. Changes in filters usually lead to restart of affected protocols. + The previous configuration is saved and the user can switch back to it + with command. The + old saved configuration is released (even if the reconfiguration attempt + fails due to e.g. a syntax error). + If Date: Wed, 9 Nov 2022 22:02:46 +0100 Subject: Conf: Make 'configure check' command restricted While it does not directly change BIRD state, it can trigger reading arbitrary files and eating significant memory. --- sysdep/unix/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 18cc091f..18fd4e44 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -282,6 +282,9 @@ cmd_read_config(const char *name) void cmd_check_config(const char *name) { + if (cli_access_restricted()) + return; + struct config *conf = cmd_read_config(name); if (!conf) return; -- cgit v1.2.3 From 140c534fb81d0e165b7d674e869c646455ed19d1 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Tue, 29 Nov 2022 03:50:33 +0100 Subject: Fix build variables for OpenBSD --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index 64181d29..a326d8ad 100644 --- a/configure.ac +++ b/configure.ac @@ -238,6 +238,8 @@ else ;; openbsd*) sysdesc=bsd + CPPFLAGS="$CPPFLAGS -I/usr/local/include" + LDFLAGS="$LDFLAGS -L/usr/local/lib" ;; dragonfly*) sysdesc=bsd -- cgit v1.2.3