* [Buildroot] [PATCH 1/1] support/testing/tests/package/test_pixz.py: use test_compressor_base
@ 2023-07-15 8:51 Julien Olivain
2023-07-23 10:29 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Julien Olivain @ 2023-07-15 8:51 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain, Vincent Stehlé
The test_pixz.py test was initially written as a standalone test.
The commit cf132a13
"support/testing/tests/package/test_compressor_base.py: new helper class"
introduced a helper class for testing data compression programs.
This commit rewrites this test to use this helper class.
The test coverage is mostly the same as before the rewrite. Notable
differences are:
- the test file is slightly smaller for faster testing,
- its content layout also slightly different.
Cc: Vincent Stehlé <vincent.stehle@laposte.net>
Signed-off-by: Julien Olivain <ju.o@free.fr>
---
support/testing/tests/package/test_pixz.py | 48 ++++++----------------
1 file changed, 13 insertions(+), 35 deletions(-)
diff --git a/support/testing/tests/package/test_pixz.py b/support/testing/tests/package/test_pixz.py
index eeff10eaa1..6620bd4a82 100644
--- a/support/testing/tests/package/test_pixz.py
+++ b/support/testing/tests/package/test_pixz.py
@@ -1,40 +1,18 @@
-import os
+from tests.package.test_compressor_base import TestCompressorBase
-import infra.basetest
-
-class TestPixz(infra.basetest.BRTest):
- config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+class TestPixz(TestCompressorBase):
+ __test__ = True
+ config = TestCompressorBase.config + \
"""
BR2_PACKAGE_PIXZ=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.
- # We ask for 3 threads for good measure but with a very small file on a
- # uniprocessor qemu this is only a light validation.
- cmd = "cp -v orig compressed && pixz -p 3 compressed"
- self.assertRunOk(cmd, timeout=60)
-
- # Uncompress.
- cmd = "cp -v compressed.xz uncompressed.xz && pixz -d uncompressed.xz"
- self.assertRunOk(cmd)
-
- # Verify.
- # The ls is there for debugging.
- cmd = "ls -l && cmp orig uncompressed"
- self.assertRunOk(cmd)
+ compress_cmd = "pixz -p3"
+ decompress_cmd = "pixz -d"
+ compressed_file_ext = ".xz"
+
+ def check_integrity_test(self):
+ # Do nothing for the integrity test because "pixz" does not
+ # implement this feature. The "-t" option has other functions:
+ # https://github.com/vasi/pixz/blob/v1.0.7/src/pixz.1.asciidoc#options
+ pass
--
2.41.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH 1/1] support/testing/tests/package/test_pixz.py: use test_compressor_base
2023-07-15 8:51 [Buildroot] [PATCH 1/1] support/testing/tests/package/test_pixz.py: use test_compressor_base Julien Olivain
@ 2023-07-23 10:29 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-07-23 10:29 UTC (permalink / raw)
To: Julien Olivain; +Cc: Vincent Stehlé, buildroot
On Sat, 15 Jul 2023 10:51:30 +0200
Julien Olivain <ju.o@free.fr> wrote:
> The test_pixz.py test was initially written as a standalone test.
>
> The commit cf132a13
> "support/testing/tests/package/test_compressor_base.py: new helper class"
> introduced a helper class for testing data compression programs.
>
> This commit rewrites this test to use this helper class.
>
> The test coverage is mostly the same as before the rewrite. Notable
> differences are:
> - the test file is slightly smaller for faster testing,
> - its content layout also slightly different.
>
> Cc: Vincent Stehlé <vincent.stehle@laposte.net>
> Signed-off-by: Julien Olivain <ju.o@free.fr>
> ---
> support/testing/tests/package/test_pixz.py | 48 ++++++----------------
> 1 file changed, 13 insertions(+), 35 deletions(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-23 10:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-15 8:51 [Buildroot] [PATCH 1/1] support/testing/tests/package/test_pixz.py: use test_compressor_base Julien Olivain
2023-07-23 10:29 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox