From d8179d25a87cfb57967a73a3d3257be5f894949c Mon Sep 17 00:00:00 2001 From: Emoly Liu Date: Sun, 19 May 2013 16:45:38 +0800 Subject: [PATCH] LU-3508 test: small fix for sanity.sh test_101c Filter out those "found no match" proc entries in sanity.sh test_101c and do some code cleanup. Signed-off-by: Liu Ying Change-Id: Ie56c058318c52c8809a21ed242e9bb797b7d421a Reviewed-on: http://review.whamcloud.com/6854 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Alexey Lyashkov Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 55 +++++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 32 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index f046122..75e3bc1 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -5865,40 +5865,31 @@ test_101c() { local STRIPE_SIZE=1048576 local FILE_LENGTH=$((STRIPE_SIZE*100)) local nreads=10000 - local osc + local osc_rpc_stats - setup_test101bc - - cancel_lru_locks osc - $LCTL set_param osc.*.rpc_stats 0 - $READS -f $DIR/$tfile -s$FILE_LENGTH -b65536 -n$nreads -t 180 - for osc in $($LCTL get_param -N osc.*); do - if [ "$osc" == "osc.num_refs" ]; then - continue - fi - - local lines=$($LCTL get_param -n ${osc}.rpc_stats | wc | awk '{print $1}') - if [ $lines -le 20 ]; then - continue - fi + setup_test101bc - local rpc4k=$($LCTL get_param -n ${osc}.rpc_stats | - awk '$1 == "1:" { print $2; exit; }') - local rpc8k=$($LCTL get_param -n ${osc}.rpc_stats | - awk '$1 == "2:" { print $2; exit; }') - local rpc16k=$($LCTL get_param -n ${osc}.rpc_stats | - awk '$1 == "4:" { print $2; exit; }') - local rpc32k=$($LCTL get_param -n ${osc}.rpc_stats | - awk '$1 == "8:" { print $2; exit; }') - - [ $rpc4k != 0 ] && error "Small 4k read IO ${rpc4k}!" - [ $rpc8k != 0 ] && error "Small 8k read IO ${rpc8k}!" - [ $rpc16k != 0 ] && error "Small 16k read IO ${rpc16k}!" - [ $rpc32k != 0 ] && error "Small 32k read IO ${rpc32k}!" - echo "${osc} rpc check passed!" - done - cleanup_test101bc - true + cancel_lru_locks osc + $LCTL set_param osc.*.rpc_stats 0 + $READS -f $DIR/$tfile -s$FILE_LENGTH -b65536 -n$nreads -t 180 + for osc_rpc_stats in $($LCTL get_param -N osc.*.rpc_stats); do + local stats=$($LCTL get_param -n $osc_rpc_stats) + local lines=$(echo "$stats" | awk 'END {print NR;}') + local size + + if [ $lines -le 20 ]; then + continue + fi + for size in 1 2 4 8; do + local rpc=$(echo "$stats" | + awk '($1 == "'$size':") {print $2; exit; }') + [ $rpc != 0 ] && + error "Small $((size*4))k read IO $rpc !" + done + echo "$osc_rpc_stats check passed!" + done + cleanup_test101bc + true } run_test 101c "check stripe_size aligned read-ahead =================" -- 1.8.3.1