diff options
author | Vijaykumar M <vmallika@redhat.com> | 2013-11-26 18:01:17 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-11-26 11:00:18 -0800 |
commit | 21f7ad207bdb8ddf549aa65cafc1ad95e261ec3d (patch) | |
tree | 1c65c603ffd579aa3b6668e16984f150e5cdfc7b /tests/bugs | |
parent | 2f218e1335d5fdab0b41716cc5c8976b20c367f6 (diff) |
posix: do not allow to set/get "trusted.glusterfs.volume-id" xattr
Change-Id: I2e9a2264b1fd5ebc1ed0aff30225e89acbd0bcb4
BUG: 1034716
Signed-off-by: Vijaykumar M <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/6361
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'tests/bugs')
-rw-r--r-- | tests/bugs/bug-1034716.t | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/bugs/bug-1034716.t b/tests/bugs/bug-1034716.t new file mode 100644 index 00000000000..5f98f7ae787 --- /dev/null +++ b/tests/bugs/bug-1034716.t @@ -0,0 +1,60 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +cleanup; + +#Basic checks +TEST glusterd +TEST pidof glusterd +TEST $CLI volume info + +#Create a distributed volume +TEST $CLI volume create $V0 $H0:$B0/${V0}{1..2}; +TEST $CLI volume start $V0 + +# Mount FUSE +TEST glusterfs -s $H0 --volfile-id $V0 $M0 + +#Create a file and perform fop on a DIR +TEST touch $M0/foo + +function xattr_query_check() { + local path=$1 + + local ret=`getfattr -m . -d $path 2>&1 | grep -c 'trusted.glusterfs'` + echo $ret +} + +function set_xattr() { + local path=$1 + local xa_name=$2 + local xa_val=$3 + + setfattr -n $xa_name -v $xa_val $path + echo $? +} + +function remove_xattr() { + local path=$1 + local xa_name=$2 + + setfattr -x $xa_name $path + echo $? +} + +EXPECT 0 xattr_query_check $M0/ +EXPECT 0 xattr_query_check $M0/foo + +EXPECT 1 set_xattr $M0/ 'trusted.glusterfs.volume-id' 'foo' +EXPECT 1 remove_xattr $M0/ 'trusted.glusterfs.volume-id' + + +## Finish up +TEST umount $M0 +TEST $CLI volume stop $V0 +TEST $CLI volume delete $V0; +TEST ! $CLI volume info $V0; + +cleanup; |