]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: add test case for double-deactivation
authorFlorian Westphal <fw@strlen.de>
Sat, 12 Aug 2023 10:39:09 +0000 (12:39 +0200)
committerFlorian Westphal <fw@strlen.de>
Sat, 12 Aug 2023 10:45:59 +0000 (12:45 +0200)
Reported-by: lonial con <kongln9170@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/testcases/maps/dumps/map_catchall_double_deactivate.nft [new file with mode: 0644]
tests/shell/testcases/maps/map_catchall_double_deactivate [new file with mode: 0755]

diff --git a/tests/shell/testcases/maps/dumps/map_catchall_double_deactivate.nft b/tests/shell/testcases/maps/dumps/map_catchall_double_deactivate.nft
new file mode 100644 (file)
index 0000000..37c48bf
--- /dev/null
@@ -0,0 +1,4 @@
+table ip test {
+       chain testchain {
+       }
+}
diff --git a/tests/shell/testcases/maps/map_catchall_double_deactivate b/tests/shell/testcases/maps/map_catchall_double_deactivate
new file mode 100755 (executable)
index 0000000..62fa73a
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+$NFT "add table ip test ;
+     add map ip test testmap { type ipv4_addr : verdict; };
+     add chain ip test testchain;
+     add element ip test testmap { * : jump testchain }" || exit 1
+
+$NFT "flush map ip test testmap; delete map ip test testmap; delete map ip test testmap" 2>/dev/null && exit 1
+$NFT "flush map ip test testmap; delete map ip test testmap; delete element ip test testmap { * : jump testchain }" 2>/dev/null && exit 1
+
+$NFT "flush map ip test testmap; delete map ip test testmap" || exit 1