Skip to content

Commit a5c4714

Browse files
committed
ima_measurements.sh: Check policy for test3
This allows the test to work even without specifying ima_policy=tcb on the boot command line. Link: https://lore.kernel.org/ltp/[email protected]/ Reviewed-by: Mimi Zohar <[email protected]> Signed-off-by: Petr Vorel <[email protected]>
1 parent aac97cc commit a5c4714

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ test3()
7777
tst_res TINFO "verify not measuring user files"
7878
tst_check_cmds sudo || return
7979

80+
if [ "$IMA_POLICY_CHECKED" != 1 ]; then
81+
tst_res TCONF "test requires specific policy, try load it with LTP_IMA_LOAD_POLICY=1"
82+
return
83+
fi
84+
8085
if ! id $user >/dev/null 2>/dev/null; then
8186
tst_res TCONF "missing system user $user (wrong installation)"
8287
return

0 commit comments

Comments
 (0)