|
17 | 17 | # limitations under the License. |
18 | 18 |
|
19 | 19 | import json |
20 | | -import subprocess |
| 20 | +import os |
21 | 21 | import pprint |
| 22 | +import subprocess |
22 | 23 |
|
23 | 24 | if Arguments.ats_bin is not None: |
24 | 25 | # Add environment variables |
25 | 26 | ENV['ATS_BIN'] = Arguments.ats_bin |
26 | 27 |
|
| 28 | +if Arguments.build_root is not None: |
| 29 | + ENV['BUILD_ROOT'] = Arguments.build_root |
| 30 | +else: |
| 31 | + # Assume the build root is the parent of the test directory. |
| 32 | + ENV['BUILD_ROOT'] = os.path.dirname(os.getcwd()) |
| 33 | + |
| 34 | +host.WriteVerbose(['ats'], "Test build root: {}:".format(ENV['BUILD_ROOT'])) |
| 35 | + |
27 | 36 | if ENV['ATS_BIN'] is not None: |
28 | 37 | # Add variables for Tests |
29 | 38 | traffic_layout = os.path.join(ENV['ATS_BIN'], "traffic_layout") |
@@ -78,9 +87,12 @@ if ENV['ATS_BIN'] is not None: |
78 | 87 | host.WriteError("tsxs is broken. Aborting tests", show_stack=False) |
79 | 88 | host.WriteVerbose(['ats'], "Traffic server build flags:\n", pprint.pformat(out)) |
80 | 89 | Variables.update(out) |
81 | | -Variables.AtsExampleDir = os.path.join(AutestSitePath, '../../../example') |
82 | | -Variables.AtsTestToolsDir = os.path.join(AutestSitePath, '../../tools') |
83 | | -Variables.AtsTestPluginsDir = os.path.join(AutestSitePath, '../../tools/plugins/.libs') |
| 90 | + |
| 91 | +Variables.AtsExampleDir = os.path.join(AutestSitePath, '..', '..', '..', 'example') |
| 92 | +Variables.AtsTestToolsDir = os.path.join(AutestSitePath, '..', '..', 'tools') |
| 93 | +Variables.BuildRoot = ENV['BUILD_ROOT'] |
| 94 | +Variables.AtsTestPluginsDir = os.path.join(Variables.BuildRoot, 'tests', 'tools', 'plugins', '.libs') |
| 95 | +Variables.AtsBuildGoldTestsDir = os.path.join(Variables.BuildRoot, 'tests', 'gold_tests') |
84 | 96 |
|
85 | 97 | # modify delay times as we always have to kill Trafficserver |
86 | 98 | # no need to wait |
|
0 commit comments