3 ##############################################################################
4 ## Copyright (c) 2015 Intel Corp.
6 ## All rights reserved. This program and the accompanying materials
7 ## are made available under the terms of the Apache License, Version 2.0
8 ## which accompanies this distribution, and is available at
9 ## http://www.apache.org/licenses/LICENSE-2.0
10 ###############################################################################
12 # Number of huge pages to create and on which NUMA node
16 # QEMU executable path and number of cpus for guest
17 qemu=/usr/local/bin/qemu-system-x86_64
19 pcm_memory=/root/pcm/pcm-memory.x
21 # Isolated cpus for nfv, must be given as a range '-' and Numa node1 CPU's should be considered
22 host_isolcpus=`lscpu | grep "NUMA node1 CPU(s)"| awk -F ':' '{print \$2}' | sed 's/[[:space:]]//g'`
23 first=$(echo ${host_isolcpus} | cut -f1 -d-)
24 last=$(echo ${host_isolcpus} | cut -f2 -d- | cut -d',' -f1 )
26 # Bind cpus from host_isolcpus range for QEMU processor threads
28 while [ ${i} -lt ${guest_cpus} ]; do
31 first=`expr $first + 1`
34 #Isolated cpus from host_isolcpus range to run Stress tool
35 stress_isolcpus=${first}-${last}
36 echo "Stress tool runs on $stress_isolcpus"
38 #Host for executing test cases based on test_type/job from releng
41 if [ ${test_type} == "verify" ];then
42 HOST_IP="10.10.100.21"
43 elif [ ${test_type} == "daily" ];then
44 HOST_IP="10.10.100.22"
46 echo "Incorrect test type"
51 #Time duration for executing test cases based on test_type/job from releng
52 function setTestTime {
54 if [ ${test_type} == "verify" ];then
56 elif [ ${test_type} == "daily" ];then
57 test_time=3600000 # 1hr
59 echo "Incorrect test type"
64 #Tar the log files generated during testcase execution and exit.
67 time_stamp=$(date -u +"%Y-%m-%d_%H-%M-%S")
68 cd $WORKSPACE/build_output/
70 tar -czvf log-${time_stamp}.tar.gz log
71 echo "uploading debugging logs to artifacts"
72 gsutil cp -r log-*.tar.gz gs://artifacts.opnfv.org/kvmfornfv/\
73 kvmfornfv_verify_debug_logs_${time_stamp} > \
74 $WORKSPACE/build_output/gsutil.log 2>&1
75 echo -e "Download the logs from artifacts using below for debugging\n
76 http://artifacts.opnfv.org/kvmfornfv/kvmfornfv_verify_debug_logs_${time_stamp}"
82 echo "Copying Log files from Node to Jump Server"
83 sudo ssh root@${HOST_IP} "cd /root;tar -czvf MBWInfo.tar.gz MBWInfo"
84 mkdir -p $WORKSPACE/build_output/log/MBWInfo
85 scp root@${HOST_IP}:/root/MBWInfo.tar.gz $WORKSPACE/build_output/log/MBWInfo
86 echo "Listing all the logs collected"
87 cd $WORKSPACE;ls build_output/log/MBWInfo;
88 sudo ssh root@${HOST_IP} "cd /root;rm -rf MBWInfo MBWInfo.tar.gz"
91 function packet_fwd_logs {
92 #Tar and copy logs for uploading to artifacts repository
93 echo "Copying Log files from Node to Jump Server"
94 mkdir -p $WORKSPACE/build_output/log/packet_fwd
95 scp -r root@${HOST_IP}:/tmp/packet_fwd_logs $WORKSPACE/build_output/log/packet_fwd
96 #removing collected logs on the node after copying.
97 sudo ssh root@${HOST_IP} "cd /tmp;rm -rf packet_fwd_logs"
100 function packet_fwd_exit {
102 TIMESTAMP=$(date -u +"%Y-%m-%d_%H-%M-%S")
103 cd $WORKSPACE/build_output/
105 tar -czvf log-${TIMESTAMP}.tar.gz log
106 echo "Uploading packet forwarding logs and results"
107 gsutil cp -r log-*.tar.gz gs://artifacts.opnfv.org/kvmfornfv/packet_fwd_${TIMESTAMP} > $WORKSPACE/build_output/gsutil.log 2>&1
108 echo "http://artifacts.opnfv.org/kvmfornfv/packet_fwd_${TIMESTAMP}"