summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2013-12-12 06:20:55 +0000
committerVijay Bellur <vbellur@redhat.com>2014-01-22 20:43:04 -0800
commit79683794c2ee9c6b5c1182e2a378598c2037a9ff (patch)
tree0d6c24c70569383d915820a011b0f8323299dd08 /tests
parentb2dfa011a3fdcb7d22764d143517d0fbd1c2a201 (diff)
quota: filter glusterfs quota xattrs
Change-Id: I86ebe02735ee88598640240aa888e02b48ecc06c BUG: 1040423 Signed-off-by: Susant Palai <spalai@redhat.com> Reviewed-on: http://review.gluster.org/6490 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/bugs/bug-1040423.t72
1 files changed, 72 insertions, 0 deletions
diff --git a/tests/bugs/bug-1040423.t b/tests/bugs/bug-1040423.t
new file mode 100755
index 000000000..6dae9eac6
--- /dev/null
+++ b/tests/bugs/bug-1040423.t
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+
+cleanup
+
+function _init() {
+# Start glusterd
+TEST glusterd;
+TEST pidof glusterd;
+TEST $CLI volume info;
+
+# Lets create volume
+TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2};
+
+## Verify volume is created
+EXPECT "$V0" volinfo_field $V0 'Volume Name';
+EXPECT 'Created' volinfo_field $V0 'Status';
+
+#Start volume and verify
+TEST $CLI volume start $V0;
+EXPECT 'Started' volinfo_field $V0 'Status';
+TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0
+
+#Enable Quota
+TEST $CLI volume quota $V0 enable
+
+#As quotad consumes some time to connect to brick process we invoke sleep
+sleep 10;
+
+#set limit of 1GB of quota on root
+TEST $CLI volume quota $V0 limit-usage / 1GB
+}
+
+function get_hardlimit()
+{
+ VOLUME=$1
+
+ $CLI volume quota $VOLUME list | tail -1 | sed "s/ \{1,\}/ /g" |
+ cut -d' ' -f 2
+}
+
+function check_fattrs {
+
+touch $M0/file1;
+
+#This confirms that pgfid is also filtered
+TEST ! "getfattr -d -e hex -m . $M0/file1 | grep pgfid ";
+
+#just check for quota xattr are visible or not
+TEST ! "getfattr -d -e hex -m . $M0 | grep quota";
+
+#setfattr should fail
+TEST ! setfattr -n trusted.glusterfs.quota.limit-set -v 10 $M0;
+
+#remove xattr should fail
+TEST ! setfattr -x trusted.glusterfs.quota.limit-set $M0;
+
+#check if list command still shows the correct value or not
+
+EXPECT "1.0GB" get_hardlimit $V0
+
+}
+
+_init;
+check_fattrs;
+cleanup
+
+
+
+