summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEric Jallot <ejallot@gmail.com>2019-11-04 21:23:59 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2019-11-06 12:38:24 +0100
commit91487a80551ea91714082da41aa49ba52dd6e9bb (patch)
tree7f9c00b47fe7b3221c9dc9d8ced8f894b8b2566b /tests
parentf5953e519ea8ae4243f58015a1311a3639524648 (diff)
src: flowtable: add support for delete command by handle
Also, display handle when listing with '-a'. Signed-off-by: Eric Jallot <ejallot@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/shell/testcases/flowtable/0010delete_handle_022
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/shell/testcases/flowtable/0010delete_handle_0 b/tests/shell/testcases/flowtable/0010delete_handle_0
new file mode 100755
index 00000000..303967dd
--- /dev/null
+++ b/tests/shell/testcases/flowtable/0010delete_handle_0
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# delete flowtable by handle
+
+set -e
+
+$NFT add table inet t
+$NFT add flowtable inet t f { hook ingress priority filter\; devices = { lo }\; }
+
+FH=$($NFT list ruleset -a | awk '/flowtable f/ { print $NF }')
+
+$NFT delete flowtable inet t handle $FH
+
+EXPECTED="table inet t {
+}"
+
+GET="$($NFT list ruleset)"
+if [ "$EXPECTED" != "$GET" ] ; then
+ DIFF="$(which diff)"
+ [ -x $DIFF ] && $DIFF -u <(echo "$EXPECTED") <(echo "$GET")
+ exit 1
+fi