X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=ci%2Ftest_kvmfornfv.sh;h=858aaf3947f5b5a07435e9575323e7964fe07250;hb=refs%2Fchanges%2F83%2F22183%2F1;hp=a338149071ffa4a2f136e98993c28418436f93ae;hpb=0d6af5dda5ef996f7a32a4ef4af84a3a67bd96e0;p=kvmfornfv.git diff --git a/ci/test_kvmfornfv.sh b/ci/test_kvmfornfv.sh old mode 100644 new mode 100755 index a33814907..858aaf394 --- a/ci/test_kvmfornfv.sh +++ b/ci/test_kvmfornfv.sh @@ -1,44 +1,33 @@ #!/bin/bash -############################################################# -## This script will launch ubuntu docker container -## runs cyclictest through yardstick -## and verifies the test results. ############################################################ +## This script is an interface to trigger the +## cyclicTestTrigger.sh for test type like patch verification, +## daily testing. +## Releng will trigger this script by passing test type like +## verify/daily as an argument +############################################################ + +test_type=$1 -volume=/tmp/kvmtest-* -if [ -d ${volume} ] ; then - echo "Directory '${volume}' exists" - sudo rm -rf ${volume} +if [ ${test_type} == "verify" ];then + HOST_IP="10.2.117.23" + test_time=600000 # 10m +elif [ ${test_type} == "daily" ];then + HOST_IP="10.2.117.25" + test_time=7200000 #2h +elif [ ${test_type} == "merge" ];then + echo "Test is not enabled for ${test_type}" + exit 0 fi -time_stamp=$(date +%Y%m%d%H%M%S) -mkdir -p /tmp/kvmtest-${time_stamp}/{image,rpm,scripts} +source $WORKSPACE/ci/cyclicTestTrigger.sh $HOST_IP $test_time $test_type -#copying required files to run yardstick cyclic testcase -mv ${WORKSPACE}/build_output/* $volume/rpm -cp ${WORKSPACE}/ci/envs/* $volume/scripts -cp ${WORKSPACE}/tests/cyclictest-node-context.yaml $volume -cp ${WORKSPACE}/tests/pod.yaml $volume +#Update cyclictest-node-context.yaml with test_time and pod.yaml with IP +updateYaml -#Launching ubuntu docker container to run yardstick -sudo docker run -t -i -v $volume:/opt --net=host --name kvmfornfv \ -kvmfornfv:latest /bin/bash /opt/scripts/cyclictest.sh -container_id=`sudo docker ps -a | grep kvmfornfv |awk '{print $1}'` -sudo docker rm $container_id +#Cleaning up the test environment before running cyclictest through yardstick. +env_clean -#Verifying the results of cyclictest -result=`grep -o '"errors":[^,]*' $volume/yardstick.out | awk -F '"' \ -'{print $4}'| awk '{if (NF=0) print "SUCCESS" }'` -if [ "$result" = "SUCCESS" ]; then - echo "####################################################" - echo "" - echo `grep -o '"data":[^}]*' $volume/yardstick.out | awk -F '{' '{print $2}'` - echo "" - echo "####################################################" - exit 0 -else - echo "Testcase failed" - echo `grep -o '"errors":[^,]*' $volume/yardstick.out | awk -F '"' '{print $4}'` - exit 1 -fi +#Creating a docker image with yardstick installed and launching ubuntu docker to run yardstick cyclic testcase +runCyclicTest