Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kselftests/damon: add support for cases where debugfs cannot be read

The kernel is in lockdown mode when secureboot is enabled and hence
debugfs cannot be used. Add support for this and other general cases
where debugfs cannot be read and communicate the same to the user before
running tests.

Signed-off-by: Gautam <gautammenghani201@gmail.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Gautam and committed by
Shuah Khan
43fe0cc4 18afe1bf

+10
+10
tools/testing/selftests/damon/_chk_dependency.sh
··· 26 26 exit 1 27 27 fi 28 28 done 29 + 30 + permission_error="Operation not permitted" 31 + for f in attrs target_ids monitor_on 32 + do 33 + status=$( cat "$DBGFS/$f" 2>&1 ) 34 + if [ "${status#*$permission_error}" != "$status" ]; then 35 + echo "Permission for reading $DBGFS/$f denied; maybe secureboot enabled?" 36 + exit $ksft_skip 37 + fi 38 + done