Whamcloud - gitweb
b=18468
authorgrev <grev>
Wed, 25 Feb 2009 16:54:32 +0000 (16:54 +0000)
committergrev <grev>
Wed, 25 Feb 2009 16:54:32 +0000 (16:54 +0000)
o=Adilger
i=Oleg.Drokin
i=grev
make racer harder

lustre/tests/racer/dir_create.sh
lustre/tests/racer/file_concat.sh
lustre/tests/racer/file_create.sh
lustre/tests/racer/file_link.sh
lustre/tests/racer/file_rename.sh
lustre/tests/racer/file_rm.sh
lustre/tests/racer/file_symlink.sh
lustre/tests/racer/racer.sh

index 80fbbe1..a280e0a 100755 (executable)
@@ -8,7 +8,7 @@ create(){
 }
 
 while /bin/true ; do 
 }
 
 while /bin/true ; do 
-    file=$(($RANDOM%$MAX))
+    file=$((RANDOM % MAX))
     mkdir -p $DIR/$file/$file/ 2> /dev/null
     create 2> /dev/null
 done
     mkdir -p $DIR/$file/$file/ 2> /dev/null
     create 2> /dev/null
 done
index 38181ad..8dde304 100755 (executable)
@@ -10,7 +10,7 @@ concat(){
 }
 
 while /bin/true ; do 
 }
 
 while /bin/true ; do 
-    file=$(($RANDOM%$MAX))
-    new_file=$(($RANDOM%$MAX))
+    file=$((RANDOM % MAX))
+    new_file=$((RANDOM % MAX))
     concat 2> /dev/null
 done
     concat 2> /dev/null
 done
index d94502c..70ba0fd 100755 (executable)
@@ -5,13 +5,13 @@ MAX=$2
 MAX_MB=256
 
 create() {
 MAX_MB=256
 
 create() {
-    SIZE=$(($RANDOM*MAX_MB/32))
+    SIZE=$((RANDOM * MAX_MB / 32))
     echo "file_create: SIZE=$SIZE"
     dd if=/dev/zero of=$DIR/$file bs=1k count=$SIZE
 }
 
 while /bin/true ; do 
     echo "file_create: SIZE=$SIZE"
     dd if=/dev/zero of=$DIR/$file bs=1k count=$SIZE
 }
 
 while /bin/true ; do 
-    file=$(($RANDOM%$MAX))
+    file=$((RANDOM % MAX))
     create 2> /dev/null
 done
 
     create 2> /dev/null
 done
 
index 5c1cac7..aaf498d 100755 (executable)
@@ -4,7 +4,7 @@ DIR=$1
 MAX=$2
 
 while /bin/true ; do 
 MAX=$2
 
 while /bin/true ; do 
-    file=$(($RANDOM%$MAX))
-    new_file=$((($file + 1)%$MAX))
+    file=$((RANDOM % $MAX))
+    new_file=$((RANDOM % MAX))
     ln $file $DIR/$new_file 2> /dev/null
 done
     ln $file $DIR/$new_file 2> /dev/null
 done
index 9552102..a4ef5b8 100755 (executable)
@@ -4,7 +4,7 @@ DIR=$1
 MAX=$2
 
 while /bin/true ; do 
 MAX=$2
 
 while /bin/true ; do 
-    file=$(($RANDOM%$MAX))
-    new_file=$((($file + 1)%$MAX))
+    file=$((RANDOM % MAX))
+    new_file=$((RANDOM % MAX))
     mv $DIR/$file $DIR/$new_file 2> /dev/null
 done
     mv $DIR/$file $DIR/$new_file 2> /dev/null
 done
index 41d3d62..20d5226 100755 (executable)
@@ -4,7 +4,7 @@ DIR=$1
 MAX=$2
 
 while /bin/true ; do 
 MAX=$2
 
 while /bin/true ; do 
-    file=$(($RANDOM%$MAX))
+    file=$((RANDOM % MAX))
     rm -rf $DIR/$file 2> /dev/null
     sleep 1
 done
     rm -rf $DIR/$file 2> /dev/null
     sleep 1
 done
index 44771a5..187b026 100755 (executable)
@@ -4,8 +4,8 @@ DIR=$1
 MAX=$2
 
 while /bin/true ; do 
 MAX=$2
 
 while /bin/true ; do 
-    file=$(($RANDOM%$MAX))
-    new_file=$((($file + 1)%$MAX))
+    file=$((RANDOM % MAX))
+    new_file=$((RANDOM % MAX))
     ln -s $file $DIR/$new_file 2> /dev/null
     ln -s $file/$file/$file $DIR/$new_file 2> /dev/null
 done
     ln -s $file $DIR/$new_file 2> /dev/null
     ln -s $file/$file/$file $DIR/$new_file 2> /dev/null
 done
index 645e349..1274d02 100755 (executable)
@@ -10,40 +10,34 @@ NUM_THREADS=${NUM_THREADS:-3}
 
 mkdir -p $DIR
 
 
 mkdir -p $DIR
 
+RACER_PROGS="file_create dir_create file_rm file_rename file_link file_symlink
+file_list file_concat"
+
 racer_cleanup()
 {
 racer_cleanup()
 {
-    killall file_create.sh 
-    killall dir_create.sh
-    killall file_rm.sh 
-    killall file_rename.sh 
-    killall file_link.sh 
-    killall file_symlink.sh 
-    killall file_list.sh 
-    killall file_concat.sh
-    trap 0
+       for P in $RACER_PROGS; do
+               killall $P.sh
+       done
+       trap 0
 }
 
 echo "Running $0 for $DURATION seconds. CTRL-C to exit"
 trap "
 }
 
 echo "Running $0 for $DURATION seconds. CTRL-C to exit"
 trap "
-    echo \"Cleaning up\" 
-    racer_cleanup
-    exit 0
+       echo \"Cleaning up\" 
+       racer_cleanup
+       exit 0
 " 2 15
 
 cd `dirname $0`
 for N in `seq 1 $NUM_THREADS`; do
 " 2 15
 
 cd `dirname $0`
 for N in `seq 1 $NUM_THREADS`; do
-       ./file_create.sh $DIR $MAX_FILES &
-       ./dir_create.sh $DIR $MAX_FILES &
-       ./file_rename.sh $DIR $MAX_FILES &
-       ./file_link.sh $DIR $MAX_FILES &
-       ./file_symlink.sh $DIR $MAX_FILES &
-       ./file_concat.sh $DIR $MAX_FILES &
-       ./file_list.sh $DIR &
-       ./file_rm.sh $DIR $MAX_FILES &
+       for P in $RACER_PROGS; do
+               ./$P.sh $DIR $MAX_FILES &
+       done
 done
 
 done
 
-sleep $DURATION;
+sleep $DURATION
 racer_cleanup
 racer_cleanup
+
 # Check our to see whether our test DIR is still available.
 df $DIR
 RC=$?
 # Check our to see whether our test DIR is still available.
 df $DIR
 RC=$?