diff options
author | Phil Sutter <phil@nwl.cc> | 2020-08-06 18:52:34 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2020-08-14 09:00:25 +0200 |
commit | cd3e83d1b04fd2683f0fb06e496ee5be08a96b4f (patch) | |
tree | 719621fae7d88a74b6f3d0519bcb1d45262a0377 /iptables/tests/shell/testcases/ip6tables/0004-return-codes_0 | |
parent | 3be40dcfb5af1438b6abdbda45a1e3b59c104e13 (diff) |
tests: shell: Merge and extend return codes test
Merge scripts for iptables and ip6tables, they were widely identical.
Also extend the test by one check (removing a non-existent rule with
valid chain and target) and quote the error messages where differences
are deliberately ignored.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/tests/shell/testcases/ip6tables/0004-return-codes_0')
-rwxr-xr-x | iptables/tests/shell/testcases/ip6tables/0004-return-codes_0 | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/iptables/tests/shell/testcases/ip6tables/0004-return-codes_0 b/iptables/tests/shell/testcases/ip6tables/0004-return-codes_0 deleted file mode 100755 index c583b0eb..00000000 --- a/iptables/tests/shell/testcases/ip6tables/0004-return-codes_0 +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -# make sure error return codes are as expected useful cases -# (e.g. commands to check ruleset state) - -global_rc=0 - -cmd() { # (rc, cmd, [args ...]) - rc_exp=$1; shift - - $XT_MULTI "$@" - rc=$? - - [ $rc -eq $rc_exp ] || { - echo "---> expected $rc_exp, got $rc for command '$@'" - global_rc=1 - } -} - -# test chain creation -cmd 0 ip6tables -N foo -cmd 1 ip6tables -N foo -# iptables-nft allows this - bug or feature? -#cmd 2 ip6tables -N "invalid name" - -# test rule adding -cmd 0 ip6tables -A INPUT -j ACCEPT -cmd 1 ip6tables -A noexist -j ACCEPT -cmd 2 ip6tables -I INPUT -j foobar - -# test rule checking -cmd 0 ip6tables -C INPUT -j ACCEPT -cmd 1 ip6tables -C FORWARD -j ACCEPT -cmd 1 ip6tables -C nonexist -j ACCEPT -cmd 2 ip6tables -C INPUT -j foobar -cmd 2 ip6tables -C INPUT -m foobar -j ACCEPT -cmd 3 ip6tables -t foobar -C INPUT -j ACCEPT - -exit $global_rc |