Whamcloud - gitweb
LU-1538 tests: standardize test script init dne-part-1
[fs/lustre-release.git] / lustre / tests / lustre-rsync-test.sh
index e74bd5d..8888469 100644 (file)
@@ -1,38 +1,30 @@
 #!/bin/bash
-# -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*-
-# vim:shiftwidth=4:softtabstop=4:tabstop=4:
 #
 # Run select tests by setting ONLY, or as arguments to the script.
 # Skip specific tests by setting EXCEPT.
 #
-# Run test by setting NOSETUP=true when ltest has setup env for us
 set -e
 
-SRCDIR=`dirname $0`
-export PATH=$PWD/$SRCDIR:$SRCDIR:$PWD/$SRCDIR/../utils:$PATH:/sbin
-
 ONLY=${ONLY:-"$*"}
-# bug number for skipped test: LU-4256
-ALWAYS_EXCEPT="$LRSYNC_EXCEPT  2b"
-# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
-
-[ "$SLOW" = "no" ] && EXCEPT_SLOW=""
-
-[ "$ALWAYS_EXCEPT$EXCEPT" ] &&
-       echo "Skipping tests: `echo $ALWAYS_EXCEPT $EXCEPT`"
 
 KILL=/bin/kill
-
-TMP=${TMP:-/tmp}
 LREPL_LOG=$TMP/lustre_rsync.log
 ORIG_PWD=${PWD}
 
-LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 init_logging
 
+ALWAYS_EXCEPT="$LRSYNC_EXCEPT "
+# bug number for skipped test: LU-4256
+ALWAYS_EXCEPT+="               2b"
+# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
+
+build_test_filter
+
+[ -n "$FILESET" ] && skip "Not functional for FILESET set"
+
 check_and_setup_lustre
 
 DIR=${DIR:-$MOUNT}
@@ -46,8 +38,6 @@ else
        error "No generic nobody group"
 fi
 
-build_test_filter
-
 export LRSYNC=${LRSYNC:-"$LUSTRE/utils/lustre_rsync"}
 [ ! -f "$LRSYNC" ] && export LRSYNC=$(which lustre_rsync)
 export LRSYNC="$LRSYNC -v -c no -d 2"
@@ -453,19 +443,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")