Fix Yardstick connection issue on virtual env 75/18475/1
authorMichal Skalski <mskalski@mirantis.com>
Thu, 11 Aug 2016 18:20:25 +0000 (20:20 +0200)
committerMichal Skalski <mskalski@mirantis.com>
Thu, 11 Aug 2016 18:24:34 +0000 (20:24 +0200)
Libvirt creates iptables rules for NAT network which reject
inbound connections which not originate from host. Use the same
appraoch as for functest and add iptables rule which allow
connections from yardstick container to libvirt vm.

JIRA: FUEL-166

Change-Id: I43840bd15cb3ff3fc0f8306ff43c83aabfa9b06f
Signed-off-by: Michal Skalski <mskalski@mirantis.com>
jjb/yardstick/yardstick-daily.sh

index e8df9be..7e9a65b 100755 (executable)
@@ -23,6 +23,11 @@ elif [[ ${INSTALLER_TYPE} == 'joid' ]]; then
     # replace the default one by the customized one provided by jenkins config
 fi
 
+# Set iptables rule to allow forwarding return traffic for container
+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
+
 opts="--privileged=true --rm"
 envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \
     -e NODE_NAME=${NODE_NAME} -e EXTERNAL_NETWORK=${EXTERNAL_NETWORK} \