selftests/landlock: fix test when overlayfs is
v7 cover selftests/landlock: fix test when overlayfs is
From: Jeff Xu <[email protected]>
Overlayfs can be disabled in kernel config, causing related tests to fail. Adding a check for overlayfs’s supportability at runtime, so we can call SKIP() when needed.
v7:
Fix bug in supports_overlayfs().
Manual test with kernel with and without overlayfs.
v6: https://lore.kernel.org/all/[email protected]/
In v4, the SKIP() was applied at FIXTURE_SETUP() after mount() fail, however, FIXTURE_TEARDOWN() will fail. It might be complicated for test infra or testcase itself to have cleanup code handing the success/failure of steps in SETUP().
This patch changes the approach, it calls supports_overlay() and SKIP() at the beginning of FIXTURE_SETUP(), FIX_TEARDOWN(), TEST_F_FORK(). Because no modification of system is done by the test, cleanup is not needed.
v4:
https://lore.kernel.org/all/[email protected]/
Jeff Xu (1):
selftests/landlock: skip overlayfs test when kernel not support it
tools/testing/selftests/landlock/fs_test.c | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+)
base-commit: 963a70bee5880640d0fd83ed29dc1e7ec0d2bd4a
Signature · 1 line
2.39.0.314.g84b9a713c41-goog