summaryrefslogtreecommitdiffstats
path: root/tests/bugs/bug-961669.t
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2013-07-19 14:23:32 +0000
committerAnand Avati <avati@redhat.com>2013-08-21 10:45:59 -0700
commit51c6fa7a354826744de98a1c5c747955ae65850c (patch)
tree3232be0125e46d19eaf1ed78c0f7a3715900895c /tests/bugs/bug-961669.t
parentcc8b149f34b3dc76a4ec094b822816852f6cfd5f (diff)
glusterd: add check in remove-brick start variant
The 'start' variant of the remove-brick command only applies at the dht level wherein we can remove all the bricks of a sub-volume (and remove multiple such sub-volumes) but not select bricks of it. This patch disallows removing individual replica bricks of multiple sub-volumes (i.e. reducing the replcia count of the volume) using remove-brick 'start'. The preferred method for such an operation is to use commit force. This patch also reverts the check to prevent removal of bricks from a replicate volume (commit 0d415f7) BUG: 961669 Change-Id: I447ad27f73a0963b5e09fb317bf7267a7a5a6147 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/5566 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'tests/bugs/bug-961669.t')
-rw-r--r--tests/bugs/bug-961669.t27
1 files changed, 16 insertions, 11 deletions
diff --git a/tests/bugs/bug-961669.t b/tests/bugs/bug-961669.t
index 1b83262253c..751a63df2be 100644
--- a/tests/bugs/bug-961669.t
+++ b/tests/bugs/bug-961669.t
@@ -1,6 +1,6 @@
#!/bin/bash
-#Test case: Create a replicate volume; mount and write to it; kill one brick; try to remove the other.
+#Test case: Fail remove-brick 'start' variant when reducing the replica count of a volume.
. $(dirname $0)/../include.rc
. $(dirname $0)/../volume.rc
@@ -12,8 +12,8 @@ TEST glusterd
TEST pidof glusterd
TEST $CLI volume info
-#Create a 1x2 replicate volume
-TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1};
+#Create a 3x3 dist-rep volume
+TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0,1,2,3,4,5,6,7,8};
TEST $CLI volume start $V0
# Mount FUSE and create file/directory
@@ -22,18 +22,23 @@ TEST touch $M0/zerobytefile.txt
TEST mkdir $M0/test_dir
TEST dd if=/dev/zero of=$M0/file bs=1024 count=1024
-#Kill one of the bricks. This step can be skipped without affecting the outcome of the test.
-kill -9 `cat /var/lib/glusterd/vols/$V0/run/$H0-d-backends-${V0}1.pid`;
+function remove_brick_start {
+ $CLI volume remove-brick $V0 replica 2 $H0:$B0/${V0}{1,4,7} start 2>&1|grep -oE 'success|failed'
+}
-function remove_brick_status {
- $CLI volume remove-brick $V0 replica 1 $H0:$B0/${V0}1 start 2>&1
+function remove_brick {
+ $CLI volume remove-brick $V0 replica 2 $H0:$B0/${V0}{1,4,7} 2>&1|grep -oE 'success|failed'
}
-#Remove brick
-EXPECT "volume remove-brick start: failed: Removing brick from a replicate volume is not allowed" remove_brick_status;
+#remove-brick start variant
+#Actual message displayed at cli is:
+#"volume remove-brick start: failed: Rebalancing not needed when reducing replica count. Try without the 'start' option"
+EXPECT "failed" remove_brick_start;
-#Check the volume type
-EXPECT "Replicate" echo `$CLI volume info |grep Type |awk '{print $2}'`
+#remove-brick commit-force
+#Actual message displayed at cli is:
+#"volume remove-brick commit force: success"
+EXPECT "success" remove_brick
TEST umount $M0
TEST $CLI volume stop $V0