From 22b37f0482f84fc935ae9ece3c9722098c0573bc Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Mon, 30 Sep 2019 17:26:05 +0200 Subject: Count all active hypervisors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Else tempest_slow fails if one hypervisor is down (detected in ONAP Openlab). It also improves Shaker, Rally and Vmtp which count them. Change-Id: Iee7c20e0357d9237501c5c451580d8f6409ac86b Signed-off-by: Cédric Ollivier --- functest/core/singlevm.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'functest/core') diff --git a/functest/core/singlevm.py b/functest/core/singlevm.py index 0473a21da..734eb22d5 100644 --- a/functest/core/singlevm.py +++ b/functest/core/singlevm.py @@ -256,6 +256,14 @@ class VmReady1(tenantnetwork.TenantNetwork1): self.__logger.debug( "Orphan security group %s in use", sec_group.id) + def count_active_hypervisors(self): + """Count all hypervisors which are up.""" + compute_cnt = 0 + for hypervisor in self.orig_cloud.list_hypervisors(): + if hypervisor['state'] == 'up': + compute_cnt += 1 + return compute_cnt + def run(self, **kwargs): """Boot the new VM -- cgit 1.2.3-korg