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@xxxxxxxxxxxxxxxxxxxx> wrote: > > On Thu, 21 Apr 2022 15:49:27 -0700 Axel Rasmussen <axelrasmussen@xxxxxxxxxx> 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@xxxxxxxxxx> > > --- > > 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 "-----------------" > _ >