summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/transactions
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2024-06-27 02:51:57 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2024-06-27 03:32:55 +0200
commitaa44b61a560d8e51bb19410d449d8c46ef3a63a4 (patch)
tree01275d3c10f0033faeff306d92952e5620b85d0d /tests/shell/testcases/transactions
parent081bf5f0d7952a6e6ac0d23a365ccf1fd27010c0 (diff)
tests: shell: check for removing table via handle with incorrect family
This test checks for upstream commit: f6e1532a2697 ("netfilter: nf_tables: validate family when identifying table via handle") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/transactions')
-rwxr-xr-xtests/shell/testcases/transactions/handle_bad_family9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/shell/testcases/transactions/handle_bad_family b/tests/shell/testcases/transactions/handle_bad_family
new file mode 100755
index 00000000..59224189
--- /dev/null
+++ b/tests/shell/testcases/transactions/handle_bad_family
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+NFT=nft
+
+HANDLE=$($NFT -a -e add table ip x | cut -d '#' -f 2 | awk '{ print $2 }' | head -1)
+
+# should fail
+$NFT delete table inet handle $HANDLE
+[ $? -ne 0 ] && exit 0