From: Andreas Dilger Date: Tue, 6 Nov 2012 19:22:08 +0000 (-0700) Subject: LU-2291 tests: add "lfs setstripe" to racer X-Git-Tag: 2.3.58~3 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=ed4d6769ec740cfb86505c1c236e19585532ef2f LU-2291 tests: add "lfs setstripe" to racer During the file_create.sh test, instead of just creating the file with default striping use "lfs setstripe -c ${{RANDOM % OSTCOUNT}}" to both exercise the "lfs setstripe" path under load, as well as make the file IO spread across multiple OSTs. Test-Parameters: envdefinitions=SLOW=yes testlist=racer Signed-off-by: Andreas Dilger Change-Id: I26020d516388af0bb95d320c0f2a364395bd0b12 Reviewed-on: http://review.whamcloud.com/4478 Reviewed-by: Jian Yu Tested-by: Hudson Reviewed-by: wangdi Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/racer/file_create.sh b/lustre/tests/racer/file_create.sh index 70ba0fd..828e69c 100755 --- a/lustre/tests/racer/file_create.sh +++ b/lustre/tests/racer/file_create.sh @@ -4,14 +4,14 @@ DIR=$1 MAX=$2 MAX_MB=256 -create() { - SIZE=$((RANDOM * MAX_MB / 32)) - echo "file_create: SIZE=$SIZE" - dd if=/dev/zero of=$DIR/$file bs=1k count=$SIZE -} +OSTCOUNT=${OSTCOUNT:-$(lfs df $DIR 2> /dev/null | grep -c OST)} while /bin/true ; do - file=$((RANDOM % MAX)) - create 2> /dev/null + file=$((RANDOM % MAX)) + SIZE=$((RANDOM * MAX_MB / 32)) + echo "file_create: FILE=$DIR/$file SIZE=$SIZE" + [ $OSTCOUNT -gt 0 ] && + lfs setstripe -c $((RANDOM % OSTCOUNT)) $DIR/$file 2> /dev/null + dd if=/dev/zero of=$DIR/$file bs=1k count=$SIZE 2> /dev/null done