]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
tests: make duplicate test work
authorFlorian Westphal <fw@strlen.de>
Mon, 25 Jun 2018 14:49:05 +0000 (16:49 +0200)
committerFlorian Westphal <fw@strlen.de>
Mon, 25 Jun 2018 14:49:08 +0000 (16:49 +0200)
set -e causes 2nd command (which is expected to fail)
to terminate the script as well.

So, don't set -e and let the error check invert the return
value to 0.

Signed-off-by: Florian Westphal <fw@strlen.de>
iptables/tests/shell/testcases/chain/0002duplicate_0

index 6d42cecf2de55bc38b192cd0a4672327dca36aad..025114ea08ecc4eb420edfc23f03758df717bb1b 100755 (executable)
@@ -1,8 +1,6 @@
 #!/bin/bash
 
-set -e
-
-$IPTABLES -t filter -N c1
+$IPTABLES -t filter -N c1 || exit 1
 $IPTABLES -t filter -N c1
 
 if [ $? -eq 0 ]; then