diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2014-03-19 11:30:22 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-04-02 12:04:11 -0700 |
commit | 5dedef81b6ef91d462ce49ded4e148dfc17deee2 (patch) | |
tree | ccbc094f6fe53d55780dadda5dd35e535a3bdb66 /tests/bugs | |
parent | e75be8977ede9b9174d20b39c427e6fb4ccde567 (diff) |
cli: remove-brick no longer defaults to commit-force
Problem : When gluster volume remove-brick is executed with out any option, it
defaults to force commit which results in data loss.
Fix : remove-brick can not be executed with out explicit option, user needs to
provide the option in the command line else the command will throw back an usage
error.
Earlier usage : volume remove-brick <VOLNAME> [replica <COUNT>] <BRICK> ...
[start|stop|status|commit|force]
Current usage : volume remove-brick <VOLNAME> [replica <COUNT>] <BRICK> ...
<start|stop|status|commit|force>
Change-Id: I2a49131f782a6c0dcd03b4dc8ebe5907999b0b49
BUG: 1077682
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/7292
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shyamsundar Ranganathan <sam.somari@gmail.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests/bugs')
-rw-r--r-- | tests/bugs/bug-1077682.t | 34 | ||||
-rw-r--r-- | tests/bugs/bug-867252.t | 2 | ||||
-rw-r--r-- | tests/bugs/bug-878004.t | 4 | ||||
-rw-r--r-- | tests/bugs/bug-961669.t | 2 |
4 files changed, 38 insertions, 4 deletions
diff --git a/tests/bugs/bug-1077682.t b/tests/bugs/bug-1077682.t new file mode 100644 index 00000000000..2923c5f66dd --- /dev/null +++ b/tests/bugs/bug-1077682.t @@ -0,0 +1,34 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +function get-task-status() +{ + $CLI $COMMAND | grep -o $PATTERN + if [ ${PIPESTATUS[0]} -ne 0 ]; + then + return 1 + fi + return 0 +} + +cleanup; + +TEST glusterd +TEST pidof glusterd + +TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2,3,4} +TEST $CLI volume start $V0 +TEST ! $CLI volume remove-brick $V0 $H0:$B0/${V0}1 +TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}2 force +TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}3 start + +EXPECT_WITHIN 10 "completed" remove_brick_status_completed_field "$V0" \ +"$H0:$B0/${V0}3" + +TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}3 commit +TEST killall glusterd +TEST glusterd + +cleanup diff --git a/tests/bugs/bug-867252.t b/tests/bugs/bug-867252.t index 8309ed9b9a0..17edcd9c5dc 100644 --- a/tests/bugs/bug-867252.t +++ b/tests/bugs/bug-867252.t @@ -35,7 +35,7 @@ EXPECT '1' brick_count $V0 TEST $CLI volume add-brick $V0 $H0:$B0/${V0}2; EXPECT '2' brick_count $V0 -TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}2; +TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}2 force; EXPECT '1' brick_count $V0 cleanup; diff --git a/tests/bugs/bug-878004.t b/tests/bugs/bug-878004.t index 5bee4c62fc3..407fd6eccec 100644 --- a/tests/bugs/bug-878004.t +++ b/tests/bugs/bug-878004.t @@ -19,10 +19,10 @@ function brick_count() TEST $CLI volume start $V0 -TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}2; +TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}2 force; EXPECT '2' brick_count $V0 -TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}3; +TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}3 force; EXPECT '1' brick_count $V0 cleanup; diff --git a/tests/bugs/bug-961669.t b/tests/bugs/bug-961669.t index 751a63df2be..77896481c3f 100644 --- a/tests/bugs/bug-961669.t +++ b/tests/bugs/bug-961669.t @@ -27,7 +27,7 @@ function remove_brick_start { } function remove_brick { - $CLI volume remove-brick $V0 replica 2 $H0:$B0/${V0}{1,4,7} 2>&1|grep -oE 'success|failed' + $CLI volume remove-brick $V0 replica 2 $H0:$B0/${V0}{1,4,7} force 2>&1|grep -oE 'success|failed' } #remove-brick start variant |