-time_stamp=$(date +%Y%m%d%H%M%S)
-volume=/tmp/kvmtest-${time_stamp}
-mkdir -p $volume/{image,rpm,scripts}
-
-#copying required files to run yardstick cyclic testcase
-mv $WORKSPACE/build_output/kernel-4.4*.rpm $volume/rpm
-cp -r $WORKSPACE/ci/envs/* $volume/scripts
-cp -r $WORKSPACE/tests/cyclictest-node-context.yaml $volume
-cp -r $WORKSPACE/tests/pod.yaml $volume
-
-#Launching ubuntu docker container to run yardstick
-sudo docker run -i -v $volume:/opt --net=host --name kvmfornfv \
-kvmfornfv:latest /bin/bash -c "cd /opt/scripts && ls; ./cyclictest.sh"
-
-#Verifying the results of cyclictest
-result=`grep -o '"errors":[^,]*' $volume/yardstick.out | awk -F '"' '{print $4}'`
-
-if [ -z "$result" ]; then
- echo "####################################################"
- echo ""
- echo `grep -o '"data":[^}]*' $volume/yardstick.out | awk -F '{' '{print $2}'`
- echo ""
- echo "####################################################"
- env_clean
- exit 0
+#Execution of testcases based on test type and test name from releng.
+if [ ${test_type} == "verify" ];then
+ getTestParams
+ install_pcm
+ if [ ${ftrace_enable} -eq '1' ]; then
+ for env in ${cyclictest_env_verify[@]}
+ do
+ #Enabling ftrace for kernel debugging.
+ sed -i '/host-setup1.sh/a\ \- \"enable-trace.sh\"' $WORKSPACE/tests/kvmfornfv_cyclictest_hostenv_guestenv.yaml
+ #Executing cyclictest through yardstick.
+ cyclictest ${env}
+ sleep 10
+ done
+ #Execution of packet forwarding test cases.
+ packetForward
+ else
+ for env in ${cyclictest_env_verify[@]}
+ do
+ #Executing cyclictest through yardstick.
+ cyclictest ${env}
+ sleep 10
+ done
+ #Execution of packet forwarding test cases.
+ packetForward
+ for envi in ${lm_env_verify[@]}
+ do
+ echo "Executing Live Migration on the node"
+ liveMigration ${envi}
+ done
+ fi
+ if [ ${cyclictest_result} -ne 0 ] || [ ${packetforward_result} -ne 0 ] || [ ${livemigration_result} -ne 0 ];then
+ echo "Test case FAILED"
+ test_exit 1
+ else
+ test_exit 0
+ fi
+elif [ ${test_type} == "daily" ];then
+ getTestParams
+ install_pcm
+ if [ ${test_name} == "packet_forward" ];then
+ packetForward
+ packet_fwd_logs
+ #clean the test environment after the test case execution.
+ sudo ssh root@${HOST_IP} "rm -rf /root/workspace/*"
+ host_clean
+ if [ ${packetforward_result} -ne 0 ] ; then
+ echo "Execution of packet forwarding test cases FAILED"
+ packet_fwd_exit 1
+ else
+ echo "Executed packet forwarding test cases SUCCESSFULLY"
+ packet_fwd_exit 0
+ fi
+ elif [ ${test_name} == "cyclictest" ];then
+ if [ ${ftrace_enable} -eq '1' ]; then
+ for env in ${cyclictest_env_daily[@]}
+ do
+ #Enabling ftrace for kernel debugging.
+ sed -i '/host-setup1.sh/a\ \- \"enable-trace.sh\"' kvmfornfv_cyclictest_hostenv_guestenv.yaml
+ #Executing cyclictest through yardstick.
+ cyclictest ${env}
+ #disabling ftrace and collecting the logs to upload to artifact repository.
+ ftrace_disable
+ sleep 5
+ done
+ else
+ for env in ${cyclictest_env_daily[@]}
+ do
+ #Executing cyclictest through yardstick.
+ cyclictest ${env}
+ sleep 5
+ done
+ fi
+ if [ ${cyclictest_result} -ne 0 ] ; then
+ echo "Cyclictest case execution FAILED"
+ test_exit 1
+ else
+ echo "Cyclictest case executed SUCCESSFULLY"
+ test_exit 0
+ fi
+ elif [ ${test_name} == "livemigration" ];then
+ for envi in ${lm_env_verify[@]}
+ do
+ echo "Executing Live Migration on the node"
+ liveMigration ${envi}
+ done
+ sudo ssh root@${HOST_IP} "rm -rf /root/workspace/*"
+ host_clean
+ if [ ${livemigration_result} -ne 0 ] ; then
+ echo "livemigration test case execution FAILED"
+ test_exit 1
+ else
+ echo "livemigration test case executed SUCCESSFULLY"
+ test_exit 0
+ fi
+ fi
+elif [ ${test_type} == "merge" ];then
+ echo "Test is not enabled for ${test_type}"
+ exit 0