Whamcloud - gitweb
b=20748
[fs/lustre-release.git] / lustre / tests / acceptance-small.sh
index 6ff5710..67cd60b 100755 (executable)
@@ -23,7 +23,7 @@ fi
 [ "$DEBUG_OFF" ] || DEBUG_OFF="eval lctl set_param debug=\"$DEBUG_LVL\""
 [ "$DEBUG_ON" ] || DEBUG_ON="eval lctl set_param debug=0x33f0484"
 
-export TESTSUITE_LIST="RUNTESTS SANITY DBENCH BONNIE IOZONE FSX SANITYN LFSCK LIBLUSTRE REPLAY_SINGLE CONF_SANITY RECOVERY_SMALL REPLAY_OST_SINGLE REPLAY_DUAL INSANITY SANITY_QUOTA SANITY_SEC SANITY_GSS PERFORMANCE_SANITY"
+export TESTSUITE_LIST="RUNTESTS SANITY DBENCH BONNIE IOZONE FSX SANITYN LFSCK LIBLUSTRE RACER REPLAY_SINGLE CONF_SANITY RECOVERY_SMALL REPLAY_OST_SINGLE REPLAY_DUAL REPLAY_VBR INSANITY SANITY_QUOTA SANITY_SEC SANITY_GSS PERFORMANCE_SANITY LARGE_SCALE RECOVERY_MDS_SCALE RECOVERY_DOUBLE_SCALE RECOVERY_RANDOM_SCALE PARALLEL_SCALE LREPLICATE_TEST METADATA_UPDATES OST_POOLS SANITY_BENCHMARK"
 
 if [ "$ACC_SM_ONLY" ]; then
     for O in $TESTSUITE_LIST; do
@@ -36,7 +36,6 @@ if [ "$ACC_SM_ONLY" ]; then
     done
 fi
 LFSCK="no" # bug 13698
-SANITY_QUOTA="no" # bug 13058
 
 LIBLUSTRETESTS=${LIBLUSTRETESTS:-../liblustre/tests}
 
