[PATCH RFC 1/3] selftests/landlock: move sandbox_type to common

From: Abhinav Saxena
Date: Sat Jul 19 2025 - 08:41:51 EST


The enum sandbox_type describes three execution modes for Landlock
test tasks:
- NO_SANDBOX: no Landlock domain
- SCOPE_SANDBOX: scoped Landlock domain
- OTHER_SANDBOX: placeholder for future cases

This enum was defined in scoped_multiple_domain_variants.h but is
needed by upcoming cross-domain test variants. Rather than duplicate
the definition, move it to scoped_common.h which is already included
by all scope-related tests.

This is a pure refactor with no functional changes to test binaries.

Signed-off-by: Abhinav Saxena <xandfury@xxxxxxxxx>
---
tools/testing/selftests/landlock/scoped_common.h | 7 +++++++
tools/testing/selftests/landlock/scoped_multiple_domain_variants.h | 7 -------
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/testing/selftests/landlock/scoped_common.h b/tools/testing/selftests/landlock/scoped_common.h
index a9a912d30c4d..08c7d732650c 100644
--- a/tools/testing/selftests/landlock/scoped_common.h
+++ b/tools/testing/selftests/landlock/scoped_common.h
@@ -9,6 +9,13 @@

#include <sys/types.h>

+enum sandbox_type {
+ NO_SANDBOX,
+ SCOPE_SANDBOX,
+ /* Any other type of sandboxing domain */
+ OTHER_SANDBOX,
+};
+
static void create_scoped_domain(struct __test_metadata *const _metadata,
const __u16 scope)
{
diff --git a/tools/testing/selftests/landlock/scoped_multiple_domain_variants.h b/tools/testing/selftests/landlock/scoped_multiple_domain_variants.h
index bcd9a83805d0..23022c6ebece 100644
--- a/tools/testing/selftests/landlock/scoped_multiple_domain_variants.h
+++ b/tools/testing/selftests/landlock/scoped_multiple_domain_variants.h
@@ -5,13 +5,6 @@
* Copyright © 2024 Tahera Fahimi <fahimitahera@xxxxxxxxx>
*/

-enum sandbox_type {
- NO_SANDBOX,
- SCOPE_SANDBOX,
- /* Any other type of sandboxing domain */
- OTHER_SANDBOX,
-};
-
/* clang-format on */
FIXTURE_VARIANT(scoped_vs_unscoped)
{

--
2.43.0