Whamcloud - gitweb
LU-949 test: improve sanity test_42e
authorNiu Yawei <niu@whamcloud.com>
Wed, 21 Dec 2011 04:33:12 +0000 (20:33 -0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 1 Mar 2012 17:45:47 +0000 (12:45 -0500)
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 <niu@whamcloud.com>
Change-Id: I603f9d278b55cd850d66466050745ecb80e2ff02
Reviewed-on: http://review.whamcloud.com/1897
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
lustre/tests/sanity.sh

index 02f0d6f..7aa65ed 100644 (file)
@@ -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"