Skip to content

Commit 9d55b75

Browse files
lyarwoodstephenfin
authored andcommitted
test_evacuate: Wait until subnode is down before starting tests
Change-Id: I714eb2ef3a6d307b60d82e7fedc49bfeadd20289
1 parent e0f088c commit 9d55b75

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

gate/test_evacuate.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,19 @@ $ANSIBLE subnodes --become -f 5 -i "$WORKSPACE/inventory" -m shell -a "for domai
6262
echo "Forcing down the subnode so we can evacuate from it"
6363
openstack --os-compute-api-version 2.11 compute service set --down ${subnode} nova-compute
6464

65+
count=0
66+
status=$(openstack compute service list --host ${subnode} --service nova-compute -f value -c State)
67+
while [ "${status}" != "down" ]
68+
do
69+
sleep 1
70+
count=$((count+1))
71+
if [ ${count} -eq 30 ]; then
72+
echo "Timed out waiting for subnode compute service to be marked as down"
73+
exit 5
74+
fi
75+
status=$(openstack compute service list --host ${subnode} --service nova-compute -f value -c State)
76+
done
77+
6578
echo "Stopping libvirt on the localhost before evacuating to trigger failure"
6679
sudo systemctl stop libvirt-bin
6780

0 commit comments

Comments
 (0)