aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2020-06-18 16:46:29 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2020-06-19 11:34:41 +0200
commitba23ccc5b1062e09aced223bdb5f32ca750154e1 (patch)
tree3bb091837c76170a2fc8b45dca9dc70c1f29926c
parenta77f9a876ecb77af9804db03e4f5580db3cd25cf (diff)
Allow listing hypervisors in VMTP
It allows listing the compute under tests via VMTP_HYPERVISORS. They are no additional log in Functest and the note in VMTP is still valid [1]. [1] https://opendev.org/x/vmtp/src/branch/master/vmtp/vmtp.py#L833 Change-Id: Ic9fbda3901d796c0ed94e42e2a14c468598f4311 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 3668a839dd9b869a3162c8aa2d98a152d22b7244)
-rw-r--r--functest/opnfv_tests/openstack/vmtp/vmtp.py10
-rw-r--r--functest/utils/env.py3
2 files changed, 11 insertions, 2 deletions
diff --git a/functest/opnfv_tests/openstack/vmtp/vmtp.py b/functest/opnfv_tests/openstack/vmtp/vmtp.py
index 76bc4e5e1..93056582b 100644
--- a/functest/opnfv_tests/openstack/vmtp/vmtp.py
+++ b/functest/opnfv_tests/openstack/vmtp/vmtp.py
@@ -33,6 +33,7 @@ from xtesting.core import testcase
from functest.core import singlevm
from functest.utils import env
+from functest.utils import functest_utils
class Vmtp(singlevm.VmReady2):
@@ -147,8 +148,15 @@ class Vmtp(singlevm.VmReady2):
del new_env['OS_TENANT_ID']
except Exception: # pylint: disable=broad-except
pass
+ extra_args = ""
+ if env.get("VMTP_HYPERVISORS"):
+ hypervisors = functest_utils.convert_ini_to_list(
+ env.get("VMTP_HYPERVISORS"))
+ for hypervisor in hypervisors:
+ extra_args = "{} --hypervisor {} ".format(
+ extra_args, hypervisor)
cmd = ['vmtp', '-d', '--json', '{}/vmtp.json'.format(self.res_dir),
- '-c', self.config]
+ '-c', self.config, extra_args]
output = subprocess.check_output(
cmd, stderr=subprocess.STDOUT, env=new_env).decode("utf-8")
self.__logger.info("%s\n%s", " ".join(cmd), output)
diff --git a/functest/utils/env.py b/functest/utils/env.py
index 652613c87..672aee1d9 100644
--- a/functest/utils/env.py
+++ b/functest/utils/env.py
@@ -39,7 +39,8 @@ INPUTS = {
'CLEAN_ORPHAN_SECURITY_GROUPS': 'True',
'SKIP_DOWN_HYPERVISORS': 'False',
'PUBLIC_ENDPOINT_ONLY': 'False',
- 'DASHBOARD_URL': ''
+ 'DASHBOARD_URL': '',
+ 'VMTP_HYPERVISORS': ''
}