summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/nft-f/0010variable_0
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shell/testcases/nft-f/0010variable_0')
-rwxr-xr-xtests/shell/testcases/nft-f/0010variable_022
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/shell/testcases/nft-f/0010variable_0 b/tests/shell/testcases/nft-f/0010variable_0
new file mode 100755
index 00000000..2df71b13
--- /dev/null
+++ b/tests/shell/testcases/nft-f/0010variable_0
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+
+tmpfile=$(mktemp)
+if [ ! -w $tmpfile ] ; then
+ echo "Failed to create tmp file" >&2
+ exit 0
+fi
+
+trap "rm -rf $tmpfile" EXIT # cleanup if aborted
+
+RULESET="define whitelist_v4 = { 1.1.1.1 }
+
+table inet filter {
+ set whitelist_v4 { type ipv4_addr; }
+}
+add element inet filter whitelist_v4 \$whitelist_v4
+"
+
+echo "$RULESET" > $tmpfile
+$NFT -f $tmpfile