X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=jjb%2Ffunctest%2Fset-functest-env.sh;h=b7d745a79d735bd0686eed575e363c66f4527cc0;hb=341749a5b6dadf4839ae289dd2441dba5a81336b;hp=24e9e2666b98ebd6e9a632a07d447365b00a8bff;hpb=17eb662f921c57049639e132ceb5f8915d7bff34;p=releng.git diff --git a/jjb/functest/set-functest-env.sh b/jjb/functest/set-functest-env.sh index 24e9e2666..b7d745a79 100755 --- a/jjb/functest/set-functest-env.sh +++ b/jjb/functest/set-functest-env.sh @@ -5,6 +5,7 @@ set -e # labconfig is used only for joid labconfig="" if [[ ${INSTALLER_TYPE} == 'apex' ]]; then + ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" if sudo virsh list | grep instack; then instack_mac=$(sudo virsh domiflist instack | grep default | \ grep -Eo "[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+") @@ -17,8 +18,8 @@ if [[ ${INSTALLER_TYPE} == 'apex' ]]; then fi INSTALLER_IP=$(/usr/sbin/arp -e | grep ${instack_mac} | awk {'print $1'}) sshkey="-v /root/.ssh/id_rsa:/root/.ssh/id_rsa" - sudo scp root@${INSTALLER_IP}:/home/stack/stackrc . - stackrc="-v ./stackrc:/home/functest/stackrc" + sudo scp $ssh_options root@${INSTALLER_IP}:/home/stack/stackrc ${HOME}/stackrc + stackrc="-v ${HOME}/stackrc:/home/opnfv/functest/conf/stackrc" 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 @@ -26,6 +27,7 @@ if [[ ${INSTALLER_TYPE} == 'apex' ]]; then 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 @@ -33,10 +35,19 @@ elif [[ ${INSTALLER_TYPE} == 'joid' ]]; then # If dev lab, credentials may not be the default ones, just provide a path to put them into docker # 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 + +DEPLOY_TYPE=baremetal +[[ $BUILD_TAG =~ "virtual" ]] && DEPLOY_TYPE=virt + echo "Functest: Start Docker and prepare environment" envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \ -e NODE_NAME=${NODE_NAME} -e DEPLOY_SCENARIO=${DEPLOY_SCENARIO} \ - -e BUILD_TAG=${BUILD_TAG} -e CI_DEBUG=${CI_DEBUG}" + -e BUILD_TAG=${BUILD_TAG} -e CI_DEBUG=${CI_DEBUG} -e DEPLOY_TYPE=${DEPLOY_TYPE}" branch=${GIT_BRANCH##*/} dir_result="${HOME}/opnfv/functest/results/${branch}" mkdir -p ${dir_result}