Whamcloud - gitweb
b=19063
authoranserper <anserper>
Mon, 13 Apr 2009 23:32:29 +0000 (23:32 +0000)
committeranserper <anserper>
Mon, 13 Apr 2009 23:32:29 +0000 (23:32 +0000)
i=Elena Gryaznova
quota_save_version must wait until switch to the new version has happened

lustre/tests/sanity-quota.sh
lustre/tests/test-framework.sh

index ed67bc6..b6e1d4b 100644 (file)
@@ -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 ==="
 
index 3bc799a..c0a802e 100644 (file)
@@ -372,6 +372,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 
@@ -808,14 +814,14 @@ wait_update () {
         local WAIT=0
         local sleep=5
         while [ $WAIT -lt $MAX ]; do
-            sleep $sleep
             RESULT=$(do_node $node "$TEST")
-            if [ $RESULT -eq $FINAL ]; then
+            if [ "$RESULT" = "$FINAL" ]; then
                 echo "Updated after $WAIT sec: wanted $FINAL got $RESULT"
                 return 0
             fi
-            WAIT=$((WAIT + sleep))
             echo "Waiting $((MAX - WAIT)) secs for update"
+            sleep $sleep
+            WAIT=$((WAIT + sleep))
         done
         echo "Update not seen after $MAX sec: wanted $FINAL got $RESULT"
         return 3
@@ -823,7 +829,8 @@ wait_update () {
 
 wait_update_facet () {
     local facet=$1
-    wait_update  $(facet_host $facet) $@
+    shift
+    wait_update  $(facet_host $facet) "$@"
 }
 
 wait_delete_completed () {