From 25bab7efd6c04454eec1c32181b4123456b0d940 Mon Sep 17 00:00:00 2001 From: Navya Date: Wed, 4 Oct 2017 02:55:58 -0700 Subject: Execution of Livemigration through Yardstick This Patch includes the scripts to execute the live migration test using Yardstick and providing the information of VM downtime, setuptime,totaltime Change-Id: Ibe768adde1e5b2289a716524a274081cca97751d Co-Authored by:RajithaY Signed-off-by: Navya (cherry picked from commit 7ea7eea6dab8c1b40c2626eead4ced80e77f87b9) --- ci/envs/lmtest.sh | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100755 ci/envs/lmtest.sh (limited to 'ci/envs/lmtest.sh') diff --git a/ci/envs/lmtest.sh b/ci/envs/lmtest.sh new file mode 100755 index 000000000..9136fb62b --- /dev/null +++ b/ci/envs/lmtest.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +########################################################### +## Invoking this script from ubuntu docker container runs +## cyclictest through yardstick +########################################################### +source utils.sh + +HOST_IP=$( getHostIP ) +pod_config='/opt/scripts/pod.yaml' +lmtest_context_file='/opt/migrate-node-context.yaml' +yardstick_prefix='/root/yardstick/yardstick/benchmark/scenarios/compute' # yardstick teardown path + +if [ ! -f ${pod_config} ] ; then + echo "file ${pod_config} not found" + exit 1 +fi + +if [ ! -f ${lmtest_context_file} ] ; then + echo "file ${lmtest_context_file} not found" + exit 1 +fi + +#Execution of the post-execute script copied requires re-installation of yardstick +( cd /root/yardstick ; python setup.py install ) + +#setting up of image for launching guest vm. +ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ +root@$HOST_IP "cp /root/images/guest1.qcow2 /root/" + +#Updating the yardstick.conf file for daily +function updateConfDaily() { + DISPATCHER_TYPE=influxdb + DISPATCHER_FILE_NAME="/tmp/yardstick.out" + # Use the influxDB on the jumping server + DISPATCHER_INFLUXDB_TARGET="http://104.197.68.199:8086" + mkdir -p /etc/yardstick + cat << EOF > /etc/yardstick/yardstick.conf +[DEFAULT] +debug = True +dispatcher = ${DISPATCHER_TYPE} + +[dispatcher_file] +file_name = ${DISPATCHER_FILE_NAME} + +[dispatcher_influxdb] +timeout = 5 +db_name = yardstick +username = opnfv +password = 0pnfv2015 +target = ${DISPATCHER_INFLUXDB_TARGET} +EOF +} + +#Function call to update yardstick conf file based on Job type +#if [ "$testType" == "daily" ];then +# updateConfDaily +#fi + +echo "changing the qemu-migrate.py" +sed -i "s/\/root\/workspace/\/root\/workspace\//g" ${yardstick_prefix}/qemu_migrate.py +sed -i "s/host.put_file/host._put_file_shell/g" ${yardstick_prefix}/qemu_migrate.py + +#Running livemigration through yardstick +echo "Executing livemigration through yardstick" +yardstick -d task start ${lmtest_context_file} +output=$? + +if [ "$testType" == "verify" ];then + chmod 777 /tmp/yardstick.out + cat /tmp/yardstick.out > /opt/yardstick.out +fi + +if [ $output != 0 ];then + echo "Yardstick Failed !!!" + exit 1 +fi -- cgit 1.2.3-korg