6 class TestUbi(infra.basetest.BRTest):
7 config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
9 BR2_TARGET_ROOTFS_UBIFS=y
10 BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x7ff80
11 BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE=0x1
12 BR2_TARGET_ROOTFS_UBI=y
13 BR2_TARGET_ROOTFS_UBI_PEBSIZE=0x80000
14 BR2_TARGET_ROOTFS_UBI_SUBSIZE=1
17 # TODO: if you boot Qemu twice on the same UBI image, it fails to
18 # attach the image the second time, with "ubi0 error:
19 # ubi_read_volume_table: the layout volume was not found".
22 img = os.path.join(self.builddir, "images", "rootfs.ubi")
23 out = subprocess.check_output(["file", img],
26 out = out.splitlines()
28 subprocess.call(["truncate", "-s 128M", img])
30 self.emulator.boot(arch="armv7",
32 kernel_cmdline=["root=ubi0:rootfs",
35 options=["-drive", "file={},if=pflash".format(img)])
37 cmd = "mount | grep 'ubi0:rootfs on / type ubifs'"
38 _, exit_code = self.emulator.run(cmd)
39 self.assertEqual(exit_code, 0)