From 44c672e6aca39acbcca2aeb1b5b5b61a45265ce4 Mon Sep 17 00:00:00 2001 From: Nathaniel Clark Date: Mon, 1 Aug 2016 16:23:40 -0400 Subject: [PATCH] LU-2049 tests: Add GRANT_CHECK_LIST to sanity 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 Change-Id: I05b9f994033e8edf92bf30a17f74f2a0f6bee462 Reviewed-on: https://review.whamcloud.com/21619 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Nunez --- lustre/tests/sanity.sh | 7 +++++-- lustre/tests/test-framework.sh | 20 +++++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 3bd6019..863eba0 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -8,13 +8,16 @@ 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" +# 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 ] diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 653709d..dab9279 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -5314,8 +5314,9 @@ check_grant() { 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......" @@ -5331,17 +5332,22 @@ check_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)) \ - "$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 - echo "failed: client:${client_grant} server: ${server_grant}." 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" - return 1 + error "failed: client:${client_grant} server: ${server_grant}." else echo "pass: client:${client_grant} server: ${server_grant}" fi -- 1.8.3.1