Test GRANT_CHECK_LIST across a selection of sanity.
Fix check_grant() to account for grant precreate and grant pending and
subtract it from total grant on OSTs.
Test-Parameters: trivial osscount=2 mdscount=2 mdtcount=1 ostcount=2 mdtfilesystemtype=zfs ostfilesystemtype=zfs testlist=sanity
Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: I05b9f994033e8edf92bf30a17f74f2a0f6bee462
Reviewed-on: https://review.whamcloud.com/21619
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
set -e
ONLY=${ONLY:-"$*"}
set -e
ONLY=${ONLY:-"$*"}
-# bug number for skipped test: 13297 2108 9789 3637 9789 3561 5188
-ALWAYS_EXCEPT=" 42a 42b 42c 42d 45 68b $SANITY_EXCEPT"
+# bug number for skipped test: LU-6493 3561 5188
+ALWAYS_EXCEPT=" 42b 45 68b $SANITY_EXCEPT"
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
# bug number for skipped tests: LU-2036 LU-8411 LU-9096
ALWAYS_EXCEPT=" 76 407 253 $ALWAYS_EXCEPT"
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
# bug number for skipped tests: LU-2036 LU-8411 LU-9096
ALWAYS_EXCEPT=" 76 407 253 $ALWAYS_EXCEPT"
+# Check Grants after these tests
+GRANT_CHECK_LIST="$GRANT_CHECK_LIST 42a 42b 42c 42d 42e 63a 63b 64a 64b 64c"
+
is_sles11() # LU-4341
{
if [ -r /etc/SuSE-release ]
is_sles11() # LU-4341
{
if [ -r /etc/SuSE-release ]
export base=$(basetest $1)
[ "$CHECK_GRANT" == "no" ] && return 0
export base=$(basetest $1)
[ "$CHECK_GRANT" == "no" ] && return 0
- testname=GCHECK_ONLY_${base}
- [ ${!testname}x == x ] && return 0
+ testnamebase=GCHECK_ONLY_${base}
+ testname=GCHECK_ONLY_$1
+ [ ${!testnamebase}x == x -a ${!testname}x == x ] && return 0
echo -n "checking grant......"
echo -n "checking grant......"
awk '{ total += $1 } END { printf("%0.0f", total) }')
# get server grant
awk '{ total += $1 } END { printf("%0.0f", total) }')
# get server grant
+ # which is tot_granted less grant_precreate
server_grant=$(do_nodes $(comma_list $(osts_nodes)) \
server_grant=$(do_nodes $(comma_list $(osts_nodes)) \
- "$LCTL get_param -n obdfilter.${FSNAME}-OST*.tot_granted" |
- awk '{ total += $1 } END { printf("%0.0f", total) }')
+ "$LCTL get_param "\
+ "obdfilter.${FSNAME}-OST*.{tot_granted,tot_pending,grant_precreate}" |
+ sed 's/=/ /'| awk '/tot_granted/{ total += $2 };
+ /tot_pending/{ total -= $2 };
+ /grant_precreate/{ total -= $2 };
+ END { printf("%0.0f", total) }')
# check whether client grant == server grant
if [[ $client_grant -ne $server_grant ]]; then
# check whether client grant == server grant
if [[ $client_grant -ne $server_grant ]]; then
- echo "failed: client:${client_grant} server: ${server_grant}."
do_nodes $(comma_list $(osts_nodes)) \
do_nodes $(comma_list $(osts_nodes)) \
- "$LCTL get_param obdfilter.${FSNAME}-OST*.tot*"
+ "$LCTL get_param obdfilter.${FSNAME}-OST*.tot*" \
+ "obdfilter.${FSNAME}-OST*.grant_*"
do_nodes $clients "$LCTL get_param osc.${FSNAME}-*.cur_*_bytes"
do_nodes $clients "$LCTL get_param osc.${FSNAME}-*.cur_*_bytes"
+ error "failed: client:${client_grant} server: ${server_grant}."
else
echo "pass: client:${client_grant} server: ${server_grant}"
fi
else
echo "pass: client:${client_grant} server: ${server_grant}"
fi