Whamcloud - gitweb
LU-3656 tests: use full path to directio
[fs/lustre-release.git] / lustre / tests / sanity-benchmark.sh
index e3dd8e6..26b10c6 100644 (file)
@@ -29,6 +29,7 @@ RSIZE=${RSIZE:-512}
 DEBUG_LVL=${DEBUG_LVL:-0}
 DEBUG_OFF=${DEBUG_OFF:-"eval lctl set_param debug=\"$DEBUG_LVL\""}
 DEBUG_ON=${DEBUG_ON:-"eval lctl set_param debug=0x33f0484"}
+DIRECTIO=${DIRECTIO:-directio}
 
 PIOSBIN=${PIOSBIN:-$(which pios 2> /dev/null || true)}
 
@@ -143,7 +144,7 @@ test_iozone() {
     # check if O_DIRECT support is implemented in kernel
     if [ -z "$O_DIRECT" ]; then
        touch $DIR/f.iozone
-       if ! ./directio write $DIR/f.iozone 0 1; then
+       if ! $DIRECTIO write $DIR/f.iozone 0 1; then
            log "SKIP iozone DIRECT IO test"
            O_DIRECT=no
        fi
@@ -193,9 +194,10 @@ test_fsx() {
     FSX_SEED=${FSX_SEED:-$RANDOM}
     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)) $testfile
+    CMD="fsx -c 50 -p 1000 -S $FSX_SEED -P $TMP -l $FSX_SIZE \
+        -N $((FSX_COUNT * 100)) $FSXOPT $testfile"
+    echo "Using: $CMD"
+    $CMD || error "fsx failed"
     rm -f $testfile
     $DEBUG_ON
 }
@@ -236,7 +238,7 @@ space_check () {
     local stripe=$($LFS getstripe -c $testdir)
 
     # if stripe_count = 1 the size should be less than min ost size, bug 24294
-    local space=$($LFS df $testdir | grep "filesystem summary:"  | awk '{print $3}')
+    local space=$(lfs_df $testdir | grep "summary"  | awk '{print $2}')
     [ $stripe -eq 1 ] && space=$(min_ost_size)
 
     local size=$(pios_file_size)
@@ -341,6 +343,6 @@ test_pios_fpp() {
 }
 run_test pios_fpp "pios file per process"
 
-complete $(basename $0) $SECONDS
+complete $SECONDS
 check_and_cleanup_lustre
 exit_status