Whamcloud - gitweb
LU-1187 tests: add create remote directory to racer
[fs/lustre-release.git] / lustre / tests / racer / file_create.sh
1 #!/bin/bash
2
3 DIR=$1
4 MAX=$2
5 MAX_MB=256
6
7 OSTCOUNT=${OSTCOUNT:-$(lfs df $DIR 2> /dev/null | grep -c OST)}
8
9 while /bin/true ; do 
10         file=$((RANDOM % MAX))
11         SIZE=$((RANDOM * MAX_MB / 32))
12         echo "file_create: FILE=$DIR/$file SIZE=$SIZE"
13         [ $OSTCOUNT -gt 0 ] &&
14                 lfs setstripe -c $((RANDOM % OSTCOUNT)) $DIR/$file 2> /dev/null
15         dd if=/dev/zero of=$DIR/$file bs=1k count=$SIZE 2> /dev/null
16 done
17