diff options
author | Michael Adam <obnox@samba.org> | 2015-11-30 10:51:13 +0100 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2015-12-17 04:06:06 -0800 |
commit | 12f36283d9e18246a97ac6a397cc54dc46ff89c5 (patch) | |
tree | cfa5d41a1ce16ec00957bbc577c671630c5bb5bc /tests | |
parent | 486b07dfc33782d27e3458659cdd6090f496ad35 (diff) |
tests:bugs:fuse: add test for bug #1283103 - selinux mount vs security xattrs
> BUG: 1283103
> Change-Id: Ic4485d650275f67eb6b0b8382a92eb829c06e27c
> Signed-off-by: Michael Adam <obnox@samba.org>
> Reviewed-on: http://review.gluster.org/12827
> Tested-by: Gluster Build System <jenkins@build.gluster.com>
> Reviewed-by: Niels de Vos <ndevos@redhat.com>
> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
(cherry picked from commit 8df88683c334c0652770e8e0fcec59dbc8bb5748)
Change-Id: I6b8e6f1c295ab951e29519113b39c7d7e75b90ee
BUG: 1283107
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-on: http://review.gluster.org/12954
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs/fuse/bug-1283103.t | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/bugs/fuse/bug-1283103.t b/tests/bugs/fuse/bug-1283103.t new file mode 100644 index 00000000000..56612534cb9 --- /dev/null +++ b/tests/bugs/fuse/bug-1283103.t @@ -0,0 +1,59 @@ +#!/bin/bash + +# +# https://bugzilla.redhat.com/show_bug.cgi?id=1283103 +# +# Test that it is possible to set and get security.* +# xattrs other thatn security.selinux irrespective of +# whether the mount was done with --selinux. This is +# for example important for Samba to be able to store +# the Windows-level acls in the security.NTACL xattr +# when the acl_xattr vfs module is used. +# + +. $(dirname $0)/../../include.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 without selinux: +TEST glusterfs -s $H0 --volfile-id $V0 $M0 + +TESTFILE="$M0/testfile" +TEST touch ${TESTFILE} + +TEST echo "setfattr -n security.foobar -v value ${TESTFILE}" +TEST setfattr -n security.foobar -v value ${TESTFILE} +TEST getfattr -n security.foobar ${TESTFILE} +TEST setfattr -x security.foobar ${TESTFILE} + +# can not currently test the security.selinux xattrs +# since the kernel intercepts them. +# see https://bugzilla.redhat.com/show_bug.cgi?id=1272868 +#TEST ! getfattr -n security.selinux ${TESTFILE} +#TEST ! setfattr -n security.selinux -v value ${TESTFILE} + +TEST umount $M0 + +# Mount FUSE with selinux: +TEST glusterfs -s $H0 --volfile-id $V0 --selinux $M0 + +TEST setfattr -n security.foobar -v value ${TESTFILE} +TEST getfattr -n security.foobar ${TESTFILE} +TEST setfattr -x security.foobar ${TESTFILE} + +# can not currently test the security.selinux xattrs +# since the kernel intercepts them. +# see https://bugzilla.redhat.com/show_bug.cgi?id=1272868 +#TEST setfattr -n security.selinux -v value ${TESTFILE} +#TEST getfattr -n security.selinux ${TESTFILE} + +cleanup; |