summaryrefslogtreecommitdiffstats
path: root/tests/run.sh
diff options
context:
space:
mode:
authorRyota MIBU <r-mibu@cq.jp.nec.com>2017-01-27 06:34:06 +0000
committerRyota MIBU <r-mibu@cq.jp.nec.com>2017-01-31 09:14:31 +0000
commitc9d0d2c9fc16f2e989444bc4d7d8fab8060433ba (patch)
tree210bc9562ae3bd550ff9d87544b8bc657e032e1f /tests/run.sh
parentee4ef36ad0d93ecce542429d49ea368b39940ef9 (diff)
improve cleanup() in run.sh
- make sure all hosts are unset force_down flag - load all functions for inspector and installer first in order to avoid 'command not found' error - also, print VM if it has error state Change-Id: If56cba201e1a5f3669a97ffb3d28b3c55c7cdb58 Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
Diffstat (limited to 'tests/run.sh')
-rwxr-xr-xtests/run.sh21
1 files changed, 17 insertions, 4 deletions
diff --git a/tests/run.sh b/tests/run.sh
index df6db979..e7afb518 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -222,6 +222,7 @@ wait_for_vm_launch() {
return 0
fi
if [[ "$state" == "ERROR" ]]; then
+ openstack $as_doctor_user server show $VM_NAME
die $LINENO "vm state is ERROR"
fi
count=$(($count+1))
@@ -304,6 +305,18 @@ check_host_status() {
fi
}
+unset_forced_down_hosts() {
+ for host in $(openstack compute service list --service nova-compute \
+ -f value -c Host -c State | sed -n -e '/down$/s/ *down$//p')
+ do
+ python ./nova_force_down.py $host --unset
+ done
+
+ echo "waiting disabled compute host back to be enabled..."
+ wait_until 'openstack compute service list --service nova-compute
+ -f value -c State | grep -q down' 240 5
+}
+
cleanup() {
set +e
echo "cleanup..."
@@ -311,10 +324,10 @@ cleanup() {
stop_inspector
stop_consumer
- echo "waiting disabled compute host back to be enabled..."
- python ./nova_force_down.py "$COMPUTE_HOST" --unset
- sleep 240
- check_host_status "UP"
+ unset_forced_down_hosts
+ # TODO: We need to make sure the target compute host is back to IP
+ # reachable. wait_ping() will be added by tojuvone .
+ sleep 110
scp $ssh_opts_cpu "$COMPUTE_USER@$COMPUTE_IP:disable_network.log" .
openstack $as_doctor_user server list | grep -q " $VM_NAME " && openstack $as_doctor_user server delete "$VM_NAME"