lkml.org 
[lkml]   [2022]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3] kselftests/damon: add support for cases where debugfs cannot be read
Date
Hi Gautam,

On Sat, 25 Jun 2022 14:05:13 +0530 Gautam <gautammenghani201@gmail.com> wrote:

> 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>

All looks good, thank you! I left one comment below, though. After fixing it,
you may have

Reviewed-by: SeongJae Park <sj@kernel.org>


> ---
> Changes in v2:
> 1. Modify the error message to account for general cases.
> 2. Change the return code so that the test is skipped.
>
> Changes in v3:
> 1. Change the name of variable holding the error message.
>
> tools/testing/selftests/damon/_chk_dependency.sh | 10 ++++++++++
> 1 file changed, 10 insertions(+)
> mode change 100644 => 100755 tools/testing/selftests/damon/_chk_dependency.sh

I think this permission change is unnecessary?


Thanks,
SJ

>
> diff --git a/tools/testing/selftests/damon/_chk_dependency.sh b/tools/testing/selftests/damon/_chk_dependency.sh
> old mode 100644
> new mode 100755
> index 0189db81550b..0328ac0b5a5e
> --- 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?"
> + exit $ksft_skip
> + fi
> +done
> --
> 2.36.1

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