Whamcloud - gitweb
LU-11010 tests: remove calls to return after skip() 32/32732/4
authorJames Nunez <jnunez@whamcloud.com>
Tue, 26 Jun 2018 22:30:07 +0000 (16:30 -0600)
committerOleg Drokin <green@whamcloud.com>
Sun, 16 Sep 2018 06:41:57 +0000 (06:41 +0000)
The skip routine now contains a call to exit. All calls
to skip() and skip_env() should be reviewed and calls to
return() that follow skip() should be removed.

This is the third patch in a series that removes calls
to return() after skip() in the Lustre test suites.

Calls to return after skip() are removed for:
large-lun.sh
large-scale.sh
lfsck-performance.sh
lnet-selftest.sh
lustre-rsync-test.sh
mds-survey.sh
metadata-updates.sh

Test-Parameters: trivial testlist=large-lun,large-scale,lfsck-performance,lnet-selftest,lustre-rsync-test,mds-survey,metadata-updates

Signed-off-by: James Nunez <jnunez@whamcloud.com>
Change-Id: Id11dc4bbde5824976a5a4d8f94ea59efd45e46f4
Reviewed-on: https://review.whamcloud.com/32732
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/large-lun.sh
lustre/tests/large-scale.sh
lustre/tests/lfsck-performance.sh
lustre/tests/lnet-selftest.sh
lustre/tests/lustre-rsync-test.sh
lustre/tests/mds-survey.sh
lustre/tests/metadata-updates.sh

index fc640e3..b184fad 100644 (file)
@@ -14,7 +14,6 @@ init_logging
 if [ "$REFORMAT" != "yes" ]; then
        skip_env "$0 reformats all devices,\
                please set REFORMAT to run this test"
-       exit 0
 fi
 
 # Variable to run mdsrate
