summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-10-24 13:09:33 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-02 16:53:02 +0000
commitc404b8895904abdb7b67aeaf854805ab40bc2c45 (patch)
treec4cfe75cfec2d5999bc8aaa57377b9f6ad82908e /meta/lib/oeqa
parent55bd4629408e350d154701b1e1969b3c50de020b (diff)
downloadpoky-c404b8895904abdb7b67aeaf854805ab40bc2c45.tar.gz
reproducible: Allow configuration of saved debug output
If OEQA_DEBUGGING_SAVED_OUTPUT is set in the environment, use this location to store reproducibile build failure output. This aids debugging on the YP autobuilder in particular. Use a date in the directory name to make it easier to find failure output. Also clean up empty directories as they're unnecessary distracting noise. (From OE-Core rev: 138ed4aa96ec5069f9f7fd02994a42452dbccc2d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/selftest/cases/reproducible.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py
index 9c715ef8eb..c261076666 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -15,6 +15,7 @@ import tempfile
15import shutil 15import shutil
16import stat 16import stat
17import os 17import os
18import datetime
18 19
19MISSING = 'MISSING' 20MISSING = 'MISSING'
20DIFFERENT = 'DIFFERENT' 21DIFFERENT = 'DIFFERENT'
@@ -80,6 +81,9 @@ class ReproducibleTests(OESelftestTestCase):
80 package_classes = ['deb', 'ipk'] 81 package_classes = ['deb', 'ipk']
81 images = ['core-image-minimal', 'core-image-sato', 'core-image-full-cmdline'] 82 images = ['core-image-minimal', 'core-image-sato', 'core-image-full-cmdline']
82 save_results = False 83 save_results = False
84 if 'OEQA_DEBUGGING_SAVED_OUTPUT' in os.environ:
85 save_results = os.environ['OEQA_DEBUGGING_SAVED_OUTPUT']
86
83 # This variable controls if one of the test builds is allowed to pull from 87 # This variable controls if one of the test builds is allowed to pull from
84 # an sstate cache/mirror. The other build is always done clean as a point of 88 # an sstate cache/mirror. The other build is always done clean as a point of
85 # comparison. 89 # comparison.
@@ -168,7 +172,9 @@ class ReproducibleTests(OESelftestTestCase):
168 diffutils_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "diffutils-native") 172 diffutils_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "diffutils-native")
169 173
170 if self.save_results: 174 if self.save_results:
171 save_dir = tempfile.mkdtemp(prefix='oe-reproducible-') 175 os.makedirs(self.save_results, exist_ok=True)
176 datestr = datetime.datetime.now().strftime('%Y%m%d')
177 save_dir = tempfile.mkdtemp(prefix='oe-reproducible-%s-' % datestr, dir=self.save_results)
172 os.chmod(save_dir, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) 178 os.chmod(save_dir, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
173 self.logger.info('Non-reproducible packages will be copied to %s', save_dir) 179 self.logger.info('Non-reproducible packages will be copied to %s', save_dir)
174 180
@@ -204,3 +210,8 @@ class ReproducibleTests(OESelftestTestCase):
204 self.fail("The following %s packages are missing or different: %s" % 210 self.fail("The following %s packages are missing or different: %s" %
205 (c, ' '.join(r.test for r in (result.missing + result.different)))) 211 (c, ' '.join(r.test for r in (result.missing + result.different))))
206 212
213 # Clean up empty directories
214 if self.save_results:
215 if not os.listdir(save_dir):
216 os.rmdir(save_dir)
217