diff options
Diffstat (limited to 'testcases/vIMS/CI')
-rw-r--r-- | testcases/vIMS/CI/orchestrator.py | 8 | ||||
-rw-r--r-- | testcases/vIMS/CI/vIMS.py | 13 |
2 files changed, 17 insertions, 4 deletions
diff --git a/testcases/vIMS/CI/orchestrator.py b/testcases/vIMS/CI/orchestrator.py index ab0b448fa..382fbd139 100644 --- a/testcases/vIMS/CI/orchestrator.py +++ b/testcases/vIMS/CI/orchestrator.py @@ -47,6 +47,12 @@ class orchestrator: def set_ssh_user(self, ssh_user): self.config['ssh_user'] = ssh_user + def set_nameservers(self, nameservers): + if 0 < len(nameservers): + self.config['dns_subnet_1'] = nameservers[0] + if 1 < len(nameservers): + self.config['dns_subnet_2'] = nameservers[1] + def set_logger(self, logger): self.logger = logger @@ -91,7 +97,7 @@ class orchestrator: if self.logger: self.logger.info("Launching the cloudify-manager deployment") - script = "set -e; " + script = "set -e; " script += "source " + self.testcase_dir + "venv_cloudify/bin/activate; " script += "cd " + self.testcase_dir + "; " script += "cfy init -r; " diff --git a/testcases/vIMS/CI/vIMS.py b/testcases/vIMS/CI/vIMS.py index 74cce9793..7a2d1979a 100644 --- a/testcases/vIMS/CI/vIMS.py +++ b/testcases/vIMS/CI/vIMS.py @@ -138,10 +138,13 @@ def test_clearwater(): logger.info("vIMS functional test Start Time:'%s'" % ( datetime.datetime.fromtimestamp(start_time_ts).strftime( '%Y-%m-%d %H:%M:%S'))) + nameservers = functest_utils.get_resolvconf_ns() + resolvconf = "" + for ns in nameservers: + resolvconf += "\nnameserver " + ns if dns_ip != "": - script = 'echo -e "nameserver ' + dns_ip + \ - '\nnameserver 8.8.8.8\nnameserver 8.8.4.4" > /etc/resolv.conf; ' + script = 'echo -e "nameserver ' + dns_ip + resolvconf + '" > /etc/resolv.conf; ' script += 'source /etc/profile.d/rvm.sh; ' script += 'cd ' + VIMS_TEST_DIR + '; ' script += 'rake test[' + \ @@ -176,7 +179,7 @@ def test_clearwater(): logger.debug("Pushing results to DB....") git_version = functest_utils.get_git_branch(REPO_PATH) functest_utils.push_results_to_db(db_url=TEST_DB, case_name="vIMS", - logger=logger, pod_name="opnfv-jump-2", git_version=git_version, + logger=logger, pod_name=functest_utils.get_pod_name(logger), git_version=git_version, payload={'orchestrator': {'duration': CFY_DEPLOYMENT_DURATION, 'result': ""}, 'vIMS': {'duration': CW_DEPLOYMENT_DURATION, @@ -343,6 +346,10 @@ def main(): cfy.set_external_network_name(ext_net) + ns = functest_utils.get_resolvconf_ns() + if ns: + cfy.set_nameservers(ns) + logger.info("Prepare virtualenv for cloudify-cli") cmd = "chmod +x " + VIMS_DIR + "create_venv.sh" functest_utils.execute_command(cmd, logger) |