diff options
author | Paul Holzinger <pholzing@redhat.com> | 2024-08-14 15:20:38 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2024-08-14 15:27:13 +0200 |
commit | 4f37d9fa3d03187cabdaae08bada7fa89930adf2 (patch) | |
tree | d1546688ffb8d7be253fbdab1fe77e4d38721d2b /test | |
parent | a5a843099f3d701e444e642a018edfd218e13f12 (diff) |
aardvark: on start failure delete entries again
If we fail to start make sure to remove the entries again to not leak
them in case following starts might work.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/250-bridge-nftables.bats | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/250-bridge-nftables.bats b/test/250-bridge-nftables.bats index c5687ac..88086e8 100644 --- a/test/250-bridge-nftables.bats +++ b/test/250-bridge-nftables.bats @@ -258,6 +258,17 @@ export NETAVARK_FW=nftables assert "${lines[1]}" =~ ".*aardvark-dns --config $NETAVARK_TMPDIR/config/aardvark-dns -p $dns_port run" "aardvark not running or bad options" } +@test "$fw_driver - aardvark-dns entries after startup failure" { + # force failure with invalid aardvark-dns binary + expected_rc=1 run_netavark --aardvark-binary ${TESTSDIR} --file ${TESTSDIR}/testfiles/dualstack-bridge-custom-dns-server.json \ + setup $(get_container_netns_path) + assert "$output" =~ "aardvark-dns failed to start: Failed to find executable" "netavark error" + + # check aardvark config must not exists after error + run_helper ls "$NETAVARK_TMPDIR/config/aardvark-dns" + assert "$output" == "" "No aardvark entries" +} + @test "$fw_driver - bridge driver must generate config for aardvark with multiple custom dns server" { # get a random port directly to avoid low ports e.g. 53 would not create nftables dns_port=$((RANDOM+10000)) |