make script fail if it failed to get COMPUTE_HOST 03/17403/1
authorRyota MIBU <r-mibu@cq.jp.nec.com>
Fri, 22 Jul 2016 10:21:42 +0000 (19:21 +0900)
committerRyota MIBU <r-mibu@cq.jp.nec.com>
Fri, 22 Jul 2016 10:23:32 +0000 (19:23 +0900)
This patch is to make sure the test will be stop and report it failed.

JIRA: DOCTOR-63

Change-Id: Ibab577a100dee784df14e8b129fbde626d04fce9
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
tests/run.sh

index 4d9a5c7..5dbd608 100755 (executable)
@@ -46,6 +46,10 @@ get_compute_host_info() {
                 grep "OS-EXT-SRV-ATTR:host" | awk '{ print $4 }' |
                 awk -F '.' '{print $1}')
     )
+    if [[ -z "$COMPUTE_HOST" ]] ; then
+        echo "ERROR: failed to get compute hostname"
+        exit 1
+    fi
     if [[ "$INSTALLER_TYPE" == "apex" ]] ; then
         COMPUTE_USER=${COMPUTE_USER:-heat-admin}
         if [[ "$INSTALLER_IP" == "none" ]] ; then