This patch contains scripts to publish the data to local 49/22449/12
authorkalyanreddy <reddyx.gundarapu@intel.com>
Thu, 29 Sep 2016 05:30:22 +0000 (11:00 +0530)
committerkalyanreddy <reddyx.gundarapu@intel.com>
Thu, 13 Oct 2016 12:28:13 +0000 (17:58 +0530)
Grafana Dashboard for daily Job

Change-Id: I382408d0f462c05f3f9b6578b3e00d104d127ee7
Co-Authored-By: Shravani <shravani.p@tcs.com>
Signed-off-by: Gundarapu Kalyan Reddy <reddyx.gundarapu@intel.com>
ci/cyclicTestTrigger.sh
ci/envs/cyclictest.sh
tests/cyclictest-node-context.yaml

index e00b367..0e9d04a 100755 (executable)
@@ -54,6 +54,17 @@ function host_clean {
     sudo ssh root@${HOST_IP} "reboot"
 }
 
+function cleanup {
+   output=$1
+   env_clean
+   host_clean
+   if [ $output != 0 ];then
+      echo "Yardstick Failed.Please check cyclictest.sh"
+      return 1
+   else
+      return 0
+   fi
+}
 
 #Creating a docker image with yardstick installed and Verify the results of cyclictest
 function runCyclicTest {
@@ -76,30 +87,28 @@ function runCyclicTest {
 
    #Launching ubuntu docker container to run yardstick
    sudo docker run -i -v ${volume}:/opt --net=host --name kvmfornfv_${testType} \
-   kvmfornfv:latest  /bin/bash -c "cd /opt/scripts && ls; ./cyclictest.sh"
-   output=$?
+   kvmfornfv:latest  /bin/bash -c "cd /opt/scripts && ls; ./cyclictest.sh $testType"
+   cyclictest_output=$?
    #Verifying the results of cyclictest
-   result=`grep -o '"errors":[^,]*' ${volume}/yardstick.out | awk -F '"' '{print $4}'`
 
-   if [ -z "${result}" ]; then
-      echo "####################################################"
-      echo ""
-      echo `grep -o '"data":[^}]*' ${volume}/yardstick.out | awk -F '{' '{print $2}'`
-      echo ""
-      echo "####################################################"
-      env_clean
-      host_clean
-      if [ $output != 0 ];then
-         echo "Some problem with Yardstick.Check cyclictest.sh"
-         return 1
+   if [ "$testType" == "verify" ];then
+      result=`grep -o '"errors":[^,]*' ${volume}/yardstick.out | awk -F '"' '{print $4}'`
+
+      if [ -z "${result}" ]; then
+         echo "####################################################"
+         echo ""
+         echo `grep -o '"data":[^}]*' ${volume}/yardstick.out | awk -F '{' '{print $2}'`
+         echo ""
+         echo "####################################################"
+         cleanup $cyclictest_output
       else
-         return 0
+         echo "Testcase failed"
+         echo `grep -o '"errors":[^,]*' ${volume}/yardstick.out | awk -F '"' '{print $4}'`
+         env_clean
+         host_clean
+         return 1
       fi
    else
-      echo "Testcase failed"
-      echo `grep -o '"errors":[^,]*' ${volume}/yardstick.out | awk -F '"' '{print $4}'`
-      env_clean
-      host_clean
-      return 1
+      cleanup $cyclictest_output
    fi
 }
index 2af22af..c5b980d 100755 (executable)
@@ -6,6 +6,7 @@
 ###########################################################
 source utils.sh
 
+testType=$1 #daily/verify/merge
 HOST_IP=$( getHostIP )
 pod_config='/opt/scripts/pod.yaml'
 cyclictest_context_file='/opt/cyclictest-node-context.yaml'
@@ -24,12 +25,45 @@ fi
 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 -d task start ${cyclictest_context_file}
 output=$?
-chmod 777 /tmp/yardstick.out
-cat /tmp/yardstick.out  > /opt/yardstick.out
+
+if [ "$testType" == "verify" ];then
+   chmod 777 /tmp/yardstick.out
+   cat /tmp/yardstick.out  > /opt/yardstick.out
+fi
+
 if [ $output != 0 ];then
-   echo "Someproblem with execution of Yardstick"
+   echo "Yardstick Failed !!!"
    exit 1
 fi
index 3125cb7..f3c84c8 100644 (file)
@@ -25,6 +25,7 @@ scenarios:
     type: Duration
     duration: 1
     interval: 1
+  tc: "kvmfornfv_cyclictest-node-context"
   sla:
     max_min_latency: 50
     max_avg_latency: 100