From 8bdc329e892f35ca19dfd07b542aa81afd855fce Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Tue, 10 Dec 2013 14:28:22 -0800 Subject: posix: if brick-uid or brick-gid is not specified, do not set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Current code would set owner uid/gid explicitly to 0/0 on start even if none was specified. Fix it. Change-Id: I72dec9e79c51bd1eb3af5334c42b7c23b01d0258 BUG: 1040275 Signed-off-by: Anand Avati Reviewed-on: http://review.gluster.org/6476 Tested-by: Gluster Build System Tested-by: Lukáš Bezdička Reviewed-by: Krishnan Parthasarathi Reviewed-by: Vijay Bellur --- tests/bugs/brick-uid-reset-on-volume-restart.t | 47 ++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 tests/bugs/brick-uid-reset-on-volume-restart.t (limited to 'tests/bugs') 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 000000000..99629733f --- /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; -- cgit