2017-03-20 21:36:52 +01:00
|
|
|
import os
|
|
|
|
|
|
|
|
import infra.basetest
|
|
|
|
|
2017-10-05 23:42:09 +02:00
|
|
|
|
2017-03-20 21:36:52 +01:00
|
|
|
class TestSquashfs(infra.basetest.BRTest):
|
|
|
|
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
|
2017-10-05 23:42:08 +02:00
|
|
|
"""
|
|
|
|
BR2_TARGET_ROOTFS_SQUASHFS=y
|
2021-06-27 08:53:50 +02:00
|
|
|
BR2_TARGET_ROOTFS_SQUASHFS4_LZO=y
|
2017-10-05 23:42:08 +02:00
|
|
|
# BR2_TARGET_ROOTFS_TAR is not set
|
|
|
|
"""
|
2017-03-20 21:36:52 +01:00
|
|
|
|
|
|
|
def test_run(self):
|
2017-07-05 14:09:48 +02:00
|
|
|
unsquashfs_cmd = ["host/bin/unsquashfs", "-s", "images/rootfs.squashfs"]
|
2019-08-09 01:10:13 +02:00
|
|
|
out = infra.run_cmd_on_host(self.builddir, unsquashfs_cmd)
|
2017-03-20 21:36:52 +01:00
|
|
|
out = out.splitlines()
|
|
|
|
self.assertEqual(out[0],
|
|
|
|
"Found a valid SQUASHFS 4:0 superblock on images/rootfs.squashfs.")
|
2021-06-27 08:53:50 +02:00
|
|
|
self.assertEqual(out[3], "Compression lzo")
|
2017-03-20 21:36:52 +01:00
|
|
|
|
|
|
|
img = os.path.join(self.builddir, "images", "rootfs.squashfs")
|
2021-06-21 22:25:45 +02:00
|
|
|
infra.img_round_power2(img)
|
2017-03-20 21:36:52 +01:00
|
|
|
|
|
|
|
self.emulator.boot(arch="armv7",
|
|
|
|
kernel="builtin",
|
|
|
|
kernel_cmdline=["root=/dev/mmcblk0",
|
|
|
|
"rootfstype=squashfs"],
|
|
|
|
options=["-drive", "file={},if=sd,format=raw".format(img)])
|
|
|
|
self.emulator.login()
|
|
|
|
|
|
|
|
cmd = "mount | grep '/dev/root on / type squashfs'"
|
2021-06-26 15:32:38 +02:00
|
|
|
self.assertRunOk(cmd)
|