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
This commit is contained in:
zhufl
2018-09-04 16:48:31 +08:00
parent 94c822fc3c
commit c7d65d1bd3

View File

@@ -79,7 +79,8 @@ class HypervisorAdminTestJSON(HypervisorAdminTestBase):
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