From 3668a839dd9b869a3162c8aa2d98a152d22b7244 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Thu, 18 Jun 2020 16:46:29 +0200 Subject: Allow listing hypervisors in VMTP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- functest/opnfv_tests/openstack/vmtp/vmtp.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'functest/opnfv_tests/openstack') diff --git a/functest/opnfv_tests/openstack/vmtp/vmtp.py b/functest/opnfv_tests/openstack/vmtp/vmtp.py index 822c1b652..edff99cb2 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): @@ -148,8 +149,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) -- cgit 1.2.3-korg