diff options
author | Alexis Lothoré <alexis.lothore@bootlin.com> | 2024-02-26 10:19:18 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-27 11:35:43 +0000 |
commit | fec128bd625dbbb5a239d6ff6999e1e4a41a5a9b (patch) | |
tree | b0e556d80ad837575227a7c83d447dfa48da4136 /meta/lib/oeqa/sdk | |
parent | 031099c417a61d6e7db2cf7bf02f69650179b7e8 (diff) | |
download | poky-fec128bd625dbbb5a239d6ff6999e1e4a41a5a9b.tar.gz |
lib/oeqa: share get_json_result_dir helper
Multiple places in oeqa need to get the log output path, and redefine a
small helper to accomplish this
Define this helper in lib/oeqa/utils/__init__.py and import it wherever
needed to allow using it.
(From OE-Core rev: 01b1a6a5a4e7cede4d23a981b5144ae9c8306274)
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/sdk')
-rw-r--r-- | meta/lib/oeqa/sdk/testsdk.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/meta/lib/oeqa/sdk/testsdk.py b/meta/lib/oeqa/sdk/testsdk.py index b4719110ed..518b09febb 100644 --- a/meta/lib/oeqa/sdk/testsdk.py +++ b/meta/lib/oeqa/sdk/testsdk.py | |||
@@ -23,14 +23,6 @@ class TestSDKBase(object): | |||
23 | return configuration | 23 | return configuration |
24 | 24 | ||
25 | @staticmethod | 25 | @staticmethod |
26 | def get_sdk_json_result_dir(d): | ||
27 | json_result_dir = os.path.join(d.getVar("LOG_DIR"), 'oeqa') | ||
28 | custom_json_result_dir = d.getVar("OEQA_JSON_RESULT_DIR") | ||
29 | if custom_json_result_dir: | ||
30 | json_result_dir = custom_json_result_dir | ||
31 | return json_result_dir | ||
32 | |||
33 | @staticmethod | ||
34 | def get_sdk_result_id(configuration): | 26 | def get_sdk_result_id(configuration): |
35 | return '%s_%s_%s_%s_%s' % (configuration['TEST_TYPE'], configuration['IMAGE_BASENAME'], configuration['SDKMACHINE'], configuration['MACHINE'], configuration['STARTTIME']) | 27 | return '%s_%s_%s_%s_%s' % (configuration['TEST_TYPE'], configuration['IMAGE_BASENAME'], configuration['SDKMACHINE'], configuration['MACHINE'], configuration['STARTTIME']) |
36 | 28 | ||
@@ -72,6 +64,7 @@ class TestSDK(TestSDKBase): | |||
72 | 64 | ||
73 | from bb.utils import export_proxies | 65 | from bb.utils import export_proxies |
74 | from oeqa.utils import make_logger_bitbake_compatible | 66 | from oeqa.utils import make_logger_bitbake_compatible |
67 | from oeqa.utils import get_json_result_dir | ||
75 | 68 | ||
76 | pn = d.getVar("PN") | 69 | pn = d.getVar("PN") |
77 | logger = make_logger_bitbake_compatible(logging.getLogger("BitBake")) | 70 | logger = make_logger_bitbake_compatible(logging.getLogger("BitBake")) |
@@ -134,7 +127,7 @@ class TestSDK(TestSDKBase): | |||
134 | component = "%s %s" % (pn, self.context_executor_class.name) | 127 | component = "%s %s" % (pn, self.context_executor_class.name) |
135 | context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env)) | 128 | context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env)) |
136 | configuration = self.get_sdk_configuration(d, self.test_type) | 129 | configuration = self.get_sdk_configuration(d, self.test_type) |
137 | result.logDetails(self.get_sdk_json_result_dir(d), | 130 | result.logDetails(get_json_result_dir(d), |
138 | configuration, | 131 | configuration, |
139 | self.get_sdk_result_id(configuration)) | 132 | self.get_sdk_result_id(configuration)) |
140 | result.logSummary(component, context_msg) | 133 | result.logSummary(component, context_msg) |