diff --git a/support/testing/tests/fs/test_squashfs.py b/support/testing/tests/fs/test_squashfs.py index a914f5aac7..0ceb4cab58 100644 --- a/support/testing/tests/fs/test_squashfs.py +++ b/support/testing/tests/fs/test_squashfs.py @@ -10,6 +10,7 @@ class TestSquashfs(infra.basetest.BRTest): BR2_TARGET_ROOTFS_SQUASHFS4_LZO=y # BR2_TARGET_ROOTFS_TAR is not set """ + expected_blocksize_in_bytes = 128*1024 def test_run(self): unsquashfs_cmd = ["host/bin/unsquashfs", "-s", "images/rootfs.squashfs"] @@ -18,6 +19,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 +33,25 @@ class TestSquashfs(infra.basetest.BRTest): cmd = "mount | grep '/dev/root on / type squashfs'" self.assertRunOk(cmd) + + +class TestSquashfsMinBlocksize(TestSquashfs): + 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 = 4*1024 + + +class TestSquashfsMaxBlocksize(TestSquashfs): + 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