summaryrefslogtreecommitdiffstats
path: root/tests/shell/features/set_expr.sh
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2023-11-06 20:51:56 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2023-11-11 09:51:03 +0100
commit665d293f939b7d331f570b9920d25a1175b71425 (patch)
tree84d330c26e20ac2e80f100b28a7a1b6e3f60bd6e /tests/shell/features/set_expr.sh
parentaa6f521b427f0c5b2384f90599807ad35b400293 (diff)
tests: shell: skip stateful expression in sets tests if kernel lacks support
Skip tests that require stateful expressions in sets. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/features/set_expr.sh')
-rwxr-xr-xtests/shell/features/set_expr.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/shell/features/set_expr.sh b/tests/shell/features/set_expr.sh
new file mode 100755
index 00000000..fbdfc228
--- /dev/null
+++ b/tests/shell/features/set_expr.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# 65038428b2c6 ("netfilter: nf_tables: allow to specify stateful expression in set definition")
+# v5.7-rc1~146^2~12^2~25
+
+# NFT_SET_EXPR to detect kernel feature only available since
+# b4e70d8dd9ea ("netfilter: nftables: add set expression flags")
+# v5.11-rc3~39^2^2
+
+EXPECTED="table ip x {
+ set y {
+ typeof ip saddr
+ counter
+ }
+}"
+
+$NFT -f - <<< $EXPECTED
+
+diff -u <($NFT list ruleset) - <<<"$EXPECTED"