summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/rule_management/0002addinsertlocation_1
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shell/testcases/rule_management/0002addinsertlocation_1')
-rwxr-xr-xtests/shell/testcases/rule_management/0002addinsertlocation_123
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/shell/testcases/rule_management/0002addinsertlocation_1 b/tests/shell/testcases/rule_management/0002addinsertlocation_1
new file mode 100755
index 0000000..920032f
--- /dev/null
+++ b/tests/shell/testcases/rule_management/0002addinsertlocation_1
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# test rule adding with invalid position/handle/index value
+
+RULESET="flush ruleset
+table ip t {
+ chain c {
+ accept
+ accept
+ }
+}"
+
+$NFT -f - <<< "$RULESET"
+
+for cmd in add insert; do
+ for keyword in position handle index; do
+ $NFT $cmd rule t c $keyword 5 drop 2>/dev/null || continue
+
+ echo "E: invalid $keyword value allowed in $cmd command" >&2
+ exit 1
+ done
+done
+exit 0