3 [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
5 # labconfig is used only for joid
8 if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
9 instack_mac=$(sudo virsh domiflist undercloud | grep default | \
10 grep -Eo "[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+")
11 INSTALLER_IP=$(/usr/sbin/arp -e | grep ${instack_mac} | awk {'print $1'})
12 sshkey="-v /root/.ssh/id_rsa:/root/.ssh/id_rsa"
13 if [[ -n $(sudo iptables -L FORWARD |grep "REJECT"|grep "reject-with icmp-port-unreachable") ]]; then
14 #note: this happens only in opnfv-lf-pod1
15 sudo iptables -D FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
16 sudo iptables -D FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
18 elif [[ ${INSTALLER_TYPE} == 'joid' ]]; then
19 # If production lab then creds may be retrieved dynamically
20 # creds are on the jumphost, always in the same folder
21 labconfig="-v $LAB_CONFIG/admin-openrc:/etc/yardstick/openstack.creds"
22 # If dev lab, credentials may not be the default ones, just provide a path to put them into docker
23 # replace the default one by the customized one provided by jenkins config
26 # Set iptables rule to allow forwarding return traffic for container
27 if ! sudo iptables -C FORWARD -j RETURN 2> ${redirect} || ! sudo iptables -L FORWARD | awk 'NR==3' | grep RETURN 2> ${redirect}; then
28 sudo iptables -I FORWARD -j RETURN
31 opts="--privileged=true --rm"
32 envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \
33 -e NODE_NAME=${NODE_NAME} -e EXTERNAL_NETWORK=${EXTERNAL_NETWORK} \
34 -e YARDSTICK_BRANCH=${BRANCH} -e BRANCH=${BRANCH} \
35 -e DEPLOY_SCENARIO=${DEPLOY_SCENARIO}"
37 # Pull the image with correct tag
38 echo "Yardstick: Pulling image opnfv/yardstick:${DOCKER_TAG}"
39 docker pull opnfv/yardstick:$DOCKER_TAG >$redirect
43 dir_result="${HOME}/opnfv/yardstick/results/${branch}"
44 mkdir -p ${dir_result}
45 sudo rm -rf ${dir_result}/*
46 map_log_dir="-v ${dir_result}:/tmp/yardstick"
49 cmd="sudo docker run ${opts} ${envs} ${labconfig} ${map_log_dir} ${sshkey} opnfv/yardstick:${DOCKER_TAG} \
50 exec_tests.sh ${YARDSTICK_DB_BACKEND} ${YARDSTICK_SCENARIO_SUITE_NAME}"
51 echo "Yardstick: Running docker cmd: ${cmd}"
54 echo "Yardstick: done!"