Skip to content

Commit e740486

Browse files
l0koddavem330
authored andcommitted
selftests/landlock: Redefine TEST_F() as TEST_F_FORK()
This has the effect of creating a new test process for either TEST_F() or TEST_F_FORK(), which doesn't change tests but will ease potential backports. See next commit for the TEST_F_FORK() merge into TEST_F(). Cc: Günther Noack <[email protected]> Cc: Kees Cook <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Will Drewry <[email protected]> Signed-off-by: Mickaël Salaün <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7779f26 commit e740486

File tree

1 file changed

+5
-1
lines changed
  • tools/testing/selftests/landlock

1 file changed

+5
-1
lines changed

tools/testing/selftests/landlock/common.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
struct __test_metadata *_metadata, \
3838
FIXTURE_DATA(fixture_name) *self, \
3939
const FIXTURE_VARIANT(fixture_name) *variant); \
40-
TEST_F(fixture_name, test_name) \
40+
__TEST_F_IMPL(fixture_name, test_name, -1, TEST_TIMEOUT_DEFAULT) \
4141
{ \
4242
int status; \
4343
const pid_t child = fork(); \
@@ -80,6 +80,10 @@
8080
__attribute__((unused)) *variant)
8181
/* clang-format on */
8282

83+
/* Makes backporting easier. */
84+
#undef TEST_F
85+
#define TEST_F(fixture_name, test_name) TEST_F_FORK(fixture_name, test_name)
86+
8387
#ifndef landlock_create_ruleset
8488
static inline int
8589
landlock_create_ruleset(const struct landlock_ruleset_attr *const attr,

0 commit comments

Comments
 (0)