From 1825aa713952288e4204ea3b38f0d3c0635a6918 Mon Sep 17 00:00:00 2001 From: Linda Wang Date: Mon, 29 Jan 2018 07:37:37 +0000 Subject: Rename a common credential file for OS and K8S Change-Id: Ib8d24be4b29ab1de00d5dd5e3442146b2437cb94 Signed-off-by: Linda Wang --- functest/ci/check_deployment.py | 2 +- functest/ci/config_functest.yaml | 4 ++-- functest/ci/run_tests.py | 14 +++----------- 3 files changed, 6 insertions(+), 14 deletions(-) (limited to 'functest/ci') diff --git a/functest/ci/check_deployment.py b/functest/ci/check_deployment.py index 8d19d850..bf43b537 100644 --- a/functest/ci/check_deployment.py +++ b/functest/ci/check_deployment.py @@ -68,7 +68,7 @@ def get_auth_token(os_creds): class CheckDeployment(object): """ Check deployment class.""" - def __init__(self, rc_file='/home/opnfv/functest/conf/openstack.creds'): + def __init__(self, rc_file='/home/opnfv/functest/conf/env_file'): self.rc_file = rc_file self.services = ('compute', 'network', 'image') self.os_creds = None diff --git a/functest/ci/config_functest.yaml b/functest/ci/config_functest.yaml index 192a1ee0..ebaccc0c 100644 --- a/functest/ci/config_functest.yaml +++ b/functest/ci/config_functest.yaml @@ -15,9 +15,9 @@ general: functest_images: /home/opnfv/functest/images rally_inst: /root/.rally - openstack: - creds: /home/opnfv/functest/conf/openstack.creds + env_file: /home/opnfv/functest/conf/env_file + openstack: image_name: Cirros-0.4.0 image_name_alt: Cirros-0.4.0-1 image_file_name: cirros-0.4.0-x86_64-disk.img diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py index 7cba0efb..feef7d6a 100644 --- a/functest/ci/run_tests.py +++ b/functest/ci/run_tests.py @@ -98,16 +98,6 @@ class Runner(object): CONST.__getattribute__('DEPLOY_SCENARIO'), pkg_resources.resource_filename('functest', 'ci/testcases.yaml')) - @staticmethod - def source_rc_file(): - """Set the environmental vars from openstack.creds""" - - rc_file = CONST.__getattribute__('openstack_creds') - if not os.path.isfile(rc_file): - raise Exception("RC file %s does not exist..." % rc_file) - LOGGER.debug("Sourcing the OpenStack RC file...") - os_utils.source_credentials(rc_file) - @staticmethod def get_run_dict(testname): """Obtain the 'run' block of the testcase from testcases.yaml""" @@ -211,7 +201,9 @@ class Runner(object): self.report_flag = kwargs['report'] try: if 'test' in kwargs: - self.source_rc_file() + LOGGER.debug("Sourcing the credential file...") + os_utils.source_credentials(CONST.__getattribute__('env_file')) + LOGGER.debug("Test args: %s", kwargs['test']) if self.tiers.get_tier(kwargs['test']): self.run_tier(self.tiers.get_tier(kwargs['test'])) -- cgit 1.2.3-korg