@@ -59,8 +58,25 @@ FORMAT=${FORMAT:-formatall}
 CLEANUP=${CLEANUP:-stopall}
 
 setup_if_needed() {
-    mount | grep $MOUNT && return
-    $FORMAT && $SETUP
+    nfs_client_mode && return
+
+    local MOUNTED=$(mounted_lustre_filesystems)
+    if $(echo $MOUNTED | grep -w -q $MOUNT); then
+        check_config $MOUNT
+        init_facets_vars
+        init_param_vars
+        return
+    fi
+
+    echo "Lustre is not mounted, trying to do setup SETUP=$SETUP ... "
+    [ "$REFORMAT" ] && $FORMAT
+    $SETUP
+
+    MOUNTED=$(mounted_lustre_filesystems)
+    if ! $(echo $MOUNTED | grep -w -q $MOUNT); then
+        echo "Lustre is not mounted after setup! SETUP=$SETUP"
+        exit 1
+    fi
 }
 
 title() {
@@ -78,21 +94,30 @@ title() {
     RANTEST=${RANTEST}$*", "
 }
 
+skip_remost()
+{
+       remote_ost_nodsh && log "SKIP: $1: remote OST with nodsh" && return 0
+       return 1
+}
+
+skip_remmds()
+{
+       remote_mds_nodsh && log "SKIP: $1: remote MDS with nodsh" && return 0
+       return 1
+}
+
 for NAME in $CONFIGS; do
        export NAME MOUNT START CLEAN
        . $LUSTRE/tests/cfg/$NAME.sh
 
-       if [ ! -f /lib/modules/$(uname -r)/kernel/fs/lustre/mds.ko -a \
-           ! -f `dirname $0`/../mds/mds.ko ]; then
-           export CLIENTMODSONLY=true
-       fi
-       
        assert_env mds_HOST MDS_MKFS_OPTS 
        assert_env ost_HOST OST_MKFS_OPTS OSTCOUNT
        assert_env FSNAME MOUNT MOUNT2
 
        setup_if_needed
 
+       MSKIPPED=0
+       OSKIPPED=0
        if [ "$RUNTESTS" != "no" ]; then
                title runtests
                bash runtests
@@ -121,7 +146,7 @@ for NAME in $CONFIGS; do
                $DEBUG_OFF
                myUID=$RUNAS_ID
                myRUNAS=$RUNAS
-               FAIL_ON_ERROR=false check_runas_id_ret $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
+               FAIL_ON_ERROR=false check_runas_id_ret $myUID $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
                chown $myUID:$myUID $DBENCHDIR
                duration=""
                [ "$SLOW" = "no" ] && duration=" -t 120"
@@ -156,7 +181,7 @@ for NAME in $CONFIGS; do
                $DEBUG_OFF
                myUID=$RUNAS_ID
                myRUNAS=$RUNAS
-               FAIL_ON_ERROR=false check_runas_id_ret $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
+               FAIL_ON_ERROR=false check_runas_id_ret $myUID $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
                chown $myUID:$myUID $BONDIR             
                $myRUNAS bonnie++ -f -r 0 -s$((SIZE / 1024)) -n 10 -u$myUID:$myUID -d$BONDIR
                $DEBUG_ON
@@ -186,7 +211,7 @@ for NAME in $CONFIGS; do
                $DEBUG_OFF
                myUID=$RUNAS_ID
                myRUNAS=$RUNAS
-               FAIL_ON_ERROR=false check_runas_id_ret $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
+               FAIL_ON_ERROR=false check_runas_id_ret $myUID $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
                chown $myUID:$myUID $IOZDIR
                $myRUNAS iozone $IOZONE_OPTS -s $SIZE -f $IOZFILE 2>&1 | tee $IOZLOG
                tail -1 $IOZLOG | grep -q complete || \
@@ -245,10 +270,15 @@ for NAME in $CONFIGS; do
 
        if [ "$FSX" != "no" ]; then
                title fsx
+               FSX_SIZE=$((RAMKB / 2))
                SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
-               [ $SPACE -lt $SIZE ] && SIZE=$((SPACE * 3 / 4))
+               [ $SPACE -lt $FSX_SIZE ] && FSX_SIZE=$((SPACE * 3 / 4))
                $DEBUG_OFF
-               ./fsx -c 50 -p 1000 -P $TMP -l $SIZE \
+               FSX_SEED=${FSX_SEED:-$RANDOM}
+               rm -f $MOUNT/fsxfile
+               $LFS setstripe -c -1 $MOUNT/fsxfile
+               echo Using FSX_SEED=$FSX_SEED FSX_SIZE=$FSX_SIZE COUNT=$COUNT
+               ./fsx -c 50 -p 1000 -S $FSX_SEED -P $TMP -l $FSX_SIZE \
                        -N $(($COUNT * 100)) $MOUNT/fsxfile
                $DEBUG_ON
                $CLEANUP
@@ -264,7 +294,7 @@ for NAME in $CONFIGS; do
                mount_client $MOUNT2
                #echo "can't mount2 for '$NAME', skipping sanityN.sh"
                START=: CLEAN=: bash sanityN.sh
-               umount $MOUNT2
+               [ "$(mount | grep $MOUNT2)" ] && umount $MOUNT2
 
                $DEBUG_ON
                $CLEANUP
@@ -272,39 +302,27 @@ for NAME in $CONFIGS; do
                SANITYN="done"
        fi
 
-       remote_mds && log "Remote MDS, skipping LFSCK test" && LFSCK=no
-       remote_ost && log "Remote OST, skipping LFSCK test" && LFSCK=no
-
-       if [ "$LFSCK" != "no" -a -x /usr/sbin/lfsck ]; then
+       [ "$LFSCK" != "no" ] && remote_mds && log "Remote MDS, skipping LFSCK test" && LFSCK=no && MSKIPPED=1
+       [ "$LFSCK" != "no" ] && remote_ost && log "Remote OST, skipping LFSCK test" && LFSCK=no && OSKIPPED=1
+       if [ "$LFSCK" != "no" ]; then
                title lfsck
-               E2VER=`e2fsck -V 2>&1 | head -n 1 | cut -d' ' -f 2`
-               if [ `echo $E2VER | cut -d. -f2` -ge 39 ] && \
-                  [ "`echo $E2VER | grep cfs`" -o \
-                       "`echo $E2VER | grep sun`" ]; then
-                               bash lfscktest.sh
+               if [ -x /usr/sbin/lfsck ]; then
+                       bash lfscktest.sh
                else
-                       e2fsck -V
-                       echo "e2fsck does not support lfsck, skipping"
+                       log "$($E2FSCK -V)"
+                       log "SKIP: $E2FSCK does not support lfsck"
                fi
                LFSCK="done"
        fi
 
        [ "$NETTYPE" = "tcp" -o "$NETTYPE" = "ptl" ] || LIBLUSTRE=no # bug 15660
+       if [ "$LIBLUSTRE" != "no" ] && ! check_versions ; then
+               skip liblustre version mismatch: cli $CLIVER, mds $MDSVER, ost $OSTVER
+               LIBLUSTRE=no    # bug 17696
+       fi
        if [ "$LIBLUSTRE" != "no" ]; then
-               title liblustre
+               title liblustre
                assert_env MGSNID MOUNT2
-               $CLEANUP
-               unload_modules
-               # Liblustre needs accept=all, noacl
-               [ -f /etc/modprobe.conf ] && MODPROBECONF=/etc/modprobe.conf
-               [ -f /etc/modprobe.d/Lustre ] && MODPROBECONF=/etc/modprobe.d/Lustre
-
-               LNETOPTS="$(awk '/^options lnet/ { print $0}' $MODPROBECONF | \
-                       sed 's/^options lnet //g; s/"//g') accept=all" \
-                       MDS_MOUNT_OPTS=$(echo $MDS_MOUNT_OPTS | sed 's/^[ \t]*//;s/[ \t]*$//') \
-                       MDS_MOUNT_OPTS="${MDS_MOUNT_OPTS},noacl" \
-                       MDS_MOUNT_OPTS=${MDS_MOUNT_OPTS/#,/-o } \
-                       $SETUP
                export LIBLUSTRE_MOUNT_POINT=$MOUNT2
                export LIBLUSTRE_MOUNT_RETRY=5
                export LIBLUSTRE_MOUNT_TARGET=$MGSNID:/$FSNAME
@@ -312,71 +330,132 @@ for NAME in $CONFIGS; do
                #export LIBLUSTRE_DEBUG_MASK=`lctl get_param -n debug`
                if [ -x $LIBLUSTRETESTS/sanity ]; then
                        mkdir -p $MOUNT2
-                       echo $LIBLUSTRETESTS/sanity --target=$LIBLUSTRE_MOUNT_TARGET
-                       $LIBLUSTRETESTS/sanity --target=$LIBLUSTRE_MOUNT_TARGET
+                       if [ "$LIBLUSTRE_EXCEPT" ]; then
+                               LIBLUSTRE_OPT="$LIBLUSTRE_OPT \
+                                       $(echo ' '$LIBLUSTRE_EXCEPT  | sed -re 's/\s+/ -e /g')"
+                       fi
+                       echo $LIBLUSTRETESTS/sanity --target=$LIBLUSTRE_MOUNT_TARGET $LIBLUSTRE_OPT
+                       $LIBLUSTRETESTS/sanity --target=$LIBLUSTRE_MOUNT_TARGET $LIBLUSTRE_OPT
                fi
                $CLEANUP
                #$SETUP
                LIBLUSTRE="done"
        fi
 
-       $CLEANUP
+       [ "$RACER" != "no" ] && [ -n "$CLIENTS" -a "$PDSH" = "no_dsh" ] && log "Remote client with no_dsh" && RACER=no 
+       if [ "$RACER" != "no" ]; then
+               title racer
+               setup_if_needed
+               DURATION=${DURATION:-900}
+               [ "$SLOW" = "no" ] && DURATION=300
+               RACERCLIENTS=$HOSTNAME
+               [ ! -z ${CLIENTS} ] && RACERCLIENTS=$CLIENTS
+               log "racer on clients: $RACERCLIENTS DURATION=$DURATION RACERDIRS=$RACERDIRS"
+               CLIENTS=${RACERCLIENTS} DURATION=$DURATION bash runracer $RACERDIRS
+               $CLEANUP
+               $SETUP
+               RACER="done"
+       fi
 done
 
+if [ "$SANITY_BENCHMARK" != "no" ]; then
+        title sanity-benchmark
+       bash sanity-benchmark.sh
+       SANITY_BENCHMARK="done"
+fi
+
+[ "$REPLAY_SINGLE" != "no" ] && skip_remmds replay-single && REPLAY_SINGLE=no && MSKIPPED=1
 if [ "$REPLAY_SINGLE" != "no" ]; then
         title replay-single
        bash replay-single.sh
        REPLAY_SINGLE="done"
 fi
 
+[ "$CONF_SANITY" != "no" ] && skip_remmds conf-sanity && CONF_SANITY=no && MSKIPPED=1
+[ "$CONF_SANITY" != "no" ] && skip_remost conf-sanity && CONF_SANITY=no && OSKIPPED=1
 if [ "$CONF_SANITY" != "no" ]; then
         title conf-sanity
         bash conf-sanity.sh
         CONF_SANITY="done"
 fi
 
+[ "$RECOVERY_SMALL" != "no" ] && skip_remmds recover-small && RECOVERY_SMALL=no && MSKIPPED=1
 if [ "$RECOVERY_SMALL" != "no" ]; then
         title recovery-small
         bash recovery-small.sh
         RECOVERY_SMALL="done"
 fi
 
+[ "$REPLAY_OST_SINGLE" != "no" ] && skip_remost replay-ost-single && REPLAY_OST_SINGLE=no && OSKIPPED=1
 if [ "$REPLAY_OST_SINGLE" != "no" ]; then
         title replay-ost-single
         bash replay-ost-single.sh
         REPLAY_OST_SINGLE="done"
 fi
 
+[ "$REPLAY_DUAL" != "no" ] && skip_remost replay-dual && REPLAY_DUAL=no && OSKIPPED=1
 if [ "$REPLAY_DUAL" != "no" ]; then
         title replay-dual
         bash replay-dual.sh
         REPLAY_DUAL="done"
 fi
 
+[ "$REPLAY_VBR" != "no" ] && skip_remmds replay-vbr && REPLAY_VBR=no && MSKIPPED=1
+if [ "$REPLAY_VBR" != "no" ]; then
+        title replay-vbr
+        bash replay-vbr.sh
+        REPLAY_VBR="done"
+fi
+
+[ "$INSANITY" != "no" ] && skip_remmds insanity && INSANITY=no && MSKIPPED=1
+[ "$INSANITY" != "no" ] && skip_remost insanity && INSANITY=no && OSKIPPED=1
 if [ "$INSANITY" != "no" ]; then
         title insanity
         bash insanity.sh -r
         INSANITY="done"
 fi
 
+[ "$SANITY_QUOTA" != "no" ] && skip_remmds sanity-quota && SANITY_QUOTA=no && MSKIPPED=1
+[ "$SANITY_QUOTA" != "no" ] && skip_remost sanity-quota && SANITY_QUOTA=no && OSKIPPED=1
 if [ "$SANITY_QUOTA" != "no" ]; then
         title sanity-quota
         bash sanity-quota.sh
         SANITY_QUOTA="done"
 fi
 
+[ "$SANITY_SEC" != "no" ] && skip_remmds sanity-sec && SANITY_SEC=no && MSKIPPED=1
+[ "$SANITY_SEC" != "no" ] && skip_remost sanity-sec && SANITY_SEC=no && OSKIPPED=1
 if [ "$SANITY_SEC" != "no" ]; then
         title sanity-sec
         bash sanity-sec.sh
         SANITY_SEC="done"
 fi
 
+[ "$SANITY_GSS" != "no" ] && skip_remmds sanity-gss && SANITY_GSS=no && MSKIPPED=1
 if [ "$SANITY_GSS" != "no" ]; then
         title sanity-gss
         bash sanity-gss.sh
         SANITY_GSS="done"
 fi
 
+
+[ "$LREPLICATE_TEST" != "no" ] && skip_remmds lreplicate-test && LREPLICATE_TEST=no && MSKIPPED=1
+[ "$LREPLICATE_TEST" != "no" ] && skip_remost lreplicate-test && LREPLICATE_TEST=no && OSKIPPED=1
+if [ "$LREPLICATE_TEST" != "no" ]; then
+        title lreplicate-test
+        bash lreplicate-test.sh
+        LREPLICATE_TEST="done"
+fi
+
+[ "$OST_POOLS" != "no" ] && skip_remmds ost-pools && OST_POOLS=no && MSKIPPED=1
+[ "$OST_POOLS" != "no" ] && skip_remost ost-pools && OST_POOLS=no && OSKIPPED=1
+if [ "$OST_POOLS" != "no" ]; then
+        title ost-pools
+        bash ost-pools.sh
+        OST_POOLS="done"
+fi
+
+
 [ "$SLOW" = no ] && PERFORMANCE_SANITY="no"
 [ -x "$MDSRATE" ] || PERFORMANCE_SANITY="no"
 which mpirun > /dev/null 2>&1 || PERFORMANCE_SANITY="no"
@@ -386,9 +465,54 @@ if [ "$PERFORMANCE_SANITY" != "no" ]; then
         PERFORMANCE_SANITY="done"
 fi
 
+[ "$LARGE_SCALE" != "no" ] && skip_remmds large-scale && LARGE_SCALE=no && MSKIPPED=1
+if [ "$LARGE_SCALE" != "no" ]; then
+        title large-scale
+        bash large-scale.sh
+        LARGE_SCALE="done"
+fi
+
+[ "$RECOVERY_MDS_SCALE" != "no" ] && skip_remmds recovery-mds-scale && RECOVERY_MDS_SCALE=no && MSKIPPED=1
+[ "$RECOVERY_MDS_SCALE" != "no" ] && skip_remost recovery-mds-scale && RECOVERY_MDS_SCALE=no && OSKIPPED=1
+if [ "$RECOVERY_MDS_SCALE" != "no" ]; then
+        title recovery-mds-scale
+        bash recovery-mds-scale.sh
+        RECOVERY_MDS_SCALE="done"
+fi
+
+[ "$RECOVERY_DOUBLE_SCALE" != "no" ] && skip_remmds recovery-double-scale && RECOVERY_DOUBLE_SCALE=no && MSKIPPED=1
+[ "$RECOVERY_DOUBLE_SCALE" != "no" ] && skip_remost recovery-double-scale && RECOVERY_DOUBLE_SCALE=no && OSKIPPED=1
+if [ "$RECOVERY_DOUBLE_SCALE" != "no" ]; then
+        title recovery-double-scale
+        bash recovery-double-scale.sh
+        RECOVERY_DOUBLE_SCALE="done"
+fi
+
+[ "$RECOVERY_RANDOM_SCALE" != "no" ] && skip_remmds recovery-random-scale && RECOVERY_RANDOM_SCALE=no && MSKIPPED=1
+if [ "$RECOVERY_RANDOM_SCALE" != "no" ]; then
+        title recovery-random-scale
+        bash recovery-random-scale.sh
+        RECOVERY_RANDOM_SCALE="done"
+fi
+
+which mpirun > /dev/null 2>&1 || PARALLEL_SCALE="no"
+if [ "$PARALLEL_SCALE" != "no" ]; then
+        title parallel-scale
+        bash parallel-scale.sh
+        PARALLEL_SCALE="done"
+fi
+
+if [ "$METADATA_UPDATES" != "no" ]; then
+        title metadata-updates
+        bash metadata-updates.sh
+        METADATA_UPDATES="done"
+fi
+
 RC=$?
 title FINISHED
 echo "Finished at `date` in $((`date +%s` - $STARTTIME))s"
 echo "Tests ran: $RANTEST"
 print_summary
+[ "$MSKIPPED" = 1 ] && log "FAIL: remote MDS tests skipped" && RC=1
+[ "$OSKIPPED" = 1 ] && log "FAIL: remote OST tests skipped" && RC=1
 echo "$0: completed with rc $RC" && exit $RC