summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/rule_management/0003insert_0
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shell/testcases/rule_management/0003insert_0')
-rwxr-xr-xtests/shell/testcases/rule_management/0003insert_027
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/shell/testcases/rule_management/0003insert_0 b/tests/shell/testcases/rule_management/0003insert_0
new file mode 100755
index 00000000..6691c166
--- /dev/null
+++ b/tests/shell/testcases/rule_management/0003insert_0
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# tests for Netfilter bug #965
+# (regarding rule management with a given position/handle spec)
+
+set -e
+$NFT add table t
+$NFT add chain t c
+$NFT insert rule t c accept
+$NFT insert rule t c drop
+$NFT insert rule t c masquerade
+
+EXPECTED="table ip t {
+ chain c {
+ masquerade
+ drop
+ accept
+ }
+}"
+
+GET="$($NFT list ruleset)"
+
+if [ "$EXPECTED" != "$GET" ] ; then
+ DIFF="$(which diff)"
+ [ -x $DIFF ] && $DIFF -u <(echo "$EXPECTED") <(echo "$GET")
+ exit 1
+fi