To modify Ixia port numbers and IP in pod.yaml
[kvmfornfv.git] / ci / envs / lmtest.sh
1 #!/bin/bash
2
3 ###########################################################
4 ## Invoking this script from ubuntu docker container runs
5 ## cyclictest through yardstick
6 ###########################################################
7 source utils.sh
8
9 HOST_IP=$( getHostIP )
10 pod_config='/opt/scripts/pod.yaml'
11 lmtest_context_file='/opt/migrate-node-context.yaml'
12 yardstick_prefix='/root/yardstick/yardstick/benchmark/scenarios/compute' # yardstick teardown path
13
14 if [ ! -f ${pod_config} ] ; then
15     echo "file ${pod_config} not found"
16     exit 1
17 fi
18
19 if [ ! -f ${lmtest_context_file} ] ; then
20     echo "file ${lmtest_context_file} not found"
21     exit 1
22 fi
23
24 #Execution of the post-execute script copied requires re-installation of yardstick
25 ( cd /root/yardstick ; python setup.py install )
26
27 #setting up of image for launching guest vm.
28 ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
29 root@$HOST_IP "cp /root/images/guest1.qcow2 /root/"
30
31 #Updating the yardstick.conf file for daily
32 function updateConfDaily() {
33    DISPATCHER_TYPE=influxdb
34    DISPATCHER_FILE_NAME="/tmp/yardstick.out"
35    # Use the influxDB on the jumping server
36    DISPATCHER_INFLUXDB_TARGET="http://104.197.68.199:8086"
37    mkdir -p /etc/yardstick
38    cat << EOF > /etc/yardstick/yardstick.conf
39 [DEFAULT]
40 debug = True
41 dispatcher = ${DISPATCHER_TYPE}
42
43 [dispatcher_file]
44 file_name = ${DISPATCHER_FILE_NAME}
45
46 [dispatcher_influxdb]
47 timeout = 5
48 db_name = yardstick
49 username = opnfv
50 password = 0pnfv2015
51 target = ${DISPATCHER_INFLUXDB_TARGET}
52 EOF
53 }
54
55 #Function call to update yardstick conf file based on Job type
56 #if [ "$testType" == "daily" ];then
57 #   updateConfDaily
58 #fi
59
60
61 #Running livemigration through yardstick
62 echo "Executing livemigration through yardstick"
63 yardstick -d task start ${lmtest_context_file}
64 output=$?
65
66 if [ "$testType" == "verify" ];then
67    chmod 777 /tmp/yardstick.out
68    cat /tmp/yardstick.out  > /opt/yardstick.out
69 fi
70
71 if [ $output != 0 ];then
72    echo "Yardstick Failed !!!"
73    exit 1
74 fi