[LTP] [PATCH v2 2/4] lib/tst_test.c: add .needs_devfs flag

Cyril Hrubis chrubis@suse.cz
Thu Aug 16 15:28:15 CEST 2018


Hi!
> We add .needs_devfs flag to prepare a suitable filesystem to test
> device special files and use ext2 instead of tmpfs(because tmpfs
> doesn't support extended attributes) as default filesystem if
> .dev_fs_type is not specified.

Can we do that only if the test temporary directory is not suitable for
creating devices?

There are distributions out there that have /tmp residing on pretty much
normal filesystems, also user can override TMPDIR to point to a path
backed up by a regular fs. In these cases this will slow down these
tests for no good reason.

So I would rather go for:

if tst_test->needs_devfs is set:

* mkdir tst_test->mntpoint if it does not exits
* check if tst_test->mntpoint is suitable for creating devices
* if not, mount some filesystem over it
  - mounting tmpfs without nodev flag should be more than enough
    and if that fails for you, we can fall back to a regular filesystem

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list