@@ -150,7 +149,7 @@ trap cleanupall EXIT
 
 test_1 () {
        [ $(facet_fstype $SINGLEMDS) != ldiskfs ] &&
-               skip "ldiskfs only test" && return
+               skip_env "ldiskfs only test"
        local dev
        for num in $(seq $OSTCOUNT); do
                dev=$(ostdevname $num)
@@ -240,10 +239,10 @@ test_2 () {
 run_test 2 "run llverfs on OST ldiskfs/zfs filesystem"
 
 test_3 () {
-       [ -z "$CLIENTS" ] && skip_env "CLIENTS not defined, skipping" && return
-       [ -z "$MPIRUN" ] && skip_env "MIPRUN not defined, skipping" && return
-       [ -z "$MDSRATE" ] && skip_env "MDSRATE not defined, skipping" && return
-       [ ! -x $MDSRATE ] && skip_env "$MDSRATE not built, skipping" && return
+       [ -z "$CLIENTS" ] && skip_env "CLIENTS not defined, skipping"
+       [ -z "$MPIRUN" ] && skip_env "MIPRUN not defined, skipping"
+       [ -z "$MDSRATE" ] && skip_env "MDSRATE not defined, skipping"
+       [ ! -x $MDSRATE ] && skip_env "$MDSRATE not built, skipping"
        # Setup the Lustre filesystem.
        log "setup the lustre filesystem"
        REFORMAT="yes" check_and_setup_lustre
index ccfa0c1..9fd35a7 100644 (file)
@@ -19,13 +19,12 @@ init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 init_logging
 
-remote_mds_nodsh && log "SKIP: remote MDS with nodsh" && exit 0
+remote_mds_nodsh && skip "remote MDS with nodsh"
 
-[ -z "$CLIENTS" ] && skip_env "$TESTSUITE: Need two or more clients" && exit 0
+[ -z "$CLIENTS" ] && skip_env "$TESTSUITE: Need two or more clients"
 [ $CLIENTCOUNT -lt 2 ] &&
-       skip_env "$TESTSUITE: Need 2+ clients, have only $CLIENTCOUNT" && exit 0
+       skip_env "$TESTSUITE: Need 2+ clients, have only $CLIENTCOUNT"
 
-#
 [ "$SLOW" = "no" ] && EXCEPT_SLOW=""
 
 MOUNT_2=""
index dc873bf..a7aee98 100644 (file)
@@ -17,7 +17,7 @@ require_dsh_mds || exit 0
 require_dsh_ost || exit 0
 
 [ "$SLOW" = "no" ] &&
-       skip "skip lfsck performance test under non-SLOW mode" && exit 0
+       skip "skip lfsck performance test under non-SLOW mode"
 
 NTHREADS=${NTHREADS:-0}
 UNIT=${UNIT:-8192}
@@ -180,7 +180,7 @@ run_test 0 "lfsck namespace performance (routine case) without load"
 
 test_1() {
        [ $(facet_fstype $SINGLEMDS) != ldiskfs ] &&
-               skip "not implemented for ZFS" && return
+               skip_env "not implemented for ZFS"
 
        local BCOUNT=0
        local i
@@ -932,7 +932,7 @@ test_7c() {
 run_test 7c "namespace LFSCK performance (repairing bad FID-in-dirent) for DNE"
 
 test_8() {
-       [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+       [ $MDSCOUNT -lt 2 ] && skip_env "needs >= 2 MDTs"
 
        [ $INCFACTOR -gt 25 ] && INCFACTOR=25
 
index 54053b8..0c70ae4 100755 (executable)
@@ -11,7 +11,7 @@ init_logging
 #
 ALWAYS_EXCEPT="$ALWAYS_EXCEPT $LNET_SELFTEST_EXCEPT"
 
-[ x$LST = x ] && { skip_env "lst not found LST=$LST" && exit 0; }
+[ x$LST = x ] && skip_env "lst not found LST=$LST"
 
 # FIXME: what is the reasonable value here?
 lst_LOOP=${lst_LOOP:-100000}
index e74bd5d..9c8658d 100644 (file)
@@ -453,19 +453,16 @@ run_test 3c "Replicate files created by createmany/unlinkmany"
 
 # Test 4 - Replicate files created by iozone
 test_4() {
-    which iozone > /dev/null 2>&1
-    if [ $? -ne 0 ]; then
-       skip "iozone not found. Skipping test"
-       return
-    fi
+       which iozone > /dev/null 2>&1
+       [ $? -ne 0 ] && skip "iozone not found"
 
-    init_src
-    init_changelog
+       init_src
+       init_changelog
 
-    END_RUN_FILE=${DIR}/$tdir/run LOAD_PID_FILE=${DIR}/$tdir/pid \
-        MOUNT=${DIR}/$tdir run_iozone.sh &
-    sleep 30
-    child_pid=$(pgrep iozone)
+       END_RUN_FILE=${DIR}/$tdir/run LOAD_PID_FILE=${DIR}/$tdir/pid \
+               MOUNT=${DIR}/$tdir run_iozone.sh &
+       sleep 30
+       child_pid=$(pgrep iozone)
        stop_procs $child_pid
 
        local LRSYNC_LOG=$(generate_logname "lrsync_log")
index 5945711..e95452d 100644 (file)
@@ -19,12 +19,10 @@ thrlo=${thrlo:-1}
 ALWAYS_EXCEPT="$MDS_SURVEY_EXCEPT"
 
 MDSSURVEY=${MDSSURVEY:-$(which mds-survey 2>/dev/null || true)}
-if [ -z ${MDSSURVEY} ]; then
-    skip_env "mds-survey not found" && exit
-fi
+[ -z ${MDSSURVEY} ] && skip_env "mds-survey not found"
 
 if [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.3.51) ]; then
-       skip_env "Need MDS version at least 2.3.51" && exit
+       skip_env "Need MDS version at least 2.3.51"
 fi
 
 build_test_filter
@@ -121,13 +119,9 @@ run_test 1 "Metadata survey with zero-stripe"
 test_2() {
        local mdscount=$(get_node_count "$(mdts_nodes)")
 
-       if [ $mdscount -gt 1 ]; then
-               skip_env "Only run this test on single MDS" && return
-       fi
+       [ $mdscount -gt 1 ] && skip_env "Only run this test on single MDS"
+       [ $ost_count -eq 0 ] && skip_env "Need to mount OST to test"
 
-       if [ $ost_count -eq 0 ]; then
-               skip_env "Need to mount OST to test" && return
-       fi
        mds_survey_run "mdd" "1"
 }
 run_test 2 "Metadata survey with stripe_count = 1"
index 66f5b08..d82d0a8 100755 (executable)
@@ -263,10 +263,7 @@ test_3() {
        machine_file=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
        numloops=1000
 
-       if [ ! -f "$WRITE_DISJOINT" ]; then
-               skip_env "$0 : write_disjoint not found "
-               return
-       fi
+       [ ! -f "$WRITE_DISJOINT" ] && skip_env "write_disjoint not found"
 
        set $TRACE
        generate_machine_file $NODES_TO_USE $machine_file