[LTP] [PATCH 3/3] Fix shell library secureboot and lockdown helpers

Martin Doucha mdoucha@suse.cz
Fri Sep 22 09:42:16 CEST 2023


Negative return value from the helper functions means no check could be
performend. Only positive return value indicates that secureboot/lockdown
is active.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 testcases/lib/tst_lockdown_enabled.c   | 2 +-
 testcases/lib/tst_secureboot_enabled.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/lib/tst_lockdown_enabled.c b/testcases/lib/tst_lockdown_enabled.c
index 0e40c428c..30abe3e5e 100644
--- a/testcases/lib/tst_lockdown_enabled.c
+++ b/testcases/lib/tst_lockdown_enabled.c
@@ -8,5 +8,5 @@
 
 int main(void)
 {
-	return !tst_lockdown_enabled();
+	return tst_lockdown_enabled() <= 0;
 }
diff --git a/testcases/lib/tst_secureboot_enabled.c b/testcases/lib/tst_secureboot_enabled.c
index 7c26fb118..dadc0413c 100644
--- a/testcases/lib/tst_secureboot_enabled.c
+++ b/testcases/lib/tst_secureboot_enabled.c
@@ -8,5 +8,5 @@
 
 int main(void)
 {
-	return !tst_secureboot_enabled();
+	return tst_secureboot_enabled() <= 0;
 }
-- 
2.42.0



More information about the ltp mailing list