summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/reproducible.py
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:52:57 +0000
commit138ed4aa96ec5069f9f7fd02994a42452dbccc2d (patch)
treeb1592697d52b8bb93b88ddd291aacd414faaea95 /meta/lib/oeqa/selftest/cases/reproducible.py
parent0de55be071efff60944c89582ae0e736f3bdc828 (diff)
downloadopenembedded-core-138ed4aa96ec5069f9f7fd02994a42452dbccc2d.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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/reproducible.py')
-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
import shutil
import stat
import os
+import datetime
MISSING = 'MISSING'
DIFFERENT = 'DIFFERENT'
@@ -80,6 +81,9 @@ class ReproducibleTests(OESelftestTestCase):
package_classes = ['deb', 'ipk']
images = ['core-image-minimal', 'core-image-sato', 'core-image-full-cmdline']
save_results = False
+ if 'OEQA_DEBUGGING_SAVED_OUTPUT' in os.environ:
+ save_results = os.environ['OEQA_DEBUGGING_SAVED_OUTPUT']
+
# This variable controls if one of the test builds is allowed to pull from
# an sstate cache/mirror. The other build is always done clean as a point of
# comparison.
@@ -168,7 +172,9 @@ class ReproducibleTests(OESelftestTestCase):
diffutils_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "diffutils-native")
if self.save_results:
- save_dir = tempfile.mkdtemp(prefix='oe-reproducible-')
+ os.makedirs(self.save_results, exist_ok=True)
+ datestr = datetime.datetime.now().strftime('%Y%m%d')
+ save_dir = tempfile.mkdtemp(prefix='oe-reproducible-%s-' % datestr, dir=self.save_results)
os.chmod(save_dir, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
self.logger.info('Non-reproducible packages will be copied to %s', save_dir)
@@ -204,3 +210,8 @@ class ReproducibleTests(OESelftestTestCase):
self.fail("The following %s packages are missing or different: %s" %
(c, ' '.join(r.test for r in (result.missing + result.different))))
+ # Clean up empty directories
+ if self.save_results:
+ if not os.listdir(save_dir):
+ os.rmdir(save_dir)
+