From patchwork Mon Jun 7 20:42:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1488981 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=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 4FzQLx20LVz9sRK for ; Tue, 8 Jun 2021 06:43:37 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8ACF340201; Mon, 7 Jun 2021 20:43:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ugVzjX-HxelG; Mon, 7 Jun 2021 20:43:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 672544026F; Mon, 7 Jun 2021 20:43:30 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 336DE1BF973 for ; Mon, 7 Jun 2021 20:42:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 21A1A402D9 for ; Mon, 7 Jun 2021 20:42:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0t2peDXiWthV for ; Mon, 7 Jun 2021 20:42:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by smtp4.osuosl.org (Postfix) with ESMTPS id 11F43402A5 for ; Mon, 7 Jun 2021 20:42:30 +0000 (UTC) Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 196D62000C; Mon, 7 Jun 2021 20:42:29 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Mon, 7 Jun 2021 22:42:20 +0200 Message-Id: <20210607204221.124908-6-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210607204221.124908-1-thomas.petazzoni@bootlin.com> References: <20210607204221.124908-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 5/5] support/testing/tests/package/test_bmap_tools: add test for host bmap-tools 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 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Thomas Petazzoni --- .../testing/tests/package/test_bmap_tools.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/support/testing/tests/package/test_bmap_tools.py b/support/testing/tests/package/test_bmap_tools.py index 6f3a8cc072..c49975e11e 100644 --- a/support/testing/tests/package/test_bmap_tools.py +++ b/support/testing/tests/package/test_bmap_tools.py @@ -1,5 +1,6 @@ import os import infra +import subprocess from infra.basetest import BRTest @@ -57,3 +58,31 @@ class TestPy3BmapTools(TestBmapTools): """ BR2_PACKAGE_PYTHON3=y """ + + +class TestHostBmapTools(BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ + """ + BR2_PACKAGE_HOST_BMAP_TOOLS=y + # BR2_TARGET_ROOTFS_TAR is not set + BR2_TARGET_ROOTFS_EXT2=y + """ + + def test_run(self): + cmd = [os.path.join(self.b.builddir, "host", "bin", "bmaptool"), + "create", + "-o", os.path.join(self.b.builddir, "images", "rootfs.ext2.bmap"), + os.path.join(self.b.builddir, "images", "rootfs.ext2")] + ret = subprocess.call(cmd, + stdout=self.b.logfile, + stderr=self.b.logfile) + self.assertEqual(ret, 0) + + cmd = [os.path.join(self.b.builddir, "host", "bin", "bmaptool"), + "copy", + os.path.join(self.b.builddir, "images", "rootfs.ext2"), + os.path.join(self.b.builddir, "images", "rootfs.ext2.copy")] + ret = subprocess.call(cmd, + stdout=self.b.logfile, + stderr=self.b.logfile) + self.assertEqual(ret, 0)