Unnecessary command and let VM creation stabilize 17/20617/1
authorCarlos Goncalves <carlos.goncalves@neclab.eu>
Tue, 6 Sep 2016 13:40:37 +0000 (15:40 +0200)
committerwenjuan dong <dong.wenjuan@zte.com.cn>
Thu, 8 Sep 2016 02:03:17 +0000 (02:03 +0000)
Method 'wait_for_status' in OpenStack CLI test_server.py suggests that
we might have to wait a little bit longer after server reaches expected
status. Better wait than break.

Change-Id: I4aaa3091ac2e458aa527b6bd0164d65d46c85017
Signed-off-by: Carlos Goncalves <carlos.goncalves@neclab.eu>
(cherry picked from commit 5d2b686e203842c57dae5bf593670dab637751f4)

tests/run.sh

index ee96da9..2b25169 100755 (executable)
@@ -450,7 +450,12 @@ wait_for_vm_launch() {
     while [[ ${count} -lt 60 ]]
     do
         state=$(openstack $as_doctor_user server list | grep " $VM_NAME " | awk '{print $6}')
-        [[ "$state" == "ACTIVE" ]] && return 0
+        if [[ "$state" == "ACTIVE" ]]; then
+            # NOTE(cgoncalves): sleeping for a bit to stabilize
+            # See python-openstackclient/functional/tests/compute/v2/test_server.py:wait_for_status
+            sleep 5
+            return 0
+        fi
         [[ "$state" == "ERROR" ]] && echo "vm state is ERROR" && exit 1
         count=$(($count+1))
         sleep 1
@@ -560,13 +565,12 @@ create_test_user
 echo "creating VM..."
 boot_vm
 wait_for_vm_launch
-openstack $as_doctor_user server show $VM_NAME
 
 echo "get computer host info..."
 get_compute_host_info
 
 echo "creating alarm..."
-#TODO: change back to use, network problems depends on infra and installers 
+#TODO: change back to use, network problems depends on infra and installers
 #get_consumer_ip
 create_alarm