[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240226162335.3532920-2-mic@digikod.net>
Date: Mon, 26 Feb 2024 17:23:34 +0100
From: Mickaël Salaün <mic@...ikod.net>
To: Jakub Kicinski <kuba@...nel.org>,
Kees Cook <keescook@...omium.org>,
Shuah Khan <shuah@...nel.org>,
davem@...emloft.net
Cc: Mickaël Salaün <mic@...ikod.net>,
Günther Noack <gnoack@...gle.com>,
Will Drewry <wad@...omium.org>,
edumazet@...gle.com,
jakub@...udflare.com,
pabeni@...hat.com,
linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org,
linux-security-module@...r.kernel.org,
netdev@...r.kernel.org
Subject: [PATCH 1/2] 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@...gle.com>
Cc: Jakub Kicinski <kuba@...nel.org>
Cc: Kees Cook <keescook@...omium.org>
Cc: Shuah Khan <shuah@...nel.org>
Cc: Will Drewry <wad@...omium.org>
Signed-off-by: Mickaël Salaün <mic@...ikod.net>
---
tools/testing/selftests/landlock/common.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/landlock/common.h b/tools/testing/selftests/landlock/common.h
index 425c5698aea2..0bc15d36971a 100644
--- a/tools/testing/selftests/landlock/common.h
+++ b/tools/testing/selftests/landlock/common.h
@@ -37,7 +37,7 @@
struct __test_metadata *_metadata, \
FIXTURE_DATA(fixture_name) *self, \
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; \
const pid_t child = fork(); \
@@ -80,6 +80,10 @@
__attribute__((unused)) *variant)
/* 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
static inline int
landlock_create_ruleset(const struct landlock_ruleset_attr *const attr,
--
2.44.0
Powered by blists - more mailing lists