summaryrefslogtreecommitdiff
path: root/poky/meta/lib/oeqa/selftest/cases
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2021-03-11 23:29:47 +0300
committerPatrick Williams <patrick@stwcx.xyz>2021-03-13 18:40:38 +0300
commit776d5d2fd95e177490624f4f2f1b2f91a20a3e77 (patch)
tree817f022609fec946e1a3a978e196b61b472cfad9 /poky/meta/lib/oeqa/selftest/cases
parentb19a422d594a25d91f16f5071b99cf77cd34014a (diff)
downloadopenbmc-776d5d2fd95e177490624f4f2f1b2f91a20a3e77.tar.xz
subtree updates
meta-openembedded: 5bba79488b..346681e7bf: Andrej Kozemcak (1): libuv: fix CVE-2020-8252 Dan Murphy (1): mariadb: Fix 64bit builds if pam is enabled Dmitry Baryshkov (2): xterm: install xterm and uxterm desktop files xterm: provide virtual/x-terminal-emulator Haiqing Bai (1): python-urllib3/python3-urllib3: fix CVE-2020-7212 Harpritkaur Bhandari (1): rapidjson: Upgrade SRCREV to latest Khem Raj (8): iscsi-initiator-utils: Upgrade to _2.1.2 iscsi-initiator-utils: Silence a clang warning on 64bit systems python-grpcio-tools: Add missing space for append gedit: Inherit python3targetconfig openipmi: Inherit python3targetconfig libplist: Inherit python3targetconfig postgresql: Inherit python3targetconfig python3-pykwalify: Do not unset _PYTHON_SYSCONFIGDATA_NAME Leon Anavi (2): sip3: Consolidate in a single file sip3: Upgrade 4.19.19 -> 4.19.23 Mario Schuknecht (1): dnsmasq: Fix systemd service Martin Jansa (3): networkd-dispatcher: use git fetcher wireguard-module: remove PKG assignment graphviz: use git fetcher instead of gitlab archives Mikko Rapeli (2): flatbuffers: whitelist CVE-2020-35864 giflib: apply patch for CVE-2019-15133 and set CVE_PRODUCT Sean Nyekjaer (1): gpsd: mark CLEANBROKEN Søren Andersen (1): zram: fix sourcing of zram parameters Vyacheslav Yurkov (1): python3-aiohttp: added missing RDEPENDs Zang Ruochen (1): openldap: upgrade 2.4.50 -> 2.4.51 akuster (2): enca: Fix SRC_URI meta-oe/README: add Ubuntu prerequisite information changqing.li@windriver.com (1): celt051: update SRC_URI zangrc (2): iscsi-initiator-utils: upgrade 2.1.2 -> 2.1.3 openldap: upgrade 2.4.51 -> 2.4.56 zhengruoqin (1): openldap: upgrade 2.4.56 -> 2.4.57 meta-raspberrypi: 9879932097..77190af02d: Aurelian Zanoschi (2): rpi-config: Add support for CM4 host USB [documentation]Add USB host support in documentation poky: 7ea41de137..d20ef1f5a5: Alexander Kanavin (9): oeqa/ptest: print a warning if ptests failed ca-certificates: correct upstream version check bitbake: lib/bb/fetch2/__init__.py: drop _PYTHON_SYSCONFIGDATA_NAME unsetting p11-kit: upgrade 0.23.20 -> 0.23.21 python3: split python target configuration into own class python3-pycairo: use python3targetconfig distutils3-base.bbclass: use python3targetconfig meta: drop _PYTHON_SYSCONFIGDATA_NAME hacks gpgme: use python3targetconfig Anatol Belski (1): glib-2.0: Rename patch file for CVE-2020-35457 Andrei Gherzan (2): oe/recipeutils: Fix copying patches when BBLAYERS entries are not normalised qemu: Backport patch to avoid assertion fails on icache line size Anuj Mittal (3): python3: fix CVE-2021-3177 linux-yocto: update genericx86 to v5.4.87 linux-yocto: update genericx86* to v5.4.94 Awais Belal (1): kernel.bbclass: fix deployment for initramfs images Bruce Ashfield (5): linux-yocto/5.4: update to v5.4.90 linux-yocto-rt/5.4: fix 5.4-stable caused build breakage linux-yocto/5.4: update to v5.4.94 linux-yocto/5.4: update to v5.4.96 linux-yocto/5.4: update to v5.4.98 Chris Laplante (2): cve-check: introduce CVE_CHECK_RECIPE_FILE variable to allow changing of per-recipe check file cve-check: add CVE_CHECK_REPORT_PATCHED variable to suppress reporting of patched CVEs Dorinda (8): sanity: Verify that user isn't building in PSEUDO_IGNORE_PATHS sanity.bbclass: sanity check for if bitbake is present in PATH sanity.bbclass: Check if PSEUDO_IGNORE_PATHS and paths under pseudo control overlap oe-pkgdata-util: Check if environment script is initialized meta/recipes-bsp: Add HOMEPAGE / DESCRIPTION meta/recipes-connectivity: Add HOMEPAGE / DESCRIPTION meta/recipes-devtools: Add HOMEPAGE / DESCRIPTION meta/recipes-core: Add HOMEPAGE / DESCRIPTION Jack Mitchell (1): distutils3: allow setup.py to be run from a different directory to ${S} Jan-Simon Möller (2): package_rpm: Enable use_source_date_epoch_as_buildtime in package_rpm class reproducible_builds: SOURCE_DATE_EPOCH should not be 0 Joe Slater (1): pseudo: fix renaming to self Jon Mason (1): gcc-9.3.inc: Fix potential runtime crash Joshua Watt (3): oeqa: reproducible: Fix SSTATE_MIRRORS variable oeqa: reproducible: Add more logging libomxil: Fix up commercial license flag Julien Massot (1): rng-tools: fix rngd_jitter initialization Khem Raj (1): python3targetconfig.bbclass: Make py3 dep and tasks only for target recipes Lee Chee Yang (8): cve-check: replace Looseversion with custom version class cve_check: add CVE_VERSION_SUFFIX to indicate suffix in versioning openssl: set CVE_VERSION_SUFFIX wic/selftest: test_permissions also test bitbake image p11-kit: upgrade 0.23.21 -> 0.23.22 sudo: 1.8.31 -> 1.8.32 go: update to 1.14.15 libsdl2: fix CVE-2020-14409 CVE-2020-14410 Marek Vasut (1): weston-init: Fix weston-keyboard path in weston.ini Mark Hatle (1): package.bbclass: hash equivalency and pr service Martin Jansa (5): base.bbclass: use os.path.normpath instead of just comparing WORKDIR and S as strings license.bbclass: Add COMMON_LICENSE_DIR and LICENSE_PATH dirs to PSEUDO_IGNORE_PATHS image_types.bbclass: tar: use posix format instead of gnu icu: backport fix for rare random genrb segmentation fault sstatesig.py: show an error instead of warning when sstate manifest isn't found Matt Hoosier (1): bitbake: fetch/git: download LFS content too during do_fetch Mauro Queirós (3): bitbake: git.py: skip smudging if lfs=0 is set bitbake: git.py: LFS bitbake note should not be printed if need_lfs is not set. bitbake: git.py: Use the correct branch to check if the repository has LFS objects. Michael Halstead (3): uninative: Upgrade to 2.10 yocto-uninative.inc: version 2.11 updates glibc to 2.33 yocto-uninative.inc: version 3.0 incorporate seccomp filter workaround Milan Shah (1): report-error.bbclass: Add layer and bitbake version info to error report Mingli Yu (2): tcl: adapt to potential pseudo changes bitbake.conf: Exclude ${CCACHE_DIR} from pseudo database Minjae Kim (2): bind: fix CVE-2020-8625 librepo: fix CVE-2020-14352 Naveen Saini (1): linux-yocto: update genericx86* SRCREV for 5.4 Oleksiy Obitotskyy (2): flex: Fix --noline option behavior dtc: improve reproducibility Oleksiy Obitotskyy yIEf0zt.mo (1): toolchain-shar-relocate.sh: Fix handling files with colons Ovidiu Panait (1): timezone: upgrade to 2021a Paul Barker (8): bitbake.conf: Prevent pyc file generation in pseudo context wic: Add workdir argument wic: Allow exec_native_cmd to run HOSTTOOLS wic: Ensure internal workdir is not reused image_types_wic: Move wic working directory wic: Update pseudo db when excluding content from rootfs wic: Copy rootfs dir if fstab needs updating wic: Optimise fstab modification for ext2/3/4 and msdos partitions Peter Bergin (1): buildhistory.bbclass: avoid exception for empty BUILDHISTORY_FEATURES variable Peter Kjellerstedt (5): pseudo: Simplify pseudo_client_ignore_path_chroot() lib/oe/path: Add canonicalize() bitbake.conf: Canonicalize paths in PSEUDO_IGNORE_PATHS wic: Pass canonicalized paths in PSEUDO_IGNORE_PATHS asciidoc: Switch to using the main branch Ricardo Ribalda (1): classes/image_types_wic: Reorder do_flush_pseudodb Ricardo Ribalda Delgado (5): wic: Fix permissions when using exclude or include path wic: Fix multi images .wks with bitbake wic: Avoid creating invalid pseudo directory wic: Add --change-directory argument oeqa: wic: Add tests for permissions and change-directory Richard Purdie (63): pseudo: Switch to oe-core branch in git repo pseudo: merge in fixes for setfacl issue pseudo: Update to add OFC fcntl lock updates pseudo: Ignore mismatched inodes from the db pseudo: Add support for ignoring paths from the pseudo DB pseudo: Abort on mismatch patch psuedo: Add tracking of linked files for fds pseudo: Fix xattr segfault pseudo: Add may unlink patch pseudo: Add pathfix patch base/bitbake.conf: Enable pseudo path filtering wic: Handle new PSEUDO_IGNORE_PATHS variable pseudo: Fix statx function usage bitbake.conf: Extend PSEUDO_IGNORE_PATHS to ${COREBASE}/meta abi_version,sanity: Tell users TMPDIR must be clean after pseudo changes pseudo: Update to account for patches merged on branch pseudo: Upgrade to include mkostemp64 wrapper oeqa/selftest/runtime_test: Exclude gpg directory from pseudo database uninative: Don't use single sstate for pseudo-native pseudo: Drop patches merged into upstream branch bitbake.conf: Add /run/ to PSEUDO_IGNORE_PATHS pseudo: Add lchmod wrapper pseudo: Update for arm host and memleak fixes/cleanup ncurses: Don't put terminfo into the sysroot python3: Avoid installing test data into recipe-sysroot staging: Clean up files installed into the sysroot pseudo: Update to include passwd and file renaming fixes package: Ensure do_packagedata is cleaned correctly qemu.inc: Should depend on qemu-system-native, not qemu-native image_types: Ensure tar archives are reproducible opkg: Fix build reproducibility issue opkg: Fix patch glitches build-appliance-image: Update to dunfell head revision poky.conf: Drop OELAYOUT_ABI poking pseudo: Update to work with glibc 2.33 pseudo: Update for rename and faccessat fixes pseudo: Update to include fixes for glibc 2.33 quilt: Be determnistic about column presence buildtools-extended-tarball: Add glibc-gconvs needed for build cwautomacros: Ensure version is set deterministically vim: Improve determinism vim: Fix a race over creation of the desktop files watchdog: Fix determinism issue from sendmail host path watchdog: Avoid reproducibility failures after fixing build xorg-fonts-minimal: Fix reproducibility xorg-minimal-fonts: Really fix determinism xmlto: Fix reproducibility groff: Fix determinism issue oeqa/commands: Fix compatibility with python 3.9 selftest/reproducible: Don't call sync between each file compare bitbake: __init__.py: Fix bitbake debug log handling linux-firmware: upgrade 20201218 -> 20210208 image: Add directories to PSEUDO_IGNORE_PATHS populate_sdk: Add directories to PSEUDO_IGNORE_PATHS bitbake.conf/image: Move image specific PSEUDO_IGNORE_PATHS to image class bitbake.conf: Split PSEUDO_IGNORE_PATHS to be more readable maintainers: Update email address for Victor libevdev: Update patch status to backport ca-certificates: Clean up two patches and submit upstream libpcre: Drop old/stale patch reproducible: Improve SOURCE_DATE_EPOCH_FALLBACK handling package/package_rpm: Disable font_provides configuration for reproducibilty cups: Fix reproducibility issues Ross Burton (3): flex: fix build with autoconf 2.70 core-image-sato-sdk-ptest: these images need ptest ovmf-shell-image: image is only buildable on x86-64 Scott Murray (2): u-boot: fix CVE-2020-8432 and CVE-2020-10648 screen: fix CVE-2021-26937 Sourabh Banerjee (1): layer.conf: fix sanity error for PATH variable in extensible SDK workflow Stefan Ghinea (1): wpa-supplicant: fix CVE-2021-0326 Steve Sakoman (2): documentation: prepare for 3.1.6 release poky.conf: Bump version for 3.1.6 release Teoh Jay Shen (1): oeqa/runlevel : add test for runlevels Thomas Viehweger (1): mtd-utils: Remove duplicate assignments to alternative link names Tomasz Dziendzielski (9): pseudo: Update to print PSEUDO_LOGFILE in abort message on path mismatches devtool: Fix source extraction for gcc shared source externalsrc: Fix parsing error with devtool non-git sources devtool: Fix file:// fetcher symlink directory structure selftest/devtool: Add modify_localfiles_only test checking symlink path externalsrc: Detect code changes in submodules python3: Use addtask statement instead of task dependencies lib/oe/patch.py: Ignore scissors line on applying patch sstatesig: Add descriptive error message to getpwuid/getgrgid "uid/gid not found" KeyError Vivien Didelot (2): local.conf.sample.extended: fix double 'of' typo local.conf.sample.extended: prefer INIT_MANAGER Vyacheslav Yurkov (1): npm.bbclass: use python3 for npm config Wang Mingyu (2): ca-certificates: upgrade 20190110 -> 20200601 openssl: upgrade 1.1.1i -> 1.1.1j Wes Lindauer (1): df.py: Add feature check for read-only-rootfs Yi Fan Yu (2): oeqa/selftest/cases/tinfoil.py: increase timeout 10->60s test_wait_event strace: increase ptest timeout duration 120->240s Yoann Congal (1): npm.bbclass: avoid building target nodejs for native npm recipes Zbigniew Bodek (1): wpebackend-fdo: Fix missing .so symlink when using dev package akuster (1): cve-check.bbclass: add layer to cve log saloni (2): libgcrypt: Whitelisted CVEs libcroco: Added CVE zangrc (1): flex: Refresh patch zhengruoqin (1): ca-certificates: upgrade 20200601 -> 20210119 Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9ffc795f097a364d73d89d01d893cde9e7946d70
Diffstat (limited to 'poky/meta/lib/oeqa/selftest/cases')
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/cve_check.py36
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/devtool.py37
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/prservice.py8
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/pseudo.py27
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/reproducible.py7
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/runtime_test.py1
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/tinfoil.py6
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/wic.py106
8 files changed, 220 insertions, 8 deletions
diff --git a/poky/meta/lib/oeqa/selftest/cases/cve_check.py b/poky/meta/lib/oeqa/selftest/cases/cve_check.py
new file mode 100644
index 0000000000..3f343a2841
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/cve_check.py
@@ -0,0 +1,36 @@
+from oe.cve_check import Version
+from oeqa.selftest.case import OESelftestTestCase
+
+class CVECheck(OESelftestTestCase):
+
+ def test_version_compare(self):
+ result = Version("100") > Version("99")
+ self.assertTrue( result, msg="Failed to compare version '100' > '99'")
+ result = Version("2.3.1") > Version("2.2.3")
+ self.assertTrue( result, msg="Failed to compare version '2.3.1' > '2.2.3'")
+ result = Version("2021-01-21") > Version("2020-12-25")
+ self.assertTrue( result, msg="Failed to compare version '2021-01-21' > '2020-12-25'")
+ result = Version("1.2-20200910") < Version("1.2-20200920")
+ self.assertTrue( result, msg="Failed to compare version '1.2-20200910' < '1.2-20200920'")
+
+ result = Version("1.0") >= Version("1.0beta")
+ self.assertTrue( result, msg="Failed to compare version '1.0' >= '1.0beta'")
+ result = Version("1.0-rc2") > Version("1.0-rc1")
+ self.assertTrue( result, msg="Failed to compare version '1.0-rc2' > '1.0-rc1'")
+ result = Version("1.0.alpha1") < Version("1.0")
+ self.assertTrue( result, msg="Failed to compare version '1.0.alpha1' < '1.0'")
+ result = Version("1.0_dev") <= Version("1.0")
+ self.assertTrue( result, msg="Failed to compare version '1.0_dev' <= '1.0'")
+
+ # ignore "p1" and "p2", so these should be equal
+ result = Version("1.0p2") == Version("1.0p1")
+ self.assertTrue( result ,msg="Failed to compare version '1.0p2' to '1.0p1'")
+ # ignore the "b" and "r"
+ result = Version("1.0b") == Version("1.0r")
+ self.assertTrue( result ,msg="Failed to compare version '1.0b' to '1.0r'")
+
+ # consider the trailing alphabet as patched level when comparing
+ result = Version("1.0b","alphabetical") < Version("1.0r","alphabetical")
+ self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' < '1.0r'")
+ result = Version("1.0b","alphabetical") > Version("1.0","alphabetical")
+ self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' > '1.0'")
diff --git a/poky/meta/lib/oeqa/selftest/cases/devtool.py b/poky/meta/lib/oeqa/selftest/cases/devtool.py
index ddf46547de..0985434238 100644
--- a/poky/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/poky/meta/lib/oeqa/selftest/cases/devtool.py
@@ -693,7 +693,44 @@ class DevtoolModifyTests(DevtoolBase):
self.assertTrue(bbclassextended, 'None of these recipes are BBCLASSEXTENDed to native - need to adjust testrecipes list: %s' % ', '.join(testrecipes))
self.assertTrue(inheritnative, 'None of these recipes do "inherit native" - need to adjust testrecipes list: %s' % ', '.join(testrecipes))
+ def test_devtool_modify_localfiles_only(self):
+ # Check preconditions
+ testrecipe = 'base-files'
+ src_uri = (get_bb_var('SRC_URI', testrecipe) or '').split()
+ foundlocalonly = False
+ correct_symlink = False
+ for item in src_uri:
+ if item.startswith('file://'):
+ if '.patch' not in item:
+ foundlocalonly = True
+ else:
+ foundlocalonly = False
+ break
+ self.assertTrue(foundlocalonly, 'This test expects the %s recipe to fetch local files only and it seems that it no longer does' % testrecipe)
+ # Clean up anything in the workdir/sysroot/sstate cache
+ bitbake('%s -c cleansstate' % testrecipe)
+ # Try modifying a recipe
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+ srcfile = os.path.join(tempdir, 'oe-local-files/share/dot.bashrc')
+ srclink = os.path.join(tempdir, 'share/dot.bashrc')
+ self.assertExists(srcfile, 'Extracted source could not be found')
+ if os.path.islink(srclink) and os.path.exists(srclink) and os.path.samefile(srcfile, srclink):
+ correct_symlink = True
+ self.assertTrue(correct_symlink, 'Source symlink to oe-local-files is broken')
+ matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % testrecipe))
+ self.assertTrue(matches, 'bbappend not created')
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn(testrecipe, result.output)
+ self.assertIn(tempdir, result.output)
+ # Try building
+ bitbake(testrecipe)
def test_devtool_modify_git(self):
# Check preconditions
diff --git a/poky/meta/lib/oeqa/selftest/cases/prservice.py b/poky/meta/lib/oeqa/selftest/cases/prservice.py
index 85b534963d..578b2b4dd9 100644
--- a/poky/meta/lib/oeqa/selftest/cases/prservice.py
+++ b/poky/meta/lib/oeqa/selftest/cases/prservice.py
@@ -23,7 +23,7 @@ class BitbakePrTests(OESelftestTestCase):
package_data_file = os.path.join(self.pkgdata_dir, 'runtime', package_name)
package_data = ftools.read_file(package_data_file)
find_pr = re.search(r"PKGR: r[0-9]+\.([0-9]+)", package_data)
- self.assertTrue(find_pr, "No PKG revision found in %s" % package_data_file)
+ self.assertTrue(find_pr, "No PKG revision found via regex 'PKGR: r[0-9]+\.([0-9]+)' in %s" % package_data_file)
return int(find_pr.group(1))
def get_task_stamp(self, package_name, recipe_task):
@@ -40,7 +40,7 @@ class BitbakePrTests(OESelftestTestCase):
return str(stamps[0])
def increment_package_pr(self, package_name):
- inc_data = "do_package_append() {\n bb.build.exec_func('do_test_prserv', d)\n}\ndo_test_prserv() {\necho \"The current date is: %s\"\n}" % datetime.datetime.now()
+ inc_data = "do_package_append() {\n bb.build.exec_func('do_test_prserv', d)\n}\ndo_test_prserv() {\necho \"The current date is: %s\" > ${PKGDESTWORK}/${PN}.datestamp\n}" % datetime.datetime.now()
self.write_recipeinc(package_name, inc_data)
res = bitbake(package_name, ignore_status=True)
self.delete_recipeinc(package_name)
@@ -63,7 +63,7 @@ class BitbakePrTests(OESelftestTestCase):
pr_2 = self.get_pr_version(package_name)
stamp_2 = self.get_task_stamp(package_name, track_task)
- self.assertTrue(pr_2 - pr_1 == 1, "Step between pkg revisions is not 1 (was %s - %s)" % (pr_2, pr_1))
+ self.assertTrue(pr_2 - pr_1 == 1, "New PR %s did not increment as expected (from %s), difference should be 1" % (pr_2, pr_1))
self.assertTrue(stamp_1 != stamp_2, "Different pkg rev. but same stamp: %s" % stamp_1)
def run_test_pr_export_import(self, package_name, replace_current_db=True):
@@ -89,7 +89,7 @@ class BitbakePrTests(OESelftestTestCase):
self.increment_package_pr(package_name)
pr_2 = self.get_pr_version(package_name)
- self.assertTrue(pr_2 - pr_1 == 1, "Step between pkg revisions is not 1 (was %s - %s)" % (pr_2, pr_1))
+ self.assertTrue(pr_2 - pr_1 == 1, "New PR %s did not increment as expected (from %s), difference should be 1" % (pr_2, pr_1))
def test_import_export_replace_db(self):
self.run_test_pr_export_import('m4')
diff --git a/poky/meta/lib/oeqa/selftest/cases/pseudo.py b/poky/meta/lib/oeqa/selftest/cases/pseudo.py
new file mode 100644
index 0000000000..33593d5ce9
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/pseudo.py
@@ -0,0 +1,27 @@
+#
+# SPDX-License-Identifier: MIT
+#
+
+import glob
+import os
+import shutil
+from oeqa.utils.commands import bitbake, get_test_layer
+from oeqa.selftest.case import OESelftestTestCase
+
+class Pseudo(OESelftestTestCase):
+
+ def test_pseudo_pyc_creation(self):
+ self.write_config("")
+
+ metaselftestpath = get_test_layer()
+ pycache_path = os.path.join(metaselftestpath, 'lib/__pycache__')
+ if os.path.exists(pycache_path):
+ shutil.rmtree(pycache_path)
+
+ bitbake('pseudo-pyc-test -c install')
+
+ test1_pyc_present = len(glob.glob(os.path.join(pycache_path, 'pseudo_pyc_test1.*.pyc')))
+ self.assertTrue(test1_pyc_present, 'test1 pyc file missing, should be created outside of pseudo context.')
+
+ test2_pyc_present = len(glob.glob(os.path.join(pycache_path, 'pseudo_pyc_test2.*.pyc')))
+ self.assertFalse(test2_pyc_present, 'test2 pyc file present, should not be created in pseudo context.')
diff --git a/poky/meta/lib/oeqa/selftest/cases/reproducible.py b/poky/meta/lib/oeqa/selftest/cases/reproducible.py
index 5d3959be77..7f74cec28f 100644
--- a/poky/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/poky/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -68,7 +68,7 @@ def compare_file(reference, test, diffutils_sysroot):
result.status = MISSING
return result
- r = runCmd(['cmp', '--quiet', reference, test], native_sysroot=diffutils_sysroot, ignore_status=True)
+ r = runCmd(['cmp', '--quiet', reference, test], native_sysroot=diffutils_sysroot, ignore_status=True, sync=False)
if r.status:
result.status = DIFFERENT
@@ -158,9 +158,10 @@ class ReproducibleTests(OESelftestTestCase):
# mirror, forcing a complete build from scratch
config += textwrap.dedent('''\
SSTATE_DIR = "${TMPDIR}/sstate"
- SSTATE_MIRROR = ""
+ SSTATE_MIRRORS = ""
''')
+ self.logger.info("Building %s (sstate%s allowed)..." % (name, '' if use_sstate else ' NOT'))
self.write_config(config)
d = get_bb_vars(capture_vars)
bitbake(' '.join(self.images))
@@ -187,6 +188,7 @@ class ReproducibleTests(OESelftestTestCase):
self.logger.info('Non-reproducible packages will be copied to %s', save_dir)
vars_A = self.do_test_build('reproducibleA', self.build_from_sstate)
+
vars_B = self.do_test_build('reproducibleB', False)
# NOTE: The temp directories from the reproducible build are purposely
@@ -201,6 +203,7 @@ class ReproducibleTests(OESelftestTestCase):
deploy_A = vars_A['DEPLOY_DIR_' + c.upper()]
deploy_B = vars_B['DEPLOY_DIR_' + c.upper()]
+ self.logger.info('Checking %s packages for differences...' % c)
result = self.compare_packages(deploy_A, deploy_B, diffutils_sysroot)
self.logger.info('Reproducibility summary for %s: %s' % (c, result))
diff --git a/poky/meta/lib/oeqa/selftest/cases/runtime_test.py b/poky/meta/lib/oeqa/selftest/cases/runtime_test.py
index cd03069340..976b513727 100644
--- a/poky/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/poky/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -161,6 +161,7 @@ class TestImage(OESelftestTestCase):
features += 'PACKAGE_FEED_GPG_NAME = "testuser"\n'
features += 'PACKAGE_FEED_GPG_PASSPHRASE_FILE = "%s"\n' % os.path.join(signing_key_dir, 'key.passphrase')
features += 'GPG_PATH = "%s"\n' % self.gpg_home
+ features += 'PSEUDO_IGNORE_PATHS .= ",%s"\n' % self.gpg_home
self.write_config(features)
# Build core-image-sato and testimage
diff --git a/poky/meta/lib/oeqa/selftest/cases/tinfoil.py b/poky/meta/lib/oeqa/selftest/cases/tinfoil.py
index 206168ed00..a51c6048d3 100644
--- a/poky/meta/lib/oeqa/selftest/cases/tinfoil.py
+++ b/poky/meta/lib/oeqa/selftest/cases/tinfoil.py
@@ -100,9 +100,11 @@ class TinfoilTests(OESelftestTestCase):
eventreceived = False
commandcomplete = False
start = time.time()
- # Wait for 10s in total so we'd detect spurious heartbeat events for example
+ # Wait for maximum 60s in total so we'd detect spurious heartbeat events for example
# The test is IO load sensitive too
- while time.time() - start < 10:
+ while (not (eventreceived == True and commandcomplete == True)
+ and (time.time() - start < 60)):
+ # if we received both events (on let's say a good day), we are done
event = tinfoil.wait_event(1)
if event:
if isinstance(event, bb.command.CommandCompleted):
diff --git a/poky/meta/lib/oeqa/selftest/cases/wic.py b/poky/meta/lib/oeqa/selftest/cases/wic.py
index 13b6a0cc72..0435aa29c9 100644
--- a/poky/meta/lib/oeqa/selftest/cases/wic.py
+++ b/poky/meta/lib/oeqa/selftest/cases/wic.py
@@ -62,6 +62,12 @@ def extract_files(debugfs_output):
return [line.split('/')[5].strip() for line in \
debugfs_output.strip().split('/\n')]
+def files_own_by_root(debugfs_output):
+ for line in debugfs_output.strip().split('/\n'):
+ if line.split('/')[3:5] != ['0', '0']:
+ print(debugfs_output)
+ return False
+ return True
class WicTestCase(OESelftestTestCase):
"""Wic test class."""
@@ -84,6 +90,7 @@ class WicTestCase(OESelftestTestCase):
self.skipTest('wic-tools cannot be built due its (intltool|gettext)-native dependency and NLS disable')
bitbake('core-image-minimal')
+ bitbake('core-image-minimal-mtdutils')
WicTestCase.image_is_ready = True
rmtree(self.resultdir, ignore_errors=True)
@@ -506,6 +513,105 @@ part /part2 --source rootfs --ondisk mmcblk0 --fstype=ext4 --include-path %s"""
% (wks_file, self.resultdir), ignore_status=True).status)
os.remove(wks_file)
+ def test_permissions(self):
+ """Test permissions are respected"""
+
+ # prepare wicenv and rootfs
+ bitbake('core-image-minimal core-image-minimal-mtdutils -c do_rootfs_wicenv')
+
+ oldpath = os.environ['PATH']
+ os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
+
+ t_normal = """
+part / --source rootfs --fstype=ext4
+"""
+ t_exclude = """
+part / --source rootfs --fstype=ext4 --exclude-path=home
+"""
+ t_multi = """
+part / --source rootfs --ondisk sda --fstype=ext4
+part /export --source rootfs --rootfs=core-image-minimal-mtdutils --fstype=ext4
+"""
+ t_change = """
+part / --source rootfs --ondisk sda --fstype=ext4 --exclude-path=etc/   
+part /etc --source rootfs --fstype=ext4 --change-directory=etc
+"""
+ tests = [t_normal, t_exclude, t_multi, t_change]
+
+ try:
+ for test in tests:
+ include_path = os.path.join(self.resultdir, 'test-include')
+ os.makedirs(include_path)
+ wks_file = os.path.join(include_path, 'temp.wks')
+ with open(wks_file, 'w') as wks:
+ wks.write(test)
+ runCmd("wic create %s -e core-image-minimal -o %s" \
+ % (wks_file, self.resultdir))
+
+ for part in glob(os.path.join(self.resultdir, 'temp-*.direct.p*')):
+ res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % (part))
+ self.assertEqual(True, files_own_by_root(res.output))
+
+ config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "%s"\n' % wks_file
+ self.append_config(config)
+ bitbake('core-image-minimal')
+ tmpdir = os.path.join(get_bb_var('WORKDIR', 'core-image-minimal'),'build-wic')
+
+ # check each partition for permission
+ for part in glob(os.path.join(tmpdir, 'temp-*.direct.p*')):
+ res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % (part))
+ self.assertTrue(files_own_by_root(res.output)
+ ,msg='Files permission incorrect using wks set "%s"' % test)
+
+ # clean config and result directory for next cases
+ self.remove_config(config)
+ rmtree(self.resultdir, ignore_errors=True)
+
+ finally:
+ os.environ['PATH'] = oldpath
+
+ def test_change_directory(self):
+ """Test --change-directory wks option."""
+
+ oldpath = os.environ['PATH']
+ os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
+
+ try:
+ include_path = os.path.join(self.resultdir, 'test-include')
+ os.makedirs(include_path)
+ wks_file = os.path.join(include_path, 'temp.wks')
+ with open(wks_file, 'w') as wks:
+ wks.write("part /etc --source rootfs --fstype=ext4 --change-directory=etc")
+ runCmd("wic create %s -e core-image-minimal -o %s" \
+ % (wks_file, self.resultdir))
+
+ part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0]
+
+ res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % (part1))
+ files = extract_files(res.output)
+ self.assertIn('passwd', files)
+
+ finally:
+ os.environ['PATH'] = oldpath
+
+ def test_change_directory_errors(self):
+ """Test --change-directory wks option error handling."""
+ wks_file = 'temp.wks'
+
+ # Absolute argument.
+ with open(wks_file, 'w') as wks:
+ wks.write("part / --source rootfs --fstype=ext4 --change-directory /usr")
+ self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
+ % (wks_file, self.resultdir), ignore_status=True).status)
+ os.remove(wks_file)
+
+ # Argument pointing to parent directory.
+ with open(wks_file, 'w') as wks:
+ wks.write("part / --source rootfs --fstype=ext4 --change-directory ././..")
+ self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
+ % (wks_file, self.resultdir), ignore_status=True).status)
+ os.remove(wks_file)
+
class Wic2(WicTestCase):
def test_bmap_short(self):