diff options
author | Phil Sutter <phil@nwl.cc> | 2021-08-03 11:32:34 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2021-08-03 11:38:58 +0200 |
commit | 8629c53f933a16f1d68d19fb163c879453a3dcf2 (patch) | |
tree | cb82f3bcf9d0b32d972b536e1dc34ce3bc66bbc4 | |
parent | 57d1422dbbc41c36ed2e9f6c67aa040c65a429a0 (diff) |
tests/shell: Assert non-verbose mode is silent
Unexpected output from iptables commands might mess up error-checking in
scripts for instance, so do a quick test of the most common commands.
Note: Test adds two rules to make sure flush command operates on a
non-empty chain.
Signed-off-by: Phil Sutter <phil@nwl.cc>
-rwxr-xr-x | iptables/tests/shell/testcases/iptables/0002-verbose-output_0 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/iptables/tests/shell/testcases/iptables/0002-verbose-output_0 b/iptables/tests/shell/testcases/iptables/0002-verbose-output_0 index b1ef91f6..5d2af4c8 100755 --- a/iptables/tests/shell/testcases/iptables/0002-verbose-output_0 +++ b/iptables/tests/shell/testcases/iptables/0002-verbose-output_0 @@ -54,3 +54,14 @@ diff -u <(echo "Flushing chain \`foobar'") <($XT_MULTI iptables -v -F foobar) diff -u <(echo "Zeroing chain \`foobar'") <($XT_MULTI iptables -v -Z foobar) diff -u <(echo "Deleting chain \`foobar'") <($XT_MULTI iptables -v -X foobar) + +# make sure non-verbose mode is silent +diff -u <(echo -n "") <( + $XT_MULTI iptables -N foobar + $XT_MULTI iptables -A foobar $RULE1 + $XT_MULTI iptables -A foobar $RULE2 + $XT_MULTI iptables -C foobar $RULE1 + $XT_MULTI iptables -D foobar $RULE2 + $XT_MULTI iptables -F foobar + $XT_MULTI iptables -X foobar +) |