Whamcloud - gitweb
b=14471
authorgrev <grev>
Tue, 23 Sep 2008 14:24:53 +0000 (14:24 +0000)
committergrev <grev>
Tue, 23 Sep 2008 14:24:53 +0000 (14:24 +0000)
i=Adilger
get rid of LPROC

lustre/tests/oos2.sh
lustre/tests/run-llog.sh
lustre/tests/test-framework.sh

index d3a4050..6437fa4 100644 (file)
@@ -2,8 +2,12 @@
 
 set -e
 
-export PATH=`dirname $0`/../utils:$PATH
+LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
+. $LUSTRE/tests/test-framework.sh
+
+export PATH=$LUSTRE/utils:$PATH
 LFS=${LFS:-lfs}
+LCTL=${LCTL:-lctl}
 MOUNT=${MOUNT:-$1}
 MOUNT=${MOUNT:-/mnt/lustre}
 MOUNT2=${MOUNT2:-$2}
@@ -11,7 +15,7 @@ MOUNT2=${MOUNT2:-${MOUNT}2}
 OOS=$MOUNT/oosfile
 OOS2=$MOUNT2/oosfile2
 TMP=${TMP:-/tmp}
-LOG=$TMP/oosfile
+LOG=$TMP/$(basename $0 .sh).log
 LOG2=${LOG}2
 
 SUCCESS=1
@@ -20,13 +24,12 @@ rm -f $OOS $OOS2 $LOG $LOG2
 
 sync; sleep 1; sync    # to ensure we get up-to-date statfs info
 
-STRIPECOUNT=`cat /proc/fs/lustre/lov/*/activeobd | head -n 1`
-ORIGFREE=`cat /proc/fs/lustre/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
-       echo "skipping out-of-space test on $OSC"
-       echo "reports ${ORIGFREE}kB free, more tham MAXFREE ${MAXFREE}kB"
-       echo "increase $MAXFREE (or reduce test fs size) to proceed"
+       skip "$0: ${ORIGFREE}kB free gt MAXFREE ${MAXFREE}kB, increase $MAXFREE (or reduce test fs size) to proceed"
        exit 0
 fi
 
@@ -46,18 +49,23 @@ if wait $DDPID; then
        SUCCESS=0
 fi
 
+[ ! -s "$LOG" ] && error "LOG file is empty!"
+[ ! -s "$LOG2" ] && error "LOG2 file is empty!"
+
 if [ "`cat $LOG $LOG2 | grep -c 'No space left on device'`" -ne 2 ]; then
-        echo "ERROR: dd not return ENOSPC"
+       echo "ERROR: dd not return ENOSPC"
        SUCCESS=0
 fi
 
 # flush cache to OST(s) so avail numbers are correct
 sync; sleep 1 ; sync
 
-for OSC in /proc/fs/lustre/osc/*-osc-*; do
-       AVAIL=`cat $OSC/kbytesavail`
-       GRANT=`cat $OSC/cur_grant_bytes`
-       [ $(($AVAIL - $GRANT / 1024)) -lt 400 ] && OSCFULL=full
+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
@@ -69,7 +77,8 @@ done
 
 if [ -z "$OSCFULL" ]; then
        echo "no OSTs are close to full"
-       grep "[0-9]" /proc/fs/lustre/osc/*-osc-*/{kbytesavail,cur*}|tee -a $LOG
+       $LCTL get_param "osc.*-osc-*.kbytesavail"
+       $LCTL get_param "osc.*-osc-*.cur*"
        SUCCESS=0
 fi
 
@@ -82,6 +91,9 @@ if [ "$RECORDSOUT" -ne $(($FILESIZE / 1024)) ]; then
         SUCCESS=0
 fi
 
+echo LOG LOG2 file
+cat $LOG $LOG2
+
 rm -f $OOS $OOS2
 sync; sleep 1; sync
 
index 7ae864c..aa41fa1 100644 (file)
@@ -1,26 +1,28 @@
 #!/bin/bash
 
+LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
+
 load_llog_test() {
     grep -q llog_test /proc/modules && return
     # Module should have been placed with other lustre modules...
     modprobe llog_test 2>&1 | grep -v "llog_test not found"
     grep -q llog_test /proc/modules && return
     # But maybe we're running from a developer tree...
-    insmod ../obdclass/llog_test.ko
+    insmod $LUSTRE/obdclass/llog_test.ko
     grep -q llog_test /proc/modules && return
     # This is for 2.4 kernels (deprecated!)
-    insmod ../obdclass/llog_test.o
+    insmod $LUSTRE/obdclass/llog_test.o
     grep -q llog_test /proc/modules && return
     echo "Unable to load llog_test module!"
     false
     return
 }
 
-PATH=`dirname $0`:`dirname $0`/../utils:$PATH
+PATH=`dirname $0`:$LUSTRE/utils:$PATH
 TMP=${TMP:-/tmp}
 
 MGS=`lctl dl | awk '/mgs/ { print $4 }'`
-[ -z "$MGS" ] && echo "no MGS available, skipping llog test" && exit 0
+[ -z "$MGS" ] && echo "$0: SKIP: no MGS available, skipping llog test" && exit 0
 
 load_llog_test || exit 0
 lctl modules > $TMP/ogdb-`hostname`
index c933a73..d00733f 100644 (file)
@@ -115,7 +115,6 @@ init_test_env() {
     export CHECKSTAT="${CHECKSTAT:-"checkstat -v"} "
     export FSYTPE=${FSTYPE:-"ldiskfs"}
     export NAME=${NAME:-local}
-    export LPROC=/proc/fs/lustre
     export LGSSD=${LGSSD:-"$LUSTRE/utils/gss/lgssd"}
     [ "$GSS_PIPEFS" = "true" ] && [ ! -f "$LGSSD" ] && \
         export LGSSD=$(which lgssd)