6 class TestSquashfs(infra.basetest.BRTest):
7 config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
9 BR2_TARGET_ROOTFS_SQUASHFS=y
10 # BR2_TARGET_ROOTFS_SQUASHFS4_GZIP is not set
11 BR2_TARGET_ROOTFS_SQUASHFS4_LZ4=y
12 # BR2_TARGET_ROOTFS_TAR is not set
16 unsquashfs_cmd = ["host/bin/unsquashfs", "-s", "images/rootfs.squashfs"]
17 out = subprocess.check_output(unsquashfs_cmd,
20 out = out.splitlines()
21 self.assertEqual(out[0],
22 "Found a valid SQUASHFS 4:0 superblock on images/rootfs.squashfs.")
23 self.assertEqual(out[3], "Compression lz4")
25 img = os.path.join(self.builddir, "images", "rootfs.squashfs")
26 subprocess.call(["truncate", "-s", "%1M", img])
28 self.emulator.boot(arch="armv7",
30 kernel_cmdline=["root=/dev/mmcblk0",
31 "rootfstype=squashfs"],
32 options=["-drive", "file={},if=sd,format=raw".format(img)])
35 cmd = "mount | grep '/dev/root on / type squashfs'"
36 _, exit_code = self.emulator.run(cmd)
37 self.assertEqual(exit_code, 0)