This patch contains scripts to publish the data to local
[kvmfornfv.git] / ci / envs / cyclictest.sh
old mode 100644 (file)
new mode 100755 (executable)
index e4dd993..c5b980d
@@ -4,8 +4,11 @@
 ## Invoking this script from ubuntu docker container runs
 ## cyclictest through yardstick
 ###########################################################
+source utils.sh
 
-pod_config='/opt/pod.yaml'
+testType=$1 #daily/verify/merge
+HOST_IP=$( getHostIP )
+pod_config='/opt/scripts/pod.yaml'
 cyclictest_context_file='/opt/cyclictest-node-context.yaml'
 
 if [ ! -f ${pod_config} ] ; then
@@ -18,6 +21,49 @@ if [ ! -f ${cyclictest_context_file} ] ; then
     exit 1
 fi
 
+#setting up of image for launching guest vm.
+ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
+root@$HOST_IP "cp /root/images/guest1.qcow2 /root/"
+
+#Updating the yardstick.conf file for daily
+function updateConfDaily() {
+   DISPATCHER_TYPE=influxdb
+   DISPATCHER_FILE_NAME="/tmp/yardstick.out"
+   # Use the influxDB on the jumping server
+   DISPATCHER_INFLUXDB_TARGET="http://10.2.117.21:8086"
+   mkdir -p /etc/yardstick
+   cat << EOF > /etc/yardstick/yardstick.conf
+[DEFAULT]
+debug = True
+dispatcher = ${DISPATCHER_TYPE}
+
+[dispatcher_file]
+file_name = ${DISPATCHER_FILE_NAME}
+
+[dispatcher_influxdb]
+timeout = 5
+db_name = yardstick
+username = root
+password = root
+target = ${DISPATCHER_INFLUXDB_TARGET}
+EOF
+}
+
+#Function call to update yardstick conf file based on Job type
+if [ "$testType" == "daily" ];then
+   updateConfDaily
+fi
+
 #Running cyclictest through yardstick
-yardstick task start ${cyclictest_context_file}
-mv /tmp/yardstick.out  /opt/
+yardstick -d task start ${cyclictest_context_file}
+output=$?
+
+if [ "$testType" == "verify" ];then
+   chmod 777 /tmp/yardstick.out
+   cat /tmp/yardstick.out  > /opt/yardstick.out
+fi
+
+if [ $output != 0 ];then
+   echo "Yardstick Failed !!!"
+   exit 1
+fi