Whamcloud - gitweb
b2d28fb99d095b757e0d82d8ab9ab2fb14ecfb45
[fs/lustre-release.git] / lustre / tests / racer / dir_remote.sh
1 #!/bin/bash
2
3 DIR=$1
4 MAX=$2
5
6 MDTCOUNT=${MDSCOUNT:-$(lfs df $DIR 2> /dev/null | grep -c MDT)}
7 while /bin/true ; do
8         remote_dir=$((RANDOM % MAX))
9         file=$((RANDOM % MAX))
10         mdt_idx=$((RANDOM % MDTCOUNT))
11         mkdir -p $DIR
12         lfs mkdir -i$mdt_idx -c$MDTCOUNT $DIR/$remote_dir 2> /dev/null
13         echo "abcd" > $DIR/$remote_dir/$file 2> /dev/null
14         $LFS getdirstripe $DIR/$remote_dir 2> /dev/null
15 done