Commit 43fe0cc4 authored by Gautam's avatar Gautam Committed by Shuah Khan

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: default avatarGautam <gautammenghani201@gmail.com>
Reviewed-by: default avatarSeongJae Park <sj@kernel.org>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 18afe1bf
......@@ -26,3 +26,13 @@ do
exit 1
fi
done
permission_error="Operation not permitted"
for f in attrs target_ids monitor_on
do
status=$( cat "$DBGFS/$f" 2>&1 )
if [ "${status#*$permission_error}" != "$status" ]; then
echo "Permission for reading $DBGFS/$f denied; maybe secureboot enabled?"
exit $ksft_skip
fi
done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment