From: Gautam Menghani <gautammenghani201@gmail.com>
To: sj@kernel.org
Cc: skhan@linuxfoundation.org, damon@lists.linux.dev,
linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] kselftests/damon: add support for cases where debugfs cannot be read
Date: Tue, 28 Jun 2022 09:07:11 +0530 [thread overview]
Message-ID: <Yrp3ZwF4Q/xPDrwG@fedora> (raw)
In-Reply-To: <Yrn6BxU298rzjiak@fedora>
Cc'ing everyone as I forgot to group reply before. Also, I have included the
example outputs in this reply.
On Tue, Jun 28, 2022 at 12:12:15AM +0530, Gautam Menghani wrote:
> On Mon, Jun 27, 2022 at 11:00:18AM -0600, Shuah Khan wrote:
> > On 6/25/22 2:03 PM, SeongJae Park wrote:
> > > Hi Gautam,
> > >
> > > On Sun, 26 Jun 2022 01:22:45 +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>
> > >
> > > Reviewed-by: SeongJae Park <sj@kernel.org>
> > >
> > >
> > > Thanks,
> > > SJ
> > >
> > > > ---
> > > > 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.
> > > >
> > > > Changes in v4:
> > > > 1. Correct the mode of the source file.
> > > >
> > > > tools/testing/selftests/damon/_chk_dependency.sh | 10 ++++++++++
> > > > 1 file changed, 10 insertions(+)
> > > >
> > > > diff --git a/tools/testing/selftests/damon/_chk_dependency.sh b/tools/testing/selftests/damon/_chk_dependency.sh
> > > > index 0189db81550b..0328ac0b5a5e 100644
> > > > --- 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.
>
> Yes this condition is reachable only with root user. If damon tests are run
> as regular user, the root check condition already skips the tests.
>
> Tests output as regular user:
> +TAP version 13
> +1..6
> +# selftests: damon: debugfs_attrs.sh
> +# Run as root
> +ok 1 selftests: damon: debugfs_attrs.sh # SKIP
> +# selftests: damon: debugfs_schemes.sh
> +# Run as root
>
> Tests output as root user:
> +TAP version 13
> +1..6
> +# selftests: damon: debugfs_attrs.sh
> +# Permission for reading /sys/kernel/debug/damon/attrs denied; maybe secureboot enabled?
> +ok 1 selftests: damon: debugfs_attrs.sh # SKIP
> +# selftests: damon: debugfs_schemes.sh
> +# Permission for reading /sys/kernel/debug/damon/attrs denied; maybe secureboot enabled?
>
> Is any change needed in this patch?
>
> > > > + exit $ksft_skip
> > > > + fi
> > > > +done
> > > > --
> > > > 2.36.1
> > >
> > thanks,
> > -- Shuah
prev parent reply other threads:[~2022-06-28 3:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 19:52 [PATCH] kselftests/damon: add support for checking secureboot status Gautam
2022-06-24 20:29 ` SeongJae Park
2022-06-25 5:56 ` [PATCH v2] kselftests/damon: add support for cases where debugfs cannot be read Gautam
2022-06-25 8:35 ` [PATCH v3] " Gautam
2022-06-25 18:55 ` SeongJae Park
2022-06-25 19:52 ` [PATCH v4] " Gautam
2022-06-25 20:03 ` SeongJae Park
2022-06-27 17:00 ` Shuah Khan
2022-06-27 18:57 ` SeongJae Park
2022-06-27 19:46 ` Shuah Khan
[not found] ` <Yrn6BxU298rzjiak@fedora>
2022-06-28 3:37 ` Gautam Menghani [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yrp3ZwF4Q/xPDrwG@fedora \
--to=gautammenghani201@gmail.com \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sj@kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox