Whamcloud - gitweb
b=14330
authorgrev <grev>
Fri, 8 Feb 2008 11:44:02 +0000 (11:44 +0000)
committergrev <grev>
Fri, 8 Feb 2008 11:44:02 +0000 (11:44 +0000)
i=Adilger
move RUNAS to local.sh; run BONNIE as RUNAS_ID user

b=14474
i=Adilger
don't allow sanity to see MOUNT2; remove chown of MOUNT

lustre/tests/acceptance-small.sh
lustre/tests/cfg/local.sh
lustre/tests/sanity.sh
lustre/tests/sanityN.sh

index 4c27f95..b731a26 100755 (executable)
@@ -91,7 +91,7 @@ for NAME in $CONFIGS; do
 
        if [ "$SANITY" != "no" ]; then
                title sanity
-               bash sanity.sh
+               MOUNT2="" bash sanity.sh
                $CLEANUP
                $SETUP
                SANITY="done"
@@ -124,16 +124,23 @@ for NAME in $CONFIGS; do
                DBENCH="done"
        fi
 
-       chown $UID $MOUNT
        which bonnie++ > /dev/null 2>&1 || BONNIE=no
        if [ "$BONNIE" != "no" ]; then
                title bonnie
-               $LFS setstripe $MOUNT 0 -1 -1
-               MIN=`cat /proc/fs/lustre/osc/*-osc-*/kbytesfree | sort -n | head -n1`
+               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
@@ -144,13 +151,16 @@ for NAME in $CONFIGS; do
        which iozone > /dev/null 2>&1 || IOZONE=no
        if [ "$IOZONE" != "no" ]; then
                title iozone
-               MIN=`cat /proc/fs/lustre/osc/*-osc-*/kbytesfree | sort -n | head -n1`
+               mkdir -p $MOUNT/d0.iozone
+               $LFS setstripe -c -1 $MOUNT/d0.iozone
+               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="$MOUNT/iozone"
+               IOZFILE="$MOUNT/d0.iozone/iozone"
                # $SPACE was calculated with all OSTs
-               $LFS setstripe $IOZFILE 0 -1 -1
                $DEBUG_OFF
                iozone $IOZONE_OPTS -f $IOZFILE
                $DEBUG_ON
@@ -178,6 +188,7 @@ 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 $MOUNT/d0.iozone
                        $DEBUG_OFF
                        THREAD=1
                        IOZFILE="-F "
index c552a4b..485815b 100644 (file)
@@ -84,6 +84,15 @@ DIR=${DIR:-$MOUNT}
 DIR1=${DIR:-$MOUNT1}
 DIR2=${DIR2:-$MOUNT2}
 
+if [ $UID -ne 0 ]; then
+        log "running as non-root uid $UID"
+        RUNAS_ID="$UID"
+        RUNAS=""
+else
+        RUNAS_ID=${RUNAS_ID:-500}
+        RUNAS=${RUNAS:-"runas -u $RUNAS_ID"}
+fi
+
 PDSH=${PDSH:-no_dsh}
 FAILURE_MODE=${FAILURE_MODE:-SOFT} # or HARD
 POWER_DOWN=${POWER_DOWN:-"powerman --off"}
index caa0a7b..17eeb90 100644 (file)
@@ -63,21 +63,6 @@ STRIPES_PER_OBJ=-1
 CHECK_GRANT=${CHECK_GRANT:-"yes"}
 GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""}
 
-if [ $UID -ne 0 ]; then
-       echo "Warning: running as non-root uid $UID"
-       RUNAS_ID="$UID"
-       RUNAS=""
-else
-       RUNAS_ID=${RUNAS_ID:-500}
-       RUNAS=${RUNAS:-"runas -u $RUNAS_ID"}
-
-       # $RUNAS_ID may get set incorrectly somewhere else
-       if [ $RUNAS_ID -eq 0 ]; then
-               echo "Error: \$RUNAS_ID set to 0, but \$UID is also 0!"
-               exit 1
-       fi
-fi
-
 export NAME=${NAME:-local}
 
 SAVE_PWD=$PWD
@@ -143,6 +128,9 @@ MAXFREE=${MAXFREE:-$((200000 * $OSTCOUNT))}
 [ -f $DIR/d52b/foo ] && chattr -i $DIR/d52b/foo
 rm -rf $DIR/[Rdfs][1-9]*
 
+# $RUNAS_ID may get set incorrectly somewhere else
+[ $UID -eq 0 -a $RUNAS_ID -eq 0 ] && error "\$RUNAS_ID set to 0, but \$UID is also 0!"
+
 check_runas_id $RUNAS_ID $RUNAS
 
 build_test_filter
@@ -160,6 +148,8 @@ echo # add a newline after mke2fs.
 
 umask 077
 
+OLDDEBUG="`sysctl -n lnet.debug 2> /dev/null`"
+sysctl -w lnet.debug=-1 2> /dev/null || true
 test_0() {
        touch $DIR/$tfile
        $CHECKSTAT -t file $DIR/$tfile || error
index 6fa2428..399dff8 100644 (file)
@@ -37,14 +37,6 @@ MOUNT_2=${MOUNT_2:-"yes"}
 CHECK_GRANT=${CHECK_GRANT:-"yes"}
 GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""}
 
-if [ $UID -ne 0 ]; then
-       RUNAS_ID="$UID"
-       RUNAS=""
-else
-       RUNAS_ID=${RUNAS_ID:-500}
-       RUNAS=${RUNAS:-"runas -u $RUNAS_ID"}
-fi
-
 SAVE_PWD=$PWD
 
 export NAME=${NAME:-local}
@@ -78,6 +70,9 @@ OSTCOUNT=`cat $LPROC/lov/$LOVNAME/numobd`
 
 rm -rf $DIR1/[df][0-9]* $DIR1/lnk
 
+# $RUNAS_ID may get set incorrectly somewhere else
+[ $UID -eq 0 -a $RUNAS_ID -eq 0 ] && error "\$RUNAS_ID set to 0, but \$UID is also 0!"
+
 check_runas_id $RUNAS_ID $RUNAS
 
 build_test_filter