From a72a949be47fc317de5d1cbcde7d79a5dad91e64 Mon Sep 17 00:00:00 2001 From: James Nunez Date: Tue, 26 Jun 2018 16:30:07 -0600 Subject: [PATCH] LU-11010 tests: remove calls to return after skip() 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 Change-Id: Id11dc4bbde5824976a5a4d8f94ea59efd45e46f4 Reviewed-on: https://review.whamcloud.com/32732 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Emoly Liu Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- lustre/tests/large-lun.sh | 11 +++++------ lustre/tests/large-scale.sh | 7 +++---- lustre/tests/lfsck-performance.sh | 6 +++--- lustre/tests/lnet-selftest.sh | 2 +- lustre/tests/lustre-rsync-test.sh | 19 ++++++++----------- lustre/tests/mds-survey.sh | 14 ++++---------- lustre/tests/metadata-updates.sh | 5 +---- 7 files changed, 25 insertions(+), 39 deletions(-) diff --git a/lustre/tests/large-lun.sh b/lustre/tests/large-lun.sh index fc640e3..b184fad 100644 --- a/lustre/tests/large-lun.sh +++ b/lustre/tests/large-lun.sh @@ -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 diff --git a/lustre/tests/large-scale.sh b/lustre/tests/large-scale.sh index ccfa0c1..9fd35a7 100644 --- a/lustre/tests/large-scale.sh +++ b/lustre/tests/large-scale.sh @@ -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="" diff --git a/lustre/tests/lfsck-performance.sh b/lustre/tests/lfsck-performance.sh index dc873bf..a7aee98 100644 --- a/lustre/tests/lfsck-performance.sh +++ b/lustre/tests/lfsck-performance.sh @@ -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 diff --git a/lustre/tests/lnet-selftest.sh b/lustre/tests/lnet-selftest.sh index 54053b8..0c70ae4 100755 --- a/lustre/tests/lnet-selftest.sh +++ b/lustre/tests/lnet-selftest.sh @@ -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} diff --git a/lustre/tests/lustre-rsync-test.sh b/lustre/tests/lustre-rsync-test.sh index e74bd5d..9c8658d 100644 --- a/lustre/tests/lustre-rsync-test.sh +++ b/lustre/tests/lustre-rsync-test.sh @@ -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") diff --git a/lustre/tests/mds-survey.sh b/lustre/tests/mds-survey.sh index 5945711..e95452d 100644 --- a/lustre/tests/mds-survey.sh +++ b/lustre/tests/mds-survey.sh @@ -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" diff --git a/lustre/tests/metadata-updates.sh b/lustre/tests/metadata-updates.sh index 66f5b08..d82d0a8 100755 --- a/lustre/tests/metadata-updates.sh +++ b/lustre/tests/metadata-updates.sh @@ -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 -- 1.8.3.1