Skip to content

Commit 8d4e8cf

Browse files
committed
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/[email protected]/ Suggested-by: Mimi Zohar <[email protected]> Reviewed-by: Mimi Zohar <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]> Signed-off-by: Petr Vorel <[email protected]>
1 parent 30f1849 commit 8d4e8cf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

testcases/kernel/security/integrity/ima/tests/ima_setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ TST_CLEANUP_CALLER="$TST_CLEANUP"
1111
TST_CLEANUP="ima_cleanup"
1212
TST_NEEDS_ROOT=1
1313
TST_MOUNT_DEVICE=1
14+
TST_SKIP_LSM_WARNINGS=1
1415

1516
# TST_MOUNT_DEVICE can be unset, therefore specify explicitly
1617
TST_NEEDS_TMPDIR=1

testcases/lib/tst_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
# SPDX-License-Identifier: GPL-2.0-or-later
3-
# Copyright (c) Linux Test Project, 2014-2022
3+
# Copyright (c) Linux Test Project, 2014-2025
44
# Author: Cyril Hrubis <[email protected]>
55
#
66
# LTP test library for shell.
@@ -81,7 +81,7 @@ _tst_do_exit()
8181
fi
8282

8383
if [ $TST_BROK -gt 0 -o $TST_FAIL -gt 0 -o $TST_WARN -gt 0 ]; then
84-
_tst_check_security_modules
84+
[ -z "$TST_SKIP_LSM_WARNINGS" ] && _tst_check_security_modules
8585
fi
8686

8787
cat >&2 << EOF

0 commit comments

Comments
 (0)