diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2015-09-08 08:22:23 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-09-13 22:02:43 -0700 |
commit | e89b7dc4f88644cb4538bd1dd3cd493028808bd6 (patch) | |
tree | d61ed73f21c2d4508ddbb600703dae8ec7d24e8d /tests/bugs/shard | |
parent | 1d02d4bd9b5f7d730ab08961c17ef58204c8e8fd (diff) |
features/shard: Filter internal shard xattrs in {get,remove,set}xattr
Backport of: http://review.gluster.org/#/c/12121/ and
http://review.gluster.org/#/c/12136/
Change-Id: Ifadebe1cda80fa4a525605e10513e6e64ee72709
BUG: 1261008
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/12127
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'tests/bugs/shard')
-rw-r--r-- | tests/bugs/shard/bug-1260637.t | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/bugs/shard/bug-1260637.t b/tests/bugs/shard/bug-1260637.t new file mode 100644 index 00000000000..f5bf083b5dc --- /dev/null +++ b/tests/bugs/shard/bug-1260637.t @@ -0,0 +1,41 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc + +cleanup + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 $H0:$B0/${V0}0 +TEST $CLI volume set $V0 features.shard on +TEST $CLI volume start $V0 + +TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0 + +# Create a file. +TEST touch $M0/foo + +# Check that the shard xattrs are set in the backend. +TEST getfattr -n trusted.glusterfs.shard.block-size $B0/${V0}0/foo +TEST getfattr -n trusted.glusterfs.shard.file-size $B0/${V0}0/foo + +# Verify that shard xattrs are not exposed on the mount. +TEST ! getfattr -n trusted.glusterfs.shard.block-size $M0/foo +TEST ! getfattr -n trusted.glusterfs.shard.file-size $M0/foo + +# Verify that shard xattrs cannot be set from the mount. +TEST ! setfattr -n trusted.glusterfs.shard.block-size -v "123" $M0/foo +TEST ! setfattr -n trusted.glusterfs.shard.file-size -v "123" $M0/foo + +# Verify that shard xattrs cannot be removed from the mount. +TEST ! setfattr -x trusted.glusterfs.shard.block-size $M0/foo +TEST ! setfattr -x trusted.glusterfs.shard.file-size $M0/foo + +# Verify that shard xattrs are not listed when listxattr is triggered. +TEST ! "getfattr -d -m . $M0/foo | grep shard" + +TEST umount $M0 +TEST $CLI volume stop $V0 +TEST $CLI volume delete $V0 + +cleanup |