diff options
author | vmallika <vmallika@redhat.com> | 2015-07-10 14:37:50 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2015-07-12 21:34:53 -0700 |
commit | 46d4d7ade012f86044135dd4af3101f851484cda (patch) | |
tree | e5308db8044e62788e0bde1f21ed54a904af40fe /tests/volume.rc | |
parent | 2e44d1580497eb75f325ad3104249a425ddf592a (diff) |
features/quota : Fix spurious failure
Problem : Basically, in this test case a file is created
which exceeds the quota limit. Once the limit is reached
that file will be deleted. At the same moment we are
testing inode-quota. It can so happen that before the
marker updates the information related to deletion of
file, a new file creation operation comes and sees that
quota limit is still exceeded.
Solution : Inducing a check to see if marker updation
completed successfully.
Updated all the test case which has the similar
machanism and also moved the "usage" function
to a common place "volume.rc"
Change-Id: I36ddbc5ebbf1b74c9d326a0d1d5f3b32f20a906a
BUG: 1229297
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/11125
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'tests/volume.rc')
-rw-r--r-- | tests/volume.rc | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/tests/volume.rc b/tests/volume.rc index 8782f461850..4bbaf108cd1 100644 --- a/tests/volume.rc +++ b/tests/volume.rc @@ -559,19 +559,42 @@ function drop_cache() { function quota_list_field () { local QUOTA_PATH=$1 local FIELD=$2 - $CLI volume quota $V0 list $QUOTA_PATH | grep $QUOTA_PATH\ - | awk '{print $FIELD}' + local cmd="$CLI volume quota $V0 list $QUOTA_PATH | grep $QUOTA_PATH | awk '{print \$$FIELD}'" + + $cmd } function quota_object_list_field () { local QUOTA_PATH=$1 local FIELD=$2 - $CLI volume quota $V0 list-objects $QUOTA_PATH | grep $QUOTA_PATH\ - | awk '{print $FIELD}' + local cmd="$CLI volume quota $V0 list-objects $QUOTA_PATH | grep $QUOTA_PATH | awk '{print \$$FIELD}'" + + $cmd } -function quota_usage() +function quotausage() { quota_list_field $1 4 } +function quota_hard_limit() +{ + quota_list_field $1 2 +} + +function quota_soft_limit() +{ + quota_list_field $1 3 +} + +function quota_sl_exceeded() +{ + quota_list_field $1 6 +} + +function quota_hl_exceeded() +{ + quota_list_field $1 7 + +} + |