2023-06-23 14:43:22

by Peter Xu

[permalink] [raw]
Subject: [PATCH v3 7/8] selftests/mm: Add -a to run_vmtests.sh

Allows to specify optional tests in run_vmtests.sh, where we can run time
consuming test matrix only when user specified "-a".

Signed-off-by: Peter Xu <[email protected]>
---
tools/testing/selftests/mm/run_vmtests.sh | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh
index 3f26f6e15b2a..824e651f62f4 100644
--- a/tools/testing/selftests/mm/run_vmtests.sh
+++ b/tools/testing/selftests/mm/run_vmtests.sh
@@ -12,11 +12,14 @@ exitcode=0

usage() {
cat <<EOF
-usage: ${BASH_SOURCE[0]:-$0} [ -h | -t "<categories>"]
+usage: ${BASH_SOURCE[0]:-$0} [ options ]
+
+ -a: run all tests, including extra ones
-t: specify specific categories to tests to run
-h: display this message

-The default behavior is to run all tests.
+The default behavior is to run required tests only. If -a is specified,
+will run all tests.

Alternatively, specific groups tests can be run by passing a string
to the -t argument containing one or more of the following categories
@@ -60,9 +63,11 @@ EOF
exit 0
}

+RUN_ALL=false

-while getopts "ht:" OPT; do
+while getopts "aht:" OPT; do
case ${OPT} in
+ "a") RUN_ALL=true ;;
"h") usage ;;
"t") VM_SELFTEST_ITEMS=${OPTARG} ;;
esac
--
2.40.1



2023-06-26 08:38:18

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH v3 7/8] selftests/mm: Add -a to run_vmtests.sh

On 23.06.23 16:29, Peter Xu wrote:
> Allows to specify optional tests in run_vmtests.sh, where we can run time
> consuming test matrix only when user specified "-a".

I'd have used something like "-e: extended tests that might be more
time-consuming".

Acked-by: David Hildenbrand <[email protected]>

--
Cheers,

David / dhildenb


2023-06-26 16:46:19

by Peter Xu

[permalink] [raw]
Subject: Re: [PATCH v3 7/8] selftests/mm: Add -a to run_vmtests.sh

On Mon, Jun 26, 2023 at 10:10:26AM +0200, David Hildenbrand wrote:
> On 23.06.23 16:29, Peter Xu wrote:
> > Allows to specify optional tests in run_vmtests.sh, where we can run time
> > consuming test matrix only when user specified "-a".
>
> I'd have used something like "-e: extended tests that might be more
> time-consuming".

'-a' stands for "all" here, I worry '-e' may be misread into running "extra
tests only".

>
> Acked-by: David Hildenbrand <[email protected]>

Thanks,

--
Peter Xu


2023-06-26 20:45:05

by John Hubbard

[permalink] [raw]
Subject: Re: [PATCH v3 7/8] selftests/mm: Add -a to run_vmtests.sh

On 6/26/23 09:24, Peter Xu wrote:
> On Mon, Jun 26, 2023 at 10:10:26AM +0200, David Hildenbrand wrote:
>> On 23.06.23 16:29, Peter Xu wrote:
>>> Allows to specify optional tests in run_vmtests.sh, where we can run time
>>> consuming test matrix only when user specified "-a".
>>
>> I'd have used something like "-e: extended tests that might be more
>> time-consuming".
>
> '-a' stands for "all" here, I worry '-e' may be misread into running "extra
> tests only".
>

It's getting to the point where long options would help. This one
could be "--stress-tests" or "--all", or "--include-long-running",
for example.

I hesitate to suggest it because it's extra work, but at some point
it would be nice. The options are already hopelessly un-guessable.


thanks,
--
John Hubbard
NVIDIA


2023-06-26 21:32:01

by Peter Xu

[permalink] [raw]
Subject: Re: [PATCH v3 7/8] selftests/mm: Add -a to run_vmtests.sh

On Mon, Jun 26, 2023 at 01:24:45PM -0700, John Hubbard wrote:
> On 6/26/23 09:24, Peter Xu wrote:
> > On Mon, Jun 26, 2023 at 10:10:26AM +0200, David Hildenbrand wrote:
> > > On 23.06.23 16:29, Peter Xu wrote:
> > > > Allows to specify optional tests in run_vmtests.sh, where we can run time
> > > > consuming test matrix only when user specified "-a".
> > >
> > > I'd have used something like "-e: extended tests that might be more
> > > time-consuming".
> >
> > '-a' stands for "all" here, I worry '-e' may be misread into running "extra
> > tests only".
> >
>
> It's getting to the point where long options would help. This one
> could be "--stress-tests" or "--all", or "--include-long-running",
> for example.
>
> I hesitate to suggest it because it's extra work, but at some point
> it would be nice. The options are already hopelessly un-guessable.

Thanks for being considerate, John. Yes I do hope this series can converge
soon, indeed hopefully any further test patches can be worked on top.

To me I would be fine with either option (-a/-e), as long as there's easy
way to dump a help message, where "run_vmtest.sh -h" works for me always.

What's more "hopeless" along my way as an user is there's no help message
for gup_test.c even though its parameter list is crazily long. I used to
"convince" myself that gup is just so special so someone should just
understand what option goes to what ioctl, better read into the .c file.
But I know that's an excuse.

Thanks,

--
Peter Xu