From 9b3a1d1c51df28e3a0301082819c78fae0e8fb68 Mon Sep 17 00:00:00 2001 From: Gaurav Kumar Garg Date: Mon, 14 Mar 2016 14:36:11 +0530 Subject: glusterd: disabling enable-shared-storage option should not delete volume This patch is a backport of: http://review.gluster.org/#/c/12232/ Previously, when you create volume with "glusterd_shared_storage" name and if user disable, enable-shared-storage option then gluster will delete the "glusterd_shared_storage" volume. With this fix gluster will do appropriate validation of enable-shared-storage option and it will not delete volume with "glusterd_shared_storage" name if it is a user created volume. Signed-off-by: Gaurav Kumar Garg >> Change-Id: I2bd92f938fb3de6ef496a934933bdcea9f251491 >> BUG: 1266818 >> Signed-off-by: Gaurav Kumar Garg >> Reviewed-on: http://review.gluster.org/12232 >> Reviewed-by: Atin Mukherjee >> Reviewed-by: Anand Nekkunti >> Tested-by: NetBSD Build System >> Tested-by: Gluster Build System Change-Id: I8cb160fece702a730e25dadbc740e74efc57483e BUG: 1317425 Reviewed-on: http://review.gluster.org/13695 Tested-by: Gaurav Kumar Garg Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Atin Mukherjee --- .../glusterd/bug-1266818-shared-storage-disable.t | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/bugs/glusterd/bug-1266818-shared-storage-disable.t (limited to 'tests') diff --git a/tests/bugs/glusterd/bug-1266818-shared-storage-disable.t b/tests/bugs/glusterd/bug-1266818-shared-storage-disable.t new file mode 100644 index 00000000000..a9ccf1b8954 --- /dev/null +++ b/tests/bugs/glusterd/bug-1266818-shared-storage-disable.t @@ -0,0 +1,36 @@ +#!/bin/bash + +## Test case for BZ 1266818; +## Disabling enable-shared-storage option should not delete user created +## volume with name glusterd_shared_storage + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc +. $(dirname $0)/../../cluster.rc + +cleanup; + +## Start a 2 node virtual cluster +TEST launch_cluster 2; + +## Peer probe server 2 from server 1 cli +TEST $CLI_1 peer probe $H2; + +EXPECT_WITHIN $PROBE_TIMEOUT 1 peer_count + +## Creating a volume with name glusterd_shared_storage +TEST $CLI_1 volume create glusterd_shared_storage $H1:$B1/${V0}0 $H2:$B1/${V0}1 + +## Disabling enable-shared-storage should not succeed and should not delete the +## user created volume with name "glusterd_shared_storage" +TEST ! $CLI_1 volume all enable-shared-storage disable + +## Volume with name should exist +TEST $CLI_1 volume info glusterd_shared_storage + +cleanup; + + + + + -- cgit