3 #############################################################
4 ## !!! The original test_kvmfornfv.sh is removed because it
5 ## break the verification process!!!
6 #############################################################
7 ## This script will launch ubuntu docker container
8 ## runs cyclictest through yardstick
9 ## and verifies the test results.
10 ############################################################
14 container_id=`sudo docker ps -a | grep kvmfornfv |awk '{print $1}'`
15 sudo docker rm $container_id
16 sudo ssh root@10.2.117.23 "rm -rf /root/workspace/*"
17 sudo ssh root@10.2.117.23 "pid=\$(ps aux | grep 'qemu' | awk '{print \$2}' | head -1); echo \$pid |xargs kill"
18 sudo rm -rf /tmp/kvmtest-*
21 #Cleaning up the test environment before running cyclictest through yardstick.
24 time_stamp=$(date +%Y%m%d%H%M%S)
25 volume=/tmp/kvmtest-${time_stamp}
26 mkdir -p $volume/{image,rpm,scripts}
28 #copying required files to run yardstick cyclic testcase
29 mv $WORKSPACE/build_output/kernel-4.4*.rpm $volume/rpm
30 cp -r $WORKSPACE/ci/envs/* $volume/scripts
31 cp -r $WORKSPACE/tests/cyclictest-node-context.yaml $volume
32 cp -r $WORKSPACE/tests/pod.yaml $volume
34 #Launching ubuntu docker container to run yardstick
35 sudo docker run -i -v $volume:/opt --net=host --name kvmfornfv \
36 kvmfornfv:latest /bin/bash -c "cd /opt/scripts && ls; ./cyclictest.sh"
38 #Verifying the results of cyclictest
39 result=`grep -o '"errors":[^,]*' $volume/yardstick.out | awk -F '"' '{print $4}'`
41 if [ -z "$result" ]; then
42 echo "####################################################"
44 echo `grep -o '"data":[^}]*' $volume/yardstick.out | awk -F '{' '{print $2}'`
46 echo "####################################################"
50 echo "Testcase failed"
51 echo `grep -o '"errors":[^,]*' ${volume}/yardstick.out | awk -F '"' '{print $4}'`