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:51:20 +0200 |
commit | 7332716dc835cd72b0beefc38afda2697bd99e02 (patch) | |
tree | ad500b48d73c31f6c6826584f6ef11c797928ab3 /functest/core | |
parent | 574243656df6acae28094c62f33410ef1fc3e7b5 (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>
Diffstat (limited to 'functest/core')
-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 734eb22d5..5ecd482ac 100644 --- a/functest/core/singlevm.py +++ b/functest/core/singlevm.py @@ -256,12 +256,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): |