aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/utils/constants.py
blob: 12f1fde38d31be14eee3c6c38119bb752bb324d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python

# Copyright (c) 2019 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0

# pylint: disable=missing-docstring

import os
import sys

import importlib.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'

with importlib.resources.as_file(
        importlib.resources.files('xtesting') /
        f'ci/{TESTCASE_DESCRIPTION}') as path:
    TESTCASE_DESCRIPTION_DEFAULT = path

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')

with importlib.resources.as_file(
        importlib.resources.files('xtesting') /
        'ci/logging.ini') as path:
    INI_PATH_DEFAULT = path
with importlib.resources.as_file(
        importlib.resources.files('xtesting') /
        'ci/logging.debug.ini') as path:
    DEBUG_INI_PATH_DEFAULT = path