summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/nft-i/0001define_0
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shell/testcases/nft-i/0001define_0')
-rwxr-xr-xtests/shell/testcases/nft-i/0001define_022
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/shell/testcases/nft-i/0001define_0 b/tests/shell/testcases/nft-i/0001define_0
new file mode 100755
index 00000000..62e1b6de
--- /dev/null
+++ b/tests/shell/testcases/nft-i/0001define_0
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+
+# test if using defines in interactive nft sessions works
+
+$NFT -i >/dev/null <<EOF
+add table inet t
+add chain inet t c
+define ports = { 22, 443 }
+add rule inet t c tcp dport \$ports accept
+add rule inet t c udp dport \$ports accept
+EOF
+
+$NFT -i >/dev/null <<EOF
+define port = 22
+flush chain inet t c
+redefine port = 443
+delete chain inet t c
+undefine port
+delete table inet t
+EOF