Whamcloud - gitweb
LU-11174 quota: use sync io to test quota 74/32874/3
authorHongchao Zhang <hongchao@whamcloud.com>
Fri, 20 Jul 2018 19:45:56 +0000 (15:45 -0400)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 27 Jul 2018 08:56:19 +0000 (08:56 +0000)
In test_61 of sanity-quota, the client cache (grant) could affect
the quota behavior, using sync io to avoid the effect of it.

Test-Parameters: trivial testlist=sanity-quota,sanity-quota,sanity-quota,sanity-quota,sanity-quota,sanity-quota,sanity-quota,sanity-quota,sanity-quota,sanity-quota,sanity-quota,sanity-quota

Change-Id: I08bc19c5e7ac4f9cb679f96a2299c0be772f0330
Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/32874
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Tested-by: Jenkins
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity-quota.sh

index be12530..12ad793 100755 (executable)
@@ -3127,7 +3127,7 @@ test_default_quota() {
        local qdtype="-U"
        local qs="-b"
        local qh="-B"
-       local LIMIT=102400 #100M disk space
+       local LIMIT=20480 #20M disk space
        local TESTFILE="$DIR/$tdir/$tfile-0"
 
        [ $qtype == "-p" ] && ! is_project_quota_supported &&
@@ -3189,7 +3189,7 @@ test_default_quota() {
 
        log "Test not out of quota"
        if [ $qpool == "data" ]; then
-               $RUNAS $DD of=$TESTFILE count=$((LIMIT/2 >> 10)) ||
+               $RUNAS $DD of=$TESTFILE count=$((LIMIT/2 >> 10)) oflag=sync ||
                        quota_error $qtype $qid "write failed, expect succeed"
        else
                $RUNAS createmany -m $TESTFILE $((LIMIT/2)) ||
@@ -3204,7 +3204,7 @@ test_default_quota() {
        cancel_lru_locks mdc
        sync; sync_all_data || true
        if [ $qpool == "data" ]; then
-               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) &&
+               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) oflag=sync &&
                        quota_error $qtype $qid "write succeed, expect EDQUOT"
        else
                $RUNAS createmany -m $TESTFILE $((LIMIT*2)) &&
@@ -3222,7 +3222,7 @@ test_default_quota() {
        cancel_lru_locks mdc
        sync; sync_all_data || true
        if [ $qpool == "data" ]; then
-               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) ||
+               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) oflag=sync ||
                        quota_error $qtype $qid "write failed, expect succeed"
        else
                $RUNAS createmany -m $TESTFILE $((LIMIT*2)) ||
@@ -3239,7 +3239,7 @@ test_default_quota() {
        cancel_lru_locks mdc
        sync; sync_all_data || true
        if [ $qpool == "data" ]; then
-               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) &&
+               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) oflag=sync &&
                        quota_error $qtype $qid "write succeed, expect EQUOT"
        else
                $RUNAS createmany -m $TESTFILE $((LIMIT*2)) &&
@@ -3256,7 +3256,7 @@ test_default_quota() {
        cancel_lru_locks mdc
        sync; sync_all_data || true
        if [ $qpool == "data" ]; then
-               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) ||
+               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) oflag=sync ||
                        quota_error $qtype $qid "write failed, expect succeed"
        else
                $RUNAS createmany -m $TESTFILE $((LIMIT*2)) ||