[LTP] [PATCH 2/4] lib: Add .skip_in_secureboot flag
Petr Vorel
pvorel@suse.cz
Thu Jul 20 17:02:04 CEST 2023
This will be used in module related tests.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
doc/test-writing-guidelines.txt | 1 +
include/tst_test.h | 4 ++++
lib/tst_test.c | 3 +++
3 files changed, 8 insertions(+)
diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt
index b83a6fdb6..6d1a69165 100644
--- a/doc/test-writing-guidelines.txt
+++ b/doc/test-writing-guidelines.txt
@@ -393,6 +393,7 @@ https://github.com/linux-test-project/ltp/wiki/Shell-Test-API[Shell Test API].
| '.skip_filesystems' | 'TST_SKIP_FILESYSTEMS'
| '.skip_in_compat' | –
| '.skip_in_lockdown' | –
+| '.skip_in_secureboot' | –
| '.supported_archs' | not applicable
| '.tags' | –
| '.taint_check' | –
diff --git a/include/tst_test.h b/include/tst_test.h
index 22acfba59..0ac492a80 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -177,6 +177,7 @@ struct tst_test {
int child_needs_reinit:1;
int needs_devfs:1;
int restore_wallclock:1;
+
/*
* If set the test function will be executed for all available
* filesystems and the current filesystem type would be set in the
@@ -186,8 +187,11 @@ struct tst_test {
* to the test function.
*/
int all_filesystems:1;
+
int skip_in_lockdown:1;
+ int skip_in_secureboot:1;
int skip_in_compat:1;
+
/*
* If set, the hugetlbfs will be mounted at .mntpoint.
*/
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 04da456c6..8f7223b0e 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1160,6 +1160,9 @@ static void do_setup(int argc, char *argv[])
if (tst_test->skip_in_lockdown && tst_lockdown_enabled())
tst_brk(TCONF, "Kernel is locked down, skipping test");
+ if (tst_test->skip_in_secureboot && tst_secureboot_enabled())
+ tst_brk(TCONF, "SecureBoot enabled, skipping test");
+
if (tst_test->skip_in_compat && TST_ABI != tst_kernel_bits())
tst_brk(TCONF, "Not supported in 32-bit compat mode");
--
2.40.1
More information about the ltp
mailing list