Apex, Functest: Fixes iptables rule 95/16295/1
authorTim Rozet <trozet@redhat.com>
Fri, 1 Jul 2016 20:55:11 +0000 (16:55 -0400)
committerTim Rozet <trozet@redhat.com>
Fri, 1 Jul 2016 20:55:11 +0000 (16:55 -0400)
Something in Apex is pushing the RETURN rule down the chain, and adding
REJECT reject-with icmp-port-unreachable.  This enhances the check to
make sure not only does the rule exist, but it is at the top of the
chain.

Change-Id: I527bc45c30008aaf30d5bc9e1d474a14065b3fdf
Signed-off-by: Tim Rozet <trozet@redhat.com>
jjb/functest/set-functest-env.sh

index 3cbb4a5..d2e232d 100755 (executable)
@@ -37,7 +37,7 @@ elif [[ ${INSTALLER_TYPE} == 'joid' ]]; then
 fi
 
 # Set iptables rule to allow forwarding return traffic for container
-if ! sudo iptables -C FORWARD -j RETURN 2> ${redirect}; then
+if ! sudo iptables -C FORWARD -j RETURN 2> ${redirect} || ! sudo iptables -L FORWARD | awk 'NR==3' | grep RETURN 2> ${redirect}; then
     sudo iptables -I FORWARD -j RETURN
 fi