diff options
author | Vijaikumar M <vmallika@redhat.com> | 2013-11-06 16:41:50 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-12-03 18:12:01 -0800 |
commit | 8e21e00fc662abb4f6556d9a258fa9ec57a20ed0 (patch) | |
tree | 0ade185f3c7fcc77f1e68512f8ef50c89b9c164a /tests | |
parent | 133c370ec5e2688b6734acb087fe3769cb900a74 (diff) |
glusterd: Do not allow remove-brick commit if the bricks are not decommissioned
Change-Id: Ibf47ea848bbb7ae37ccf91c40e5fe0e2338438b7
BUG: 1027171
Signed-off-by: Vijaikumar M <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/6233
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs/bug-1027171.t | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/bugs/bug-1027171.t b/tests/bugs/bug-1027171.t new file mode 100644 index 00000000000..c1f4bd809fe --- /dev/null +++ b/tests/bugs/bug-1027171.t @@ -0,0 +1,53 @@ +#!/bin/bash + +#Test case: Do not allow commit if the bricks are not decommissioned + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +cleanup; + +#Basic checks +TEST glusterd +TEST pidof glusterd +TEST $CLI volume info + +#Create a Distributed volume +TEST $CLI volume create $V0 $H0:$B0/${V0}{1..2}; +TEST $CLI volume start $V0 + +#Remove bricks and commit without starting +function remove_brick_commit_status { + $CLI volume remove-brick $V0 \ + $H0:$B0/${V0}2 commit 2>&1 |grep -oE "success|decommissioned" +} +EXPECT "decommissioned" remove_brick_commit_status; + +TEST $CLI volume stop $V0 +TEST $CLI volume delete $V0 +TEST ! $CLI volume info $V0 + +#Create a Distributed-Replicate volume +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1..4}; +TEST $CLI volume start $V0 + +#Try to reduce replica count with start option +function remove_brick_start_status { + $CLI volume remove-brick $V0 replica 1 \ + $H0:$B0/${V0}1 $H0:$B0/${V0}3 start 2>&1 |grep -oE "success|failed" +} +EXPECT "failed" remove_brick_start_status; + +#Remove bricks with commit option +function remove_brick_commit_status2 { + $CLI volume remove-brick $V0 replica 1 \ + $H0:$B0/${V0}1 $H0:$B0/${V0}3 commit 2>&1 | + grep -oE "success|decommissioned" +} +EXPECT "decommissioned" remove_brick_commit_status2; + +TEST $CLI volume stop $V0 +TEST $CLI volume delete $V0 +TEST ! $CLI volume info $V0 + +cleanup; |