diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2019-10-06 20:43:02 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2019-10-08 06:53:28 +0200 |
commit | b450f6f87d3675aea0e278e9b2e92e920adb8406 (patch) | |
tree | aa6cdbedb5d39e060f61c78ae69213aafddc5a83 /functest/core/singlevm.py | |
parent | f4a7f631e286f9a163fbc992eead751b71679efe (diff) |
Count all hypervisors by default
If one hypervisor is down, few tempest test fails.
User is free to set SKIP_DOWN_HYPERVISORS if it's down on purpose.
Change-Id: I7b6a4d0d8f67755d8c1550fd1bc6fd707634f68b
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 7332716dc835cd72b0beefc38afda2697bd99e02)
Diffstat (limited to 'functest/core/singlevm.py')
-rw-r--r-- | functest/core/singlevm.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/functest/core/singlevm.py b/functest/core/singlevm.py index cebb7cc84..4c3392097 100644 --- a/functest/core/singlevm.py +++ b/functest/core/singlevm.py @@ -257,12 +257,21 @@ class VmReady1(tenantnetwork.TenantNetwork1): self.__logger.debug( "Orphan security group %s in use", sec_group.id) + def count_hypervisors(self): + """Count hypervisors.""" + if env.get('SKIP_DOWN_HYPERVISORS').lower() == 'false': + return len(self.orig_cloud.list_hypervisors()) + return self.count_active_hypervisors() + 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 + else: + self.__logger.warning( + "%s is down", hypervisor['hypervisor_hostname']) return compute_cnt def run(self, **kwargs): |