Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] fs/squashfs: needs more test cases
@ 2022-05-17 14:19 Linus Kaschulla via buildroot
  2022-05-17 20:40 ` Yann E. MORIN
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Kaschulla via buildroot @ 2022-05-17 14:19 UTC (permalink / raw)
  To: buildroot; +Cc: Linus Kaschulla, Yann E . MORIN

For the new patch, adding block size options (commit 555f8dfd),
Yann E. MORIN requested updated testcases that specifically ensure
the extreme blocksizes (4K and 1024K) don't cause issues.

This patch splits the current test case in 2, testing with both
block sizes and ensuring the block size was applied in the same
fashion as for the specified compression.

Signed-off-by: Linus Kaschulla <linus@cosmos-ink.net>
---
 support/testing/tests/fs/test_squashfs.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/support/testing/tests/fs/test_squashfs.py b/support/testing/tests/fs/test_squashfs.py
index a914f5aac7..07239fcce2 100644
--- a/support/testing/tests/fs/test_squashfs.py
+++ b/support/testing/tests/fs/test_squashfs.py
@@ -3,13 +3,15 @@ import os
 import infra.basetest
 
 
-class TestSquashfs(infra.basetest.BRTest):
+class TestSquashfsMinBlocksize(infra.basetest.BRTest):
     config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
         """
         BR2_TARGET_ROOTFS_SQUASHFS=y
+        BR2_TARGET_ROOTFS_SQUASHFS_BS_4K=y
         BR2_TARGET_ROOTFS_SQUASHFS4_LZO=y
         # BR2_TARGET_ROOTFS_TAR is not set
         """
+    expected_blocksize_in_bytes = 1024 * 4
 
     def test_run(self):
         unsquashfs_cmd = ["host/bin/unsquashfs", "-s", "images/rootfs.squashfs"]
@@ -18,6 +20,7 @@ class TestSquashfs(infra.basetest.BRTest):
         self.assertEqual(out[0],
                          "Found a valid SQUASHFS 4:0 superblock on images/rootfs.squashfs.")
         self.assertEqual(out[3], "Compression lzo")
+        self.assertEqual(out[4], "Block size {}".format(self.expected_blocksize_in_bytes))
 
         img = os.path.join(self.builddir, "images", "rootfs.squashfs")
         infra.img_round_power2(img)
@@ -31,3 +34,15 @@ class TestSquashfs(infra.basetest.BRTest):
 
         cmd = "mount | grep '/dev/root on / type squashfs'"
         self.assertRunOk(cmd)
+
+# Reusing TestSquashfsMinBlocksize's test_run(), but change
+# blocksize in config the maxium to ensure all extemes work.
+class TestSquashfsMaxBlocksize(TestSquashfsMinBlocksize):
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_TARGET_ROOTFS_SQUASHFS=y
+        BR2_TARGET_ROOTFS_SQUASHFS_BS_1024K=y
+        BR2_TARGET_ROOTFS_SQUASHFS4_LZO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+    expected_blocksize_in_bytes = 1024 * 1024
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-17 21:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-17 14:19 [Buildroot] [PATCH 1/1] fs/squashfs: needs more test cases Linus Kaschulla via buildroot
2022-05-17 20:40 ` Yann E. MORIN
2022-05-17 20:56   ` Linus via buildroot
2022-05-17 21:04     ` Yann E. MORIN
2022-05-17 21:08       ` Linus via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox