From f426fb920e3b97298a603a142d56be89c12f2006 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Fri, 19 Aug 2011 15:58:43 -0600 Subject: [PATCH] LU-614 test: speed up needlessly long tests 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 Reviewed-on: http://review.whamcloud.com/1266 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Yu Jian Reviewed-by: Oleg Drokin --- lustre/tests/conf-sanity.sh | 23 +++++------------------ lustre/tests/sanity.sh | 2 +- lustre/tests/test-framework.sh | 21 ++++++++++++++++++--- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index a2069e5..05eec26 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -2588,33 +2588,20 @@ test_53b() { } 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() { - 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 } -run_test 54a "llverdev" +run_test 54a "test llverdev and partial verify of device" test_54b() { setup - run_llverfs $MOUNT + run_llverfs $MOUNT -p [ $? -eq 0 ] || error "llverfs failed!" cleanup } -run_test 54b "llverfs" +run_test 54b "test llverfs and partial verify of filesystem" lov_objid_size() { @@ -2627,7 +2614,7 @@ test_55() { local ostdev=$(ostdevname 1) local saved_opts=$OST_MKFS_OPTS - for i in 0 1023 2048 + for i in 1023 2048 do OST_MKFS_OPTS="$saved_opts --index $i" reformat diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 4cbd691..2ba4577 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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 - 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" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 28334dd..8ff0903 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -4505,6 +4505,7 @@ log_sub_test_end() { 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 @@ -4514,10 +4515,24 @@ run_llverdev() 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() { -- 1.8.3.1