summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFeng Pan <fpan@redhat.com>2016-04-21 14:01:15 -0400
committerFeng Pan <fpan@redhat.com>2016-04-21 14:29:42 -0400
commit17fb8572b65e6e155d752380ee2a29724bcc6dc7 (patch)
tree4725e53f8edcaed70630b82ca92d238344fb807b
parent313ee3584c00db4fb8a91878a8f89b6909320a57 (diff)
functest, apex: Add iptable rule check before deleting
Change-Id: I70955e7ab926b9e6b1a5c9be70a06eba6d8b4d7d Signed-off-by: Feng Pan <fpan@redhat.com>
-rw-r--r--jjb/functest/functest-ci-jobs.yml8
1 files changed, 6 insertions, 2 deletions
diff --git a/jjb/functest/functest-ci-jobs.yml b/jjb/functest/functest-ci-jobs.yml
index 1e16fcfb8..5e1d972c6 100644
--- a/jjb/functest/functest-ci-jobs.yml
+++ b/jjb/functest/functest-ci-jobs.yml
@@ -262,8 +262,12 @@
fi
INSTALLER_IP=$(/usr/sbin/arp -e | grep ${instack_mac} | awk {'print $1'})
sshkey="-v /root/.ssh/id_rsa:/root/.ssh/id_rsa"
- sudo iptables -D FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
- sudo iptables -D FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
+ if sudo iptables -C FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable 2> ${redirect}; then
+ sudo iptables -D FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
+ fi
+ if sudo iptables -C FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable 2> ${redirect}; then
+ sudo iptables -D FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
+ fi
elif [[ ${INSTALLER_TYPE} == 'joid' ]]; then
# If production lab then creds may be retrieved dynamically
# creds are on the jumphost, always in the same folder