diff options
author | Joshua Watt <jpewhacker@gmail.com> | 2019-08-27 14:33:48 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-08-30 17:10:28 +0100 |
commit | 977aee76cf85849017807aef958790834d730cee (patch) | |
tree | aaadc117d54abf8d5a5fe1cadcc957d8c464fb69 /meta/lib/oeqa | |
parent | a0ce9a8bbc5e88ebe965344f01057615aa55fdbc (diff) | |
download | poky-977aee76cf85849017807aef958790834d730cee.tar.gz |
oeqa: reproducible: Record packages in test results
Records the results of the reproducibility analysis in the JSON test
results file. This makes it easier to do post-test analysis on the
packages.
[YOCTO #13324]
(From OE-Core rev: 6c357c8eee322163da96df676a54ff70a0bdc911)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/reproducible.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py index 2b8b4e9e88..ebfa88fbc5 100644 --- a/meta/lib/oeqa/selftest/cases/reproducible.py +++ b/meta/lib/oeqa/selftest/cases/reproducible.py | |||
@@ -8,6 +8,7 @@ from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars | |||
8 | import functools | 8 | import functools |
9 | import multiprocessing | 9 | import multiprocessing |
10 | import textwrap | 10 | import textwrap |
11 | import json | ||
11 | import unittest | 12 | import unittest |
12 | 13 | ||
13 | MISSING = 'MISSING' | 14 | MISSING = 'MISSING' |
@@ -86,6 +87,7 @@ class ReproducibleTests(OESelftestTestCase): | |||
86 | self.extras = self.tc.extraresults | 87 | self.extras = self.tc.extraresults |
87 | 88 | ||
88 | self.extras.setdefault('reproducible.rawlogs', {})['log'] = '' | 89 | self.extras.setdefault('reproducible.rawlogs', {})['log'] = '' |
90 | self.extras.setdefault('reproducible', {}).setdefault('files', {}) | ||
89 | 91 | ||
90 | def append_to_log(self, msg): | 92 | def append_to_log(self, msg): |
91 | self.extras['reproducible.rawlogs']['log'] += msg | 93 | self.extras['reproducible.rawlogs']['log'] += msg |
@@ -114,6 +116,10 @@ class ReproducibleTests(OESelftestTestCase): | |||
114 | result.sort() | 116 | result.sort() |
115 | return result | 117 | return result |
116 | 118 | ||
119 | def write_package_list(self, package_class, name, packages): | ||
120 | self.extras['reproducible']['files'].setdefault(package_class, {})[name] = [ | ||
121 | {'reference': p.reference, 'test': p.test} for p in packages] | ||
122 | |||
117 | @unittest.skip("Reproducible builds do not yet pass") | 123 | @unittest.skip("Reproducible builds do not yet pass") |
118 | def test_reproducible_builds(self): | 124 | def test_reproducible_builds(self): |
119 | capture_vars = ['DEPLOY_DIR_' + c.upper() for c in self.package_classes] | 125 | capture_vars = ['DEPLOY_DIR_' + c.upper() for c in self.package_classes] |
@@ -162,6 +168,10 @@ class ReproducibleTests(OESelftestTestCase): | |||
162 | 168 | ||
163 | self.append_to_log('\n'.join("%s: %s" % (r.status, r.test) for r in result.total)) | 169 | self.append_to_log('\n'.join("%s: %s" % (r.status, r.test) for r in result.total)) |
164 | 170 | ||
171 | self.write_package_list(package_class, 'missing', result.missing) | ||
172 | self.write_package_list(package_class, 'different', result.different) | ||
173 | self.write_package_list(package_class, 'same', result.same) | ||
174 | |||
165 | if result.missing or result.different: | 175 | if result.missing or result.different: |
166 | self.fail("The following %s packages are missing or different: %s" % | 176 | self.fail("The following %s packages are missing or different: %s" % |
167 | (c, ' '.join(r.test for r in (result.missing + result.different)))) | 177 | (c, ' '.join(r.test for r in (result.missing + result.different)))) |