From: Niu Yawei Date: Wed, 21 Dec 2011 04:33:12 +0000 (-0800) Subject: LU-949 test: improve sanity test_42e X-Git-Tag: 2.1.58~12 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=aad5c82cf6cefd214b1a060d500ede7503660ad0;ds=sidebyside LU-949 test: improve sanity test_42e The sanity test_42e should check that the RPCs with less than 16 pages are not more than 15%, instead of checking the 16-page RPCs are more than 85%, because the pages could be merged into even larger(> 16 pages) RPCs. Signed-off-by: Niu Yawei Change-Id: I603f9d278b55cd850d66466050745ecb80e2ff02 Reviewed-on: http://review.whamcloud.com/1897 Reviewed-by: Andreas Dilger Tested-by: Hudson Tested-by: Maloo Reviewed-by: Yu Jian --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 02f0d6f..7aa65ed 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2644,8 +2644,8 @@ run_test 42d "test complete truncate of file with cached dirty data" test_42e() { # bug22074 local TDIR=$DIR/${tdir}e local pagesz=$(page_size) - local pages=16 - local files=$((OSTCOUNT * 500)) # hopefully 500 files on each OST + local pages=16 # hardcoded 16 pages, don't change it. + local files=$((OSTCOUNT * 500)) # hopefully 500 files on each OST local proc_osc0="osc.${FSNAME}-OST0000-osc-[^MDT]*" local max_dirty_mb local warmup_files @@ -2694,13 +2694,25 @@ test_42e() { # bug22074 sync $LCTL get_param $proc_osc0/rpc_stats - $LCTL get_param $proc_osc0/rpc_stats | - while read PPR RRPC RPCT RCUM BAR WRPC WPCT WCUM; do - [ "$PPR" != "16:" ] && continue - [ $WPCT -lt 85 ] && error "$pages-page write RPCs only $WPCT% < 85%" - break # we only want the "pages per rpc" stat - done - rm -rf $TDIR + local percent=0 + local have_ppr=false + $LCTL get_param $proc_osc0/rpc_stats | + while read PPR RRPC RPCT RCUM BAR WRPC WPCT WCUM; do + # skip lines until we are at the RPC histogram data + [ "$PPR" == "pages" ] && have_ppr=true && continue + $have_ppr || continue + + # we only want the percent stat for < 16 pages + [ $(echo $PPR | tr -d ':') -ge $pages ] && break + + percent=$((percent + WPCT)) + if [ $percent -gt 15 ]; then + error "less than 16-pages write RPCs" \ + "$percent% > 15%" + break + fi + done + rm -rf $TDIR } run_test 42e "verify sub-RPC writes are not done synchronously"