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 <adilger@whamcloud.com>
Change-Id: I26020d516388af0bb95d320c0f2a364395bd0b12
Reviewed-on: http://review.whamcloud.com/4478
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Hudson
Reviewed-by: wangdi <di.wang@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
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