- - shell: |
- #!/bin/bash
- set +e
- [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
- # labconfig is used only for joid
- labconfig=""
- if [[ ${INSTALLER_TYPE} == 'apex' ]]; 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]+")
- 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
- elif [[ ${INSTALLER_TYPE} == 'joid' ]]; then
- # If production lab then creds may be retrieved dynamically
- # creds are on the jumphost, always in the same folder
- labconfig="-v $LAB_CONFIG/admin-openrc:/home/opnfv/functest/conf/openstack.creds"
- # 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
- 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 CI_DEBUG=${CI_DEBUG}"
- branch=${GIT_BRANCH##*/}
- dir_result="${HOME}/opnfv/functest/results/${branch}"
- mkdir -p ${dir_result}
- sudo rm -rf ${dir_result}/*
- res_volume="-v ${dir_result}:/home/opnfv/functest/results"