Whamcloud - gitweb
b=22423 rely on pings to issue reconnects
[fs/lustre-release.git] / lustre / tests / sanity-benchmark.sh
index cfce876..31a9ffe 100644 (file)
@@ -48,7 +48,7 @@ test_dbench() {
        return
     fi
 
-    DBENCHDIR=$MOUNT/d0.$HOSTNAME
+    local DBENCHDIR=$DIR/d0.$HOSTNAME
     mkdir -p $DBENCHDIR
     local SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
     DB_THREADS=$((SPACE / 50000))
@@ -79,7 +79,7 @@ test_bonnie() {
        skip_env "No bonnie++ installed"
        return 0
     fi
-    BONDIR=$MOUNT/d0.bonnie
+    local BONDIR=$DIR/d0.bonnie
     mkdir -p $BONDIR
     $LFS setstripe -c -1 $BONDIR
     sync
@@ -105,7 +105,7 @@ test_iozone() {
 
     export O_DIRECT
     
-    IOZDIR=$MOUNT/d0.iozone
+    local IOZDIR=$DIR/d0.iozone
     mkdir -p $IOZDIR
     $LFS setstripe -c -1 $IOZDIR
     sync
@@ -130,12 +130,12 @@ test_iozone() {
     
     # check if O_DIRECT support is implemented in kernel
     if [ -z "$O_DIRECT" ]; then
-       touch $MOUNT/f.iozone
-       if ! ./directio write $MOUNT/f.iozone 0 1; then
+       touch $DIR/f.iozone
+       if ! ./directio write $DIR/f.iozone 0 1; then
            log "SKIP iozone DIRECT IO test"
            O_DIRECT=no
        fi
-       rm -f $MOUNT/f.iozone
+       rm -f $DIR/f.iozone
     fi
     if [ "$O_DIRECT" != "no" -a "$IOZONE_DIR" != "no" ]; then
        $DEBUG_OFF
@@ -172,17 +172,18 @@ test_iozone() {
 run_test iozone "iozone"
 
 test_fsx() {
+    local testfile=$DIR/f0.fsxfile
     FSX_SIZE=$SIZE
     FSX_COUNT=1000
     local SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
     [ $SPACE -lt $FSX_SIZE ] && FSX_SIZE=$((SPACE * 3 / 4))
     $DEBUG_OFF
     FSX_SEED=${FSX_SEED:-$RANDOM}
-    rm -f $MOUNT/fsxfile
-    $LFS setstripe -c -1 $MOUNT/fsxfile
+    rm -f $testfile
+    $LFS setstripe -c -1 $testfile
     echo Using FSX_SEED=$FSX_SEED FSX_SIZE=$FSX_SIZE FSX_COUNT=$FSX_COUNT
     fsx -c 50 -p 1000 -S $FSX_SEED -P $TMP -l $FSX_SIZE \
-       -N $(($FSX_COUNT * 100)) $MOUNT/fsxfile
+       -N $(($FSX_COUNT * 100)) $DIR/fsxfile
     $DEBUG_ON
 }
 run_test fsx "fsx"
@@ -269,8 +270,12 @@ test_pios_ssf() {
     local rc=0
     space_check || { skip_env "not enough space" && return 0; }
     pios_setup --stripe || return
+    # bug 19657
+    local old_PWD=$PWD
+    cd $TMP
     run_pios || return
     run_pios  --verify || rc=$? 
+    cd $old_PWD
     pios_cleanup $rc
     return $rc
 }
@@ -285,8 +290,12 @@ test_pios_fpp() {
     local rc=0
     space_check || { skip_env "not enough space" && return 0; }
     pios_setup || return
+    # bug 19657
+    local old_PWD=$PWD
+    cd $TMP
     run_pios -L fpp || return
     run_pios -L fpp --verify || rc=$?
+    cd $old_PWD
     pios_cleanup $rc
     return $rc
 }