X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=ci%2FcyclicTestTrigger.sh;h=f4a51628206bf8a87e9f57acd0a492e7c5dc2a05;hb=7ea7eea6dab8c1b40c2626eead4ced80e77f87b9;hp=7f606b0b644c8dd5296c867014aac8ca158397a6;hpb=0f6296e038b5c299654d596026e7bee5aa723e56;p=kvmfornfv.git diff --git a/ci/cyclicTestTrigger.sh b/ci/cyclicTestTrigger.sh index 7f606b0b6..f4a516282 100755 --- a/ci/cyclicTestTrigger.sh +++ b/ci/cyclicTestTrigger.sh @@ -132,13 +132,32 @@ function cleanup { env_clean host_clean if [ $output != 0 ];then - echo "Yardstick Failed.Please check cyclictest.sh" + echo "Yardstick Failed.Please check your testcase" return 1 else return 0 fi } +#environment setup for executing cyclictest and live migration test cases +function setUpEnv { + test=$1 + time_stamp=$(date +%Y%m%d%H%M%S) + volume=/tmp/kvmtest-${testType}-${time_stamp} + mkdir -p $volume/{image,rpm,scripts} + #copying required files to run yardstick cyclic testcase + cp $WORKSPACE/build_output/kernel-${KERNELRPM_VERSION}*.rpm ${volume}/rpm + cp $WORKSPACE/build_output/kernel-devel-${KERNELRPM_VERSION}*.rpm ${volume}/rpm + cp $WORKSPACE/build_output/qemu-${QEMURPM_VERSION}*.rpm ${volume}/rpm + cp -r $WORKSPACE/ci/envs/* ${volume}/scripts + cp -r $WORKSPACE/tests/pod.yaml ${volume}/scripts + if [ "$test" == "cyclictest" ];then + cp -r $WORKSPACE/tests/kvmfornfv_cyclictest_${testName}.yaml ${volume} + else + cp -r $WORKSPACE/tests/migrate-node-context.yaml ${volume} + fi +} + #environment setup for executing packet forwarding test cases function setUpPacketForwarding { #copying required files to run packet forwarding test cases @@ -148,6 +167,7 @@ function setUpPacketForwarding { #Copying the host configuration scripts on to host scp -r $WORKSPACE/ci/envs/* root@$HOST_IP:/root/workspace/scripts scp -r $WORKSPACE/tests/vsperf.conf* root@$HOST_IP:/root/workspace/scripts + scp -r $WORKSPACE/tests/pod.yaml root@$HOST_IP:/root/workspace/scripts scp -r $WORKSPACE/build_output/kernel-${KERNELRPM_VERSION}*.rpm root@$HOST_IP:/root/workspace/rpm scp -r $WORKSPACE/build_output/kernel-devel-${KERNELRPM_VERSION}*.rpm root@$HOST_IP:/root/workspace/rpm scp -r $WORKSPACE/build_output/qemu-${QEMURPM_VERSION}*.rpm root@$HOST_IP:/root/workspace/rpm @@ -167,6 +187,7 @@ function runPacketForwarding { #Creating a docker image with yardstick installed and Verify the results of cyclictest function runCyclicTest { ftrace_enable=$1 + variable=$2 docker_image_dir=$WORKSPACE/docker_image_build ( cd ${docker_image_dir}; sudo docker build -t kvmfornfv:latest --no-cache=true . ) if [ ${?} -ne 0 ] ; then @@ -174,15 +195,9 @@ function runCyclicTest { id=$(sudo docker ps -a | head -2 | tail -1 | awk '{print $1}'); sudo docker rm -f $id exit 1 fi - time_stamp=$(date +%Y%m%d%H%M%S) - volume=/tmp/kvmtest-${testType}-${time_stamp} - mkdir -p $volume/{image,rpm,scripts} - #copying required files to run yardstick cyclic testcase - cp $WORKSPACE/build_output/kernel-${KERNELRPM_VERSION}*.rpm ${volume}/rpm - cp $WORKSPACE/build_output/qemu-${QEMURPM_VERSION}*.rpm ${volume}/rpm - cp -r $WORKSPACE/ci/envs/* ${volume}/scripts - cp -r $WORKSPACE/tests/kvmfornfv_cyclictest_${testName}.yaml ${volume} - cp -r $WORKSPACE/tests/pod.yaml ${volume}/scripts + + #setting up the environment for cyclictest + setUpEnv $variable #Launching ubuntu docker container to run yardstick sudo docker run -i -v ${volume}:/opt --net=host --name kvmfornfv_${testType}_${testName} \ @@ -220,3 +235,22 @@ function runCyclicTest { cleanup $cyclictest_output fi } +function runLiveMigration { + echo "In live migration function" + test_env=$1 + variable=$2 + #Setting up the environment for live migration test case + setUpEnv $variable + #Launching ubuntu docker container to run yardstick + sudo docker run -i -v ${volume}:/opt --net=host --name kvmfornfv_lm_${test_env} \ + kvmfornfv:latest /bin/bash -c "cd /opt/scripts && ls; ./lmtest.sh " + lmtest_result=$? + #Verifying the results of livemigration + if [ ${lmtest_result} -ne 0 ];then + env_clean + host_clean + return 1 + else + cleanup $lmtest_result + fi +}