From patchwork Fri Oct 3 21:12:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 71615 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 DDEE7CAC5B0 for ; Fri, 3 Oct 2025 21:13:15 +0000 (UTC) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mx.groups.io with SMTP id smtpd.web10.1516.1759525994078114936 for ; Fri, 03 Oct 2025 14:13:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=1nPcEfwj; spf=pass (domain: smile.fr, ip: 209.85.167.50, mailfrom: yoann.congal@smile.fr) Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-57ea78e0618so3015465e87.0 for ; Fri, 03 Oct 2025 14:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1759525992; x=1760130792; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=v2MVppYAz04Vbs+gxMbvw4m3OMzsWK5Ppm2Dwu0KOtA=; b=1nPcEfwjbTUChxFWyBXGI01B9aS3nUphJVjwuvUYkD2rUddik/WiwTpEBGmxAQXhDa sy1qEO3X6qTD5DB5FKNuhISyZYcPhOpJN6yLQPYsQRx16b7c8k8Awk346PlSiUfIY58h RVjvGVdX1JrRzUP4A4IKMiZckapaZvRFeHrvk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759525992; x=1760130792; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from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Vgrru3EevX40QkOw== X-Google-Smtp-Source: AGHT+IFIg6gCPUQqswpM1ic87sP+GAC4JaToPYAE500PH6MFsx2kAGK9+UgVoWG8rR7CRliEHToqBQ== X-Received: by 2002:a05:6512:3b88:b0:578:4239:162e with SMTP id 2adb3069b0e04-58cb96627d3mr1428871e87.11.1759525991530; Fri, 03 Oct 2025 14:13:11 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.local (2a01cb001331aa0036c6349435ab0707.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:36c6:3494:35ab:707]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-58b0119e878sm2168290e87.99.2025.10.03.14.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Oct 2025 14:13:11 -0700 (PDT) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [PATCH 1/2] oeqa/selftest/wic: fix PATH for wic.Wic2.test_extra_partition_space Date: Fri, 3 Oct 2025 23:12:47 +0200 Message-Id: <20251003211248.1660154-1-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 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 ; Fri, 03 Oct 2025 21:13:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224423 From: Yoann Congal Without importing PATH from the wic-tools recipes, the build host PATH is used and this test may fail depending on tools (parted, dumpe2fs, ...) availability. This triggers build faillure on AB (e.g. [0]) To fix this, import PATH from wic-tools and ensure the original environment is restored after. Since this indent a block of code into a try/finally block, here is the diff ignoring white spaces change: diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index b1c318bd4e..34d844b90b 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -1331,0 +1332,4 @@ + oldpath = os.environ['PATH'] + os.environ['PATH'] = get_bb_var("PATH", "wic-tools") + + try: @@ -1366,0 +1371,2 @@ + finally: + os.environ['PATH'] = oldpath [0]: https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/2456 Signed-off-by: Yoann Congal --- meta/lib/oeqa/selftest/cases/wic.py | 74 ++++++++++++++++------------- 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 1b59980f1c..bff3842305 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -1330,41 +1330,47 @@ run_wic_cmd() { def test_extra_partition_space(self): native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "wic-tools") - with NamedTemporaryFile("w", suffix=".wks") as tempf: - tempf.write("bootloader --ptable gpt\n" \ - "part --ondisk hda --size 10M --extra-partition-space 10M --fstype=ext4\n" \ - "part --ondisk hda --fixed-size 20M --extra-partition-space 10M --fstype=ext4\n" \ - "part --source rootfs --ondisk hda --extra-partition-space 10M --fstype=ext4\n" \ - "part --source rootfs --ondisk hda --fixed-size 200M --extra-partition-space 10M --fstype=ext4\n") - tempf.flush() - - _, wicimg = self._get_wic(tempf.name) - - res = runCmd("parted -m %s unit b p" % wicimg, - native_sysroot=native_sysroot, stderr=subprocess.PIPE) - - # parse parted output which looks like this: - # BYT;\n - # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n - # 1:0.00MiB:200MiB:200MiB:ext4::;\n - partlns = res.output.splitlines()[2:] - - self.assertEqual(4, len(partlns)) + oldpath = os.environ['PATH'] + os.environ['PATH'] = get_bb_var("PATH", "wic-tools") - # Test for each partitions that the extra part space exists - for part in range(0, len(partlns)): - part_file = os.path.join(self.resultdir, "selftest_img.part%d" % (part + 1)) - partln = partlns[part].split(":") - self.assertEqual(7, len(partln)) - self.assertRegex(partln[3], r'^[0-9]+B$') - part_size = int(partln[3].rstrip("B")) - start = int(partln[1].rstrip("B")) / 512 - length = part_size / 512 - runCmd("dd if=%s of=%s skip=%d count=%d" % - (wicimg, part_file, start, length)) - res = runCmd("dumpe2fs %s -h | grep \"^Block count\"" % part_file) - fs_size = int(res.output.split(":")[1].strip()) * 1024 - self.assertLessEqual(fs_size + 10485760, part_size, "part file: %s" % part_file) + try: + with NamedTemporaryFile("w", suffix=".wks") as tempf: + tempf.write("bootloader --ptable gpt\n" \ + "part --ondisk hda --size 10M --extra-partition-space 10M --fstype=ext4\n" \ + "part --ondisk hda --fixed-size 20M --extra-partition-space 10M --fstype=ext4\n" \ + "part --source rootfs --ondisk hda --extra-partition-space 10M --fstype=ext4\n" \ + "part --source rootfs --ondisk hda --fixed-size 200M --extra-partition-space 10M --fstype=ext4\n") + tempf.flush() + + _, wicimg = self._get_wic(tempf.name) + + res = runCmd("parted -m %s unit b p" % wicimg, + native_sysroot=native_sysroot, stderr=subprocess.PIPE) + + # parse parted output which looks like this: + # BYT;\n + # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n + # 1:0.00MiB:200MiB:200MiB:ext4::;\n + partlns = res.output.splitlines()[2:] + + self.assertEqual(4, len(partlns)) + + # Test for each partitions that the extra part space exists + for part in range(0, len(partlns)): + part_file = os.path.join(self.resultdir, "selftest_img.part%d" % (part + 1)) + partln = partlns[part].split(":") + self.assertEqual(7, len(partln)) + self.assertRegex(partln[3], r'^[0-9]+B$') + part_size = int(partln[3].rstrip("B")) + start = int(partln[1].rstrip("B")) / 512 + length = part_size / 512 + runCmd("dd if=%s of=%s skip=%d count=%d" % + (wicimg, part_file, start, length)) + res = runCmd("dumpe2fs %s -h | grep \"^Block count\"" % part_file) + fs_size = int(res.output.split(":")[1].strip()) * 1024 + self.assertLessEqual(fs_size + 10485760, part_size, "part file: %s" % part_file) + finally: + os.environ['PATH'] = oldpath # TODO this test could also work on aarch64 @skipIfNotArch(['i586', 'i686', 'x86_64']) From patchwork Fri Oct 3 21:12:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 71616 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 BB41DCCA471 for ; Fri, 3 Oct 2025 21:13:25 +0000 (UTC) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by mx.groups.io with SMTP id smtpd.web10.1517.1759525997102333970 for ; Fri, 03 Oct 2025 14:13:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=Rjb7o8K9; spf=pass (domain: smile.fr, ip: 209.85.167.46, mailfrom: yoann.congal@smile.fr) Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-579363a4602so3067710e87.0 for ; Fri, 03 Oct 2025 14:13:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1759525995; x=1760130795; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Rc0XCps5B1s0XG2Avi159tsyyRp3Zc9rAppmgEoq4S8=; b=Rjb7o8K9KqasWRwIsImOyRuKthUrzqnSyojtQncpEuQv9o2iZRlF/nerZ69atUwFag C1KJdTDz+YSZL0z44XMy0Qq63GfIBVvhWxSDPG9Woh2e/I44pIZcVxeGNDK2dFlYBNL3 RbFVhuRo3OBDsphhPI8oyjCcu9E68soGQVQ+Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759525995; x=1760130795; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rc0XCps5B1s0XG2Avi159tsyyRp3Zc9rAppmgEoq4S8=; b=trW3ufqpfOW6+32sAD6/qxvCPEA9gfkG4yGUWFH1BHAQOUnfnGGJLBxEjrWJBdh4xs s6J0sjbxc+ARAddL71S7q0ShNUGcO3N3noEqIZ20QW6Nds3i2+yxjaMPsXockNKBpvIx 6kegMc9i760gGS0eLGDqElucgFzQapaDNpWH8uPp3wuI+RMkKrTQPOF9OAehT7FHk3wy ir+L3fFGoTYt0kL/aGvebjOZ3+h8LeUGXrofeRnIAPtn7d2GGYACUVestODCLOCMYNzG X5tcPsK8K+/F+VyQIrso+yN7guboR/a3PGrKvdblTfv8XSfPjxxdwqo+TZFMZZsxp5nq jjmQ== X-Gm-Message-State: AOJu0YyVDHyaEVh6G79nm/vx8YNNBYvbPIWbeI/JFzNjMJ9ScE6utyL3 Zj+luxM/YPC4KFGp0DNy4jQiOEPfw2LAFuLobjC/iV+FlFUFeVIP3osYSaQ7IRlTdKpPgLvuyuP A298J+9Y= X-Gm-Gg: ASbGncs4HP+0aFECDMV6Gayucr8+b3DnpClh2lyRxKYrYGFUBUpBtV7bS6gwFIrg7M6 EV+2ds/eWnY4Cy4qOOAfhS8mgCB3HSqPDTzgo6T4a0TDKFlce98qLqIRcnVamm7rcWsFtbWeGIG 1f6XUI2Rz3l7O3Q/AEfhu/rwK456VaWCGbcNfVfAuIdVseNpeTjTg/9cWjre7sop7kpaeAjm2rG tV833+GeUHCcb9NgMvCfqDCwKgBGqKKV4jWQ5O45EbDQGc/YoN/Ovth9mJOCr+XTnXUAyO5L9vi xRXeGZOn/Z10sL7/fBBT0Sqtvyrj3cQwp+RmhuoZ1tdUvOYzLV5DacwNcQsPwSlKm//qrqKBXos 4w/mx2mRs2PJnsU1VZqhSFne3r5G7wCTY1nSQ1eGLw9a4bzNNlcM8BlF0cywQhIK1mO51rFHlD5 RsuiXM32djt78vQYgHLzNFLYRGi66zF9TBzcVxEpWhkkv2nZ1tNsgBwA== X-Google-Smtp-Source: AGHT+IFFXYhO1Krhft9purPGTG/8bG0rNnnrz0I5NQIvD2lNu3UFEWuLUZeccPt5kFxh1tTY9njA2w== X-Received: by 2002:a05:6512:3c91:b0:57a:7467:8898 with SMTP id 2adb3069b0e04-58cbb90de23mr1380588e87.38.1759525994879; Fri, 03 Oct 2025 14:13:14 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.local (2a01cb001331aa0036c6349435ab0707.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:36c6:3494:35ab:707]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-58b0119e878sm2168290e87.99.2025.10.03.14.13.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Oct 2025 14:13:14 -0700 (PDT) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [PATCH 2/2 master-next] oeqa/selftest/wic: fix PATH for wic.Wic2.test_extra_partition_plugin Date: Fri, 3 Oct 2025 23:12:48 +0200 Message-Id: <20251003211248.1660154-2-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251003211248.1660154-1-yoann.congal@smile.fr> References: <20251003211248.1660154-1-yoann.congal@smile.fr> 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 ; Fri, 03 Oct 2025 21:13:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224424 From: Yoann Congal Without importing PATH from the wic-tools recipes, the build host PATH is used and this test may fail depending on tools (parted, dumpe2fs, ...) availability. This triggers build faillure on AB (e.g. [0]) To fix this, import PATH from wic-tools and ensure the original environment is restored after. Since this indent a block of code into a try/finally block, here is the diff ignoring white spaces change: diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index bff3842305..bc99673d0d 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -1680,0 +1681,4 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot" + oldpath = os.environ['PATH'] + os.environ['PATH'] = get_bb_var("PATH", "wic-tools") + + try: @@ -1696,0 +1701,3 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot" + finally: + os.environ['PATH'] = oldpath + [0]: https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/2456 Signed-off-by: Yoann Congal --- meta/lib/oeqa/selftest/cases/wic.py | 31 ++++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index bff3842305..bc99673d0d 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -1678,21 +1678,28 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot" testfile.write("test") testfile.close() - with NamedTemporaryFile("w", suffix=".wks") as wks: - wks.writelines(['part / --source extra_partition --ondisk sda --fstype=ext4 --label foo --align 4 --size 5M\n', - 'part / --source extra_partition --ondisk sda --fstype=ext4 --uuid e7d0824e-cda3-4bed-9f54-9ef5312d105d --align 4 --size 5M\n', - 'part / --source extra_partition --ondisk sda --fstype=ext4 --label bar --align 4 --size 5M\n']) - wks.flush() - _, wicimg = self._get_wic(wks.name) + oldpath = os.environ['PATH'] + os.environ['PATH'] = get_bb_var("PATH", "wic-tools") + + try: + with NamedTemporaryFile("w", suffix=".wks") as wks: + wks.writelines(['part / --source extra_partition --ondisk sda --fstype=ext4 --label foo --align 4 --size 5M\n', + 'part / --source extra_partition --ondisk sda --fstype=ext4 --uuid e7d0824e-cda3-4bed-9f54-9ef5312d105d --align 4 --size 5M\n', + 'part / --source extra_partition --ondisk sda --fstype=ext4 --label bar --align 4 --size 5M\n']) + wks.flush() + _, wicimg = self._get_wic(wks.name) - result = runCmd("wic ls %s | wc -l" % wicimg) - self.assertEqual('4', result.output, msg="Expect 3 partitions, not %s" % result.output) + result = runCmd("wic ls %s | wc -l" % wicimg) + self.assertEqual('4', result.output, msg="Expect 3 partitions, not %s" % result.output) - for part, file in enumerate(["foo.conf", "foobar.conf", "bar.conf"]): - result = runCmd("wic ls %s:%d | grep -q \"%s\"" % (wicimg, part + 1, file)) - self.assertEqual(0, result.status, msg="File '%s' not found in the partition #%d" % (file, part)) + for part, file in enumerate(["foo.conf", "foobar.conf", "bar.conf"]): + result = runCmd("wic ls %s:%d | grep -q \"%s\"" % (wicimg, part + 1, file)) + self.assertEqual(0, result.status, msg="File '%s' not found in the partition #%d" % (file, part)) - self.remove_config(config) + self.remove_config(config) + + finally: + os.environ['PATH'] = oldpath def test_fs_types(self): """Test filesystem types for empty and not empty partitions"""