summaryrefslogtreecommitdiffstats
path: root/iptables/tests/shell/run-tests.sh
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2018-07-10 12:58:24 +0200
committerFlorian Westphal <fw@strlen.de>2018-07-10 12:59:30 +0200
commitc468f01f10f3f5d968bf894aa5f63c1113db3b7a (patch)
treefc24833ea8cbe3bffe5cfe0ea2f6f885319980cb /iptables/tests/shell/run-tests.sh
parent47d148461b2fc8336fa2be312ba6a75e7b7feea4 (diff)
tests: check iptables retval, not echo
Pablo reports that tests that should return nozero now fail. Reason is that $? is checking return value of "echo" and not the script. Fixes: 17c66a50608 ("iptables: tests: shell: Add README") Reported-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/tests/shell/run-tests.sh')
-rwxr-xr-xiptables/tests/shell/run-tests.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/iptables/tests/shell/run-tests.sh b/iptables/tests/shell/run-tests.sh
index a39aecb6..b6eb01c6 100755
--- a/iptables/tests/shell/run-tests.sh
+++ b/iptables/tests/shell/run-tests.sh
@@ -65,13 +65,13 @@ do_test() {
if [ "$VERBOSE" = "y" ]; then
XT_MULTI=$xtables_multi unshare -n ${testfile}
+ rc_got=$?
else
XT_MULTI=$xtables_multi unshare -n ${testfile} > /dev/null 2>&1
+ rc_got=$?
echo -en "\033[1A\033[K" # clean the [EXECUTING] foobar line
fi
- rc_got=$?
-
if [ "$rc_got" == "$rc_spec" ] ; then
msg_info "[OK] $testfile"
((ok++))