From cf5a5ab1a81bb61bb66982757ccd301d015ac16e Mon Sep 17 00:00:00 2001 From: Anuradha Date: Mon, 23 Jun 2014 14:37:38 +0530 Subject: features/index : Creation of indices directory as soon as brick is up. Missing indices directory in the bricks leads to unwanted log messages. Therefore, indices directory needs to be created as soon as the brick comes up. This patch results in creation of indices/xattrop directory as required. Also includes a testcase to test the same. Backport of http://review.gluster.org/#/c/6343/ and http://review.gluster.org/#/c/6426/ Change-Id: I2a6f48b78aa09357ed60e45b62ec5fb08f816d76 BUG: 1112111 Signed-off-by: Anuradha Reviewed-on: http://review.gluster.org/8152 Reviewed-by: Pranith Kumar Karampuri Tested-by: Gluster Build System Reviewed-by: Niels de Vos --- tests/bugs/bug-1112111.t | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/bugs/bug-1112111.t (limited to 'tests') diff --git a/tests/bugs/bug-1112111.t b/tests/bugs/bug-1112111.t new file mode 100644 index 00000000000..7ccb4403ea9 --- /dev/null +++ b/tests/bugs/bug-1112111.t @@ -0,0 +1,31 @@ +#!/bin/bash +#Test case: Check the creation of indices/xattrop dir as soon as brick comes up. + +. $(dirname $0)/../include.rc + +cleanup; + +#Create a volume +TEST glusterd; +TEST pidof glusterd +TEST $CLI volume info; + +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}-{0,1}; +EXPECT 'Created' volinfo_field $V0 'Status'; + +TEST mkdir -p $B0/${V0}-0/.glusterfs/indices/ +TEST touch $B0/${V0}-0/.glusterfs/indices/xattrop + +#Volume start should not work when xattrop dir not created +TEST ! $CLI volume start $V0; + +TEST rm $B0/${V0}-0/.glusterfs/indices/xattrop + +#Volume start should work now +TEST $CLI volume start $V0; +EXPECT 'Started' volinfo_field $V0 'Status'; + +#Check for the existence of indices/xattrop dir +TEST [ -d $B0/${V0}-0/.glusterfs/indices/xattrop/ ]; + +cleanup; -- cgit