diff options
author | Niels de Vos <ndevos@redhat.com> | 2014-05-08 22:21:25 -0300 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2014-05-09 07:36:02 -0700 |
commit | e528724e793a8add1e3c21932913d8cb4e93da8c (patch) | |
tree | e2a30a9a1aecac3cabe7673fd294f3209e3e136f /tests/bugs | |
parent | a256094f34df6500bcd19845fd0f32a9f3690751 (diff) |
posix: if brick-uid or brick-gid is not specified, do not set
Current code would set owner uid/gid explicitly to 0/0 on start
even if none was specified. Fix it.
Cherry picked from commit 8bdc329:
> Change-Id: I72dec9e79c51bd1eb3af5334c42b7c23b01d0258
> BUG: 1040275
> Signed-off-by: Anand Avati <avati@redhat.com>
> Reviewed-on: http://review.gluster.org/6476
> Tested-by: Gluster Build System <jenkins@build.gluster.com>
> Tested-by: Lukáš Bezdička <lukas.bezdicka@gooddata.com>
> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Change-Id: Ie0396c1a4e6e0979ea9c855d33db963544a75c42
BUG: 1095971
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/7720
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'tests/bugs')
-rwxr-xr-x | tests/bugs/brick-uid-reset-on-volume-restart.t | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/bugs/brick-uid-reset-on-volume-restart.t b/tests/bugs/brick-uid-reset-on-volume-restart.t new file mode 100755 index 00000000000..99629733f9b --- /dev/null +++ b/tests/bugs/brick-uid-reset-on-volume-restart.t @@ -0,0 +1,47 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +function get_uid() { + stat -c '%u' $1; +} + +function get_gid() { + stat -c '%g' $1; +} + + +cleanup; + +TEST glusterd +TEST pidof glusterd + +TEST $CLI volume create $V0 replica 2 stripe 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; + +EXPECT "$V0" volinfo_field $V0 'Volume Name'; +EXPECT 'Created' volinfo_field $V0 'Status'; +EXPECT '8' brick_count $V0 + +TEST $CLI volume start $V0; +EXPECT 'Started' volinfo_field $V0 'Status'; + +TEST glusterfs -s $H0 --volfile-id $V0 $M0; + +EXPECT 0 get_uid $M0; +EXPECT 0 get_gid $M0; + +TEST chown 100:101 $M0; + +EXPECT 100 get_uid $M0; +EXPECT 101 get_gid $M0; + +TEST $CLI volume stop $V0; +TEST $CLI volume start $V0; + +sleep 10; + +EXPECT 100 get_uid $M0; +EXPECT 101 get_gid $M0; + +cleanup; |