[oe-commits] [openembedded-core] 01/03: oeqa: reproducible: Add option to capture bad packages
git at git.openembedded.org
git at git.openembedded.org
Mon Oct 28 05:32:55 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 08c139918ac12b4b84f87e624da435c587542112
Author: Joshua Watt <JPEWhacker at gmail.com>
AuthorDate: Thu Oct 24 13:07:19 2019 -0500
oeqa: reproducible: Add option to capture bad packages
Adds an option that can be used to copy the offending packages to a temp
directory for later evaluation. This is useful on the Autobuilder to
investigate failures.
Signed-off-by: Joshua Watt <JPEWhacker at gmail.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/lib/oeqa/selftest/cases/reproducible.py | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py
index c235c13..c0fdf7a 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -5,11 +5,14 @@
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
+import bb.utils
import functools
import multiprocessing
import textwrap
import json
import unittest
+import tempfile
+import shutil
MISSING = 'MISSING'
DIFFERENT = 'DIFFERENT'
@@ -74,6 +77,7 @@ def compare_file(reference, test, diffutils_sysroot):
class ReproducibleTests(OESelftestTestCase):
package_classes = ['deb', 'ipk']
images = ['core-image-minimal']
+ save_results = False
def setUpLocal(self):
super().setUpLocal()
@@ -117,9 +121,16 @@ class ReproducibleTests(OESelftestTestCase):
self.extrasresults['reproducible']['files'].setdefault(package_class, {})[name] = [
{'reference': p.reference, 'test': p.test} for p in packages]
+ def copy_file(self, source, dest):
+ bb.utils.mkdirhier(os.path.dirname(dest))
+ shutil.copyfile(source, dest)
+
def test_reproducible_builds(self):
capture_vars = ['DEPLOY_DIR_' + c.upper() for c in self.package_classes]
+ if self.save_results:
+ save_dir = tempfile.mkdtemp(prefix='oe-reproducible')
+
# Build native utilities
self.write_config('')
bitbake("diffutils-native -c addto_recipe_sysroot")
@@ -156,6 +167,7 @@ class ReproducibleTests(OESelftestTestCase):
vars_B = get_bb_vars(capture_vars)
bitbake(' '.join(self.images))
+
# NOTE: The temp directories from the reproducible build are purposely
# kept after the build so it can be diffed for debugging.
@@ -176,7 +188,13 @@ class ReproducibleTests(OESelftestTestCase):
self.write_package_list(package_class, 'different', result.different)
self.write_package_list(package_class, 'same', result.same)
+ if self.save_results:
+ for d in result.different:
+ self.copy_file(d.reference, os.path.join(save_dir, d.reference))
+ self.copy_file(d.test, os.path.join(save_dir, d.test))
+
if result.missing or result.different:
- self.fail("The following %s packages are missing or different: %s" %
- (c, ' '.join(r.test for r in (result.missing + result.different))))
+ self.fail("The following %s packages are missing or different: %s%s" %
+ (c, ' '.join(r.test for r in (result.missing + result.different)),
+ ('\nPackages copied to %s for evaluation' % save_dir) if self.save_results else ''))
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list