From patchwork Sun Jul 17 14:44:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Vincent_Stehl=C3=A9?= X-Patchwork-Id: 1657231 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=buildroot.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lm7DW6CfBz9sB4 for ; Mon, 18 Jul 2022 00:45:15 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 59FDD60B2F; Sun, 17 Jul 2022 14:45:13 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 59FDD60B2F 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 jDP-jDrlxG18; Sun, 17 Jul 2022 14:45:12 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 6F2B9606EC; Sun, 17 Jul 2022 14:45:11 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 6F2B9606EC X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 529531BF281 for ; Sun, 17 Jul 2022 14:45:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 350B282983 for ; Sun, 17 Jul 2022 14:45:10 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 350B282983 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z_J56Eqs8p8u for ; Sun, 17 Jul 2022 14:45:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 5EFDF82605 Received: from smtp-outgoing-2003.laposte.net (smtp-outgoing-2003.laposte.net [160.92.124.110]) by smtp1.osuosl.org (Postfix) with ESMTPS id 5EFDF82605 for ; Sun, 17 Jul 2022 14:45:07 +0000 (UTC) X-mail-filterd: {"version":"1.4.3", "queueID":"4Lm7DD5mxVz1spV6", "contextId":"5d336687-2239-42df-b051-ccdf20d0bbd1"} Received: from outgoing-mail.laposte.net (localhost.localdomain [127.0.0.1]) by mlpnf0111.laposte.net (SMTP Server) with ESMTP id 4Lm7DD5mxVz1spV6; Sun, 17 Jul 2022 16:45:00 +0200 (CEST) X-mail-filterd: {"version":"1.4.3", "queueID":"4Lm7DD4ZzPz1spTs", "contextId":"a95508a5-33e7-4c27-bb6b-4ffac63488d2"} X-lpn-mailing: LEGIT X-lpn-spamrating: 46 X-lpn-spamlevel: not-spam Received: from romuald.bergerie (unknown [88.169.129.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mlpnf0111.laposte.net (SMTP Server) with ESMTPSA id 4Lm7DD4ZzPz1spTs; Sun, 17 Jul 2022 16:45:00 +0200 (CEST) Received: from radicelle.bergerie (radicelle.bergerie [192.168.124.12]) by romuald.bergerie (Postfix) with ESMTP id 580D84BB02CF; Sun, 17 Jul 2022 16:45:00 +0200 (CEST) Received: from vincent by radicelle.bergerie with local (Exim 4.96) (envelope-from ) id 1oD5Vu-0006Mx-07; Sun, 17 Jul 2022 16:44:54 +0200 To: buildroot@buildroot.org Date: Sun, 17 Jul 2022 16:44:41 +0200 Message-Id: <20220717144441.24477-1-vincent.stehle@laposte.net> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=laposte.net; s=lpn-wlmd; t=1658069105; bh=133ELLkYtIfjLyUbFIpv3gEc0yhXYgz3QnVB4aE7Pes=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type:Content-Transfer-Encoding; b=fZTKmqoalCnf2gWFieiICspqM2ppDCtFXptOZp61mO7RnaRYDAegCQzZ3i6JZn16PZPhdnc6z0rf6oAfGsbNLRxL4g8NzGf5QlLD6+Ox8CheC5FB7lMyexVY/cvpi1jbMJhYJKrEOp05Lq2xwxhUzsgDatycIsWOygBEmB7popVs8ZfTSXJyFXLm8HN9rOLzrrXkmviVRtL2xryDRpjbyDBI/APnYJN6WOs2jTOUbuaOXHdA7HsK48UcDPD0GzsI4sCAmjkikTDtrsHuj7ZB/u5BhFWdhtKyY6QdCyFwja+2mZUZf0QeKYNH9N2KvtS4+gl8FRiVSeXQH0PAIe64/g==; X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=laposte.net header.i=@laposte.net header.a=rsa-sha256 header.s=lpn-wlmd header.b=fZTKmqoa Subject: [Buildroot] [PATCH] support/testing: add test for lzop X-BeenThere: buildroot@buildroot.org 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: , X-Patchwork-Original-From: =?utf-8?q?Vincent_Stehl=C3=A9_via_buildroot?= From: =?utf-8?q?Vincent_Stehl=C3=A9?= Reply-To: =?utf-8?q?Vincent_Stehl=C3=A9?= Cc: =?utf-8?q?Vincent_Stehl=C3=A9?= Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Add a simple compress-uncompress test to verify that lzop is working. Signed-off-by: Vincent Stehlé Cc: Peter Korsgaard --- Hi, I have verified that this test works fine locally and on gitlab. Peter, please do not hesitate to let me know about any feedback, and if this test should be assigned to you in DEVELOPERS instead. I am adding myself by default to make sure the test is not orphaned. Best regards, Vincent. DEVELOPERS | 1 + support/testing/tests/package/test_lzop.py | 38 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 support/testing/tests/package/test_lzop.py diff --git a/DEVELOPERS b/DEVELOPERS index 5c3c24ff7a..644711c5f4 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2919,6 +2919,7 @@ F: package/i7z/ F: package/msr-tools/ F: package/pixz/ F: package/zerofree/ +F: support/testing/tests/package/test_lzop.py F: support/testing/tests/package/test_msr_tools* F: support/testing/tests/package/test_pixz.py F: support/testing/tests/package/test_zerofree.py diff --git a/support/testing/tests/package/test_lzop.py b/support/testing/tests/package/test_lzop.py new file mode 100644 index 0000000000..b5479a25d5 --- /dev/null +++ b/support/testing/tests/package/test_lzop.py @@ -0,0 +1,38 @@ +import os + +import infra.basetest + + +class TestLzop(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ + """ + BR2_PACKAGE_LZOP=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def test_run(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv5", + kernel="builtin", + options=["-initrd", cpio_file]) + self.emulator.login() + + # Prepare input file with random data and zeroes. + # We keep the size small (4 MB) for the sake of test time. + cmd = "dd if=/dev/urandom of=orig bs=1M count=2 && " \ + "dd if=/dev/zero of=orig bs=1M count=2 seek=2" + self.assertRunOk(cmd) + + # Compress. + self.assertRunOk("lzop -v -o compressed.lzo orig", timeout=60) + + # Test. + self.assertRunOk("lzop -tv compressed.lzo") + + # Uncompress. + self.assertRunOk("lzop -dv -o uncompressed compressed.lzo") + + # Verify. + # The ls is there for debugging. + self.assertRunOk("ls -l && cmp orig uncompressed")