Skip to content

Commit

Permalink
kselftests/damon: add support for cases where debugfs cannot be read
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gautam authored and Shuah Khan committed Jun 27, 2022
1 parent 18afe1b commit 43fe0cc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tools/testing/selftests/damon/_chk_dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 43fe0cc

Please sign in to comment.