X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=ci%2Fenvs%2Fcyclictest.sh;h=d1ae5c7fab550f736b2874f77266106fdf2318f5;hb=HEAD;hp=e4dd9931f6c5aa1aa7ed6f5af59be0c6077152ab;hpb=0d6af5dda5ef996f7a32a4ef4af84a3a67bd96e0;p=kvmfornfv.git diff --git a/ci/envs/cyclictest.sh b/ci/envs/cyclictest.sh old mode 100644 new mode 100755 index e4dd9931f..d1ae5c7fa --- a/ci/envs/cyclictest.sh +++ b/ci/envs/cyclictest.sh @@ -4,9 +4,14 @@ ## Invoking this script from ubuntu docker container runs ## cyclictest through yardstick ########################################################### +source utils.sh -pod_config='/opt/pod.yaml' -cyclictest_context_file='/opt/cyclictest-node-context.yaml' +testType=$1 #daily/verify/merge +testName=$2 #idle_idle/stress_idle +HOST_IP=$( getHostIP ) +pod_config='/opt/scripts/pod.yaml' +cyclictest_context_file='/opt/kvmfornfv_cyclictest_'${testName}'.yaml' +yardstick_prefix='/root/yardstick/yardstick/benchmark/scenarios/compute' # yardstick teardown path if [ ! -f ${pod_config} ] ; then echo "file ${pod_config} not found" @@ -18,6 +23,55 @@ if [ ! -f ${cyclictest_context_file} ] ; then exit 1 fi +#As yardstick executes only *.bash scripts, copy the post-execute script as .bash script +cp /opt/scripts/disable_trace.sh ${yardstick_prefix}/disable_trace.bash + +#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 + #Running cyclictest through yardstick -yardstick task start ${cyclictest_context_file} -mv /tmp/yardstick.out /opt/ +yardstick -d task start ${cyclictest_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