summaryrefslogtreecommitdiff
path: root/poky/meta/lib/oeqa
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2019-07-31 20:59:18 +0300
committerEd Tanous <ed.tanous@intel.com>2019-07-31 20:59:18 +0300
commitb4f66bacb1b8e661d794fa7a189e2f66f5092e2e (patch)
tree5a8302cd349fdb68dadca003483c61917d4a6add /poky/meta/lib/oeqa
parent43a183cc0926da36e3a218efa02ab4838ace316f (diff)
parentdd755025e33af27b059ea7ef3afbe850e4880b08 (diff)
downloadopenbmc-b4f66bacb1b8e661d794fa7a189e2f66f5092e2e.tar.xz
Merge branch 'master' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into intel
Diffstat (limited to 'poky/meta/lib/oeqa')
-rw-r--r--poky/meta/lib/oeqa/core/case.py2
-rw-r--r--poky/meta/lib/oeqa/core/context.py17
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/logrotate.py4
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/scons.py37
-rw-r--r--poky/meta/lib/oeqa/runtime/files/SConstruct1
-rw-r--r--poky/meta/lib/oeqa/runtime/files/hello.c5
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/devtool.py2
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py41
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/manifest.py7
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/oescripts.py3
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/package.py3
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/recipetool.py42
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/reproducible.py160
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/resulttooltests.py2
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/signing.py3
-rw-r--r--poky/meta/lib/oeqa/utils/logparser.py4
-rw-r--r--poky/meta/lib/oeqa/utils/qemurunner.py5
17 files changed, 319 insertions, 19 deletions
diff --git a/poky/meta/lib/oeqa/core/case.py b/poky/meta/lib/oeqa/core/case.py
index 54977c809..aca144e9d 100644
--- a/poky/meta/lib/oeqa/core/case.py
+++ b/poky/meta/lib/oeqa/core/case.py
@@ -32,6 +32,8 @@ class OETestCase(unittest.TestCase):
@classmethod
def _oeSetUpClass(clss):
_validate_td_vars(clss.td, clss.td_vars, "class")
+ if hasattr(clss, 'setUpHooker') and callable(getattr(clss, 'setUpHooker')):
+ clss.setUpHooker()
clss.setUpClassMethod()
@classmethod
diff --git a/poky/meta/lib/oeqa/core/context.py b/poky/meta/lib/oeqa/core/context.py
index 09627044c..68819cc33 100644
--- a/poky/meta/lib/oeqa/core/context.py
+++ b/poky/meta/lib/oeqa/core/context.py
@@ -9,6 +9,7 @@ import json
import time
import logging
import collections
+import unittest
from oeqa.core.loader import OETestLoader
from oeqa.core.runner import OETestRunner
@@ -45,10 +46,22 @@ class OETestContext(object):
def skipTests(self, skips):
if not skips:
return
+ def skipfuncgen(skipmsg):
+ def func():
+ raise unittest.SkipTest(skipmsg)
+ return func
+ class_ids = {}
for test in self.suites:
+ if test.__class__ not in class_ids:
+ class_ids[test.__class__] = '.'.join(test.id().split('.')[:-1])
for skip in skips:
- if test.id().startswith(skip):
- setattr(test, 'setUp', lambda: test.skipTest('Skip by the command line argument "%s"' % skip))
+ if (test.id()+'.').startswith(skip+'.'):
+ setattr(test, 'setUp', skipfuncgen('Skip by the command line argument "%s"' % skip))
+ for tclass in class_ids:
+ cid = class_ids[tclass]
+ for skip in skips:
+ if (cid + '.').startswith(skip + '.'):
+ setattr(tclass, 'setUpHooker', skipfuncgen('Skip by the command line argument "%s"' % skip))
def loadTests(self, module_paths, modules=[], tests=[],
modules_manifest="", modules_required=[], filters={}):
diff --git a/poky/meta/lib/oeqa/runtime/cases/logrotate.py b/poky/meta/lib/oeqa/runtime/cases/logrotate.py
index 8358793a2..bfa57c534 100644
--- a/poky/meta/lib/oeqa/runtime/cases/logrotate.py
+++ b/poky/meta/lib/oeqa/runtime/cases/logrotate.py
@@ -35,7 +35,9 @@ class LogrotateTest(OERuntimeTestCase):
@OETestDepends(['logrotate.LogrotateTest.test_1_logrotate_setup'])
def test_2_logrotate(self):
- status, output = self.target.run('logrotate -f /etc/logrotate.conf')
+ status, output = self.target.run('echo "create \n include /etc/logrotate.d" > /tmp/logrotate-test.conf')
+ status, output = self.target.run('logrotate -f /tmp/logrotate-test.conf')
+
msg = ('logrotate service could not be reloaded. Status and output: '
'%s and %s' % (status, output))
self.assertEqual(status, 0, msg = msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/scons.py b/poky/meta/lib/oeqa/runtime/cases/scons.py
new file mode 100644
index 000000000..3c7c7f727
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/scons.py
@@ -0,0 +1,37 @@
+#
+# SPDX-License-Identifier: MIT
+#
+
+import os
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class SconsCompileTest(OERuntimeTestCase):
+
+ @classmethod
+ def setUp(cls):
+ dst = '/tmp/'
+ src = os.path.join(cls.tc.runtime_files_dir, 'hello.c')
+ cls.tc.target.copyTo(src, dst)
+
+ src = os.path.join(cls.tc.runtime_files_dir, 'SConstruct')
+ cls.tc.target.copyTo(src, dst)
+
+ @classmethod
+ def tearDown(cls):
+ files = '/tmp/hello.c /tmp/hello.o /tmp/hello /tmp/SConstruct'
+ cls.tc.target.run('rm %s' % files)
+
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ @OEHasPackage(['gcc'])
+ @OEHasPackage(['python3-scons'])
+ def test_scons_compile(self):
+ status, output = self.target.run('cd /tmp/ && scons')
+ msg = 'scons compile failed, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ status, output = self.target.run('/tmp/hello')
+ msg = 'running compiled file failed, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
diff --git a/poky/meta/lib/oeqa/runtime/files/SConstruct b/poky/meta/lib/oeqa/runtime/files/SConstruct
new file mode 100644
index 000000000..d2cb6dd12
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/files/SConstruct
@@ -0,0 +1 @@
+Program('hello.c')
diff --git a/poky/meta/lib/oeqa/runtime/files/hello.c b/poky/meta/lib/oeqa/runtime/files/hello.c
new file mode 100644
index 000000000..b0697a330
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/files/hello.c
@@ -0,0 +1,5 @@
+int
+ main()
+ {
+ printf("Hello, world!\n");
+ }
diff --git a/poky/meta/lib/oeqa/selftest/cases/devtool.py b/poky/meta/lib/oeqa/selftest/cases/devtool.py
index 434a7b9dd..904ff6988 100644
--- a/poky/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/poky/meta/lib/oeqa/selftest/cases/devtool.py
@@ -393,7 +393,7 @@ class DevtoolAddTests(DevtoolBase):
tempdir = tempfile.mkdtemp(prefix='devtoolqa')
self.track_for_cleanup(tempdir)
testver = '0.23'
- url = 'https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-%s.tar.gz' % testver
+ url = 'https://files.pythonhosted.org/packages/c0/41/bae1254e0396c0cc8cf1751cb7d9afc90a602353695af5952530482c963f/MarkupSafe-%s.tar.gz' % testver
testrecipe = 'python-markupsafe'
srcdir = os.path.join(tempdir, testrecipe)
# Test devtool add
diff --git a/poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py b/poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py
new file mode 100644
index 000000000..8fb93af8a
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py
@@ -0,0 +1,41 @@
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake
+
+class IncompatibleLicenseTests(OESelftestTestCase):
+
+ def lic_test(self, pn, pn_lic, lic):
+ error_msg = 'ERROR: Nothing PROVIDES \'%s\'\n%s was skipped: it has an incompatible license: %s' % (pn, pn, pn_lic)
+
+ self.write_config("INCOMPATIBLE_LICENSE += \"%s\"" % (lic))
+
+ result = bitbake('%s --dry-run' % (pn), ignore_status=True)
+ if error_msg not in result.output:
+ raise AssertionError(result.output)
+
+ # Verify that a package with an SPDX license (from SRC_DISTRIBUTE_LICENSES)
+ # cannot be built when INCOMPATIBLE_LICENSE contains this SPDX license
+ def test_incompatible_spdx_license(self):
+ self.lic_test('incompatible-license', 'GPL-3.0', 'GPL-3.0')
+
+ # Verify that a package with an SPDX license (from SRC_DISTRIBUTE_LICENSES)
+ # cannot be built when INCOMPATIBLE_LICENSE contains an alias (in
+ # SPDXLICENSEMAP) of this SPDX license
+ def test_incompatible_alias_spdx_license(self):
+ self.lic_test('incompatible-license', 'GPL-3.0', 'GPLv3')
+
+ # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX
+ # license cannot be built when INCOMPATIBLE_LICENSE contains this SPDX
+ # license
+ def test_incompatible_spdx_license_alias(self):
+ self.lic_test('incompatible-license-alias', 'GPLv3', 'GPL-3.0')
+
+ # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX
+ # license cannot be built when INCOMPATIBLE_LICENSE contains this alias
+ def test_incompatible_alias_spdx_license_alias(self):
+ self.lic_test('incompatible-license-alias', 'GPLv3', 'GPLv3')
+
+ # Verify that a package with a non-SPDX license (neither in
+ # SRC_DISTRIBUTE_LICENSES nor in SPDXLICENSEMAP) cannot be built when
+ # INCOMPATIBLE_LICENSE contains this license
+ def test_incompatible_nonspdx_license(self):
+ self.lic_test('incompatible-nonspdx-license', 'FooLicense', 'FooLicense')
diff --git a/poky/meta/lib/oeqa/selftest/cases/manifest.py b/poky/meta/lib/oeqa/selftest/cases/manifest.py
index c0b25ab5d..5d13f3546 100644
--- a/poky/meta/lib/oeqa/selftest/cases/manifest.py
+++ b/poky/meta/lib/oeqa/selftest/cases/manifest.py
@@ -86,11 +86,8 @@ class VerifyManifest(OESelftestTestCase):
try:
mdir = self.get_dir_from_bb_var('SDK_DEPLOY', self.buildtarget)
for k in d_target.keys():
- bb_vars = get_bb_vars(['SDK_NAME', 'SDK_VERSION'], self.buildtarget)
- mfilename[k] = "{}-toolchain-{}.{}.manifest".format(
- bb_vars['SDK_NAME'],
- bb_vars['SDK_VERSION'],
- k)
+ toolchain_outputname = get_bb_var('TOOLCHAIN_OUTPUTNAME', self.buildtarget)
+ mfilename[k] = "{}.{}.manifest".format(toolchain_outputname, k)
mpath[k] = os.path.join(mdir, mfilename[k])
if not os.path.isfile(mpath[k]):
self.logger.debug("{}: {} does not exist".format(
diff --git a/poky/meta/lib/oeqa/selftest/cases/oescripts.py b/poky/meta/lib/oeqa/selftest/cases/oescripts.py
index 217afe377..7770b66a2 100644
--- a/poky/meta/lib/oeqa/selftest/cases/oescripts.py
+++ b/poky/meta/lib/oeqa/selftest/cases/oescripts.py
@@ -3,6 +3,7 @@
#
import os
+import unittest
from oeqa.selftest.case import OESelftestTestCase
from oeqa.selftest.cases.buildhistory import BuildhistoryBase
from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer
@@ -38,7 +39,7 @@ class OEScriptTests(OESelftestTestCase):
try:
import cairo
except ImportError:
- cls.skipTest('Python module cairo is not present')
+ raise unittest.SkipTest('Python module cairo is not present')
bitbake("core-image-minimal -c rootfs -f")
cls.tmpdir = get_bb_var('TMPDIR')
cls.buildstats = cls.tmpdir + "/buildstats/" + sorted(os.listdir(cls.tmpdir + "/buildstats"))[-1]
diff --git a/poky/meta/lib/oeqa/selftest/cases/package.py b/poky/meta/lib/oeqa/selftest/cases/package.py
index 7a0075382..291627877 100644
--- a/poky/meta/lib/oeqa/selftest/cases/package.py
+++ b/poky/meta/lib/oeqa/selftest/cases/package.py
@@ -7,6 +7,7 @@ from oeqa.utils.commands import bitbake, get_bb_vars, get_bb_var, runqemu
import stat
import subprocess, os
import oe.path
+import re
class VersionOrdering(OESelftestTestCase):
# version1, version2, sort order
@@ -134,7 +135,7 @@ class PackageTests(OESelftestTestCase):
return False
# Check debugging symbols works correctly
- elif "Breakpoint 1, main () at hello.c:4" in l:
+ elif re.match("Breakpoint 1.*hello\.c.*4", l):
return True
self.logger.error("GDB result:\n%d: %s", status, output)
diff --git a/poky/meta/lib/oeqa/selftest/cases/recipetool.py b/poky/meta/lib/oeqa/selftest/cases/recipetool.py
index f1cb37b53..e3f5c7166 100644
--- a/poky/meta/lib/oeqa/selftest/cases/recipetool.py
+++ b/poky/meta/lib/oeqa/selftest/cases/recipetool.py
@@ -435,7 +435,45 @@ class RecipetoolTests(RecipetoolBase):
checkvars = {}
checkvars['LICENSE'] = set(['Apache-2.0'])
checkvars['SRC_URI'] = 'git://github.com/mesonbuild/meson;protocol=https'
- inherits = ['setuptools']
+ inherits = ['setuptools3']
+ self._test_recipe_contents(recipefile, checkvars, inherits)
+
+ def test_recipetool_create_python3_setuptools(self):
+ # Test creating python3 package from tarball (using setuptools3 class)
+ temprecipe = os.path.join(self.tempdir, 'recipe')
+ os.makedirs(temprecipe)
+ pn = 'python-magic'
+ pv = '0.4.15'
+ recipefile = os.path.join(temprecipe, '%s_%s.bb' % (pn, pv))
+ srcuri = 'https://files.pythonhosted.org/packages/84/30/80932401906eaf787f2e9bd86dc458f1d2e75b064b4c187341f29516945c/python-magic-%s.tar.gz' % pv
+ result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri))
+ self.assertTrue(os.path.isfile(recipefile))
+ checkvars = {}
+ checkvars['LICENSE'] = set(['MIT'])
+ checkvars['LIC_FILES_CHKSUM'] = 'file://LICENSE;md5=16a934f165e8c3245f241e77d401bb88'
+ checkvars['SRC_URI'] = 'https://files.pythonhosted.org/packages/84/30/80932401906eaf787f2e9bd86dc458f1d2e75b064b4c187341f29516945c/python-magic-${PV}.tar.gz'
+ checkvars['SRC_URI[md5sum]'] = 'e384c95a47218f66c6501cd6dd45ff59'
+ checkvars['SRC_URI[sha256sum]'] = 'f3765c0f582d2dfc72c15f3b5a82aecfae9498bd29ca840d72f37d7bd38bfcd5'
+ inherits = ['setuptools3']
+ self._test_recipe_contents(recipefile, checkvars, inherits)
+
+ def test_recipetool_create_python3_distutils(self):
+ # Test creating python3 package from tarball (using distutils3 class)
+ temprecipe = os.path.join(self.tempdir, 'recipe')
+ os.makedirs(temprecipe)
+ pn = 'docutils'
+ pv = '0.14'
+ recipefile = os.path.join(temprecipe, '%s_%s.bb' % (pn, pv))
+ srcuri = 'https://files.pythonhosted.org/packages/84/f4/5771e41fdf52aabebbadecc9381d11dea0fa34e4759b4071244fa094804c/docutils-%s.tar.gz' % pv
+ result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri))
+ self.assertTrue(os.path.isfile(recipefile))
+ checkvars = {}
+ checkvars['LICENSE'] = set(['PSF', '&', 'BSD', 'GPL'])
+ checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING.txt;md5=35a23d42b615470583563132872c97d6'
+ checkvars['SRC_URI'] = 'https://files.pythonhosted.org/packages/84/f4/5771e41fdf52aabebbadecc9381d11dea0fa34e4759b4071244fa094804c/docutils-${PV}.tar.gz'
+ checkvars['SRC_URI[md5sum]'] = 'c53768d63db3873b7d452833553469de'
+ checkvars['SRC_URI[sha256sum]'] = '51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274'
+ inherits = ['distutils3']
self._test_recipe_contents(recipefile, checkvars, inherits)
def test_recipetool_create_github_tarball(self):
@@ -450,7 +488,7 @@ class RecipetoolTests(RecipetoolBase):
checkvars = {}
checkvars['LICENSE'] = set(['Apache-2.0'])
checkvars['SRC_URI'] = 'https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz'
- inherits = ['setuptools']
+ inherits = ['setuptools3']
self._test_recipe_contents(recipefile, checkvars, inherits)
def test_recipetool_create_git_http(self):
diff --git a/poky/meta/lib/oeqa/selftest/cases/reproducible.py b/poky/meta/lib/oeqa/selftest/cases/reproducible.py
new file mode 100644
index 000000000..6dc83d284
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -0,0 +1,160 @@
+#
+# SPDX-License-Identifier: MIT
+#
+# Copyright 2019 by Garmin Ltd. or its subsidiaries
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
+import functools
+import multiprocessing
+import textwrap
+import unittest
+
+MISSING = 'MISSING'
+DIFFERENT = 'DIFFERENT'
+SAME = 'SAME'
+
+@functools.total_ordering
+class CompareResult(object):
+ def __init__(self):
+ self.reference = None
+ self.test = None
+ self.status = 'UNKNOWN'
+
+ def __eq__(self, other):
+ return (self.status, self.test) == (other.status, other.test)
+
+ def __lt__(self, other):
+ return (self.status, self.test) < (other.status, other.test)
+
+class PackageCompareResults(object):
+ def __init__(self):
+ self.total = []
+ self.missing = []
+ self.different = []
+ self.same = []
+
+ def add_result(self, r):
+ self.total.append(r)
+ if r.status == MISSING:
+ self.missing.append(r)
+ elif r.status == DIFFERENT:
+ self.different.append(r)
+ else:
+ self.same.append(r)
+
+ def sort(self):
+ self.total.sort()
+ self.missing.sort()
+ self.different.sort()
+ self.same.sort()
+
+ def __str__(self):
+ return 'same=%i different=%i missing=%i total=%i' % (len(self.same), len(self.different), len(self.missing), len(self.total))
+
+def compare_file(reference, test, diffutils_sysroot):
+ result = CompareResult()
+ result.reference = reference
+ result.test = test
+
+ if not os.path.exists(reference):
+ result.status = MISSING
+ return result
+
+ r = runCmd(['cmp', '--quiet', reference, test], native_sysroot=diffutils_sysroot, ignore_status=True)
+
+ if r.status:
+ result.status = DIFFERENT
+ return result
+
+ result.status = SAME
+ return result
+
+class ReproducibleTests(OESelftestTestCase):
+ package_classes = ['deb']
+ images = ['core-image-minimal']
+
+ def setUpLocal(self):
+ super().setUpLocal()
+ needed_vars = ['TOPDIR', 'TARGET_PREFIX', 'BB_NUMBER_THREADS']
+ bb_vars = get_bb_vars(needed_vars)
+ for v in needed_vars:
+ setattr(self, v.lower(), bb_vars[v])
+
+ if not hasattr(self.tc, "extraresults"):
+ self.tc.extraresults = {}
+ self.extras = self.tc.extraresults
+
+ self.extras.setdefault('reproducible.rawlogs', {})['log'] = ''
+
+ def append_to_log(self, msg):
+ self.extras['reproducible.rawlogs']['log'] += msg
+
+ def compare_packages(self, reference_dir, test_dir, diffutils_sysroot):
+ result = PackageCompareResults()
+
+ old_cwd = os.getcwd()
+ try:
+ file_result = {}
+ os.chdir(test_dir)
+ with multiprocessing.Pool(processes=int(self.bb_number_threads or 0)) as p:
+ for root, dirs, files in os.walk('.'):
+ async_result = []
+ for f in files:
+ reference_path = os.path.join(reference_dir, root, f)
+ test_path = os.path.join(test_dir, root, f)
+ async_result.append(p.apply_async(compare_file, (reference_path, test_path, diffutils_sysroot)))
+
+ for a in async_result:
+ result.add_result(a.get())
+
+ finally:
+ os.chdir(old_cwd)
+
+ result.sort()
+ return result
+
+ @unittest.skip("Reproducible builds do not yet pass")
+ def test_reproducible_builds(self):
+ capture_vars = ['DEPLOY_DIR_' + c.upper() for c in self.package_classes]
+
+ common_config = textwrap.dedent('''\
+ INHERIT += "reproducible_build"
+ PACKAGE_CLASSES = "%s"
+ ''') % (' '.join('package_%s' % c for c in self.package_classes))
+
+ # Do an initial build. It's acceptable for this build to use sstate
+ self.write_config(common_config)
+ vars_reference = get_bb_vars(capture_vars)
+ bitbake(' '.join(self.images))
+
+ # Build native utilities
+ bitbake("diffutils-native -c addto_recipe_sysroot")
+ diffutils_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "diffutils-native")
+
+ # Perform another build. This build should *not* share sstate or pull
+ # from any mirrors, but sharing a DL_DIR is fine
+ self.write_config(textwrap.dedent('''\
+ TMPDIR = "${TOPDIR}/reproducible/tmp"
+ SSTATE_DIR = "${TMPDIR}/sstate"
+ SSTATE_MIRROR = ""
+ ''') + common_config)
+ vars_test = get_bb_vars(capture_vars)
+ bitbake(' '.join(self.images))
+
+ for c in self.package_classes:
+ package_class = 'package_' + c
+
+ deploy_reference = vars_reference['DEPLOY_DIR_' + c.upper()]
+ deploy_test = vars_test['DEPLOY_DIR_' + c.upper()]
+
+ result = self.compare_packages(deploy_reference, deploy_test, diffutils_sysroot)
+
+ self.logger.info('Reproducibility summary for %s: %s' % (c, result))
+
+ self.append_to_log('\n'.join("%s: %s" % (r.status, r.test) for r in result.total))
+
+ 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))))
+
diff --git a/poky/meta/lib/oeqa/selftest/cases/resulttooltests.py b/poky/meta/lib/oeqa/selftest/cases/resulttooltests.py
index 10eb9c12d..dac5c4680 100644
--- a/poky/meta/lib/oeqa/selftest/cases/resulttooltests.py
+++ b/poky/meta/lib/oeqa/selftest/cases/resulttooltests.py
@@ -56,7 +56,7 @@ class ResultToolTests(OESelftestTestCase):
'test4': {'status': 'ERROR'},
'test5': {'status': 'SKIPPED'}}}
report = ResultsTextReport()
- result_report = report.get_aggregated_test_result(None, result_data)
+ result_report = report.get_aggregated_test_result(None, result_data, 'DummyMachine')
self.assertTrue(result_report['passed'] == 2, msg="Passed count not correct:%s" % result_report['passed'])
self.assertTrue(result_report['failed'] == 2, msg="Failed count not correct:%s" % result_report['failed'])
self.assertTrue(result_report['skipped'] == 1, msg="Skipped count not correct:%s" % result_report['skipped'])
diff --git a/poky/meta/lib/oeqa/selftest/cases/signing.py b/poky/meta/lib/oeqa/selftest/cases/signing.py
index 9c710bd0f..b390f37d8 100644
--- a/poky/meta/lib/oeqa/selftest/cases/signing.py
+++ b/poky/meta/lib/oeqa/selftest/cases/signing.py
@@ -30,7 +30,8 @@ class Signing(OESelftestTestCase):
self.secret_key_path = os.path.join(self.testlayer_path, 'files', 'signing', "key.secret")
nsysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "gnupg-native")
- runCmd('gpg --batch --homedir %s --import %s %s' % (self.gpg_dir, self.pub_key_path, self.secret_key_path), native_sysroot=nsysroot)
+
+ runCmd('gpg --agent-program=`which gpg-agent`\|--auto-expand-secmem --batch --homedir %s --import %s %s' % (self.gpg_dir, self.pub_key_path, self.secret_key_path), native_sysroot=nsysroot)
return nsysroot + get_bb_var("bindir_native")
diff --git a/poky/meta/lib/oeqa/utils/logparser.py b/poky/meta/lib/oeqa/utils/logparser.py
index cc6d18d94..b31214b1c 100644
--- a/poky/meta/lib/oeqa/utils/logparser.py
+++ b/poky/meta/lib/oeqa/utils/logparser.py
@@ -16,7 +16,7 @@ class PtestParser(object):
def parse(self, logfile):
test_regex = {}
test_regex['PASSED'] = re.compile(r"^PASS:(.+)")
- test_regex['FAILED'] = re.compile(r"^FAIL:(.+)")
+ test_regex['FAILED'] = re.compile(r"^FAIL:([^(]+)")
test_regex['SKIPPED'] = re.compile(r"^SKIP:(.+)")
section_regex = {}
@@ -69,7 +69,7 @@ class PtestParser(object):
if result:
if current_section['name'] not in self.results:
self.results[current_section['name']] = {}
- self.results[current_section['name']][result.group(1)] = t
+ self.results[current_section['name']][result.group(1).strip()] = t
return self.results, self.sections
diff --git a/poky/meta/lib/oeqa/utils/qemurunner.py b/poky/meta/lib/oeqa/utils/qemurunner.py
index fd386ef5a..c16227fc3 100644
--- a/poky/meta/lib/oeqa/utils/qemurunner.py
+++ b/poky/meta/lib/oeqa/utils/qemurunner.py
@@ -60,6 +60,7 @@ class QemuRunner:
self.runqemutime = 120
self.qemu_pidfile = 'pidfile_'+str(os.getpid())
self.host_dumper = HostDumper(dump_host_cmds, dump_dir)
+ self.monitorpipe = None
self.logger = logger
@@ -155,11 +156,11 @@ class QemuRunner:
# and analyze descendents in order to determine it.
if os.path.exists(self.qemu_pidfile):
os.remove(self.qemu_pidfile)
- self.qemuparams = 'bootparams="{0}" qemuparams="-serial tcp:127.0.0.1:{1} -pidfile {2}"'.format(bootparams, threadport, self.qemu_pidfile)
+ self.qemuparams = 'bootparams="{0}" qemuparams="-pidfile {1}"'.format(bootparams, self.qemu_pidfile)
if qemuparams:
self.qemuparams = self.qemuparams[:-1] + " " + qemuparams + " " + '\"'
- launch_cmd += ' tcpserial=%s %s' % (self.serverport, self.qemuparams)
+ launch_cmd += ' tcpserial=%s:%s %s' % (threadport, self.serverport, self.qemuparams)
self.origchldhandler = signal.getsignal(signal.SIGCHLD)
signal.signal(signal.SIGCHLD, self.handleSIGCHLD)