1 --- lustre/tests/test-framework.sh
2 +++ lustre/tests/test-framework.sh
4 (cd `dirname $1`; echo $PWD/`basename $1`)
8 - [ -d $DIR1 ] && cd $DIR1 && sync; sleep 1; sync
9 - [ -d $DIR2 ] && cd $DIR2 && sync; sleep 1; sync
14 export base=`basetest $1`
15 @@ -3069,39 +3064,34 @@
16 [ ${!testname}x == x ] && return 0
18 echo -n "checking grant......"
20 - # write some data to sync client lost_grant
21 - rm -f $DIR1/${tfile}_check_grant_* 2>&1
22 - for i in `seq $OSTCOUNT`; do
23 - $LFS setstripe $DIR1/${tfile}_check_grant_$i -i $(($i -1)) -c 1
24 - dd if=/dev/zero of=$DIR1/${tfile}_check_grant_$i bs=4k \
25 - count=1 > /dev/null 2>&1
27 - # sync all the data and make sure no pending data on server
30 - #get client grant and server grant
32 - for d in `lctl get_param -n osc.*.cur_grant_bytes`; do
33 - client_grant=$((client_grant + $d))
36 - for d in `lctl get_param -n obdfilter.*.tot_granted`; do
37 - server_grant=$((server_grant + $d))
40 - # cleanup the check_grant file
41 - for i in `seq $OSTCOUNT`; do
42 - rm $DIR1/${tfile}_check_grant_$i
44 + local clients=$CLIENTS
45 + [ -z $clients ] && clients=$(hostname)
47 + # sync all the data and make sure no pending data on server
48 + do_nodes $clients sync
51 + client_grant=`do_nodes $clients \
52 + "$LCTL get_param -n osc.${FSNAME}-*.cur_*grant_bytes" | \
53 + awk '{total += $1} END{print total}'`
56 + server_grant=`do_nodes $(comma_list $(osts_nodes)) \
57 + "$LCTL get_param -n obdfilter.${FSNAME}-OST*.tot_granted" | \
58 + awk '{total += $1} END{print total}'`
60 + # check whether client grant == server grant
61 + if [ $client_grant -ne $server_grant ]; then
62 + echo "failed: client:${client_grant} server: ${server_grant}."
63 + do_nodes $(comma_list $(osts_nodes)) \
64 + "$LCTL get_param obdfilter.${FSNAME}-OST*.tot*"
65 + do_nodes $clients "$LCTL get_param osc.${FSNAME}-*.cur_*_bytes"
68 + echo "pass: client:${client_grant} server: ${server_grant}"
71 - #check whether client grant == server grant
72 - if [ $client_grant != $server_grant ]; then
73 - echo "failed: client:${client_grant} server: ${server_grant}"
80 ########################