Whamcloud - gitweb
b=21835 fix mdsrate script.
authorEric Mei <Eric.Mei@Sun.COM>
Mon, 22 Feb 2010 22:20:21 +0000 (14:20 -0800)
committerRobert Read <rread@sun.com>
Mon, 22 Feb 2010 22:20:21 +0000 (14:20 -0800)
Fix mdsrate test script to also account in inodes numbers used by
test directories.

r=robert.read

lustre/tests/mdsrate-create-large.sh
lustre/tests/mdsrate-create-small.sh
lustre/tests/mdsrate-lookup-10dirs.sh
lustre/tests/mdsrate-lookup-1dir.sh
lustre/tests/mdsrate-stat-large.sh
lustre/tests/mdsrate-stat-small.sh
lustre/tests/test-framework.sh

index 17e290e..aa99a1c 100644 (file)
@@ -37,7 +37,7 @@ chmod 0777 $BASEDIR
 $LFS setstripe $BASEDIR -c -1
 get_stripe $BASEDIR
 
 $LFS setstripe $BASEDIR -c -1
 get_stripe $BASEDIR
 
-IFree=$(inodes_available)
+IFree=$(mdsrate_inodes_available)
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
 fi
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
 fi
@@ -85,7 +85,7 @@ else
     rmdir $TESTDIR_SINGLE
 fi
 
     rmdir $TESTDIR_SINGLE
 fi
 
-IFree=$(inodes_available)
+IFree=$(mdsrate_inodes_available)
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
 fi
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
 fi
index c7ca1c7..03ca9bb 100644 (file)
@@ -45,7 +45,7 @@ chmod 0777 $BASEDIR
 $LFS setstripe $BASEDIR -i 0 -c 1
 get_stripe $BASEDIR
 
 $LFS setstripe $BASEDIR -i 0 -c 1
 get_stripe $BASEDIR
 
-IFree=$(inodes_available)
+IFree=$(mdsrate_inodes_available)
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
 fi
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
 fi
@@ -98,7 +98,7 @@ else
     fi
 fi
 
     fi
 fi
 
-IFree=$(inodes_available)
+IFree=$(mdsrate_inodes_available)
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
 fi
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
 fi
index d99c01b..946d587 100644 (file)
@@ -43,7 +43,7 @@ chmod 0777 $BASEDIR
 $LFS setstripe $BASEDIR -c 1
 get_stripe $BASEDIR
 
 $LFS setstripe $BASEDIR -c 1
 get_stripe $BASEDIR
 
-IFree=$(inodes_available)
+IFree=$(($(mdsrate_inodes_available) - NUM_DIRS))
 if [ $IFree -lt $((NUM_FILES * NUM_DIRS)) ]; then
     NUM_FILES=$((IFree / NUM_DIRS))
 fi
 if [ $IFree -lt $((NUM_FILES * NUM_DIRS)) ]; then
     NUM_FILES=$((IFree / NUM_DIRS))
 fi
index 291fd70..0a8ede4 100644 (file)
@@ -42,7 +42,7 @@ chmod 0777 $BASEDIR
 $LFS setstripe $BASEDIR -c 1
 get_stripe $BASEDIR
 
 $LFS setstripe $BASEDIR -c 1
 get_stripe $BASEDIR
 
-IFree=$(inodes_available)
+IFree=$(mdsrate_inodes_available)
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
 fi
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
 fi
index fef4381..5580985 100644 (file)
@@ -47,7 +47,7 @@ chmod 0777 $BASEDIR
 $LFS setstripe $BASEDIR -c -1
 get_stripe $BASEDIR
 
 $LFS setstripe $BASEDIR -c -1
 get_stripe $BASEDIR
 
-IFree=$(inodes_available)
+IFree=$(mdsrate_inodes_available)
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
 fi
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
 fi
index 6de066a..50586ee 100644 (file)
@@ -47,7 +47,7 @@ chmod 0777 $BASEDIR
 $LFS setstripe $BASEDIR -i 0 -c 1
 get_stripe $BASEDIR
 
 $LFS setstripe $BASEDIR -i 0 -c 1
 get_stripe $BASEDIR
 
-IFree=$(inodes_available)
+IFree=$(mdsrate_inodes_available)
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
 fi
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
 fi
index be0a9ad..371e5e2 100644 (file)
@@ -3058,6 +3058,10 @@ inodes_available () {
     echo $IFree
 }
 
     echo $IFree
 }
 
+mdsrate_inodes_available () {
+    echo $(($(inodes_available) - 1))
+}
+
 # reset llite stat counters
 clear_llite_stats(){
         lctl set_param -n llite.*.stats 0
 # reset llite stat counters
 clear_llite_stats(){
         lctl set_param -n llite.*.stats 0