X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=ci%2FcyclicTestTrigger.sh;h=4315aab5c7fc61b0156a5d74b44f914d1d2884da;hb=878d38941df56e0392cb652efe3c5996592e7f39;hp=d222ae15b17a3e3e5d9bee771c58faca6252c4ce;hpb=881aa3fcf152088440444d6f4296eaac3783801c;p=kvmfornfv.git diff --git a/ci/cyclicTestTrigger.sh b/ci/cyclicTestTrigger.sh index d222ae15b..4315aab5c 100755 --- a/ci/cyclicTestTrigger.sh +++ b/ci/cyclicTestTrigger.sh @@ -13,6 +13,10 @@ testType=$3 testName=$4 source $WORKSPACE/ci/envs/utils.sh +source $WORKSPACE/ci/envs/host-config + +checkRPMNames + KERNELRPM_VERSION=$( getKernelVersion ) QEMURPM_VERSION=$( getQemuVersion ) @@ -35,6 +39,29 @@ function verifyGuestImage { fi } +#Verifying the availability of the host after reboot +function connect_host { + n=0 + while [ $n -lt 25 ]; do + host_ping_test="ping -c 1 ${HOST_IP}" + eval $host_ping_test &> /dev/null + if [ ${?} -ne 0 ] ; then + sleep 10 + echo "host machine is still under reboot..trying to connect...." + n=$(($n+1)) + else + echo "resuming the execution of test cases....." + #Waiting for ssh to be available for the host machine. + sleep 30 + break + fi + if [ $n == 24 ];then + echo "Host machine unable to boot-up!" + exit 1 + fi + done +} + #Updating the pod.yaml file with HOST_IP,kvmfornfv_cyclictest_idle_idle.yaml with loops and interval function updateYaml { cd $WORKSPACE/tests/ @@ -110,7 +137,7 @@ function runCyclicTest { if [ ${?} -ne 0 ] ; then echo "Docker image build failed" id=$(sudo docker ps -a | head -2 | tail -1 | awk '{print $1}'); sudo docker rm -f $id - exit 1 + err_exit 1 fi time_stamp=$(date +%Y%m%d%H%M%S) volume=/tmp/kvmtest-${testType}-${time_stamp}