summaryrefslogtreecommitdiffstats
path: root/ci/cyclicTestTrigger.sh
diff options
context:
space:
mode:
authorkalyanreddy <reddyx.gundarapu@intel.com>2016-09-29 11:00:22 +0530
committerkalyanreddy <reddyx.gundarapu@intel.com>2016-10-13 17:58:13 +0530
commit596c056f98f1225a2fffd76cf30f6982b69ec0e4 (patch)
treef3e9ea8c87434d78a4b315c59212e35ab6b3af67 /ci/cyclicTestTrigger.sh
parent3f130ef583ff4984853be9d3db8d8824e996b5ca (diff)
This patch contains scripts to publish the data to local
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>
Diffstat (limited to 'ci/cyclicTestTrigger.sh')
-rwxr-xr-xci/cyclicTestTrigger.sh49
1 files changed, 29 insertions, 20 deletions
diff --git a/ci/cyclicTestTrigger.sh b/ci/cyclicTestTrigger.sh
index e00b36783..0e9d04a54 100755
--- a/ci/cyclicTestTrigger.sh
+++ b/ci/cyclicTestTrigger.sh
@@ -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
}