Whamcloud - gitweb
LU-614 test: speed up needlessly long tests
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 19 Aug 2011 21:58:43 +0000 (15:58 -0600)
committerOleg Drokin <green@whamcloud.com>
Wed, 24 Aug 2011 15:28:41 +0000 (11:28 -0400)
Some tests are running needlessly long compared to the value that
they provide, and can be made much faster without any loss in value.

conf-sanity test_53a: run llverdev in partial mode always
conf-sanity test_53b: run llverfs in partial mode always
sanity test_220: use unlinkmany instead of "rm -rf", but could likely
                 be sped up dramatically via CFS_FAIL_LOC() on OST

Change-Id: Ifbe66bffc051b6163e41a9bffb1d6b1ab6304e94
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1266
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/conf-sanity.sh
lustre/tests/sanity.sh
lustre/tests/test-framework.sh

index a2069e5..05eec26 100644 (file)
@@ -2588,33 +2588,20 @@ test_53b() {
 }
 run_test 53b "check MDT thread count params"
 
 }
 run_test 53b "check MDT thread count params"
 
-run_llverfs()
-{
-        local dir=$1
-        local partial_arg=""
-        local size=$(df -B G $dir | tail -1 | awk '{print $2}' | sed 's/G//') # Gb
-
-        # Run in partial (fast) mode if the size
-        # of a partition > 10 GB
-        [ $size -gt 10 ] && partial_arg="-p"
-
-        llverfs $partial_arg $dir
-}
-
 test_54a() {
 test_54a() {
-    do_rpc_nodes $(facet_host ost1) run_llverdev $(ostdevname 1)
+    do_rpc_nodes $(facet_host ost1) run_llverdev $(ostdevname 1) -p
     [ $? -eq 0 ] || error "llverdev failed!"
     reformat_and_config
 }
     [ $? -eq 0 ] || error "llverdev failed!"
     reformat_and_config
 }
-run_test 54a "llverdev"
+run_test 54a "test llverdev and partial verify of device"
 
 test_54b() {
     setup
 
 test_54b() {
     setup
-    run_llverfs $MOUNT
+    run_llverfs $MOUNT -p
     [ $? -eq 0 ] || error "llverfs failed!"
     cleanup
 }
     [ $? -eq 0 ] || error "llverfs failed!"
     cleanup
 }
-run_test 54b "llverfs"
+run_test 54b "test llverfs and partial verify of filesystem"
 
 lov_objid_size()
 {
 
 lov_objid_size()
 {
@@ -2627,7 +2614,7 @@ test_55() {
        local ostdev=$(ostdevname 1)
        local saved_opts=$OST_MKFS_OPTS
 
        local ostdev=$(ostdevname 1)
        local saved_opts=$OST_MKFS_OPTS
 
-       for i in 1023 2048
+       for i in 1023 2048
        do
                OST_MKFS_OPTS="$saved_opts --index $i"
                reformat
        do
                OST_MKFS_OPTS="$saved_opts --index $i"
                reformat
index 4cbd691..2ba4577 100644 (file)
@@ -8274,7 +8274,7 @@ test_220() { #LU-325
 
        do_facet mgs $LCTL pool_remove $FSNAME.$TESTNAME $OST || return 4
        do_facet mgs $LCTL pool_destroy $FSNAME.$TESTNAME || return 5
 
        do_facet mgs $LCTL pool_remove $FSNAME.$TESTNAME $OST || return 4
        do_facet mgs $LCTL pool_destroy $FSNAME.$TESTNAME || return 5
-       rm -fr $DIR/$tdir
+       unlinkmany $DIR/$tdir/f $next_id $free || return 3
 }
 run_test 220 "the preallocated objects in MDS still can be used if ENOSPC is returned by OST with enough disk space"
 
 }
 run_test 220 "the preallocated objects in MDS still can be used if ENOSPC is returned by OST with enough disk space"
 
index 28334dd..8ff0903 100644 (file)
@@ -4505,6 +4505,7 @@ log_sub_test_end() {
 run_llverdev()
 {
         local dev=$1
 run_llverdev()
 {
         local dev=$1
+        local llverdev_opts=$2
         local devname=$(basename $1)
         local size=$(grep "$devname"$ /proc/partitions | awk '{print $3}')
         # loop devices aren't in /proc/partitions
         local devname=$(basename $1)
         local size=$(grep "$devname"$ /proc/partitions | awk '{print $3}')
         # loop devices aren't in /proc/partitions
@@ -4514,10 +4515,24 @@ run_llverdev()
 
         local partial_arg=""
         # Run in partial (fast) mode if the size
 
         local partial_arg=""
         # Run in partial (fast) mode if the size
-        # of a partition > 10 GB
-        [ $size -gt 10 ] && partial_arg="-p"
+        # of a partition > 1 GB
+        [ $size -gt 1 ] && partial_arg="-p"
 
 
-        llverdev --force $partial_arg $dev
+        llverdev --force $partial_arg $llverdev_opts $dev
+}
+
+run_llverfs()
+{
+        local dir=$1
+        local llverfs_opts=$2
+        local partial_arg=""
+        local size=$(df -B G $dir |tail -n 1 |awk '{print $2}' |sed 's/G//') #GB
+
+        # Run in partial (fast) mode if the size
+        # of a partition > 1 GB
+        [ $size -gt 1 ] && partial_arg="-p"
+
+        llverfs $partial_arg $llverfs_opts $dir
 }
 
 remove_mdt_files() {
 }
 
 remove_mdt_files() {