[LTP] [RFC][PATCH 1/2] libltp: add support to mount tmpfs

Cyril Hrubis chrubis@suse.cz
Tue Aug 29 12:16:28 CEST 2017


Hi!
> Some tests go through losetup, create, format and mount
> filesystems only to run tests for 'EROFS' return value from
> system calls. The tests end up being flaky depending on the tools
> available on the platform. e.g. mkfs.<filesystem> tool is required for
> mounting a device with filesystem.
> 
> If the test is only to check for EROFS, this can be achieved by simply
> doing a 'tmpfs' read-only mount in $tmpdir.

Using tmpfs for EROFS sounds like a good idea, that should be much
faster than loop device as well, but there is a catch. There most likely
are embedded Linux devices that do not have tmpfs support compiled in
and as it is this would break these testcases on such platforms.

What about we created even more high-level interface for this? For
instance we can add .needs_rofs flag to the tst_test structure (reuse
the mntpoint to mount it) and let the library handle the details. I.e.
go for tmpfs and if that fails fall back to loop mounted device.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list