3 [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
9 rc_file_vol="-v ${HOME}/opnfv-openrc.sh:/etc/yardstick/openstack.creds"
11 if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
12 instack_mac=$(sudo virsh domiflist undercloud | grep default | \
13 grep -Eo "[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+")
14 INSTALLER_IP=$(/usr/sbin/arp -e | grep ${instack_mac} | awk {'print $1'})
15 sshkey="-v /root/.ssh/id_rsa:/root/.ssh/id_rsa"
16 if [[ -n $(sudo iptables -L FORWARD |grep "REJECT"|grep "reject-with icmp-port-unreachable") ]]; then
17 #note: this happens only in opnfv-lf-pod1
18 sudo iptables -D FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
19 sudo iptables -D FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
23 if [[ ${INSTALLER_TYPE} == 'joid' ]]; then
24 if [[ "${DEPLOY_SCENARIO:0:2}" == "k8" ]];then
25 rc_file_vol="-v ${HOME}/admin.conf:/etc/yardstick/admin.conf"
27 # If production lab then creds may be retrieved dynamically
28 # creds are on the jumphost, always in the same folder
29 rc_file_vol="-v $LAB_CONFIG/admin-openrc:/etc/yardstick/openstack.creds"
30 # If dev lab, credentials may not be the default ones, just provide a path to put them into docker
31 # replace the default one by the customized one provided by jenkins config
33 elif [[ ${INSTALLER_TYPE} == 'compass' ]]; then
34 if [[ "${DEPLOY_SCENARIO:0:2}" == "k8" ]];then
35 rc_file_vol="-v ${HOME}/admin.conf:/etc/yardstick/admin.conf"
37 cacert_file_vol="-v ${HOME}/os_cacert:/etc/yardstick/os_cacert"
38 echo "export OS_CACERT=/etc/yardstick/os_cacert" >> ${HOME}/opnfv-openrc.sh
40 elif [[ ${INSTALLER_TYPE} == 'fuel' ]]; then
41 cacert_file_vol="-v ${HOME}/os_cacert:/etc/ssl/certs/mcp_os_cacert"
42 sshkey="-v ${SSH_KEY}:/root/.ssh/mcp.rsa"
44 # Set iptables rule to allow forwarding return traffic for container
45 if ! sudo iptables -C FORWARD -j RETURN 2> ${redirect} || ! sudo iptables -L FORWARD | awk 'NR==3' | grep RETURN 2> ${redirect}; then
46 sudo iptables -I FORWARD -j RETURN
49 opts="--privileged=true --rm"
50 envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \
51 -e NODE_NAME=${NODE_NAME} -e EXTERNAL_NETWORK=${EXTERNAL_NETWORK} \
52 -e YARDSTICK_BRANCH=${BRANCH} -e BRANCH=${BRANCH} \
53 -e DEPLOY_SCENARIO=${DEPLOY_SCENARIO} -e CI_DEBUG=true"
55 if [[ "${INSTALLER_TYPE}" == 'fuel' ]]; then
56 envs+=" -e SSH_KEY=/root/.ssh/mcp.rsa"
59 # Pull the image with correct tag
60 DOCKER_REPO='opnfv/yardstick'
61 if [ "$(uname -m)" = 'aarch64' ]; then
62 DOCKER_REPO="${DOCKER_REPO}_$(uname -m)"
64 echo "Yardstick: Pulling image ${DOCKER_REPO}:${DOCKER_TAG}"
65 docker pull ${DOCKER_REPO}:$DOCKER_TAG >$redirect
70 dir_result="${HOME}/opnfv/yardstick/results/${branch}"
71 mkdir -p ${dir_result}
72 sudo rm -rf ${dir_result}/*
73 map_log_dir="-v ${dir_result}:/tmp/yardstick"
76 cmd="sudo docker run ${opts} ${envs} ${rc_file_vol} ${cacert_file_vol} ${map_log_dir} ${sshkey} ${DOCKER_REPO}:${DOCKER_TAG} \
77 exec_tests.sh ${YARDSTICK_DB_BACKEND} ${YARDSTICK_SCENARIO_SUITE_NAME}"
79 echo "Yardstick: Running docker cmd: ${cmd}"
82 echo "Yardstick: done!"