summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/utils/metadata.py12
-rwxr-xr-xscripts/oe-selftest4
2 files changed, 11 insertions, 5 deletions
diff --git a/meta/lib/oeqa/utils/metadata.py b/meta/lib/oeqa/utils/metadata.py
index a3c1b2b46c..08d8198935 100644
--- a/meta/lib/oeqa/utils/metadata.py
+++ b/meta/lib/oeqa/utils/metadata.py
@@ -29,14 +29,13 @@ def metadata_from_bb():
29 29
30 Data will be gathered using bitbake -e thanks to get_bb_vars. 30 Data will be gathered using bitbake -e thanks to get_bb_vars.
31 """ 31 """
32 metadata_config_vars = ('MACHINE')
32 33
33 info_dict = OrderedDict() 34 info_dict = OrderedDict()
34 hostname = runCmd('hostname') 35 hostname = runCmd('hostname')
35 info_dict['hostname'] = hostname.output 36 info_dict['hostname'] = hostname.output
36 data_dict = get_bb_vars() 37 data_dict = get_bb_vars()
37 38
38 info_dict['machine'] = data_dict['MACHINE']
39
40 # Distro information 39 # Distro information
41 info_dict['distro'] = {'id': data_dict['DISTRO'], 40 info_dict['distro'] = {'id': data_dict['DISTRO'],
42 'version_id': data_dict['DISTRO_VERSION'], 41 'version_id': data_dict['DISTRO_VERSION'],
@@ -52,6 +51,10 @@ def metadata_from_bb():
52 51
53 info_dict['layers'] = get_layers(data_dict['BBLAYERS']) 52 info_dict['layers'] = get_layers(data_dict['BBLAYERS'])
54 info_dict['bitbake'] = git_rev_info(os.path.dirname(bb.__file__)) 53 info_dict['bitbake'] = git_rev_info(os.path.dirname(bb.__file__))
54
55 info_dict['config'] = OrderedDict()
56 for var in sorted(metadata_config_vars):
57 info_dict['config'][var] = data_dict[var]
55 return info_dict 58 return info_dict
56 59
57def metadata_from_data_store(d): 60def metadata_from_data_store(d):
@@ -106,7 +109,10 @@ def dict_to_XML(tag, dictionary, **kwargs):
106 elif isinstance(val, MutableMapping): 109 elif isinstance(val, MutableMapping):
107 child = (dict_to_XML(key, val)) 110 child = (dict_to_XML(key, val))
108 else: 111 else:
109 child = Element(key) 112 if tag == 'config':
113 child = Element('variable', name=key)
114 else:
115 child = Element(key)
110 child.text = str(val) 116 child.text = str(val)
111 elem.append(child) 117 elem.append(child)
112 return elem 118 return elem
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index 5b045e8672..fb33c08512 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -604,7 +604,7 @@ def main():
604 l_branches = {str(branch) for branch in repo.branches} 604 l_branches = {str(branch) for branch in repo.branches}
605 branch = '%s/%s/%s' % (metadata['hostname'], 605 branch = '%s/%s/%s' % (metadata['hostname'],
606 metadata['layers']['meta'].get('branch', '(nogit)'), 606 metadata['layers']['meta'].get('branch', '(nogit)'),
607 metadata['machine']) 607 metadata['config']['MACHINE'])
608 608
609 if branch in l_branches: 609 if branch in l_branches:
610 log.debug('Found branch in local repository, checking out') 610 log.debug('Found branch in local repository, checking out')
@@ -634,7 +634,7 @@ def main():
634 values.get('branch', '(nogit)'), values.get('commit', '0'*40)) 634 values.get('branch', '(nogit)'), values.get('commit', '0'*40))
635 msg = 'Selftest for build %s of %s for machine %s on %s\n\n%s' % ( 635 msg = 'Selftest for build %s of %s for machine %s on %s\n\n%s' % (
636 log_prefix[12:], metadata['distro']['pretty_name'], 636 log_prefix[12:], metadata['distro']['pretty_name'],
637 metadata['machine'], metadata['hostname'], layer_info) 637 metadata['config']['MACHINE'], metadata['hostname'], layer_info)
638 638
639 log.debug('Commiting results to local repository') 639 log.debug('Commiting results to local repository')
640 repo.index.commit(msg) 640 repo.index.commit(msg)