3 ############################################################
4 ## This script is an interface to trigger the
5 ## cyclicTestTrigger.sh for test type like patch verification,
7 ## Releng will trigger this script by passing test type as
8 ## verify/daily and test name as idle_idle/stress_idle/
9 ## packet_forward as arguments.
10 ## Verify Job runs idle_idle,packet_forward test
11 ## daily job runs base on the test name parameter
12 ############################################################
17 cyclictest_env_verify=("idle_idle" "cpustress_idle" "memorystress_idle" "iostress_idle") #cyclictest environment
18 cyclictest_env_daily=("idle_idle" "cpustress_idle" "memorystress_idle" "iostress_idle")
19 cyclictest_result=0 #exit code of cyclictest
20 packetforward_result=0 #exit code of packet forward
21 source $WORKSPACE/ci/envs/host-config
23 function packetForward {
24 # source $WORKSPACE/ci/packet_forward_test.sh $HOST_IP
25 echo "Packetforwarding need to be implemented"
26 packetforward_result=$?
27 if [ ${packetforward_result} -ne 0 ];then
28 echo "Packet Forwarding test case execution FAILED"
30 echo "Packet Forwarding test case executed SUCCESSFULLY"
37 source $WORKSPACE/ci/cyclicTestTrigger.sh $HOST_IP $test_time $test_type $test_case
38 #Verifying whether the test node is up and running
40 #Waiting for ssh to be available for the host machine.
42 #calculating and verifying sha512sum of the guestimage.
43 if ! verifyGuestImage;then
46 #Update kvmfornfv_cyclictest_${testName}.yaml with test_time and pod.yaml with IP
48 #Cleaning up the test environment before running cyclictest through yardstick.
51 collect_MBWInfo $test_type
52 #Creating a docker image with yardstick installed and launching ubuntu docker to run yardstick cyclic testcase
54 cyclictest_result=`expr ${cyclictest_result} + 0`
56 echo "Test case execution FAILED for ${test_case} environment"
57 cyclictest_result=`expr ${cyclictest_result} + 1`
59 echo "Terminating PCM Process"
60 sudo ssh root@${HOST_IP} "pid=\$(ps aux | grep 'pcm' | awk '{print \$2}' | head -1); echo \$pid |xargs kill -SIGTERM"
62 function collect_MBWInfo {
63 #Collecting the Memory Bandwidth Information using pcm-memory utility
64 source $WORKSPACE/ci/envs/host-config
66 timeStamp=$(date +%Y%m%d%H%M%S)
67 echo "Running PCM memory to collect memory bandwidth"
68 sudo ssh root@${HOST_IP} "mkdir -p /root/MBWInfo"
69 sudo ssh root@${HOST_IP} "${pcm_memory} 60 &>/root/MBWInfo/MBWInfo_${testType}_${timeStamp} &disown"
71 function install_pcm {
72 source $WORKSPACE/ci/envs/host-config
73 sudo ssh root@${HOST_IP} '
74 modelName=`cat /proc/cpuinfo | grep -i "model name" | uniq`
75 if echo "$modelName" | grep -i "xeon" ;then
76 echo "pcm utility supports $modelName processor"
78 echo "check for the pcm utility supported processors"
82 if [ ! -d "pcm" ]; then
83 `git clone https://github.com/opcm/pcm`
86 echo "Disabling NMI Watchdog"
87 echo 0 > /proc/sys/kernel/nmi_watchdog
88 echo "To Access MSR registers installing msr-tools"
89 sudo yum install msr-tools
95 function ftrace_disable {
96 sudo ssh root@${HOST_IP} "sh /root/workspace/scripts/disbale-trace.sh"
97 sudo ssh root@${HOST_IP} "cd /tmp ; a=\$(ls -rt | tail -1) ; echo \$a ; mv \$a cyclictest_${env}.txt"
98 sudo mkdir -p $WORKSPACE/build_output/log/kernel_trace
99 sudo scp root@${HOST_IP}:/tmp/cyclictest_${env}.txt $WORKSPACE/build_output/log/kernel_trace/
102 #Execution of testcases based on test type and test name from releng.
103 if [ ${test_type} == "verify" ];then
104 HOST_IP="10.10.100.21"
107 if [ ${ftrace_enable} -eq '1' ]; then
108 for env in ${cyclictest_env_verify[@]}
110 #Enabling ftrace for kernel debugging.
111 sed -i '/host-setup1.sh/a\ \- \"enable-trace.sh\"' kvmfornfv_cyclictest_hostenv_guestenv.yaml
112 #Executing cyclictest through yardstick.
114 #disabling ftrace and collecting the logs to upload to artifact repository.
118 #Execution of packet forwarding test cases.
121 for env in ${cyclictest_env_verify[@]}
123 #Executing cyclictest through yardstick.
127 #Execution of packet forwarding test cases.
130 if [ ${cyclictest_result} -ne 0 ] || [ ${packetforward_result} -ne 0 ];then
131 echo "Test case FAILED"
136 elif [ ${test_type} == "daily" ];then
137 HOST_IP="10.10.100.22"
138 test_time=3600000 #1h
140 if [ ${test_name} == "packet_forward" ];then
142 if [ ${packetforward_result} -ne 0 ] ; then
147 elif [ ${test_name} == "cyclictest" ];then
148 if [ ${ftrace_enable} -eq '1' ]; then
149 for env in ${cyclictest_env_daily[@]}
151 #Enabling ftrace for kernel debugging.
152 sed -i '/host-setup1.sh/a\ \- \"enable-trace.sh\"' kvmfornfv_cyclictest_hostenv_guestenv.yaml
153 #Executing cyclictest through yardstick.
155 #disabling ftrace and collecting the logs to upload to artifact repository.
160 for env in ${cyclictest_env_daily[@]}
162 #Executing cyclictest through yardstick.
167 if [ ${cyclictest_result} -ne 0 ] ; then
168 echo "Cyclictest case execution FAILED"
171 echo "Cyclictest case executed SUCCESSFULLY"
175 elif [ ${test_type} == "merge" ];then
176 echo "Test is not enabled for ${test_type}"
179 echo "Incorrect test type ${test_type}"