@@ -2919,6 +2919,7 @@ F: package/i7z/
F: package/msr-tools/
F: package/pixz/
F: package/zerofree/
+F: support/testing/tests/package/test_gzip.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
new file mode 100644
@@ -0,0 +1,42 @@
+import os
+
+import infra.basetest
+
+
+class TestGzip(infra.basetest.BRTest):
+ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+ """
+ BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+ BR2_PACKAGE_GZIP=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.
+ cmd = "cp -v orig compressed && gzip -v compressed"
+ self.assertRunOk(cmd, timeout=60)
+
+ # Test.
+ self.assertRunOk("gzip -tv compressed.gz")
+
+ # Uncompress.
+ cmd = "cp -v compressed.gz uncompressed.gz && " \
+ "gunzip -v uncompressed.gz"
+ self.assertRunOk(cmd)
+
+ # Verify.
+ # The ls is there for debugging.
+ self.assertRunOk("ls -l && cmp orig uncompressed")
Add a simple compress-uncompress test to verify that gzip is working. Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net> --- Hi, I have verified that this test runs fine both locally and on gitlab. Best regards, Vincent. DEVELOPERS | 1 + support/testing/tests/package/test_gzip.py | 42 ++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 support/testing/tests/package/test_gzip.py