All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/3] Add skip_in_lockdown flag to struct tst_test
@ 2021-07-20 10:39 Martin Doucha
  2021-07-20 10:39 ` [LTP] [PATCH 2/3] Replace existing lockdown checks with skip_in_lockdown Martin Doucha
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Martin Doucha @ 2021-07-20 10:39 UTC (permalink / raw)
  To: ltp

When the flag is set to 1, the LTP library will call tst_lockdown_enabled()
during initialization and exit with TCONF if kernel lockdown is detected.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 include/tst_test.h | 1 +
 lib/tst_test.c     | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/include/tst_test.h b/include/tst_test.h
index 6ad355506..c7d77eb09 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -157,6 +157,7 @@ struct tst_test {
 	 * to the test function.
 	 */
 	int all_filesystems:1;
+	int skip_in_lockdown:1;
 
 	/*
 	 * The skip_filesystem is a NULL terminated list of filesystems the
diff --git a/lib/tst_test.c b/lib/tst_test.c
index f4d9f8e3b..c7c77596c 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -957,6 +957,9 @@ static void do_setup(int argc, char *argv[])
 	if (tst_test->min_kver)
 		check_kver();
 
+	if (tst_test->skip_in_lockdown && tst_lockdown_enabled())
+		tst_brk(TCONF, "Kernel is locked down, skipping test");
+
 	if (tst_test->needs_cmds) {
 		const char *cmd;
 		char path[PATH_MAX];
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-07-26  6:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20 10:39 [LTP] [PATCH 1/3] Add skip_in_lockdown flag to struct tst_test Martin Doucha
2021-07-20 10:39 ` [LTP] [PATCH 2/3] Replace existing lockdown checks with skip_in_lockdown Martin Doucha
2021-07-20 11:59   ` Cyril Hrubis
2021-07-20 10:39 ` [LTP] [PATCH 3/3] Add lockdown checks to init_module* and finit_module* tests Martin Doucha
2021-07-20 12:02   ` Cyril Hrubis
2021-07-20 12:36     ` Martin Doucha
2021-07-20 12:45       ` Cyril Hrubis
2021-07-26  6:05   ` Petr Vorel
2021-07-20 11:59 ` [LTP] [PATCH 1/3] Add skip_in_lockdown flag to struct tst_test Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.