diff options
Diffstat (limited to 'iptables/tests/shell/testcases/iptables/0003-list-rules_0')
-rwxr-xr-x | iptables/tests/shell/testcases/iptables/0003-list-rules_0 | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/iptables/tests/shell/testcases/iptables/0003-list-rules_0 b/iptables/tests/shell/testcases/iptables/0003-list-rules_0 index 2e87ce5a..d335d442 100755 --- a/iptables/tests/shell/testcases/iptables/0003-list-rules_0 +++ b/iptables/tests/shell/testcases/iptables/0003-list-rules_0 @@ -46,3 +46,19 @@ EXPECT='-P OUTPUT ACCEPT -c 0 0 -A OUTPUT -o eth123 -m mark --mark 0x42 -c 0 0 -j ACCEPT' diff -u -Z <(echo -e "$EXPECT") <($XT_MULTI iptables -v -t nat -S OUTPUT) + +# some of the following commands are supposed to fail +set +e + +$XT_MULTI iptables -S nonexistent && { + echo "list-rules in non-existent chain should fail" + exit 1 +} +$XT_MULTI iptables -S nonexistent 23 && { + echo "list-rules in non-existent chain with given rule number should fail" + exit 1 +} +$XT_MULTI iptables -S FORWARD 234 || { + echo "list-rules in existent chain with invalid rule number should succeed" + exit 1 +} |