From f48050cbf6b761eba3b9f1d56e420ba3eebd6d64 Mon Sep 17 00:00:00 2001 From: Fatih Degirmenci Date: Fri, 31 Aug 2018 12:04:40 +0200 Subject: Create script to run yardstick The created script runs the yardstick in similar way the functest script does. installer-type:osa deploy-scenario:os-nosdn-nofeature Change-Id: Ic03445ec03fcfec8dc0d09f638e7cb1187fef883 Signed-off-by: Fatih Degirmenci --- xci/playbooks/roles/prepare-tests/tasks/main.yml | 6 +++ .../prepare-tests/templates/run-yardstick.sh.j2 | 44 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 xci/playbooks/roles/prepare-tests/templates/run-yardstick.sh.j2 diff --git a/xci/playbooks/roles/prepare-tests/tasks/main.yml b/xci/playbooks/roles/prepare-tests/tasks/main.yml index b75965df..1512bbab 100644 --- a/xci/playbooks/roles/prepare-tests/tasks/main.yml +++ b/xci/playbooks/roles/prepare-tests/tasks/main.yml @@ -57,3 +57,9 @@ src: run-functest.sh.j2 dest: /root/run-functest.sh mode: 0755 + +- name: create the script to run yardstick + template: + src: run-yardstick.sh.j2 + dest: /root/run-yardstick.sh + mode: 0755 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..5eaf7bdb --- /dev/null +++ b/xci/playbooks/roles/prepare-tests/templates/run-yardstick.sh.j2 @@ -0,0 +1,44 @@ +#!/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 #} +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=$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" +rc_file_vol="-v /root/openrc:/etc/yardstick/openstack.creds" +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 +{% else %} +{# stuff needed for Kubernetes based scenarios #} + echo "Kubernetes testing is not enabled" +{% endif %} -- cgit 1.2.3-korg