Update robot initialization detection 11/23011/1
authorGary Wu <gary.i.wu@huawei.com>
Thu, 9 Nov 2017 19:42:15 +0000 (11:42 -0800)
committerGary Wu <gary.i.wu@huawei.com>
Thu, 9 Nov 2017 19:42:15 +0000 (11:42 -0800)
Change-Id: I0b19fde5d36b4b5582c983979a336eddab46f87c
Issue-ID: INT-278
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
test/ete/scripts/remote/run-robot.sh
test/ete/scripts/run-healthcheck.sh

index ff7223a..8eebd9f 100755 (executable)
@@ -1,9 +1,10 @@
-#!/bin/bash
+#!/bin/bash -x
 
 cd /opt
 
-if [ ! -x /opt/demo.sh ]; then
-    echo "Robot VM not initialized"
+docker ps | grep -q openecompete_container
+if [ ! $? -eq 0 ]; then
+    echo "Robot not initialized"
     exit 2
 fi
 
@@ -12,7 +13,8 @@ if [ ! -d eteshare/logs/demo ]; then
     echo "gary_wu" > /opt/config/openstack_username.txt
     echo $OS_PASSWORD_INPUT > /opt/config/openstack_password.txt
     /bin/bash /opt/eteshare/config/vm_config2robot.sh
-    echo "test" | /opt/demo.sh init_robot
+    # set robot VM http server password
+    echo "admin" | /opt/demo.sh init_robot
 fi
 
 /opt/ete.sh health
index 10811b5..057504e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -x
 
 SSH_KEY=~/.ssh/onap_key
 
@@ -13,6 +13,10 @@ cd $WORKSPACE/test/ete/scripts
 ROBOT_IP=$(./get-floating-ip.sh onap-robot)
 echo "ROBOT_IP=${ROBOT_IP}"
 
+if [ "" == "${ROBOT_IP}" ]; then
+    exit 1
+fi
+
 ssh-keygen -R ${ROBOT_IP}
 
 ssh -o StrictHostKeychecking=no -i ${SSH_KEY} root@${ROBOT_IP} "OS_PASSWORD_INPUT=$OS_PASSWORD_INPUT bash -s" < ./remote/run-robot.sh