lkml.org 
[lkml]   [2022]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4] kselftests/damon: add support for cases where debugfs cannot be read
Date
From: SeongJae Park <sj@kernel.org>

Hi Shuah,

On Mon, 27 Jun 2022 11:00:18 -0600 Shuah Khan <skhan@linuxfoundation.org> wrote:

[...]
> >> --- a/tools/testing/selftests/damon/_chk_dependency.sh
> >> +++ b/tools/testing/selftests/damon/_chk_dependency.sh
> >> @@ -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?"
>
> btw - does this run as a regular user or does it need root privilege?
> If so add a test for that and skip with a message.

It needs the root permission, and does the check at the beginning[1].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/testing/selftests/damon/_chk_dependency.sh?h=v5.19-rc4#n9


Thanks,
SJ

> >> + exit $ksft_skip
> >> + fi
> >> +done
> >> --
> >> 2.36.1
> >
> thanks,
> -- Shuah

\
 
 \ /
  Last update: 2022-06-27 20:59    [W:0.064 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site