From patchwork Wed Nov 9 19:31:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15235 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B193FC433FE for ; Wed, 9 Nov 2022 19:31:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.1440.1668022304009107542 for ; Wed, 09 Nov 2022 11:31:44 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A02261FB; Wed, 9 Nov 2022 11:31:49 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 07B6F3F703; Wed, 9 Nov 2022 11:31:42 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 01/15] oeqa/qemurunner: update exception class for QMP API changes Date: Wed, 9 Nov 2022 19:31:21 +0000 Message-Id: <20221109193135.291048-1-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173034 Signed-off-by: Ross Burton --- meta/lib/oeqa/utils/qemurunner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index 6a85f57e498..e602399232b 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -354,7 +354,7 @@ class QemuRunner: except OSError as msg: self.logger.warning("Failed to connect qemu monitor socket: %s File: %s" % (msg, msg.filename)) return False - except qmp.QMPConnectError as msg: + except qmp.legacy.QMPError as msg: self.logger.warning("Failed to communicate with qemu monitor: %s" % (msg)) return False finally: From patchwork Wed Nov 9 19:31:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15239 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F050AC352A1 for ; Wed, 9 Nov 2022 19:31:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.1441.1668022304434199059 for ; Wed, 09 Nov 2022 11:31:44 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4BED423A; Wed, 9 Nov 2022 11:31:50 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A91353F703; Wed, 9 Nov 2022 11:31:43 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 02/15] oeqa/core/decorator: add decorators to skip based on HOST_ARCH Date: Wed, 9 Nov 2022 19:31:22 +0000 Message-Id: <20221109193135.291048-2-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109193135.291048-1-ross.burton@arm.com> References: <20221109193135.291048-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173035 There are already decorators to skip on the value of MACHINE, but for flexibility it's better to skip based on the target architecture. This means, for example, the ISO image tests could skip if the architecture isn't x86. Signed-off-by: Ross Burton --- meta/lib/oeqa/core/decorator/data.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py index 3ce10e54999..de881e097ab 100644 --- a/meta/lib/oeqa/core/decorator/data.py +++ b/meta/lib/oeqa/core/decorator/data.py @@ -194,3 +194,27 @@ class skipIfQemu(OETestDecorator): self.logger.debug("Checking if qemu MACHINE") if self.case.td.get('MACHINE', '').startswith('qemu'): self.case.skipTest('Test only runs on real hardware') + +@registerDecorator +class skipIfArch(OETestDecorator): + """ + Skip test if HOST_ARCH is present in the tuple specified. + """ + + attrs = ('archs',) + def setUpDecorator(self): + arch = self.case.td['HOST_ARCH'] + if arch in self.archs: + self.case.skipTest('Test skipped on %s' % arch) + +@registerDecorator +class skipIfNotArch(OETestDecorator): + """ + Skip test if HOST_ARCH is not present in the tuple specified. + """ + + attrs = ('archs',) + def setUpDecorator(self): + arch = self.case.td['HOST_ARCH'] + if arch not in self.archs: + self.case.skipTest('Test skipped on %s' % arch) From patchwork Wed Nov 9 19:31:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15237 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7326C4167E for ; Wed, 9 Nov 2022 19:31:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.1442.1668022305156005768 for ; Wed, 09 Nov 2022 11:31:45 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EC599D6E; Wed, 9 Nov 2022 11:31:50 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 555BB3F703; Wed, 9 Nov 2022 11:31:44 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 03/15] oeqa/selftest/buildoptions: skip test_read_only_image on qemuarm64 Date: Wed, 9 Nov 2022 19:31:23 +0000 Message-Id: <20221109193135.291048-3-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109193135.291048-1-ross.burton@arm.com> References: <20221109193135.291048-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173036 qemuarm64 currently uses SERIAL_CONSOLES_CHECK but this is incompatible with read-only rootfs under sysvinit. Until qemuarm64 doesn't use this, skip the test on qemuarm64. Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/cases/buildoptions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/buildoptions.py b/meta/lib/oeqa/selftest/cases/buildoptions.py index ee3e28d74bf..01ea4dce395 100644 --- a/meta/lib/oeqa/selftest/cases/buildoptions.py +++ b/meta/lib/oeqa/selftest/cases/buildoptions.py @@ -11,6 +11,7 @@ import shutil import tempfile from oeqa.selftest.case import OESelftestTestCase from oeqa.selftest.cases.buildhistory import BuildhistoryBase +from oeqa.core.decorator.data import skipIfMachine from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars import oeqa.utils.ftools as ftools @@ -49,6 +50,8 @@ class ImageOptionsTests(OESelftestTestCase): loglines = "".join(f.readlines()) self.assertIn("ccache", loglines, msg="No match for ccache in %s log.do_compile. For further details: %s" % (recipe , log_compile)) + # https://bugzilla.yoctoproject.org/show_bug.cgi?id=14962 + @skipIfMachine("qemuarm64", "fails on qemuarm64 (uses SERIAL_CONSOLES_CHECK)") def test_read_only_image(self): distro_features = get_bb_var('DISTRO_FEATURES') if not ('x11' in distro_features and 'opengl' in distro_features): From patchwork Wed Nov 9 19:31:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15238 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D830DC41535 for ; Wed, 9 Nov 2022 19:31:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.1442.1668022305156005768 for ; Wed, 09 Nov 2022 11:31:45 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9A0191FB; Wed, 9 Nov 2022 11:31:51 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 01B363F703; Wed, 9 Nov 2022 11:31:44 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 04/15] oeqa/selftest/efibootpartition: improve test Date: Wed, 9 Nov 2022 19:31:24 +0000 Message-Id: <20221109193135.291048-4-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109193135.291048-1-ross.burton@arm.com> References: <20221109193135.291048-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173037 This test was overly complex with a setUp() method for a single test case, which was marked as a class function for no good reason. Generalise the test so that it has the possibility of working on more machines in the future, add a decorator so that it only runs on qemux86-64, and respect QEMU_USE_KVM to speed up test execution. Signed-off-by: Ross Burton --- .../oeqa/selftest/cases/efibootpartition.py | 41 +++++++------------ 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/efibootpartition.py b/meta/lib/oeqa/selftest/cases/efibootpartition.py index 26de3a07c9e..e17da9f9a09 100644 --- a/meta/lib/oeqa/selftest/cases/efibootpartition.py +++ b/meta/lib/oeqa/selftest/cases/efibootpartition.py @@ -5,42 +5,29 @@ # SPDX-License-Identifier: MIT # -import re - from oeqa.selftest.case import OESelftestTestCase -from oeqa.utils.commands import bitbake, runqemu, get_bb_var +from oeqa.utils.commands import bitbake, runqemu +from oeqa.core.decorator.data import skipIfNotMachine +import oe.types class GenericEFITest(OESelftestTestCase): """EFI booting test class""" + @skipIfNotMachine("qemux86-64", "test is qemux86-64 specific currently") + def test_boot_efi(self): + cmd = "runqemu nographic serial wic ovmf" + if oe.types.qemu_use_kvm(self.td['QEMU_USE_KVM'], self.td["TARGET_ARCH"]): + cmd += " kvm" + image = "core-image-minimal" - cmd_common = "runqemu nographic serial wic ovmf" - efi_provider = "systemd-boot" - image = "core-image-minimal" - machine = "qemux86-64" - recipes_built = False - - @classmethod - def setUpLocal(self): - super(GenericEFITest, self).setUpLocal(self) - - self.write_config(self, -""" -EFI_PROVIDER = "%s" + self.write_config(""" +EFI_PROVIDER = "systemd-boot" IMAGE_FSTYPES:pn-%s:append = " wic" -MACHINE = "%s" MACHINE_FEATURES:append = " efi" WKS_FILE = "efi-bootdisk.wks.in" IMAGE_INSTALL:append = " grub-efi systemd-boot kernel-image-bzimage" """ -% (self.efi_provider, self.image, self.machine)) - if not self.recipes_built: - bitbake("ovmf") - bitbake(self.image) - self.recipes_built = True +% (image)) - @classmethod - def test_boot_efi(self): - """Test generic boot partition with qemu""" - cmd = "%s %s" % (self.cmd_common, self.machine) - with runqemu(self.image, ssh=False, launch_cmd=cmd) as qemu: + bitbake(image + " ovmf") + with runqemu(image, ssh=False, launch_cmd=cmd) as qemu: self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd) From patchwork Wed Nov 9 19:31:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15236 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEF26C4167B for ; Wed, 9 Nov 2022 19:31:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.1443.1668022306438964926 for ; Wed, 09 Nov 2022 11:31:46 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 470AC23A; Wed, 9 Nov 2022 11:31:52 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A40D33F703; Wed, 9 Nov 2022 11:31:45 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 05/15] oeqa/selftest/imagefeatures: remove hardcoded MACHINE in test_image_gen_debugfs Date: Wed, 9 Nov 2022 19:31:25 +0000 Message-Id: <20221109193135.291048-5-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109193135.291048-1-ross.burton@arm.com> References: <20221109193135.291048-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173038 There's no need for this to be built for genericx86-64, we want to test the current MACHINE. Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/cases/imagefeatures.py | 1 - 1 file changed, 1 deletion(-) diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py index d3fd52851c0..f259ebb8041 100644 --- a/meta/lib/oeqa/selftest/cases/imagefeatures.py +++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py @@ -271,7 +271,6 @@ SKIP_RECIPE[busybox] = "Don't build this" image_name = 'core-image-minimal' features = 'IMAGE_GEN_DEBUGFS = "1"\n' features += 'IMAGE_FSTYPES_DEBUGFS = "tar.bz2"\n' - features += 'MACHINE = "genericx86-64"\n' self.write_config(features) bitbake(image_name) From patchwork Wed Nov 9 19:31:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15233 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C893DC4321E for ; Wed, 9 Nov 2022 19:31:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.1540.1668022307154915422 for ; Wed, 09 Nov 2022 11:31:47 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E79661FB; Wed, 9 Nov 2022 11:31:52 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5090D3F703; Wed, 9 Nov 2022 11:31:46 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 06/15] oeqa/selftest/imagefeatures: don't use wic images in test_hypervisor_fmts Date: Wed, 9 Nov 2022 19:31:26 +0000 Message-Id: <20221109193135.291048-6-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109193135.291048-1-ross.burton@arm.com> References: <20221109193135.291048-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173039 There's no need to build a wic image in this test as not all machines (such as qemuarm64 currently) have wic images out of the box. We can simply build ext4 images to work on more machines and save some time. Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/cases/imagefeatures.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py index f259ebb8041..df796eaed09 100644 --- a/meta/lib/oeqa/selftest/cases/imagefeatures.py +++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py @@ -136,7 +136,7 @@ class ImageFeatures(OESelftestTestCase): img_types = [ 'vmdk', 'vdi', 'qcow2' ] features = "" for itype in img_types: - features += 'IMAGE_FSTYPES += "wic.%s"\n' % itype + features += 'IMAGE_FSTYPES += "ext4.%s"\n' % itype self.write_config(features) image_name = 'core-image-minimal' @@ -145,7 +145,7 @@ class ImageFeatures(OESelftestTestCase): deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') link_name = get_bb_var('IMAGE_LINK_NAME', image_name) for itype in img_types: - image_path = os.path.join(deploy_dir_image, "%s.wic.%s" % + image_path = os.path.join(deploy_dir_image, "%s.ext4.%s" % (link_name, itype)) # check if result image file is in deploy directory From patchwork Wed Nov 9 19:31:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C15BEC43217 for ; Wed, 9 Nov 2022 19:31:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.1501.1668022307744120925 for ; Wed, 09 Nov 2022 11:31:48 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 93D2923A; Wed, 9 Nov 2022 11:31:53 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F11EB3F703; Wed, 9 Nov 2022 11:31:46 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 07/15] oeqa/selftest/imagefeatures: set a .wks in test_fs_types Date: Wed, 9 Nov 2022 19:31:27 +0000 Message-Id: <20221109193135.291048-7-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109193135.291048-1-ross.burton@arm.com> References: <20221109193135.291048-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173040 Set WKS_FILE to wictestdisk.wks, which is a very simple Wic file that simply contains the root filesystem. It may not actually boot but this test doesn't care, and it does exercise the wic image construction on all machines. Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/cases/imagefeatures.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py index df796eaed09..af38150613b 100644 --- a/meta/lib/oeqa/selftest/cases/imagefeatures.py +++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py @@ -206,9 +206,12 @@ class ImageFeatures(OESelftestTestCase): skip_image_types = set(('container', 'elf', 'f2fs', 'multiubi', 'tar.zst', 'wic.zst', 'squashfs-lzo')) img_types = all_image_types - skip_image_types - config = 'IMAGE_FSTYPES += "%s"\n'\ - 'MKUBIFS_ARGS ?= "-m 2048 -e 129024 -c 2047"\n'\ - 'UBINIZE_ARGS ?= "-m 2048 -p 128KiB -s 512"' % ' '.join(img_types) + config = """ +IMAGE_FSTYPES += "%s" +WKS_FILE = "wictestdisk.wks" +MKUBIFS_ARGS ?= "-m 2048 -e 129024 -c 2047" +UBINIZE_ARGS ?= "-m 2048 -p 128KiB -s 512" +""" % ' '.join(img_types) self.write_config(config) bitbake(image_name) From patchwork Wed Nov 9 19:31:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4103C43219 for ; Wed, 9 Nov 2022 19:31:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.1444.1668022308418623914 for ; Wed, 09 Nov 2022 11:31:48 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 404601FB; Wed, 9 Nov 2022 11:31:54 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9D69A3F703; Wed, 9 Nov 2022 11:31:47 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 08/15] oeqa/selftest/overlayfs: overlayfs: skip x86-specific tests Date: Wed, 9 Nov 2022 19:31:28 +0000 Message-Id: <20221109193135.291048-8-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109193135.291048-1-ross.burton@arm.com> References: <20221109193135.291048-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173041 For now, not all machines have a default wks file, so mark the tests which need a wks as being specific to qemux86-64. Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/cases/overlayfs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py b/meta/lib/oeqa/selftest/cases/overlayfs.py index 57a8c8bdb6e..dfd9f1486d0 100644 --- a/meta/lib/oeqa/selftest/cases/overlayfs.py +++ b/meta/lib/oeqa/selftest/cases/overlayfs.py @@ -7,6 +7,7 @@ from oeqa.selftest.case import OESelftestTestCase from oeqa.utils.commands import bitbake, runqemu from oeqa.core.decorator import OETestTag +from oeqa.core.decorator.data import skipIfNotMachine def getline_qemu(out, line): for l in out.split('\n'): @@ -333,6 +334,8 @@ EXTRA_IMAGE_FEATURES += "package-management" self.assertTrue("overlayfs-etc" in res.output, msg=res.output) self.assertTrue("package-management" in res.output, msg=res.output) + # https://bugzilla.yoctoproject.org/show_bug.cgi?id=14963 + @skipIfNotMachine("qemux86-64", "tests are qemux86-64 specific currently") def test_image_feature_is_missing(self): """ Summary: Overlayfs-etc class is not applied when image feature is not set @@ -368,9 +371,11 @@ OVERLAYFS_ETC_DEVICE = "/dev/sda3" line = getline_qemu(output, "upperdir=/data/overlay-etc/upper") self.assertFalse(line, msg=output) + @skipIfNotMachine("qemux86-64", "tests are qemux86-64 specific currently") def test_sbin_init_preinit(self): self.run_sbin_init(False) + @skipIfNotMachine("qemux86-64", "tests are qemux86-64 specific currently") def test_sbin_init_original(self): self.run_sbin_init(True) @@ -419,6 +424,7 @@ OVERLAYFS_ETC_DEVICE = "/dev/sda3" line = getline_qemu(output, testFile) self.assertTrue(line and line.startswith(testFile), msg=output) + @skipIfNotMachine("qemux86-64", "tests are qemux86-64 specific currently") def test_lower_layer_access(self): """ Summary: Test that lower layer of /etc is available read-only when configured From patchwork Wed Nov 9 19:31:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B40D0C4332F for ; Wed, 9 Nov 2022 19:31:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.1503.1668022309000663329 for ; Wed, 09 Nov 2022 11:31:49 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E0CF823A; Wed, 9 Nov 2022 11:31:54 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 49F013F703; Wed, 9 Nov 2022 11:31:48 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 09/15] oeqa/selftest/package: generalise test_gdb_hardlink_debug() Date: Wed, 9 Nov 2022 19:31:29 +0000 Message-Id: <20221109193135.291048-9-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109193135.291048-1-ross.burton@arm.com> References: <20221109193135.291048-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173042 When the trivial test binary, which just calls printf(), is compiled for aarch64 with -O2 -D_FORTIFY=2 (as is the default configuration), gdb resolves main() to the inlined printf() wrapper in stdio2.h instead of main.c, so the test fails. Presumably, this is due to debugging being unreliable with -O2. Solve this problem by not caring where the main() breakpoint resolves to, just check that it was resolved at all. Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/cases/package.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/package.py b/meta/lib/oeqa/selftest/cases/package.py index 2d1b48a15df..482a7c02ad4 100644 --- a/meta/lib/oeqa/selftest/cases/package.py +++ b/meta/lib/oeqa/selftest/cases/package.py @@ -135,8 +135,10 @@ class PackageTests(OESelftestTestCase): self.logger.error("No debugging symbols found. GDB result:\n%s" % output) return False - # Check debugging symbols works correctly - elif re.match(r"Breakpoint 1.*hello\.c.*4", l): + # Check debugging symbols works correctly. Don't look for a + # source file as optimisation can put the breakpoint inside + # stdio.h. + elif "Breakpoint 1 at" in l: return True self.logger.error("GDB result:\n%d: %s", status, output) From patchwork Wed Nov 9 19:31:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15243 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE079C4332F for ; Wed, 9 Nov 2022 19:31:59 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.1536.1668022309658165463 for ; Wed, 09 Nov 2022 11:31:50 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8E5CDD6E; Wed, 9 Nov 2022 11:31:55 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EA6853F703; Wed, 9 Nov 2022 11:31:48 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 10/15] oeqa/selftest/package: improve test_preserve_ownership Date: Wed, 9 Nov 2022 19:31:30 +0000 Message-Id: <20221109193135.291048-10-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109193135.291048-1-ross.burton@arm.com> References: <20221109193135.291048-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173043 This test was failing very oddly in qemuarm64 runs. Rewriting the test to be clearer and less fragile fixed it. Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/cases/package.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/package.py b/meta/lib/oeqa/selftest/cases/package.py index 482a7c02ad4..4f7cd10658a 100644 --- a/meta/lib/oeqa/selftest/cases/package.py +++ b/meta/lib/oeqa/selftest/cases/package.py @@ -153,25 +153,25 @@ class PackageTests(OESelftestTestCase): self.fail('GDB %s failed' % binary) def test_preserve_ownership(self): - import os, stat, oe.cachedpath features = 'IMAGE_INSTALL:append = " selftest-chown"\n' self.write_config(features) bitbake("core-image-minimal") - sysconfdir = get_bb_var('sysconfdir', 'selftest-chown') - def check_ownership(qemu, gid, uid, path): + def check_ownership(qemu, expected_gid, expected_uid, path): self.logger.info("Check ownership of %s", path) - status, output = qemu.run_serial(r'/bin/stat -c "%U %G" ' + path, timeout=60) - output = output.split(" ") - if output[0] != uid or output[1] != gid : - self.logger.error("Incrrect ownership %s [%s:%s]", path, output[0], output[1]) - return False - return True + status, output = qemu.run_serial('stat -c "%U %G" ' + path) + self.assertEqual(status, 1, "stat failed: " + output) + try: + uid, gid = output.split() + self.assertEqual(uid, expected_uid) + self.assertEqual(gid, expected_gid) + except ValueError: + self.fail("Cannot parse output: " + output) + sysconfdir = get_bb_var('sysconfdir', 'selftest-chown') with runqemu('core-image-minimal') as qemu: for path in [ sysconfdir + "/selftest-chown/file", sysconfdir + "/selftest-chown/dir", sysconfdir + "/selftest-chown/symlink", sysconfdir + "/selftest-chown/fifotest/fifo"]: - if not check_ownership(qemu, "test", "test", path): - self.fail('Test ownership %s failed' % path) + check_ownership(qemu, "test", "test", path) From patchwork Wed Nov 9 19:31:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15245 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAD28C4167B for ; Wed, 9 Nov 2022 19:31:59 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.1511.1668022310393784215 for ; Wed, 09 Nov 2022 11:31:50 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 39A8E1FB; Wed, 9 Nov 2022 11:31:56 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 96E6F3F703; Wed, 9 Nov 2022 11:31:49 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 11/15] oeqa/selftest/runqemu: don't hardcode qemux86-64 Date: Wed, 9 Nov 2022 19:31:31 +0000 Message-Id: <20221109193135.291048-11-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109193135.291048-1-ross.burton@arm.com> References: <20221109193135.291048-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173044 Don't hardcode qemux86-64. This has some complications: the IMAGE_FSTYPES needs to be constructed to reflect what the machine can do (only x86 machines can build ISO images), and several tests which need a wic file are currently limited to qemux86-64. Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/cases/runqemu.py | 26 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py index c1d277a095a..58a4526df64 100644 --- a/meta/lib/oeqa/selftest/cases/runqemu.py +++ b/meta/lib/oeqa/selftest/cases/runqemu.py @@ -9,6 +9,7 @@ import tempfile import time import oe.types from oeqa.core.decorator import OETestTag +from oeqa.core.decorator.data import skipIfNotArch, skipIfNotMachine from oeqa.selftest.case import OESelftestTestCase from oeqa.utils.commands import bitbake, runqemu, get_bb_var, runCmd @@ -22,23 +23,25 @@ class RunqemuTests(OESelftestTestCase): def setUpLocal(self): super(RunqemuTests, self).setUpLocal() self.recipe = 'core-image-minimal' - self.machine = 'qemux86-64' - self.fstypes = "ext4 iso hddimg wic.vmdk wic.qcow2 wic.vdi" - self.cmd_common = "runqemu nographic" + self.machine = self.td['MACHINE'] + + self.fstypes = "ext4" + if self.td["HOST_ARCH"] in ('i586', 'i686', 'x86_64'): + self.fstypes += " iso hddimg" + if self.machine == "qemux86-64": + self.fstypes += " wic.vmdk wic.qcow2 wic.vdi" - kvm = oe.types.qemu_use_kvm(get_bb_var('QEMU_USE_KVM'), 'x86_64') + self.cmd_common = "runqemu nographic" + kvm = oe.types.qemu_use_kvm(get_bb_var('QEMU_USE_KVM'), self.td["TARGET_ARCH"]) if kvm: self.cmd_common += " kvm" self.write_config( """ -MACHINE = "%s" IMAGE_FSTYPES = "%s" # 10 means 1 second SYSLINUX_TIMEOUT = "10" -""" -% (self.machine, self.fstypes) - ) +""" % self.fstypes) if not RunqemuTests.image_is_ready: RunqemuTests.deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') @@ -59,6 +62,7 @@ SYSLINUX_TIMEOUT = "10" with open(qemu.qemurunnerlog) as f: self.assertIn('rootfs.ext4', f.read(), "Failed: %s" % cmd) + @skipIfNotArch(['i586', 'i686', 'x86_64']) def test_boot_machine_iso(self): """Test runqemu machine iso""" cmd = "%s %s iso" % (self.cmd_common, self.machine) @@ -73,7 +77,8 @@ SYSLINUX_TIMEOUT = "10" with open(qemu.qemurunnerlog) as f: self.assertTrue(qemu.runner.logged, "Failed: %s, %s" % (cmd, f.read())) - + # https://bugzilla.yoctoproject.org/show_bug.cgi?id=14963 + @skipIfNotMachine("qemux86-64", "tests are qemux86-64 specific currently") def test_boot_recipe_image_vmdk(self): """Test runqemu recipe-image vmdk""" cmd = "%s %s wic.vmdk" % (self.cmd_common, self.recipe) @@ -81,6 +86,7 @@ SYSLINUX_TIMEOUT = "10" with open(qemu.qemurunnerlog) as f: self.assertIn('format=vmdk', f.read(), "Failed: %s" % cmd) + @skipIfNotMachine("qemux86-64", "tests are qemux86-64 specific currently") def test_boot_recipe_image_vdi(self): """Test runqemu recipe-image vdi""" cmd = "%s %s wic.vdi" % (self.cmd_common, self.recipe) @@ -96,6 +102,7 @@ SYSLINUX_TIMEOUT = "10" self.assertTrue(qemu.runner.logged, "Failed: %s, %s" % (cmd, f.read())) + @skipIfNotArch(['i586', 'i686', 'x86_64']) def test_boot_deploy_hddimg(self): """Test runqemu deploy_dir_image hddimg""" cmd = "%s %s hddimg" % (self.cmd_common, self.deploy_dir_image) @@ -110,6 +117,7 @@ SYSLINUX_TIMEOUT = "10" with open(qemu.qemurunnerlog) as f: self.assertIn(' -netdev user', f.read(), "Failed: %s" % cmd) + @skipIfNotMachine("qemux86-64", "tests are qemux86-64 specific currently") def test_boot_machine_slirp_qcow2(self): """Test runqemu machine slirp qcow2""" cmd = "%s slirp wic.qcow2 %s" % (self.cmd_common, self.machine) From patchwork Wed Nov 9 19:31:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15241 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E68EAC43219 for ; Wed, 9 Nov 2022 19:31:59 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.1505.1668022310967994057 for ; Wed, 09 Nov 2022 11:31:51 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DA41F23A; Wed, 9 Nov 2022 11:31:56 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 432613F703; Wed, 9 Nov 2022 11:31:50 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 12/15] oeqa/selftest/runtime_test: only run the virgl tests on qemux86-64 Date: Wed, 9 Nov 2022 19:31:32 +0000 Message-Id: <20221109193135.291048-12-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109193135.291048-1-ross.burton@arm.com> References: <20221109193135.291048-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173045 These tests should be able to work on qemuarm64, but this is untested and the runners will need configuration. Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/cases/runtime_test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py index fe83b248f35..ae797249562 100644 --- a/meta/lib/oeqa/selftest/cases/runtime_test.py +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py @@ -10,7 +10,7 @@ from oeqa.core.decorator import OETestTag import os import tempfile import oe.lsb -from oeqa.core.decorator.data import skipIfNotQemu +from oeqa.core.decorator.data import skipIfNotQemu, skipIfNotMachine class TestExport(OESelftestTestCase): @@ -202,6 +202,8 @@ class TestImage(OESelftestTestCase): bitbake('core-image-full-cmdline socat') bitbake('-c testimage core-image-full-cmdline') + # https://bugzilla.yoctoproject.org/show_bug.cgi?id=14966 + @skipIfNotMachine("qemux86-64", "test needs qemux86-64") def test_testimage_virgl_gtk_sdl(self): """ Summary: Check host-assisted accelerate OpenGL functionality in qemu with gtk and SDL frontends @@ -243,6 +245,7 @@ class TestImage(OESelftestTestCase): bitbake('core-image-minimal') bitbake('-c testimage core-image-minimal') + @skipIfNotMachine("qemux86-64", "test needs qemux86-64") def test_testimage_virgl_headless(self): """ Summary: Check host-assisted accelerate OpenGL functionality in qemu with egl-headless frontend From patchwork Wed Nov 9 19:31:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15242 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB0F1C4321E for ; Wed, 9 Nov 2022 19:31:59 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.1447.1668022311626606594 for ; Wed, 09 Nov 2022 11:31:51 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 86A4B1FB; Wed, 9 Nov 2022 11:31:57 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E3CD83F703; Wed, 9 Nov 2022 11:31:50 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 13/15] oeqa/selftest/wic: skip more tests on aarch64 Date: Wed, 9 Nov 2022 19:31:33 +0000 Message-Id: <20221109193135.291048-13-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109193135.291048-1-ross.burton@arm.com> References: <20221109193135.291048-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173046 test_rawcopy_plugin_qemu and test_wic_image_type are x86-specific currently as the .wks uses x86-specific bootloaders. This can be fixed, but that can come later. Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/cases/wic.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 0d664d7c395..8abe6918f3f 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -817,7 +817,8 @@ class Wic2(WicTestCase): self.resultdir)) self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*direct")))) - @only_for_arch(['i586', 'i686', 'x86_64', 'aarch64']) + # TODO this test could also work on aarch64 + @only_for_arch(['i586', 'i686', 'x86_64']) def test_wic_image_type(self): """Test building wic images by bitbake""" config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\ @@ -1042,7 +1043,8 @@ class Wic2(WicTestCase): size = int(size[:-3]) self.assertGreaterEqual(size, 204800) - @only_for_arch(['i586', 'i686', 'x86_64', 'aarch64']) + # TODO this test could also work on aarch64 + @only_for_arch(['i586', 'i686', 'x86_64']) @OETestTag("runqemu") def test_rawcopy_plugin_qemu(self): """Test rawcopy plugin in qemu""" From patchwork Wed Nov 9 19:31:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15244 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4339C43217 for ; Wed, 9 Nov 2022 19:31:59 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.1512.1668022312434952713 for ; Wed, 09 Nov 2022 11:31:52 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 573701FB; Wed, 9 Nov 2022 11:31:58 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 906233F703; Wed, 9 Nov 2022 11:31:51 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 14/15] oeqa/selftest/wic: use skipIfNotArch instead of custom decorator Date: Wed, 9 Nov 2022 19:31:34 +0000 Message-Id: <20221109193135.291048-14-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109193135.291048-1-ross.burton@arm.com> References: <20221109193135.291048-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173047 There's now a shared decorator for architecture skipping, so use that. Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/cases/wic.py | 57 ++++++++++------------------- 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 8abe6918f3f..ca1abb970a3 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -15,33 +15,14 @@ import hashlib from glob import glob from shutil import rmtree, copy -from functools import wraps, lru_cache from tempfile import NamedTemporaryFile from oeqa.selftest.case import OESelftestTestCase from oeqa.core.decorator import OETestTag +from oeqa.core.decorator.data import skipIfNotArch from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu -@lru_cache() -def get_host_arch(): - return get_bb_var('HOST_ARCH') - - -def only_for_arch(archs): - """Decorator for wrapping test cases that can be run only for specific target - architectures. A list of compatible architectures is passed in `archs`. - """ - def wrapper(func): - @wraps(func) - def wrapped_f(*args, **kwargs): - arch = get_host_arch() - if archs and arch not in archs: - raise unittest.SkipTest("Testcase arch dependency not met: %s" % arch) - return func(*args, **kwargs) - return wrapped_f - return wrapper - def extract_files(debugfs_output): """ extract file names from the output of debugfs -R 'ls -p', @@ -171,14 +152,14 @@ class Wic(WicTestCase): runCmd(cmd) self.assertEqual(1, len(glob(os.path.join (self.resultdir, "wictestdisk-*.direct")))) - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) def test_gpt_image(self): """Test creation of core-image-minimal with gpt table and UUID boot""" cmd = "wic create directdisk-gpt --image-name core-image-minimal -o %s" % self.resultdir runCmd(cmd) self.assertEqual(1, len(glob(os.path.join(self.resultdir, "directdisk-*.direct")))) - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) def test_iso_image(self): """Test creation of hybrid iso image with legacy and EFI boot""" config = 'INITRAMFS_IMAGE = "core-image-minimal-initramfs"\n'\ @@ -192,21 +173,21 @@ class Wic(WicTestCase): self.assertEqual(1, len(glob(os.path.join(self.resultdir, "HYBRID_ISO_IMG-*.direct")))) self.assertEqual(1, len(glob(os.path.join (self.resultdir, "HYBRID_ISO_IMG-*.iso")))) - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) def test_qemux86_directdisk(self): """Test creation of qemux-86-directdisk image""" cmd = "wic create qemux86-directdisk -e core-image-minimal -o %s" % self.resultdir runCmd(cmd) self.assertEqual(1, len(glob(os.path.join(self.resultdir, "qemux86-directdisk-*direct")))) - @only_for_arch(['i586', 'i686', 'x86_64', 'aarch64']) + @skipIfNotArch(['i586', 'i686', 'x86_64', 'aarch64']) def test_mkefidisk(self): """Test creation of mkefidisk image""" cmd = "wic create mkefidisk -e core-image-minimal -o %s" % self.resultdir runCmd(cmd) self.assertEqual(1, len(glob(os.path.join(self.resultdir, "mkefidisk-*direct")))) - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) def test_bootloader_config(self): """Test creation of directdisk-bootloader-config image""" config = 'DEPENDS:pn-core-image-minimal += "syslinux"\n' @@ -217,7 +198,7 @@ class Wic(WicTestCase): runCmd(cmd) self.assertEqual(1, len(glob(os.path.join(self.resultdir, "directdisk-bootloader-config-*direct")))) - @only_for_arch(['i586', 'i686', 'x86_64', 'aarch64']) + @skipIfNotArch(['i586', 'i686', 'x86_64', 'aarch64']) def test_systemd_bootdisk(self): """Test creation of systemd-bootdisk image""" config = 'MACHINE_FEATURES:append = " efi"\n' @@ -248,7 +229,7 @@ class Wic(WicTestCase): self.assertEqual(1, len(glob(os.path.join(self.resultdir, "sdimage-bootpart-*direct")))) # TODO this doesn't have to be x86-specific - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) def test_default_output_dir(self): """Test default output location""" for fname in glob("directdisk-*.direct"): @@ -261,7 +242,7 @@ class Wic(WicTestCase): runCmd(cmd) self.assertEqual(1, len(glob("directdisk-*.direct"))) - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) def test_build_artifacts(self): """Test wic create directdisk providing all artifacts.""" bb_vars = get_bb_vars(['STAGING_DATADIR', 'RECIPE_SYSROOT_NATIVE'], @@ -353,7 +334,7 @@ class Wic(WicTestCase): self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct")))) # TODO this doesn't have to be x86-specific - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) def test_rootfs_indirect_recipes(self): """Test usage of rootfs plugin with rootfs recipes""" runCmd("wic create directdisk-multi-rootfs " @@ -364,7 +345,7 @@ class Wic(WicTestCase): self.assertEqual(1, len(glob(os.path.join(self.resultdir, "directdisk-multi-rootfs*.direct")))) # TODO this doesn't have to be x86-specific - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) def test_rootfs_artifacts(self): """Test usage of rootfs plugin with rootfs paths""" bb_vars = get_bb_vars(['STAGING_DATADIR', 'RECIPE_SYSROOT_NATIVE'], @@ -818,7 +799,7 @@ class Wic2(WicTestCase): self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*direct")))) # TODO this test could also work on aarch64 - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) def test_wic_image_type(self): """Test building wic images by bitbake""" config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\ @@ -838,7 +819,7 @@ class Wic2(WicTestCase): self.assertTrue(os.path.isfile(os.path.realpath(path))) # TODO this should work on aarch64 - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) @OETestTag("runqemu") def test_qemu(self): """Test wic-image-minimal under qemu""" @@ -859,7 +840,7 @@ class Wic2(WicTestCase): self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) self.assertEqual(output, 'UUID=2c71ef06-a81d-4735-9d3a-379b69c6bdba\t/media\text4\tdefaults\t0\t0') - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) @OETestTag("runqemu") def test_qemu_efi(self): """Test core-image-minimal efi image under qemu""" @@ -1044,7 +1025,7 @@ class Wic2(WicTestCase): self.assertGreaterEqual(size, 204800) # TODO this test could also work on aarch64 - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) @OETestTag("runqemu") def test_rawcopy_plugin_qemu(self): """Test rawcopy plugin in qemu""" @@ -1111,7 +1092,7 @@ class Wic2(WicTestCase): result = runCmd("wic ls %s -n %s | awk -F ' ' '{print $1 \" \" $5}' | grep '^2' | wc -w" % (image_path, sysroot)) self.assertEqual('1', result.output) - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) @OETestTag("runqemu") def test_biosplusefi_plugin_qemu(self): """Test biosplusefi plugin in qemu""" @@ -1144,7 +1125,7 @@ class Wic2(WicTestCase): self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) self.assertEqual(output, '*') - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) def test_biosplusefi_plugin(self): """Test biosplusefi plugin""" # Wic generation below may fail depending on the order of the unittests @@ -1171,7 +1152,7 @@ class Wic2(WicTestCase): self.assertEqual(1, len(out)) # TODO this test could also work on aarch64 - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) @OETestTag("runqemu") def test_efi_plugin_unified_kernel_image_qemu(self): """Test efi plugin's Unified Kernel Image feature in qemu""" @@ -1289,7 +1270,7 @@ class Wic2(WicTestCase): out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname)) self.assertEqual(1, len(out)) - @only_for_arch(['i586', 'i686', 'x86_64']) + @skipIfNotArch(['i586', 'i686', 'x86_64']) @OETestTag("runqemu") def test_expand_mbr_image(self): """Test wic write --expand command for mbr image""" From patchwork Wed Nov 9 19:31:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 15240 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA116C433FE for ; Wed, 9 Nov 2022 19:31:59 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.1542.1668022313087574989 for ; Wed, 09 Nov 2022 11:31:53 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0380323A; Wed, 9 Nov 2022 11:31:59 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 60A9D3F703; Wed, 9 Nov 2022 11:31:52 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 15/15] classes/testexport: move to classes-recipe Date: Wed, 9 Nov 2022 19:31:35 +0000 Message-Id: <20221109193135.291048-15-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109193135.291048-1-ross.burton@arm.com> References: <20221109193135.291048-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Nov 2022 19:31:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173048 This class should be in classes-recipe as, like testimage, it is specific to image recipes. This also solves a regression where simply IMAGE_CLASSES += "testexport" doesn't work if testimage isn't already in IMAGE_CLASSES. The testexport class adds testimage to IMAGE_CLASSES, but by this point it's too late. Now that the class can only be inherited via IMAGE_CLASSES, we can simply inherit testimage directly. Signed-off-by: Ross Burton --- meta/{classes => classes-recipe}/testexport.bbclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename meta/{classes => classes-recipe}/testexport.bbclass (98%) diff --git a/meta/classes/testexport.bbclass b/meta/classes-recipe/testexport.bbclass similarity index 98% rename from meta/classes/testexport.bbclass rename to meta/classes-recipe/testexport.bbclass index f7c5242dc5e..0f0c56107f8 100644 --- a/meta/classes/testexport.bbclass +++ b/meta/classes-recipe/testexport.bbclass @@ -7,12 +7,14 @@ # To use it add testexport to global inherit and call your target image with -c testexport # You can try it out like this: # - First build an image. i.e. core-image-sato -# - Add INHERIT += "testexport" in local.conf +# - Add IMAGE_CLASSES += "testexport" in local.conf # - Then bitbake core-image-sato -c testexport. That will generate the directory structure # to execute the runtime tests using runexported.py. # # For more information on TEST_SUITES check testimage class. +inherit testimage + TEST_LOG_DIR ?= "${WORKDIR}/testexport" TEST_EXPORT_DIR ?= "${TMPDIR}/testexport/${PN}" TEST_EXPORT_PACKAGED_DIR ?= "packages/packaged" @@ -176,5 +178,3 @@ def testexport_create_tarball(d, tar_name, src_dir): tar.add(base_name) tar.close() os.chdir(current_dir) - -IMAGE_CLASSES += "testimage"