diff options
-rw-r--r-- | meta/classes/testsdk.bbclass | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/meta/classes/testsdk.bbclass b/meta/classes/testsdk.bbclass index d3f475d22b..a6c362723f 100644 --- a/meta/classes/testsdk.bbclass +++ b/meta/classes/testsdk.bbclass | |||
@@ -14,6 +14,30 @@ | |||
14 | # | 14 | # |
15 | # where "<image-name>" is an image like core-image-sato. | 15 | # where "<image-name>" is an image like core-image-sato. |
16 | 16 | ||
17 | def _get_sdk_configuration(d, test_type, pid): | ||
18 | import platform | ||
19 | configuration = {'TEST_TYPE': test_type, | ||
20 | 'PROCESS_ID': pid, | ||
21 | 'SDK_MACHINE': d.getVar("SDKMACHINE"), | ||
22 | 'IMAGE_BASENAME': d.getVar("IMAGE_BASENAME"), | ||
23 | 'IMAGE_PKGTYPE': d.getVar("IMAGE_PKGTYPE"), | ||
24 | 'HOST_DISTRO': ('-'.join(platform.linux_distribution())).replace(' ', '-')} | ||
25 | layers = (d.getVar("BBLAYERS") or "").split() | ||
26 | for l in layers: | ||
27 | configuration['%s_BRANCH_REV' % os.path.basename(l)] = '%s:%s' % (base_get_metadata_git_branch(l, None).strip(), | ||
28 | base_get_metadata_git_revision(l, None)) | ||
29 | return configuration | ||
30 | |||
31 | def _get_sdk_json_result_dir(d): | ||
32 | json_result_dir = os.path.join(d.getVar("WORKDIR"), 'oeqa') | ||
33 | custom_json_result_dir = d.getVar("OEQA_JSON_RESULT_DIR") | ||
34 | if custom_json_result_dir: | ||
35 | json_result_dir = custom_json_result_dir | ||
36 | return json_result_dir | ||
37 | |||
38 | def _get_sdk_result_id(configuration): | ||
39 | return '%s_%s_%s' % (configuration['TEST_TYPE'], configuration['IMAGE_BASENAME'], configuration['SDK_MACHINE']) | ||
40 | |||
17 | def testsdk_main(d): | 41 | def testsdk_main(d): |
18 | import os | 42 | import os |
19 | import subprocess | 43 | import subprocess |
@@ -80,8 +104,10 @@ def testsdk_main(d): | |||
80 | 104 | ||
81 | component = "%s %s" % (pn, OESDKTestContextExecutor.name) | 105 | component = "%s %s" % (pn, OESDKTestContextExecutor.name) |
82 | context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env)) | 106 | context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env)) |
83 | 107 | configuration = _get_sdk_configuration(d, 'sdk', os.getpid()) | |
84 | result.logDetails() | 108 | result.logDetails(_get_sdk_json_result_dir(d), |
109 | configuration, | ||
110 | _get_sdk_result_id(configuration)) | ||
85 | result.logSummary(component, context_msg) | 111 | result.logSummary(component, context_msg) |
86 | 112 | ||
87 | if not result.wasSuccessful(): | 113 | if not result.wasSuccessful(): |
@@ -184,8 +210,10 @@ def testsdkext_main(d): | |||
184 | 210 | ||
185 | component = "%s %s" % (pn, OESDKExtTestContextExecutor.name) | 211 | component = "%s %s" % (pn, OESDKExtTestContextExecutor.name) |
186 | context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env)) | 212 | context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env)) |
187 | 213 | configuration = _get_sdk_configuration(d, 'sdkext', os.getpid()) | |
188 | result.logDetails() | 214 | result.logDetails(_get_sdk_json_result_dir(d), |
215 | configuration, | ||
216 | _get_sdk_result_id(configuration)) | ||
189 | result.logSummary(component, context_msg) | 217 | result.logSummary(component, context_msg) |
190 | 218 | ||
191 | if not result.wasSuccessful(): | 219 | if not result.wasSuccessful(): |