aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvalentin boucher <valentin.boucher@orange.com>2017-05-22 13:08:45 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-05-22 13:08:45 +0000
commitefbe74c4cc1b6b6982e9e13950319f690541d6a3 (patch)
tree96cced0345a6a9498b6209210b5347465c481078
parent6f70bd17b238e3c931f5d575e4b8eb625dbca91d (diff)
parentd5e8713a186d07fe33c904bbf0bb3a43cb518700 (diff)
Merge "Set default value for CONFIG_FUNCTEST_YAML"
-rw-r--r--functest/tests/unit/utils/test_functest_utils.py3
-rw-r--r--functest/utils/env.py4
-rw-r--r--functest/utils/functest_utils.py5
-rwxr-xr-xrun_unit_tests.sh1
4 files changed, 8 insertions, 5 deletions
diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py
index 0fe7e91d..218f7f72 100644
--- a/functest/tests/unit/utils/test_functest_utils.py
+++ b/functest/tests/unit/utils/test_functest_utils.py
@@ -55,7 +55,8 @@ class FunctestUtilsTesting(unittest.TestCase):
self.testcase_dict = {'case_name': 'testname',
'criteria': self.criteria}
self.parameter = 'general.openstack.image_name'
- self.config_yaml = 'test_config_yaml-'
+ self.config_yaml = os.path.normpath(os.path.join(os.path.dirname(
+ os.path.abspath(__file__)), '../../../ci/config_functest.yaml'))
self.db_url_env = 'http://foo/testdb'
self.file_yaml = {'general': {'openstack': {'image_name':
'test_image_name'}}}
diff --git a/functest/utils/env.py b/functest/utils/env.py
index c9629e15..3724ec99 100644
--- a/functest/utils/env.py
+++ b/functest/utils/env.py
@@ -15,7 +15,9 @@ default_envs = {
'INSTALLER_IP': None,
'BUILD_TAG': None,
'OS_ENDPOINT_TYPE': None,
- 'OS_AUTH_URL': None
+ 'OS_AUTH_URL': None,
+ 'CONFIG_FUNCTEST_YAML': os.path.normpath(os.path.join(os.path.dirname(
+ os.path.abspath(__file__)), '../ci/config_functest.yaml'))
}
diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py
index bf30f56e..284c7971 100644
--- a/functest/utils/functest_utils.py
+++ b/functest/utils/functest_utils.py
@@ -24,6 +24,7 @@ from six.moves import urllib
import yaml
from git import Repo
+from functest.utils import constants
from functest.utils import decorators
logger = logging.getLogger(__name__)
@@ -375,7 +376,7 @@ def get_parameter_from_yaml(parameter, file):
def get_functest_config(parameter):
- yaml_ = os.environ["CONFIG_FUNCTEST_YAML"]
+ yaml_ = constants.CONST.__getattribute__('CONFIG_FUNCTEST_YAML')
return get_parameter_from_yaml(parameter, yaml_)
@@ -397,7 +398,7 @@ def get_testcases_file_dir():
def get_functest_yaml():
- with open(os.environ["CONFIG_FUNCTEST_YAML"]) as f:
+ with open(constants.CONST.__getattribute__('CONFIG_FUNCTEST_YAML')) as f:
functest_yaml = yaml.safe_load(f)
f.close()
return functest_yaml
diff --git a/run_unit_tests.sh b/run_unit_tests.sh
index 86096fab..c4973ab6 100755
--- a/run_unit_tests.sh
+++ b/run_unit_tests.sh
@@ -33,7 +33,6 @@ git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng releng-unittests
pip install releng-unittests/modules/
rm -fr releng-unittests
-export CONFIG_FUNCTEST_YAML=$(pwd)/functest/ci/config_functest.yaml
nosetests --with-xunit \
--with-coverage \
--cover-tests \