aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/utils
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2022-03-03 15:29:16 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2022-03-03 15:44:28 +0100
commit8b1c441cd912cc31802f4117e638aab9b379d2d6 (patch)
tree269a8dc3306bc7fdaf0ce8e32b38673cafd8ceac /xtesting/utils
parent318c2e427e2933fdff2213bf807249c66628b56f (diff)
Search config files in tree
It allows putting configurations in classical dirs. It fallbacks to the python package for backward compatibility. Change-Id: Ie33b9482fb197926c7d7d66ace815fa4ae01d02d Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'xtesting/utils')
-rw-r--r--xtesting/utils/constants.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/xtesting/utils/constants.py b/xtesting/utils/constants.py
index acd0d31d..d99a0e33 100644
--- a/xtesting/utils/constants.py
+++ b/xtesting/utils/constants.py
@@ -3,12 +3,24 @@
# pylint: disable=missing-docstring
import os
+import sys
+
+import pkg_resources
ENV_FILE = '/var/lib/xtesting/conf/env_file'
+XTESTING_PATHES = [
+ "~/.xtesting", "/etc/xtesting", os.path.join(sys.prefix + "/etc/xtesting")]
+
+TESTCASE_DESCRIPTION = 'testcases.yaml'
+TESTCASE_DESCRIPTION_DEFAULT = pkg_resources.resource_filename(
+ 'xtesting', f'ci/{TESTCASE_DESCRIPTION}')
+
RESULTS_DIR = '/var/lib/xtesting/results'
LOG_PATH = os.path.join(RESULTS_DIR, 'xtesting.log')
DEBUG_LOG_PATH = os.path.join(RESULTS_DIR, 'xtesting.debug.log')
-INI_PATH = 'ci/logging.ini'
-DEBUG_INI_PATH = 'ci/logging.debug.ini'
+INI_PATH_DEFAULT = pkg_resources.resource_filename(
+ 'xtesting', 'ci/logging.ini')
+DEBUG_INI_PATH_DEFAULT = pkg_resources.resource_filename(
+ 'xtesting', 'ci/logging.debug.ini')