From bf3a6dcdf3c8a8a64e7c864b56c4d9be60fca8e6 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Wed, 3 Jun 2015 15:18:08 +0530 Subject: snapshot: Fix finding brick mount path logic Previously while finding brick mount paths of snap volume's bricks, we were taking brick order into consideration. This logic fails when a brick is removed or a tier is added. Hence modifying the logic to look for the first occurence of the word "brick" in the brick path. From there we iterate till we find a '/'. The string till the first '/' after we encounter the word brick is the brick mount path. Change-Id: Ic85983c4e975e701cdfd4e13f8e276ac391a3e49 BUG: 1227646 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/11060 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Rajesh Joseph Reviewed-by: Krishnan Parthasarathi --- tests/bugs/snapshot/bug-1227646.t | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/bugs/snapshot/bug-1227646.t (limited to 'tests/bugs') diff --git a/tests/bugs/snapshot/bug-1227646.t b/tests/bugs/snapshot/bug-1227646.t new file mode 100644 index 00000000000..643d814e2ee --- /dev/null +++ b/tests/bugs/snapshot/bug-1227646.t @@ -0,0 +1,32 @@ +#!/bin/bash + +. $(dirname $0)/../../volume.rc +. $(dirname $0)/../../snapshot.rc +. $(dirname $0)/../../include.rc + +cleanup; + +TEST init_n_bricks 3; +TEST setup_lvm 3; + +TEST glusterd; +TEST pidof glusterd; + +#TEST $CLI volume create $V0 $H0:$L1 $H0:$L2 $H0:$L3; +TEST $CLI volume create $V0 $H0:$L2 $H0:$L3; +TEST $CLI volume start $V0; + +TEST $CLI snapshot create snap1 $V0 no-timestamp; +TEST $CLI volume stop $V0 +TEST $CLI snapshot restore snap1; +TEST $CLI volume start $V0 +TEST $CLI volume attach-tier $V0 $H0:$L1 $H0:$L2 + +TEST pkill gluster +TEST glusterd +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Started' volinfo_field $V0 'Status' + +TEST $CLI volume stop $V0 + +cleanup ; + -- cgit