X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Foos.sh;fp=lustre%2Ftests%2Foos.sh;h=5a2646a41bc8ffcf30b59686a782d199432bd6b1;hb=090c677210ee2946d99c71412e4ff762bb300f4f;hp=1d068d536251e6e06e571b6153ba9d439a2e38f9;hpb=c843241715b13024a656fad4e465be20e7fc5c79;p=fs%2Flustre-release.git diff --git a/lustre/tests/oos.sh b/lustre/tests/oos.sh index 1d068d5..5a2646a 100755 --- a/lustre/tests/oos.sh +++ b/lustre/tests/oos.sh @@ -22,8 +22,8 @@ sleep 1 # to ensure we get up-to-date statfs info #lctl clear #lctl debug_daemon start /r/tmp/debug 1024 -STRIPECOUNT=`cat /proc/fs/lustre/lov/*/activeobd | head -n 1` -ORIGFREE=`cat /proc/fs/lustre/llite/*/kbytesavail | head -n 1` +STRIPECOUNT=`cat /proc/fs/lustre/lov/*/activeobd | head -1` +ORIGFREE=`cat /proc/fs/lustre/llite/*/kbytesavail | head -1` MAXFREE=${MAXFREE:-$((200000 * $STRIPECOUNT))} if [ $ORIGFREE -gt $MAXFREE ]; then echo "skipping out-of-space test on $OSC" @@ -34,9 +34,6 @@ fi export LANG=C LC_LANG=C # for "No space left on device" message -rm -f $LOG >/dev/null 2>&1 -[ -f $LOG ] && echo "ERROR: log file wasn't removed?" && exit 1 - # make sure we stripe over all OSTs to avoid OOS on only a subset of OSTs $LFS setstripe $OOS 65536 0 $STRIPECOUNT if dd if=/dev/zero of=$OOS count=$(($ORIGFREE + 100)) bs=1k 2> $LOG; then @@ -52,15 +49,12 @@ fi # flush cache to OST(s) so avail numbers are correct sync; sleep 1 ; sync -for OSC in /proc/fs/lustre/osc/OSC*MNT*; do - AVAIL=`cat $OSC/kbytesavail` - GRANT=`cat $OSC/cur_grant_bytes` - [ $(($AVAIL - $GRANT / 1024)) -lt 400 ] && OSCFULL=full +for AVAIL in /proc/fs/lustre/osc/OSC*MNT*/kbytesavail; do + [ `cat $AVAIL` -lt 400 ] && OSCFULL=full done - if [ -z "$OSCFULL" ]; then echo "no OSTs are close to full" - grep [0-9] /proc/fs/lustre/osc/OSC*MNT*/{kbytesavail,cur*} + grep "[0-9]" /proc/fs/lustre/osc/OSC*MNT*/{kbytesavail,cur*} SUCCESS=0 fi