diff options
author | vmallika <vmallika@redhat.com> | 2015-04-15 17:35:07 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-05-07 23:54:33 -0700 |
commit | ffbe47e0ec8411313b666a8705f31a67d3862763 (patch) | |
tree | a161fdbec2678aea5329fae1dcb932cefe4d8395 /tests | |
parent | 753a603ce3259f3c6667a48ff4001512941f9128 (diff) |
quota: support for inode quota in quota.conf
Currently when quota limit is set, corresponding gfid
is set in quota.conf. This patch supports storing
inode-quota limits in quota.conf and also stores
additional byte for each gfid to differentiate
between usage quota limit and inode quota limit.
Change-Id: I444d7399407594edd280e640681679a784d4c46a
BUG: 1218170
Signed-off-by: vmallika <vmallika@redhat.com>
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/10069
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/10524
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs/quota/bug-1202244-support-inode-quota.t | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/bugs/quota/bug-1202244-support-inode-quota.t b/tests/bugs/quota/bug-1202244-support-inode-quota.t new file mode 100644 index 00000000000..438bbad7b2f --- /dev/null +++ b/tests/bugs/quota/bug-1202244-support-inode-quota.t @@ -0,0 +1,44 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +function get_quota_value() +{ + local LIST_TYPE=$1 + local LIMIT_PATH=$2; + $CLI volume quota $V0 $LIST_TYPE $LIMIT_PATH | grep "$LIMIT_PATH"\ + | awk '{print $2}' +} + +cleanup; + +TEST glusterd; +TEST pidof glusterd; + +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2}; +TEST $CLI volume start $V0; +TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0; + +TEST $CLI volume quota $V0 enable; +EXPECT "on" volinfo_field $V0 'features.quota' +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" quotad_up_status; + +TEST mkdir $M0/dir; + +TEST $CLI volume quota $V0 limit-usage /dir 10MB; +EXPECT "10.0MB" get_quota_value "list" "/dir" + +TEST $CLI volume quota $V0 limit-objects /dir 10; +EXPECT "10" get_quota_value "list-objects" "/dir" + +TEST $CLI volume quota $V0 remove /dir; +EXPECT "" get_quota_value "list" "/dir" + +TEST $CLI volume quota $V0 remove-objects /dir; +EXPECT "" get_quota_value "list-objects" "/dir" + +TEST $CLI volume stop $V0 +EXPECT "1" get_aux + +cleanup; |