X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fsanity-benchmark.sh;h=a56dc845d12c36588a1698078a6212a75932924e;hb=0bafbd7d8f652997d83b3cc2419894f48833f424;hp=dbd4bac3b8c172391d19e4ef66e07c288c6ae378;hpb=02582d03b7d530e4bf3be5952d1b9de9ef97e71a;p=fs%2Flustre-release.git diff --git a/lustre/tests/sanity-benchmark.sh b/lustre/tests/sanity-benchmark.sh index dbd4bac..a56dc84 100644 --- a/lustre/tests/sanity-benchmark.sh +++ b/lustre/tests/sanity-benchmark.sh @@ -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,11 @@ 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)) $DIR/fsxfile + 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 } run_test fsx "fsx" @@ -231,7 +234,13 @@ pios_file_size () { } space_check () { - local space=$(df -P $DIR | tail -n 1 | awk '{ print $4 }') + local testdir=$DIR/$tdir + 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 "summary" | awk '{print $4}') + [ $stripe -eq 1 ] && space=$(min_ost_size) + local size=$(pios_file_size) size=$(( size + size / 10 )) # we can not use pios --cleanup|-x because we need the files exist for pios --verify, @@ -265,7 +274,7 @@ pios_setup() { } pios_cleanup() { - local rc=$1 + local rc=${1:-0} local testdir=$DIR/$tdir if [ $rc -eq 0 ]; then echo cleanup: testdir=$testdir rc=$rc @@ -301,8 +310,12 @@ test_pios_ssf() { fi local rc=0 - space_check || { skip_env "not enough space" && return 0; } pios_setup --stripe || return + if ! space_check; then + skip_env "not enough space" + pios_cleanup + return 0 + fi run_pios || return run_pios --verify || rc=$? pios_cleanup $rc @@ -317,8 +330,12 @@ test_pios_fpp() { fi local rc=0 - space_check || { skip_env "not enough space" && return 0; } pios_setup || return + if ! space_check; then + skip_env "not enough space" + pios_cleanup + return 0 + fi run_pios -L fpp || return run_pios -L fpp --verify || rc=$? pios_cleanup $rc @@ -326,6 +343,6 @@ test_pios_fpp() { } run_test pios_fpp "pios file per process" -equals_msg `basename $0`: test complete, cleaning up +complete $SECONDS check_and_cleanup_lustre -[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true +exit_status