X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Facceptance-small.sh;h=2494bd5e65520a3b9a61ba081ebf82dac8e385ff;hb=71ae4129e98b8fa4fd8d326a238a50d5cec54ca2;hp=e00ab89fc6436d68799833755b47148640c2e1c6;hpb=70a25bc86ba3eaac05db18d2a99baa16d3796cd3;p=fs%2Flustre-release.git diff --git a/lustre/tests/acceptance-small.sh b/lustre/tests/acceptance-small.sh index e00ab89..2494bd5 100755 --- a/lustre/tests/acceptance-small.sh +++ b/lustre/tests/acceptance-small.sh @@ -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` @@ -24,9 +25,25 @@ fi [ "$DEBUG_OFF" ] || DEBUG_OFF="eval sysctl -w lnet.debug=\"$DEBUG_LVL\"" [ "$DEBUG_ON" ] || DEBUG_ON="eval sysctl -w lnet.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" -LIBLUSTRE=${LIBLUSTRE:-../liblustre} -LIBLUSTRETESTS=${LIBLUSTRETESTS:-$LIBLUSTRE/tests} +if [ "$SLOW" = "no" ]; then +# 5 min + export IOZONE="no" +fi + +if [ "$ACC_SM_ONLY" ]; then + for O in $TESTSUITE_LIST; do + export ${O}="no" + done + for O in $ACC_SM_ONLY; do + O=`echo $O | tr "[:lower:]" "[:upper:]"` + export ${O}="yes" + done +fi +LFSCK="no" # bug 13698 + +LIBLUSTRETESTS=${LIBLUSTRETESTS:-../liblustre/tests} STARTTIME=`date +%s` RANTEST="" @@ -35,6 +52,11 @@ LUSTRE=${LUSTRE:-`dirname $0`/..} . $LUSTRE/tests/test-framework.sh init_test_env $@ +if $GSS; then + # liblustre doesn't support GSS + export LIBLUSTRE=no +fi + SETUP=${SETUP:-setupall} FORMAT=${FORMAT:-formatall} CLEANUP=${CLEANUP:-stopall} @@ -45,7 +67,7 @@ setup_if_needed() { } title() { - echo "-----============= acceptance-small: "$*" ============-----" + log "-----============= acceptance-small: "$*" ============----- `date`" RANTEST=${RANTEST}$*", " } @@ -61,63 +83,97 @@ for NAME in $CONFIGS; do if [ "$RUNTESTS" != "no" ]; then title runtests - sh runtests + bash runtests $CLEANUP $SETUP + RUNTESTS="done" fi if [ "$SANITY" != "no" ]; then title sanity - SANITYLOG=/tmp/sanity.log sh sanity.sh + MOUNT2="" bash sanity.sh $CLEANUP $SETUP + SANITY="done" fi which dbench > /dev/null 2>&1 || DBENCH=no if [ "$DBENCH" != "no" ]; then title dbench + DBENCHDIR=$MOUNT/$HOSTNAME + mkdir -p $DBENCHDIR SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'` DB_THREADS=$((SPACE / 50000)) [ $THREADS -lt $DB_THREADS ] && DB_THREADS=$THREADS $DEBUG_OFF - sh rundbench 1 - $DEBUG_ON - $CLEANUP - $SETUP + myUID=$RUNAS_ID + myRUNAS=$RUNAS + FAIL_ON_ERROR=false check_runas_id $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; } + chown $myUID:$myUID $DBENCHDIR + duration="" + [ "$SLOW" = "no" ] && duration=" -t 120" + if [ "$SLOW" != "no" -o $DB_THREADS -eq 1 ]; then + DIR=$DBENCHDIR $myRUNAS bash rundbench 1 $duration + $DEBUG_ON + $CLEANUP + $SETUP + fi if [ $DB_THREADS -gt 1 ]; then $DEBUG_OFF - sh rundbench $DB_THREADS + DIR=$DBENCHDIR $myRUNAS bash rundbench $DB_THREADS $duration $DEBUG_ON $CLEANUP $SETUP fi - rm -f /mnt/lustre/`hostname`/client.txt + rm -rf $DBENCHDIR + DBENCH="done" fi - chown $UID $MOUNT && chmod 700 $MOUNT which bonnie++ > /dev/null 2>&1 || BONNIE=no if [ "$BONNIE" != "no" ]; then title bonnie - SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'` + BONDIR=$MOUNT/d0.bonnie + mkdir -p $BONDIR + $LFS setstripe -c -1 $BONDIR + sync + MIN=`cat /proc/fs/lustre/osc/*/kbytesavail | sort -n | head -n1` + SPACE=$(( OSTCOUNT * MIN )) [ $SPACE -lt $SIZE ] && SIZE=$((SPACE * 3 / 4)) + log "min OST has ${MIN}kB available, using ${SIZE}kB file size" $DEBUG_OFF - bonnie++ -f -r 0 -s $((SIZE / 1024)) -n 10 -u $UID -d $MOUNT + myUID=$RUNAS_ID + myRUNAS=$RUNAS + FAIL_ON_ERROR=false check_runas_id $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 $CLEANUP $SETUP + BONNIE="done" fi export O_DIRECT which iozone > /dev/null 2>&1 || IOZONE=no if [ "$IOZONE" != "no" ]; then title iozone - SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'` + IOZDIR=$MOUNT/d0.iozone + mkdir -p $IOZDIR + $LFS setstripe -c -1 $IOZDIR + sync + MIN=`cat /proc/fs/lustre/osc/*/kbytesavail | sort -n | head -n1` + SPACE=$(( OSTCOUNT * MIN )) [ $SPACE -lt $SIZE ] && SIZE=$((SPACE * 3 / 4)) + log "min OST has ${MIN}kB available, using ${SIZE}kB file size" IOZONE_OPTS="-i 0 -i 1 -i 2 -e -+d -r $RSIZE -s $SIZE" - IOZFILE="-f $MOUNT/iozone" + IOZFILE="$IOZDIR/iozone" + # $SPACE was calculated with all OSTs $DEBUG_OFF - iozone $IOZONE_OPTS $IOZFILE + myUID=$RUNAS_ID + myRUNAS=$RUNAS + FAIL_ON_ERROR=false check_runas_id $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; } + chown $myUID:$myUID $IOZDIR + $myRUNAS iozone $IOZONE_OPTS -f $IOZFILE $DEBUG_ON $CLEANUP $SETUP @@ -132,7 +188,8 @@ for NAME in $CONFIGS; do fi if [ "$O_DIRECT" != "no" -a "$IOZONE_DIR" != "no" ]; then $DEBUG_OFF - iozone -I $IOZONE_OPTS $IOZFILE.odir + # cd TMP to have write permission for tmp file iozone writes + ( cd $TMP && $myRUNAS iozone -I $IOZONE_OPTS $IOZFILE.odir ) $DEBUG_ON $CLEANUP $SETUP @@ -143,14 +200,15 @@ for NAME in $CONFIGS; do [ $THREADS -lt $IOZ_THREADS ] && IOZ_THREADS=$THREADS IOZVER=`iozone -v | awk '/Revision:/ {print $3}' | tr -d .` if [ "$IOZ_THREADS" -gt 1 -a "$IOZVER" -ge 3145 ]; then + $LFS setstripe -c 1 $IOZDIR $DEBUG_OFF THREAD=1 IOZFILE="-F " while [ $THREAD -le $IOZ_THREADS ]; do - IOZFILE="$IOZFILE $MOUNT/iozone.$THREAD" + IOZFILE="$IOZFILE $IOZDIR/iozone.$THREAD" THREAD=$((THREAD + 1)) done - iozone $IOZONE_OPTS -t $IOZ_THREADS $IOZFILE + $myRUNAS iozone $IOZONE_OPTS -t $IOZ_THREADS $IOZFILE $DEBUG_ON $CLEANUP $SETUP @@ -158,6 +216,7 @@ for NAME in $CONFIGS; do VER=`iozone -v | awk '/Revision:/ { print $3 }'` echo "iozone $VER too old for multi-thread test" fi + IOZONE="done" fi if [ "$FSX" != "no" ]; then @@ -170,6 +229,7 @@ for NAME in $CONFIGS; do $DEBUG_ON $CLEANUP $SETUP + FSX="done" fi if [ "$SANITYN" != "no" ]; then @@ -179,19 +239,30 @@ for NAME in $CONFIGS; do mkdir -p $MOUNT2 mount_client $MOUNT2 #echo "can't mount2 for '$NAME', skipping sanityN.sh" - SANITYLOG=$TMP/sanity.log START=: CLEAN=: sh sanityN.sh + START=: CLEAN=: bash sanityN.sh umount $MOUNT2 $DEBUG_ON $CLEANUP $SETUP + SANITYN="done" fi 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 + bash lfscktest.sh + else + e2fsck -V + echo "e2fsck does not support lfsck, skipping" + fi + else + echo "remote OST, skipping test" + fi + LFSCK="done" fi if [ "$LIBLUSTRE" != "no" ]; then @@ -200,17 +271,27 @@ for NAME in $CONFIGS; do $CLEANUP unload_modules # Liblustre needs accept=all, noacl - LNETOPTS="accept=all" MDS_MOUNT_OPTS="${MDS_MOUNT_OPTS},noacl" $SETUP + [ -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') 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_TARGET=$MGSNID:/$FSNAME export LIBLUSTRE_TIMEOUT=`cat /proc/sys/lustre/timeout` #export LIBLUSTRE_DEBUG_MASK=`cat /proc/sys/lnet/debug` if [ -x $LIBLUSTRETESTS/sanity ]; then mkdir -p $MOUNT2 + echo $LIBLUSTRETESTS/sanity --target=$LIBLUSTRE_MOUNT_TARGET $LIBLUSTRETESTS/sanity --target=$LIBLUSTRE_MOUNT_TARGET fi $CLEANUP #$SETUP + LIBLUSTRE="done" fi $CLEANUP @@ -218,43 +299,54 @@ done if [ "$REPLAY_SINGLE" != "no" ]; then title replay-single - sh replay-single.sh + bash replay-single.sh + REPLAY_SINGLE="done" fi if [ "$CONF_SANITY" != "no" ]; then title conf-sanity - sh conf-sanity.sh + bash conf-sanity.sh + CONF_SANITY="done" fi if [ "$RECOVERY_SMALL" != "no" ]; then title recovery-small - sh recovery-small.sh + bash recovery-small.sh + RECOVERY_SMALL="done" fi if [ "$REPLAY_OST_SINGLE" != "no" ]; then title replay-ost-single - sh replay-ost-single.sh + bash replay-ost-single.sh + REPLAY_OST_SINGLE="done" fi if [ "$REPLAY_DUAL" != "no" ]; then title replay-dual - sh replay-dual.sh + bash replay-dual.sh + REPLAY_DUAL="done" fi if [ "$INSANITY" != "no" ]; then title insanity - sh insanity.sh -r + bash insanity.sh -r + INSANITY="done" fi if [ "$SANITY_QUOTA" != "no" ]; then title sanity-quota - sh sanity-quota.sh + bash sanity-quota.sh + SANITY_QUOTA="done" fi +if [ "$SANITY_SEC" != "no" ]; then + title sanity-sec + bash sanity-sec.sh +fi RC=$? title FINISHED echo "Finished at `date` in $((`date +%s` - $STARTTIME))s" echo "Tests ran: $RANTEST" - +print_summary echo "$0: completed with rc $RC" && exit $RC