summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2022-01-06 10:42:36 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-01-25 12:07:01 +0000
commitd4928afea65c3e171821e002e9b4ca96114965d2 (patch)
tree2d50bb5f1916d9224dadfe77109e863c5cf4fb9c
parent1627394ca3fb4d03c1499536ee5615839dc4d591 (diff)
downloadpoky-d4928afea65c3e171821e002e9b4ca96114965d2.tar.gz
poky-d4928afea65c3e171821e002e9b4ca96114965d2.tar.bz2
poky-d4928afea65c3e171821e002e9b4ca96114965d2.zip
selftest: reproducible: Set maximum report size
Diffoscope can end up running for a very long time if there are a lot of changes. To put a limit on how long it can run, cap the maximum report size at 250 MB by default. (From OE-Core rev: 12c4da7e9986ae8a6207bcc3a4aa787579d7b863) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 52d5f76f54eac384f9480dffe96df089d9ee8f33) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/reproducible.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py
index a62757399b..546dc91120 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -114,8 +114,9 @@ def compare_file(reference, test, diffutils_sysroot):
result.status = SAME
return result
-def run_diffoscope(a_dir, b_dir, html_dir, **kwargs):
- return runCmd(['diffoscope', '--no-default-limits', '--exclude-directory-metadata', 'yes', '--html-dir', html_dir, a_dir, b_dir],
+def run_diffoscope(a_dir, b_dir, html_dir, max_report_size=0, **kwargs):
+ return runCmd(['diffoscope', '--no-default-limits', '--max-report-size', str(max_report_size),
+ '--exclude-directory-metadata', 'yes', '--html-dir', html_dir, a_dir, b_dir],
**kwargs)
class DiffoscopeTests(OESelftestTestCase):
@@ -145,6 +146,9 @@ class ReproducibleTests(OESelftestTestCase):
package_classes = ['deb', 'ipk', 'rpm']
+ # Maximum report size, in bytes
+ max_report_size = 250 * 1024 * 1024
+
# targets are the things we want to test the reproducibility of
targets = ['core-image-minimal', 'core-image-sato', 'core-image-full-cmdline', 'core-image-weston', 'world']
# sstate targets are things to pull from sstate to potentially cut build/debugging time
@@ -321,7 +325,7 @@ class ReproducibleTests(OESelftestTestCase):
# Copy jquery to improve the diffoscope output usability
self.copy_file(os.path.join(jquery_sysroot, 'usr/share/javascript/jquery/jquery.min.js'), os.path.join(package_html_dir, 'jquery.js'))
- run_diffoscope('reproducibleA', 'reproducibleB', package_html_dir,
+ run_diffoscope('reproducibleA', 'reproducibleB', package_html_dir, max_report_size=self.max_report_size,
native_sysroot=diffoscope_sysroot, ignore_status=True, cwd=package_dir)
if fails: