lkml.org 
[lkml]   [2022]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2] selftests: vm: refactor run_vmtests.sh to reduce boilerplate
Since this is a revert, I guess the diff is "backwards" -- meaning,
others were proposing *adding* $ksft_skip handling to some tests?

if that's the case, then I agree none of those diffs are needed, my
change should properly handle $ksft_skip for all tests now and in the
future.

On Fri, Apr 22, 2022 at 2:55 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Thu, 21 Apr 2022 15:49:27 -0700 Axel Rasmussen <axelrasmussen@google.com> wrote:
>
> > Previously, each test printed out its own header, dealt with its own
> > return code, etc. By just putting this standard stuff in a function, we
> > can delete > 300 lines from the script.
> >
> > This also makes adding future tests easier. And, it gets rid of various
> > inconsistencies that already exist:
> >
> > - Some tests correctly deal with ksft_skip, but others don't.
> > - Some tests just print the executable name, others print arguments, and
> > yet others print some comment in the header.
> > - Most tests print out a header with two separator lines, but not the
> > HMM smoke test or the memfd_secret test, which only print one.
> > - We had a redundant "exit" at the end, with all the boilerplate it's an
> > easy oversight.
> >
> > Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
> > ---
> > tools/testing/selftests/vm/run_vmtests.sh | 459 +++-------------------
> > 1 file changed, 64 insertions(+), 395 deletions(-)
>
> Well that's nice.
>
> There were a bunch of changes already pending in this file but I think
> with this patch, they become unneeded. So I just reverted them all.
> please double check?
>
>
> --- a/tools/testing/selftests/vm/run_vmtests.sh~revert-1
> +++ a/tools/testing/selftests/vm/run_vmtests.sh
> @@ -162,32 +162,22 @@ echo "----------------------------------
> echo "running: gup_test -u # get_user_pages_fast() benchmark"
> echo "------------------------------------------------------"
> ./gup_test -u
> -ret_val=$?
> -
> -if [ $ret_val -eq 0 ]; then
> - echo "[PASS]"
> -elif [ $ret_val -eq $ksft_skip ]; then
> - echo "[SKIP]"
> - exitcode=$ksft_skip
> -else
> +if [ $? -ne 0 ]; then
> echo "[FAIL]"
> exitcode=1
> +else
> + echo "[PASS]"
> fi
>
> echo "------------------------------------------------------"
> echo "running: gup_test -a # pin_user_pages_fast() benchmark"
> echo "------------------------------------------------------"
> ./gup_test -a
> -ret_val=$?
> -
> -if [ $ret_val -eq 0 ]; then
> - echo "[PASS]"
> -elif [ $ret_val -eq $ksft_skip ]; then
> - echo "[SKIP]"
> - exitcode=$ksft_skip
> -else
> +if [ $? -ne 0 ]; then
> echo "[FAIL]"
> exitcode=1
> +else
> + echo "[PASS]"
> fi
>
> echo "------------------------------------------------------------"
> @@ -195,16 +185,11 @@ echo "# Dump pages 0, 19, and 4096, usin
> echo "running: gup_test -ct -F 0x1 0 19 0x1000 # dump_page() test"
> echo "------------------------------------------------------------"
> ./gup_test -ct -F 0x1 0 19 0x1000
> -ret_val=$?
> -
> -if [ $ret_val -eq 0 ]; then
> - echo "[PASS]"
> -elif [ $ret_val -eq $ksft_skip ]; then
> - echo "[SKIP]"
> - exitcode=$ksft_skip
> -else
> +if [ $? -ne 0 ]; then
> echo "[FAIL]"
> exitcode=1
> +else
> + echo "[PASS]"
> fi
>
> echo "-------------------"
> @@ -306,16 +291,11 @@ echo "-------------------"
> echo "running mremap_test"
> echo "-------------------"
> ./mremap_test
> -ret_val=$?
> -
> -if [ $ret_val -eq 0 ]; then
> - echo "[PASS]"
> -elif [ $ret_val -eq $ksft_skip ]; then
> - echo "[SKIP]"
> - exitcode=$ksft_skip
> -else
> +if [ $? -ne 0 ]; then
> echo "[FAIL]"
> exitcode=1
> +else
> + echo "[PASS]"
> fi
>
> echo "-----------------"
> _
>

\
 
 \ /
  Last update: 2022-04-23 00:47    [W:1.238 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site