Add check for hypervisor state before getting uptime
show_hypervisor_uptime will take several minutes to
return fail info if hypervisor is not good, so this is to add
check for hypervisor state up before show_hypervisor_uptime
to save running time in the situation where there is abnormal
hypervisor in the system.
Change-Id: I93753a73ac84243d6837b3364d1f252018e03431
diff --git a/tempest/api/compute/admin/test_hypervisor.py b/tempest/api/compute/admin/test_hypervisor.py
index 14f51e9..9822c26 100644
--- a/tempest/api/compute/admin/test_hypervisor.py
+++ b/tempest/api/compute/admin/test_hypervisor.py
@@ -79,7 +79,8 @@
for hyper in hypers:
details = (self.client.show_hypervisor(hyper['id'])
['hypervisor'])
- if details['hypervisor_type'] != 'ironic':
+ if (details['hypervisor_type'] != 'ironic' and
+ details['state'] == 'up'):
hypers_without_ironic.append(hyper)
ironic_only = False