X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fsanity-benchmark.sh;h=35a58fc3773db28fdd4405dd836db8592bd645fb;hb=f276f1cb0859e8718448e69bd99ee305f5e62d42;hp=5ea7a0cfcae4cb2e72b1571999607a1aef8ae05f;hpb=fe45ada3cb639dc6935e07b6526f4d41b43dafbc;p=fs%2Flustre-release.git diff --git a/lustre/tests/sanity-benchmark.sh b/lustre/tests/sanity-benchmark.sh index 5ea7a0c..35a58fc 100644 --- a/lustre/tests/sanity-benchmark.sh +++ b/lustre/tests/sanity-benchmark.sh @@ -8,17 +8,18 @@ set -e ONLY=${ONLY:-"$*"} -LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} +LUSTRE=${LUSTRE:-$(dirname $0)/..} . $LUSTRE/tests/test-framework.sh init_test_env $@ -. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} init_logging -# bug number: ALWAYS_EXCEPT="$SANITY_BENCHMARK_EXCEPT" +[ "$SLOW" = "no" ] && EXCEPT_SLOW="iozone" + +build_test_filter MAX_THREADS=${MAX_THREADS:-20} -RAMKB=`awk '/MemTotal:/ { print $2 }' /proc/meminfo` +RAMKB=$(awk '/MemTotal:/ { print $2 }' /proc/meminfo) if [ -z "$THREADS" ]; then THREADS=$((RAMKB / 16384)) [ $THREADS -gt $MAX_THREADS ] && THREADS=$MAX_THREADS @@ -31,9 +32,6 @@ DEBUG_OFF=${DEBUG_OFF:-"eval lctl set_param debug=\"$DEBUG_LVL\""} DEBUG_ON=${DEBUG_ON:-"eval lctl set_param debug=0x33f0484"} DIRECTIO=${DIRECTIO:-directio} -[ "$SLOW" = "no" ] && EXCEPT_SLOW="iozone" - -build_test_filter check_and_setup_lustre assert_DIR @@ -107,6 +105,7 @@ test_iozone() { export O_DIRECT local IOZDIR=$DIR/d0.iozone + wait_delete_completed || true mkdir -p $IOZDIR $LFS setstripe -c -1 $IOZDIR sync @@ -129,6 +128,7 @@ test_iozone() { tail -1 $IOZLOG | grep -q complete || \ { error "iozone (1) failed" && return 1; } rm -f $IOZLOG + wait_delete_completed || true $DEBUG_ON # check if O_DIRECT support is implemented in kernel @@ -139,6 +139,7 @@ test_iozone() { O_DIRECT=no fi rm -f $DIR/f.iozone + wait_delete_completed || true fi if [ "$O_DIRECT" != "no" -a "$IOZONE_DIR" != "no" ]; then $DEBUG_OFF @@ -146,6 +147,7 @@ test_iozone() { tail -1 $IOZLOG | grep -q complete || \ { error "iozone (2) failed" && return 1; } rm -f $IOZLOG + wait_delete_completed || true $DEBUG_ON fi @@ -166,6 +168,7 @@ test_iozone() { tail -1 $IOZLOG | grep -q complete || \ { error "iozone (3) failed" && return 1; } rm -f $IOZLOG + wait_delete_completed || true $DEBUG_ON elif [ $IOZVER -lt 3145 ]; then VER=`iozone -v | awk '/Revision:/ { print $3 }'` @@ -175,24 +178,52 @@ 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 $testfile - $LFS setstripe -c -1 $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 + local testfile=$DIR/f0.fsxfile + FSX_SIZE=$SIZE + FSX_COUNT=1000 + local SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'` + + check_set_fallocate + + [ $SPACE -lt $FSX_SIZE ] && FSX_SIZE=$((SPACE * 3 / 4)) + $DEBUG_OFF + FSX_SEED=${FSX_SEED:-$RANDOM} + rm -f $testfile + $LFS setstripe -c -1 $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 } run_test fsx "fsx" +test_fsx_partial_punch() { + local fsx_count=100000 + local testfile=$DIR/f0.fsxfile + local fsx_size=5407677 # upper bound file size + local fsx_seed=7919 + + check_set_fallocate + + rm -f $testfile + $LFS setstripe -c -1 $testfile + + # + # $fsx_seed, $fsx_count and $fsx_size combination almost + # always reproduces the LASSERT under LU-14640. Therefore these + # constants are used as reproducer vs using a random value and + # hoping it hits the error condition + # + CMD="$FSX -c 50 -p 1000 -S $fsx_seed -P $TMP -l $fsx_size \ + -N $fsx_count $testfile" + echo "Using: $CMD" + $CMD || error "fsx failed" + rm -f $testfile +} +run_test fsx_partial_punch "Verify fsx with partial punch via fallocate" + complete $SECONDS check_and_cleanup_lustre exit_status