mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
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 <gnoack@google.com> Cc: Kees Cook <keescook@chromium.org> Cc: Shuah Khan <shuah@kernel.org> Cc: Will Drewry <wad@chromium.org> Signed-off-by: Mickaël Salaün <mic@digikod.net> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7779f26866
commit
e74048650e
1 changed files with 5 additions and 1 deletions
|
@ -37,7 +37,7 @@
|
||||||
struct __test_metadata *_metadata, \
|
struct __test_metadata *_metadata, \
|
||||||
FIXTURE_DATA(fixture_name) *self, \
|
FIXTURE_DATA(fixture_name) *self, \
|
||||||
const FIXTURE_VARIANT(fixture_name) *variant); \
|
const FIXTURE_VARIANT(fixture_name) *variant); \
|
||||||
TEST_F(fixture_name, test_name) \
|
__TEST_F_IMPL(fixture_name, test_name, -1, TEST_TIMEOUT_DEFAULT) \
|
||||||
{ \
|
{ \
|
||||||
int status; \
|
int status; \
|
||||||
const pid_t child = fork(); \
|
const pid_t child = fork(); \
|
||||||
|
@ -80,6 +80,10 @@
|
||||||
__attribute__((unused)) *variant)
|
__attribute__((unused)) *variant)
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
|
|
||||||
|
/* Makes backporting easier. */
|
||||||
|
#undef TEST_F
|
||||||
|
#define TEST_F(fixture_name, test_name) TEST_F_FORK(fixture_name, test_name)
|
||||||
|
|
||||||
#ifndef landlock_create_ruleset
|
#ifndef landlock_create_ruleset
|
||||||
static inline int
|
static inline int
|
||||||
landlock_create_ruleset(const struct landlock_ruleset_attr *const attr,
|
landlock_create_ruleset(const struct landlock_ruleset_attr *const attr,
|
||||||
|
|
Loading…
Reference in a new issue