diff options
Diffstat (limited to 'xci/playbooks/roles/prepare-tests/templates/run-yardstick.sh.j2')
-rw-r--r-- | xci/playbooks/roles/prepare-tests/templates/run-yardstick.sh.j2 | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/xci/playbooks/roles/prepare-tests/templates/run-yardstick.sh.j2 b/xci/playbooks/roles/prepare-tests/templates/run-yardstick.sh.j2 new file mode 100644 index 00000000..1cb43be2 --- /dev/null +++ b/xci/playbooks/roles/prepare-tests/templates/run-yardstick.sh.j2 @@ -0,0 +1,47 @@ +#!/bin/bash + +# Create directory to store yardstick logs +mkdir -p /root/yardstick-results/ + +# Dump the env file +echo "------------------------------------------------------" +echo "------------- yardstick environment file --------------" +cat /root/env +echo "------------------------------------------------------" + +# we need to ensure the necessary environment variables are sourced +source /root/env + +{% if 'os-' in deploy_scenario %} +{# stuff needed for OpenStack based scenarios #} +rc_file_vol="-v /root/openrc:/etc/yardstick/openstack.creds" +{% else %} +{# k8 scenario name is hardcoded for the timebeing until we clarify #} +{# which suite name we should use for the scenarios without yardstick suites #} +DEPLOY_SCENARIO="k8-nosdn-nofeature-noha" +rc_file_vol="-v /root/admin.conf:/etc/yardstick/admin.conf" +{% endif %} + +OS_CACERT="/etc/ssl/certs/xci.crt" +DOCKER_IMAGE_NAME="opnfv/yardstick" +YARDSTICK_SCENARIO_SUITE_NAME="opnfv_${DEPLOY_SCENARIO}_daily.yaml" + +# add OS_CACERT to openrc +echo "export OS_CACERT=/etc/yardstick/os_cacert" >> ~/openrc + +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 \ + -e YARDSTICK_BRANCH=master -e BRANCH=master \ + -e DEPLOY_SCENARIO=$DEPLOY_SCENARIO -e CI_DEBUG=true" +cacert_file_vol="-v $OS_CACERT:/etc/yardstick/os_cacert" +map_log_dir="-v /root/yardstick-results:/tmp/yardstick" +sshkey="-v /root/.ssh/id_rsa:/root/.ssh/id_rsa" +cmd="sudo docker run ${opts} ${envs} ${rc_file_vol} ${cacert_file_vol} \ + ${map_log_dir} ${sshkey} ${DOCKER_IMAGE_NAME} \ + exec_tests.sh ${YARDSTICK_SCENARIO_SUITE_NAME}" +echo "Running yardstick with the command" +echo "------------------------------------------------------" +echo $cmd +echo "------------------------------------------------------" +$cmd |