diff options
author | Jiang, Yunhong <yunhong.jiang@intel.com> | 2017-03-13 19:22:04 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-03-13 19:22:04 +0000 |
commit | af712826966ee75ba5ac466a6c192580abdf0c29 (patch) | |
tree | c032c8979699d2b73865ca87f9e12d2a6d709525 /ci/test_kvmfornfv.sh | |
parent | 0666e6b9c92cdba1d90c951423e5ef1fb2736c48 (diff) | |
parent | 53bf71ea043426dd23319bd3bd011fd9a8ce0446 (diff) |
Merge "This patch includes updated scripts for modifying function names and to optimize the code for executing all the test cases and performing necessary host cleaning operations after executing all the test cases."
Diffstat (limited to 'ci/test_kvmfornfv.sh')
-rwxr-xr-x | ci/test_kvmfornfv.sh | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/ci/test_kvmfornfv.sh b/ci/test_kvmfornfv.sh index 20bdaeefb..adf0aa3ce 100755 --- a/ci/test_kvmfornfv.sh +++ b/ci/test_kvmfornfv.sh @@ -29,7 +29,6 @@ function packetForward { else echo "Packet Forwarding test case executed SUCCESSFULLY" fi - host_clean } function cyclictest { @@ -38,17 +37,24 @@ function cyclictest { #Verifying whether the test node is up and running connect_host #Waiting for ssh to be available for the host machine. - sleep 10 + sleep 20 #calculating and verifying sha512sum of the guestimage. if ! verifyGuestImage;then exit 1 fi #Update kvmfornfv_cyclictest_${testName}.yaml with test_time and pod.yaml with IP updateYaml - #Cleaning up the test environment before running cyclictest through yardstick. - env_clean #Running PCM utility collect_MBWInfo $test_type + #Checking which test cases will be executed first and last from the list to perform cleaning operations. + first_test_case=cyclictest_env_$test_type[0] + last_test_case=cyclictest_env_$test_type[-1] + #Cleaning the environment before running cyclictest through yardstick + if [ ${test_case} == "${!first_test_case}" ];then + env_clean + else + sudo ssh root@${HOST_IP} "pid=\$(ps aux | grep 'qemu' | awk '{print \$2}' | head -1); echo \$pid |xargs kill" + fi #Creating a docker image with yardstick installed and launching ubuntu docker to run yardstick cyclic testcase if runCyclicTest;then cyclictest_result=`expr ${cyclictest_result} + 0` @@ -58,6 +64,9 @@ function cyclictest { fi echo "Terminating PCM Process" sudo ssh root@${HOST_IP} "pid=\$(ps aux | grep 'pcm' | awk '{print \$2}' | head -1); echo \$pid |xargs kill -SIGTERM" + if [ ${test_case} != "${!last_test_case}" ];then + sudo ssh root@${HOST_IP} "reboot" + fi } function collect_MBWInfo { #Collecting the Memory Bandwidth Information using pcm-memory utility @@ -124,14 +133,16 @@ if [ ${test_type} == "verify" ];then cyclictest ${env} sleep 10 done + env_clean + host_clean #Execution of packet forwarding test cases. packetForward fi if [ ${cyclictest_result} -ne 0 ] || [ ${packetforward_result} -ne 0 ];then echo "Test case FAILED" - err_exit 1 + test_exit 1 else - err_exit 0 + test_exit 0 fi elif [ ${test_type} == "daily" ];then HOST_IP="10.10.100.22" @@ -140,9 +151,9 @@ elif [ ${test_type} == "daily" ];then if [ ${test_name} == "packet_forward" ];then packetForward if [ ${packetforward_result} -ne 0 ] ; then - err_exit 1 + test_exit 1 else - err_exit 0 + test_exit 0 fi elif [ ${test_name} == "cyclictest" ];then if [ ${ftrace_enable} -eq '1' ]; then @@ -163,13 +174,15 @@ elif [ ${test_type} == "daily" ];then cyclictest ${env} sleep 5 done + env_clean + host_clean fi if [ ${cyclictest_result} -ne 0 ] ; then echo "Cyclictest case execution FAILED" - err_exit 1 + test_exit 1 else echo "Cyclictest case executed SUCCESSFULLY" - err_exit 0 + test_exit 0 fi fi elif [ ${test_type} == "merge" ];then |