From fdbfe10922d09ee3dad407b10be0205082dddce3 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Wed, 21 Feb 2018 11:33:39 +0100 Subject: Use constants for Functest config file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit env_file can't be defined in a config file simply because it's an entry point (Jenkins jobs, end users) Change-Id: Ie23c0ef90efc839d60f0f3a9754c58746b1f3a00 Signed-off-by: Cédric Ollivier --- functest/ci/check_deployment.py | 3 ++- functest/ci/config_functest.yaml | 2 -- functest/ci/run_tests.py | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'functest/ci') diff --git a/functest/ci/check_deployment.py b/functest/ci/check_deployment.py index bf43b537..a475491a 100644 --- a/functest/ci/check_deployment.py +++ b/functest/ci/check_deployment.py @@ -28,6 +28,7 @@ from snaps.openstack.utils import keystone_utils from snaps.openstack.utils import neutron_utils from snaps.openstack.utils import nova_utils +from functest.utils import constants from functest.opnfv_tests.openstack.snaps import snaps_utils __author__ = "Jose Lausuch " @@ -68,7 +69,7 @@ def get_auth_token(os_creds): class CheckDeployment(object): """ Check deployment class.""" - def __init__(self, rc_file='/home/opnfv/functest/conf/env_file'): + def __init__(self, rc_file=constants.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 be7a2db5..e93b025d 100644 --- a/functest/ci/config_functest.yaml +++ b/functest/ci/config_functest.yaml @@ -15,8 +15,6 @@ general: functest_images: /home/opnfv/functest/images rally_inst: /root/.rally - env_file: /home/opnfv/functest/conf/env_file - openstack: image_name: Cirros-0.4.0 image_name_alt: Cirros-0.4.0-1 diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py index ca101ce6..0b980303 100644 --- a/functest/ci/run_tests.py +++ b/functest/ci/run_tests.py @@ -29,10 +29,10 @@ import yaml from functest.ci import tier_builder from functest.core import testcase +from functest.utils import constants from functest.utils import env LOGGER = logging.getLogger('functest.ci.run_tests') -ENV_FILE = "/home/opnfv/functest/conf/env_file" class Result(enum.Enum): @@ -95,7 +95,7 @@ class Runner(object): pkg_resources.resource_filename('functest', 'ci/testcases.yaml')) @staticmethod - def source_envfile(rc_file=ENV_FILE): + def source_envfile(rc_file=constants.ENV_FILE): """Source the env file passed as arg""" if not os.path.isfile(rc_file): LOGGER.debug("No env file %s found", rc_file) -- cgit 1.2.3-korg