summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/listing/0019set_0
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-07-11 15:49:09 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-07-16 19:53:43 +0200
commit7d3c01182e883e18050903b9176593c517e4ff91 (patch)
tree2cc24b204177e2192bbd6be3e8f2b8e5bd27c6d7 /tests/shell/testcases/listing/0019set_0
parent0fd53234e360d4dde8aa53dbcaad89495a4fab7f (diff)
evaluate: missing object maps handling in list and flush commands
NFT_SET_OBJECT tells there is an object map. # nft list ruleset table inet filter { map countermap { type ipv4_addr : counter } } The following command fails: # nft flush set inet filter countermap This patch checks for NFT_SET_OBJECT from new set_is_literal() and map_is_literal() functions. This patch also adds tests for this. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/listing/0019set_0')
-rwxr-xr-xtests/shell/testcases/listing/0019set_019
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/shell/testcases/listing/0019set_0 b/tests/shell/testcases/listing/0019set_0
new file mode 100755
index 00000000..04eb0faf
--- /dev/null
+++ b/tests/shell/testcases/listing/0019set_0
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+EXPECTED="table inet filter {
+ set ipset {
+ type ipv4_addr
+ }
+}"
+
+set -e
+
+$NFT -f - <<< $EXPECTED
+$NFT flush set inet filter ipset
+
+GET="$($NFT list set inet filter ipset)"
+if [ "$EXPECTED" != "$GET" ] ; then
+ DIFF="$(which diff)"
+ [ -x $DIFF ] && $DIFF -u <(echo "$EXPECTED") <(echo "$GET")
+ exit 1
+fi