aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/vmtp/vmtp.py
diff options
context:
space:
mode:
Diffstat (limited to 'functest/opnfv_tests/openstack/vmtp/vmtp.py')
-rw-r--r--functest/opnfv_tests/openstack/vmtp/vmtp.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/functest/opnfv_tests/openstack/vmtp/vmtp.py b/functest/opnfv_tests/openstack/vmtp/vmtp.py
index 2fd4e089c..cfbd134c7 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):
@@ -50,6 +51,7 @@ class Vmtp(singlevm.VmReady2):
flavor_vcpus = 1
flavor_disk = 0
create_server_timeout = 300
+ ssh_retry_timeout = 240
def __init__(self, **kwargs):
if "case_name" not in kwargs:
@@ -60,7 +62,7 @@ class Vmtp(singlevm.VmReady2):
(_, self.pubkey_filename) = tempfile.mkstemp()
def check_requirements(self):
- if len(self.orig_cloud.list_hypervisors()) < 2:
+ if self.count_hypervisors() < 2:
self.__logger.warning("Vmtp requires at least 2 hypervisors")
self.is_skipped = True
self.project.clean()
@@ -122,6 +124,7 @@ class Vmtp(singlevm.VmReady2):
self.guid)
vmtp_conf["dns_nameservers"] = [env.get('NAMESERVER')]
vmtp_conf["generic_retry_count"] = self.create_server_timeout // 2
+ vmtp_conf["ssh_retry_count"] = self.ssh_retry_timeout // 2
conf.write(yaml.dump(vmtp_conf))
def run_vmtp(self):
@@ -135,6 +138,8 @@ class Vmtp(singlevm.VmReady2):
OS_USERNAME=self.project.user.name,
OS_PROJECT_NAME=self.project.project.name,
OS_PROJECT_ID=self.project.project.id,
+ OS_PROJECT_DOMAIN_NAME=self.project.domain.name,
+ OS_USER_DOMAIN_NAME=self.project.domain.name,
OS_PASSWORD=self.project.password)
if not new_env["OS_AUTH_URL"].endswith(('v3', 'v3/')):
new_env["OS_AUTH_URL"] = "{}/v3".format(new_env["OS_AUTH_URL"])
@@ -145,6 +150,12 @@ class Vmtp(singlevm.VmReady2):
pass
cmd = ['vmtp', '-d', '--json', '{}/vmtp.json'.format(self.res_dir),
'-c', self.config]
+ if env.get("VMTP_HYPERVISORS"):
+ hypervisors = functest_utils.convert_ini_to_list(
+ env.get("VMTP_HYPERVISORS"))
+ for hypervisor in hypervisors:
+ cmd.extend(["--hypervisor", hypervisor])
+ self.__logger.debug("cmd: %s", cmd)
output = subprocess.check_output(
cmd, stderr=subprocess.STDOUT, env=new_env).decode("utf-8")
self.__logger.info("%s\n%s", " ".join(cmd), output)