Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / tests / acceptance-small.sh
index 4296343..35048b2 100755 (executable)
@@ -6,6 +6,7 @@ set -e
 
 PATH=`dirname $0`/../utils:$PATH
 
+[ -z "$CONFIG" -a "$NAME" ] && CONFIGS=$NAME
 [ "$CONFIGS" ] || CONFIGS="local"  #"local lov"
 [ "$MAX_THREADS" ] || MAX_THREADS=20
 RAMKB=`awk '/MemTotal:/ { print $2 }' /proc/meminfo`
@@ -21,13 +22,16 @@ fi
 [ "$TMP" ] || TMP=/tmp
 [ "$COUNT" ] || COUNT=1000
 [ "$DEBUG_LVL" ] || DEBUG_LVL=0
-[ "$DEBUG_OFF" ] || DEBUG_OFF="sysctl -w lnet.debug=$DEBUG_LVL"
-[ "$DEBUG_ON" ] || DEBUG_ON="sysctl -w lnet.debug=0x33f0484"
+[ "$DEBUG_OFF" ] || DEBUG_OFF="eval sysctl -w lnet.debug=\"$DEBUG_LVL\""
+[ "$DEBUG_ON" ] || DEBUG_ON="eval sysctl -w lnet.debug=0x33f0484"
 
 
 LIBLUSTRE=${LIBLUSTRE:-../liblustre}
 LIBLUSTRETESTS=${LIBLUSTRETESTS:-$LIBLUSTRE/tests}
 
+STARTTIME=`date +%s`
+RANTEST=""
+
 LUSTRE=${LUSTRE:-`dirname $0`/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
@@ -43,6 +47,7 @@ setup_if_needed() {
 
 title() {
     echo "-----============= acceptance-small: "$*" ============-----"
+    RANTEST=${RANTEST}$*", "
 }
 
 for NAME in $CONFIGS; do
@@ -186,13 +191,26 @@ for NAME in $CONFIGS; do
        if [ "$LFSCK" != "no" -a -x /usr/sbin/lfsck ]; then
                title lfsck
                E2VER=`e2fsck -V 2>&1 | head -n 1 | cut -d' ' -f 2`
-               [ `echo $E2VER | cut -d. -f2` -ge 39 ] && \
-                       [ "`echo $E2VER | grep cfs`" ] && sh lfscktest.sh
+               if grep -q obdfilter /proc/fs/lustre/devices; then
+                       if [ `echo $E2VER | cut -d. -f2` -ge 39 ] && \
+                          [ "`echo $E2VER | grep cfs`" ]; then
+                               sh lfscktest.sh
+                       else
+                               e2fsck -V
+                               echo "e2fsck does not support lfsck, skipping"
+                       fi
+               else
+                       echo "remote OST, skipping test"
+               fi
        fi
 
        if [ "$LIBLUSTRE" != "no" ]; then
                title liblustre
-               assert_env MGSNID
+               assert_env MGSNID MOUNT2
+               $CLEANUP
+               unload_modules
+               # Liblustre needs accept=all, noacl
+               LNETOPTS="accept=all" MDS_MOUNT_OPTS="${MDS_MOUNT_OPTS},noacl" $SETUP
                export LIBLUSTRE_MOUNT_POINT=$MOUNT2
                export LIBLUSTRE_MOUNT_TARGET=$MGSNID:/$FSNAME
                export LIBLUSTRE_TIMEOUT=`cat /proc/sys/lustre/timeout`
@@ -208,11 +226,6 @@ for NAME in $CONFIGS; do
        $CLEANUP
 done
 
-if [ "$SANITY_QUOTA" != "no" ]; then
-        title sanity-quota
-        sh sanity-quota.sh
-fi
-
 if [ "$REPLAY_SINGLE" != "no" ]; then
         title replay-single
        sh replay-single.sh
@@ -243,7 +256,15 @@ if [ "$INSANITY" != "no" ]; then
         sh insanity.sh -r
 fi
 
-title FINISHED
+if [ "$SANITY_QUOTA" != "no" ]; then
+        title sanity-quota
+        sh sanity-quota.sh
+fi
+
 
 RC=$?
+title FINISHED
+echo "Finished at `date` in $((`date +%s` - $STARTTIME))s"
+echo "Tests ran: $RANTEST"
+
 echo "$0: completed with rc $RC" && exit $RC