summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-29 13:49:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-16 14:31:27 +0000
commit78020fb6395c73d9ea0ce8e3ad8767d6e55021ee (patch)
treec55a1eeaf9a613e6d680c519b3579944fcba165b /meta/classes
parente331378e17a07da3e024b2780f25d648b95b574f (diff)
downloadpoky-78020fb6395c73d9ea0ce8e3ad8767d6e55021ee.tar.gz
testsdk: Improvements to the json logging
Tweak the preceeding commit to: * Add STARTTIME to the identifier to make it unique * Add MACHINE to the identifier * Use LOG_DIR * Store the layer config in a more natural json format * Drop '_' function prefixes (From OE-Core rev: 31f0c5e59c7fb0ae0915de584fbfcf3d95bbb061) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/testsdk.bbclass36
1 files changed, 18 insertions, 18 deletions
diff --git a/meta/classes/testsdk.bbclass b/meta/classes/testsdk.bbclass
index 66170e3377..6981d40be1 100644
--- a/meta/classes/testsdk.bbclass
+++ b/meta/classes/testsdk.bbclass
@@ -14,29 +14,29 @@
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
17def _get_sdk_configuration(d, test_type, pid): 17def get_sdk_configuration(d, test_type):
18 import platform 18 import platform
19 from oeqa.utils.metadata import get_layers
19 configuration = {'TEST_TYPE': test_type, 20 configuration = {'TEST_TYPE': test_type,
20 'PROCESS_ID': pid, 21 'MACHINE': d.getVar("MACHINE"),
21 'SDK_MACHINE': d.getVar("SDKMACHINE"), 22 'SDKMACHINE': d.getVar("SDKMACHINE"),
22 'IMAGE_BASENAME': d.getVar("IMAGE_BASENAME"), 23 'IMAGE_BASENAME': d.getVar("IMAGE_BASENAME"),
23 'IMAGE_PKGTYPE': d.getVar("IMAGE_PKGTYPE"), 24 'IMAGE_PKGTYPE': d.getVar("IMAGE_PKGTYPE"),
24 'HOST_DISTRO': ('-'.join(platform.linux_distribution())).replace(' ', '-')} 25 'STARTTIME': d.getVar("DATETIME"),
25 layers = (d.getVar("BBLAYERS") or "").split() 26 'HOST_DISTRO': ('-'.join(platform.linux_distribution())).replace(' ', '-'),
26 for l in layers: 27 'LAYERS': get_layers(d.getVar("BBLAYERS"))}
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 28 return configuration
29get_sdk_configuration[vardepsexclude] = "DATETIME"
30 30
31def _get_sdk_json_result_dir(d): 31def get_sdk_json_result_dir(d):
32 json_result_dir = os.path.join(d.getVar("WORKDIR"), 'oeqa') 32 json_result_dir = os.path.join(d.getVar("LOG_DIR"), 'oeqa')
33 custom_json_result_dir = d.getVar("OEQA_JSON_RESULT_DIR") 33 custom_json_result_dir = d.getVar("OEQA_JSON_RESULT_DIR")
34 if custom_json_result_dir: 34 if custom_json_result_dir:
35 json_result_dir = custom_json_result_dir 35 json_result_dir = custom_json_result_dir
36 return json_result_dir 36 return json_result_dir
37 37
38def _get_sdk_result_id(configuration): 38def get_sdk_result_id(configuration):
39 return '%s_%s_%s' % (configuration['TEST_TYPE'], configuration['IMAGE_BASENAME'], configuration['SDK_MACHINE']) 39 return '%s_%s_%s_%s_%s' % (configuration['TEST_TYPE'], configuration['IMAGE_BASENAME'], configuration['SDKMACHINE'], configuration['MACHINE'], configuration['STARTTIME'])
40 40
41def testsdk_main(d): 41def testsdk_main(d):
42 import os 42 import os
@@ -93,10 +93,10 @@ def testsdk_main(d):
93 93
94 component = "%s %s" % (pn, OESDKTestContextExecutor.name) 94 component = "%s %s" % (pn, OESDKTestContextExecutor.name)
95 context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env)) 95 context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env))
96 configuration = _get_sdk_configuration(d, 'sdk', os.getpid()) 96 configuration = get_sdk_configuration(d, 'sdk')
97 result.logDetails(_get_sdk_json_result_dir(d), 97 result.logDetails(get_sdk_json_result_dir(d),
98 configuration, 98 configuration,
99 _get_sdk_result_id(configuration)) 99 get_sdk_result_id(configuration))
100 result.logSummary(component, context_msg) 100 result.logSummary(component, context_msg)
101 101
102 if not result.wasSuccessful(): 102 if not result.wasSuccessful():
@@ -198,10 +198,10 @@ def testsdkext_main(d):
198 198
199 component = "%s %s" % (pn, OESDKExtTestContextExecutor.name) 199 component = "%s %s" % (pn, OESDKExtTestContextExecutor.name)
200 context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env)) 200 context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env))
201 configuration = _get_sdk_configuration(d, 'sdkext', os.getpid()) 201 configuration = get_sdk_configuration(d, 'sdkext')
202 result.logDetails(_get_sdk_json_result_dir(d), 202 result.logDetails(get_sdk_json_result_dir(d),
203 configuration, 203 configuration,
204 _get_sdk_result_id(configuration)) 204 get_sdk_result_id(configuration))
205 result.logSummary(component, context_msg) 205 result.logSummary(component, context_msg)
206 206
207 if not result.wasSuccessful(): 207 if not result.wasSuccessful():