-#Cleaning up the test environment before running cyclictest through yardstick.
-env_clean
-
-#Creating a docker image with yardstick installed.
-( cd ${docker_image_dir}; sudo docker build -t kvmfornfv:latest --no-cache=true . )
-if [ ${?} -ne 0 ] ; then
- echo "Docker image build failed"
- 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-${time_stamp}
-mkdir -p $volume/{image,rpm,scripts}
-
-#copying required files to run yardstick cyclic testcase
-mv $WORKSPACE/build_output/kernel-${KERNEL_VERSION}*.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 "####################################################"
- #cleaning the environment after executing the test through yardstick.
- env_clean
- #Cleaning the latest kernel changes on host after executing the test.
- host_clean
- exit 0
+#Execution of testcases based on test type and test name from releng.
+if [ ${test_type} == "verify" ];then
+ HOST_IP="10.10.100.21"
+ test_time=120000 # 2m
+ for env in ${cyclictest_env_verify[@]}
+ do
+ #Executing cyclictest through yardstick.
+ cyclictest ${env}
+ sleep 10
+ done
+ #Execution of packet forwarding test cases.
+ packetForward
+ if [ ${cyclictest_result} -ne 0 ] || [ ${packetforward_result} -ne 0 ];then
+ echo "Test case FAILED"
+ exit 1
+ else
+ exit 0
+ fi
+elif [ ${test_type} == "daily" ];then
+ HOST_IP="10.10.100.22"
+ test_time=3600000 #1h
+ if [ ${test_name} == "packet_forward" ];then
+ packetForward
+ if [ ${packetforward_result} -ne 0 ] ; then
+ exit 1
+ else
+ exit 0
+ fi
+ elif [ ${test_name} == "cyclictest" ];then
+ for env in ${cyclictest_env_daily[@]}
+ do
+ #Executing cyclictest through yardstick.
+ cyclictest ${env}
+ sleep 5
+ done
+ if [ ${cyclictest_result} -ne 0 ] ; then
+ echo "Cyclictest case execution FAILED"
+ exit 1
+ else
+ echo "Cyclictest case executed SUCCESSFULLY"
+ exit 0
+ fi
+ fi
+elif [ ${test_type} == "merge" ];then
+ echo "Test is not enabled for ${test_type}"
+ exit 0