[v3,7/8] selftests/mm: Add -a to run_vmtests.sh

Message ID 20230623142936.268456-8-peterx@redhat.com
State New
Headers
Series mm/gup: Unify hugetlb, speed up thp |

Commit Message

Peter Xu June 23, 2023, 2:29 p.m. UTC
  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 <peterx@redhat.com>
---
 tools/testing/selftests/mm/run_vmtests.sh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
  

Comments

David Hildenbrand June 26, 2023, 8:10 a.m. UTC | #1
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 <david@redhat.com>
  
Peter Xu June 26, 2023, 4:24 p.m. UTC | #2
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 <david@redhat.com>

Thanks,
  
John Hubbard June 26, 2023, 8:24 p.m. UTC | #3
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,
  
Peter Xu June 26, 2023, 8:40 p.m. UTC | #4
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,
  

Patch

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