diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-11-10 21:54:05 +0100 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-11-10 22:03:07 +0100 |
commit | 12b1809f55882d40fce87e9665c66240d8650d65 (patch) | |
tree | ed77e4119210cd189736d8f5af6f4bca4ff29cb3 | |
parent | f7cccc6d791bcd9a4aa9b0cc48800b0df3ec86cf (diff) |
Check if at least 1 hypervisors
Vmtp is skipped if only one hypervisor.
As Vtmp returns 0 when all is skipped, it protects vs issues when
generating charts.
Change-Id: I5ea7c31c0688ae773425d2192a4f30a22360185f
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 396b3d8a7a9036ae3a8a8443b489654d3a2dd3cb)
-rw-r--r-- | functest/opnfv_tests/openstack/tempest/tempest.py | 2 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/vmtp/vmtp.py | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py index 4d5a0f547..4fd466780 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -402,7 +402,7 @@ class TempestCommon(singlevm.VmReady2): """ if not os.path.exists(self.res_dir): os.makedirs(self.res_dir) - compute_cnt = len(self.cloud.list_hypervisors()) + compute_cnt = len(self.orig_cloud.list_hypervisors()) self.image_alt = self.publish_image_alt() self.flavor_alt = self.create_flavor_alt() diff --git a/functest/opnfv_tests/openstack/vmtp/vmtp.py b/functest/opnfv_tests/openstack/vmtp/vmtp.py index 2e0be28ad..6bad9aec2 100644 --- a/functest/opnfv_tests/openstack/vmtp/vmtp.py +++ b/functest/opnfv_tests/openstack/vmtp/vmtp.py @@ -60,6 +60,12 @@ class Vmtp(singlevm.VmReady2): (_, self.privkey_filename) = tempfile.mkstemp() (_, self.pubkey_filename) = tempfile.mkstemp() + def check_requirements(self): + if len(self.orig_cloud.list_hypervisors()) < 2: + self.__logger.warning("Vmtp requires at least 2 hypervisors") + self.is_skipped = True + self.project.clean() + def create_network_resources(self): """Create router |