Whamcloud - gitweb
LU-7587 tests: fix sanity test_231a on SLES12 22/17722/6
authorYang Sheng <yang.sheng@intel.com>
Thu, 24 Dec 2015 02:43:30 +0000 (10:43 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 12 Jan 2016 02:45:26 +0000 (02:45 +0000)
Flush out write RPC to ensure it is finished before
we read statistic data from proc.

Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Change-Id: I8b40654cb95b151fe82067ec979dcf9f604355dc
Reviewed-on: http://review.whamcloud.com/17722
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity.sh

index f696fe0..ccf10b3 100755 (executable)
@@ -13128,16 +13128,20 @@ test_231a()
 
        # clear the OSC stats
        $LCTL set_param osc.*.stats=0 &>/dev/null
+       stop_writeback
 
        # Client writes $bulk_size - there must be 1 rpc for $max_pages.
        dd if=/dev/zero of=$DIR/$tdir/$tfile bs=$bulk_size count=1 \
                oflag=direct &>/dev/null || error "dd failed"
 
+       sync; sleep 1; sync # just to be safe
        local nrpcs=$($LCTL get_param osc.*.stats |awk '/ost_write/ {print $2}')
        if [ x$nrpcs != "x1" ]; then
-               error "found $nrpc ost_write RPCs, not 1 as expected"
+               $LCTL get_param osc.*.stats
+               error "found $nrpcs ost_write RPCs, not 1 as expected"
        fi
 
+       start_writeback
        # Drop the OSC cache, otherwise we will read from it
        cancel_lru_locks osc
 
@@ -13150,7 +13154,8 @@ test_231a()
 
        nrpcs=$($LCTL get_param osc.*.stats | awk '/ost_read/ { print $2 }')
        if [ x$nrpcs != "x1" ]; then
-               error "found $nrpc ost_read RPCs, not 1 as expected"
+               $LCTL get_param osc.*.stats
+               error "found $nrpcs ost_read RPCs, not 1 as expected"
        fi
 }
 run_test 231a "checking that reading/writing of BRW RPC size results in one RPC"