From 8d4e8cf104f48da9f9fa5120b8e4af281e015776 Mon Sep 17 00:00:00 2001 From: Petr Vorel Date: Tue, 14 Jan 2025 12:29:15 +0100 Subject: [PATCH] tst_test.sh: IMA: Allow to disable LSM warnings and use it for IMA we are printing a hint on a failure that SELinux or AppArmor may have caused the failure and we want a knob to disable it and use it for IMA. Link: https://lore.kernel.org/ltp/20250114112915.610297-11-pvorel@suse.cz/ Suggested-by: Mimi Zohar Reviewed-by: Mimi Zohar Reviewed-by: Cyril Hrubis Signed-off-by: Petr Vorel --- testcases/kernel/security/integrity/ima/tests/ima_setup.sh | 1 + testcases/lib/tst_test.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/security/integrity/ima/tests/ima_setup.sh b/testcases/kernel/security/integrity/ima/tests/ima_setup.sh index fc0e7697299..173f405eb11 100644 --- a/testcases/kernel/security/integrity/ima/tests/ima_setup.sh +++ b/testcases/kernel/security/integrity/ima/tests/ima_setup.sh @@ -11,6 +11,7 @@ TST_CLEANUP_CALLER="$TST_CLEANUP" TST_CLEANUP="ima_cleanup" TST_NEEDS_ROOT=1 TST_MOUNT_DEVICE=1 +TST_SKIP_LSM_WARNINGS=1 # TST_MOUNT_DEVICE can be unset, therefore specify explicitly TST_NEEDS_TMPDIR=1 diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index cfdae02300b..2b797705e3d 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) Linux Test Project, 2014-2022 +# Copyright (c) Linux Test Project, 2014-2025 # Author: Cyril Hrubis # # LTP test library for shell. @@ -81,7 +81,7 @@ _tst_do_exit() fi if [ $TST_BROK -gt 0 -o $TST_FAIL -gt 0 -o $TST_WARN -gt 0 ]; then - _tst_check_security_modules + [ -z "$TST_SKIP_LSM_WARNINGS" ] && _tst_check_security_modules fi cat >&2 << EOF