Merge "Stop running tempest full and scenario if healthcheck fails"
[releng.git] / jjb / functest / functest-alpine.sh
index 8aef9a0..ef2a649 100755 (executable)
@@ -8,6 +8,7 @@ REPO=${REPO:-opnfv}
 CI_LOOP=${CI_LOOP:-daily}
 TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results
 ENERGY_RECORDER_API_URL=http://energy.opnfv.fr/resources
+DOCKER_TAG=${DOCKER_TAG:-$([[ ${BRANCH##*/} == "master" ]] && echo "latest" || echo ${BRANCH##*/})}
 
 check_os_deployment() {
     FUNCTEST_IMAGE=${REPO}/functest-healthcheck:${DOCKER_TAG}
@@ -42,6 +43,7 @@ run_tiers() {
             echo ${ret_value} > ${ret_val_file}
             if [ ${tier} == 'healthcheck' ]; then
                 echo "Healthcheck tier failed. Exiting Functest..."
+                skip_tests=1
                 break
             fi
         fi
@@ -87,7 +89,6 @@ FUNCTEST_DIR=/home/opnfv/functest
 DEPLOY_TYPE=baremetal
 [[ $BUILD_TAG =~ "virtual" ]] && DEPLOY_TYPE=virt
 HOST_ARCH=$(uname -m)
-DOCKER_TAG=`[[ ${BRANCH##*/} == "master" ]] && echo "latest" || echo ${BRANCH##*/}`
 
 # Prepare OpenStack credentials volume
 rc_file=${HOME}/opnfv-openrc.sh
@@ -186,6 +187,7 @@ elif [ ${FUNCTEST_MODE} == 'tier' ]; then
     run_tiers ${tiers}
 else
     tests=(tempest_full tempest_scenario)
+    skip_tests=0
     if [ ${DEPLOY_TYPE} == 'baremetal' ] && [ "${HOST_ARCH}" != "aarch64" ]; then
         if [[ ${BRANCH} == "stable/fraser" ]]; then
             tiers=(healthcheck smoke features vnf parser)
@@ -202,7 +204,9 @@ else
         fi
     fi
     run_tiers ${tiers}
-    for test in "${tests[@]}"; do
-        run_test "$test"
-    done
+    if [ ${skip_tests} -eq 0 ]; then
+        for test in "${tests[@]}"; do
+            run_test "$test"
+        done
+    fi
 fi