Whamcloud - gitweb
LU-13994 ldlm: osc_object_ast_clear() is called for mdc object on eviction
[fs/lustre-release.git] / lustre / tests / oos2.sh
index 6437fa4..d96f934 100644 (file)
@@ -2,19 +2,16 @@
 
 set -e
 
-LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
 . $LUSTRE/tests/test-framework.sh
+init_test_env $@
 
-export PATH=$LUSTRE/utils:$PATH
-LFS=${LFS:-lfs}
-LCTL=${LCTL:-lctl}
 MOUNT=${MOUNT:-$1}
 MOUNT=${MOUNT:-/mnt/lustre}
 MOUNT2=${MOUNT2:-$2}
 MOUNT2=${MOUNT2:-${MOUNT}2}
 OOS=$MOUNT/oosfile
 OOS2=$MOUNT2/oosfile2
-TMP=${TMP:-/tmp}
 LOG=$TMP/$(basename $0 .sh).log
 LOG2=${LOG}2
 
@@ -24,8 +21,8 @@ rm -f $OOS $OOS2 $LOG $LOG2
 
 sync; sleep 1; sync    # to ensure we get up-to-date statfs info
 
-STRIPECOUNT=`$LCTL get_param -n lov.*.activeobd | head -n 1`
-ORIGFREE=`$LCTL get_param -n llite.*.kbytesavail | head -n 1`
+STRIPECOUNT=$($LCTL get_param -n lov.*.activeobd | head -n 1)
+ORIGFREE=$($LCTL get_param -n llite.*.kbytesavail | head -n 1)
 MAXFREE=${MAXFREE:-$((400000 * $STRIPECOUNT))}
 echo STRIPECOUNT=$STRIPECOUNT ORIGFREE=$ORIGFREE MAXFREE=$MAXFREE
 if [ $ORIGFREE -gt $MAXFREE ]; then
@@ -60,25 +57,8 @@ fi
 # flush cache to OST(s) so avail numbers are correct
 sync; sleep 1 ; sync
 
-for OSC in `$LCTL get_param -N osc.*-osc-*.kbytesavail | cut -d"." -f1-2`; do
-       AVAIL=`$LCTL get_param -n $OSC.kbytesavail`
-       GRANT=$((`$LCTL get_param -n $OSC.cur_grant_bytes` / 1024))
-       echo -n "$(echo $OSC | cut -d"." -f2) avl=$AVAIL grnt=$GRANT diff=$(($AVAIL - $GRANT))"
-       [ $(($AVAIL - $GRANT)) -lt 400 ] && OSCFULL=full && echo -n " FULL"
-       echo " "
-done
-
-# FIXME - This test reports false failures
-# The grants from multiple clients need to be added together and compared 
-# against the kbytesavail.
-#/proc/fs/lustre/osc/lustre-OST0001-osc-c3b04200/kbytesavail:16248
-#/proc/fs/lustre/osc/lustre-OST0001-osc-c3b04200/cur_grant_bytes:4313088
-#/proc/fs/lustre/osc/lustre-OST0001-osc-c3b04e00/cur_grant_bytes:12660736
-
-if [ -z "$OSCFULL" ]; then
+if ! oos_full; then
        echo "no OSTs are close to full"
-       $LCTL get_param "osc.*-osc-*.kbytesavail"
-       $LCTL get_param "osc.*-osc-*.cur*"
        SUCCESS=0
 fi