From f88d0ade1c09aa1a3cee3713dc851da9552d7ff5 Mon Sep 17 00:00:00 2001 From: Gaurav Kumar Garg Date: Thu, 24 Sep 2015 18:04:23 +0530 Subject: glusterd: disabling enable-shared-storage option should not delete volume 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. 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 --- .../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