From patchwork Mon Jun 21 20:25:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1495311 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G81Jg6wjvz9sTD for ; Tue, 22 Jun 2021 06:26:27 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 7A361403F9; Mon, 21 Jun 2021 20:26:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id anE96cfuecLc; Mon, 21 Jun 2021 20:26:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id CE39B404D7; Mon, 21 Jun 2021 20:26:23 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id EB8941C113E for ; Mon, 21 Jun 2021 20:25:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id DACF7608DA for ; Mon, 21 Jun 2021 20:25:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YM258JNorWgq for ; Mon, 21 Jun 2021 20:25:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by smtp3.osuosl.org (Postfix) with ESMTPS id 100EA6089B for ; Mon, 21 Jun 2021 20:25:56 +0000 (UTC) Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id CAB7F1BF206; Mon, 21 Jun 2021 20:25:54 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Mon, 21 Jun 2021 22:25:45 +0200 Message-Id: <20210621202547.360391-3-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621202547.360391-1-thomas.petazzoni@bootlin.com> References: <20210621202547.360391-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/4] support/testing/tests: fix tests to use infra.img_round_power2() X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Jeremy Connat , Ricardo Martincoski Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" All the tests that are using if=sd as a Qemu options are changed to use infra.img_round_power2() instead of simply extending the size of the image to the next MB boundary, which is not longer sufficient with Qemu >= 5.1. Signed-off-by: Thomas Petazzoni --- support/testing/tests/core/test_file_capabilities.py | 2 +- support/testing/tests/fs/test_squashfs.py | 2 +- support/testing/tests/init/base.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/support/testing/tests/core/test_file_capabilities.py b/support/testing/tests/core/test_file_capabilities.py index b9ece18d7b..bd46f5138d 100644 --- a/support/testing/tests/core/test_file_capabilities.py +++ b/support/testing/tests/core/test_file_capabilities.py @@ -28,7 +28,7 @@ class TestFileCapabilities(infra.basetest.BRTest): def test_run(self): img = os.path.join(self.builddir, "images", "rootfs.squashfs") - subprocess.call(["truncate", "-s", "%1M", img]) + infra.img_round_power2(img) self.emulator.boot(arch="armv7", kernel=os.path.join(self.builddir, "images", "zImage"), diff --git a/support/testing/tests/fs/test_squashfs.py b/support/testing/tests/fs/test_squashfs.py index 234f4944be..7d6297ec5e 100644 --- a/support/testing/tests/fs/test_squashfs.py +++ b/support/testing/tests/fs/test_squashfs.py @@ -22,7 +22,7 @@ class TestSquashfs(infra.basetest.BRTest): self.assertEqual(out[3], "Compression lz4") img = os.path.join(self.builddir, "images", "rootfs.squashfs") - subprocess.call(["truncate", "-s", "%1M", img]) + infra.img_round_power2(img) self.emulator.boot(arch="armv7", kernel="builtin", diff --git a/support/testing/tests/init/base.py b/support/testing/tests/init/base.py index 75cfbe9c59..7ed035263b 100644 --- a/support/testing/tests/init/base.py +++ b/support/testing/tests/init/base.py @@ -7,7 +7,7 @@ class InitSystemBase(infra.basetest.BRTest): def start_emulator(self, fs_type, kernel=None, dtb=None, init=None): img = os.path.join(self.builddir, "images", "rootfs.{}".format(fs_type)) - subprocess.call(["truncate", "-s", "%1M", img]) + infra.img_round_power2(img) options = ["-drive", "file={},if=sd,format=raw".format(img),