From 2014640f08e0a5a8a4fa400d63159ee878b3132f Mon Sep 17 00:00:00 2001 From: anserper Date: Mon, 13 Apr 2009 23:37:22 +0000 Subject: [PATCH] b=19063 i=Elena Gryaznova quota_save_version must wait until switch to the new version has happened --- lustre/tests/sanity-quota.sh | 14 +++++++++++--- lustre/tests/test-framework.sh | 9 ++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index f14933f..9fabb3d 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -1309,7 +1309,12 @@ test_15(){ LIMIT=$((24 * 1024 * 1024 * 1024 * 1024)) # 24 TB PATTERN="`echo $DIR | sed 's/\//\\\\\//g'`" - wait_delete_completed + wait_delete_completed + + # force using the latest version in case 14b was omitted + $LFS quotaoff -ug $DIR + quota_set_version 3 2>&1 | grep "Invalid argument" && quota_set_version 2 + $LFS quotacheck -ug $DIR || error "quotacheck failed" # test for user $LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR @@ -1323,13 +1328,16 @@ test_15(){ TOTAL_LIMIT="`$LFS quota -v -g $TSTUSR $DIR | awk '/^.*'$PATTERN'.*[[:digit:]+][[:space:]+]/ { print $4 }'`" [ $TOTAL_LIMIT -eq $LIMIT ] || error " (group)total limits = $TOTAL_LIMIT; limit = $LIMIT, failed!" echo " (group)total limits = $TOTAL_LIMIT; limit = $LIMIT, successful!" + resetquota -g $TSTUSR $LFS quotaoff -ug $DIR - quota_set_version 1 + quota_save_version 1 $LFS quotacheck -ug $DIR || error "quotacheck failed" echo "Testing that >4GB quota limits fail on volume with quota v1" - ! $LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR + $LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR && error "no error from setquota, but should have failed" + + return 0 } run_test_with_stat 15 "set block quota more than 4T ===" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 14e3229..124621f 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -362,6 +362,12 @@ quota_save_version() { varsvc=${ost}_svc do_facet mgs "lctl conf_param ${!varsvc}.ost.quota_type=$1" done + + # we must wait until the update has been triggered on the OST + for ost in ${osts//,/ }; do + wait_update_facet $ost "lctl get_param -n obdfilter.${!varsvc}.quota_type" $1 + done + wait_update_facet mds "lctl get_param -n mds.${fsname}-MDT*.quota_type" $1 } # client could mount several lustre @@ -836,7 +842,8 @@ wait_update () { wait_update_facet () { local facet=$1 - wait_update $(facet_host $facet) $@ + shift + wait_update $(facet_host $facet) "$@" } wait_delete_completed () { -- 1.8.3.1