path: root/tests/volume.rc
diff options
authorRavishankar N <>2013-09-13 18:48:38 +0530
committerAnand Avati <>2013-09-19 09:22:36 -0700
commitc550ae69526ad60b2f288ddc98a59141b9e64dcc (patch)
tree5725d57d276eec0f5c2e6da0a2a7d6c5d2829954 /tests/volume.rc
parentf86a37bddf0f301c820c2a3ead50a93ce30dd2dc (diff)
cli/glusterd: improve rebalance fix-layout status reporting
Problem: Currenly the CLI rebalance status command output does not indicate the 'type' of rebalance, i.e. whether a full rebalance or only a fix-layout was carried out. Fix: After the rebalance status of all peers is received by the originator glusterd, alter it to reflect the type of rebalance before passing it on to the CLI process. Change-Id: I1940ffda0d36e25e5b33c84a0ea210394cc9e1d3 BUG: 1004744 Signed-off-by: Ravishankar N <> Reviewed-on: Reviewed-by: Krishnan Parthasarathi <> Tested-by: Gluster Build System <> Reviewed-by: Anand Avati <>
Diffstat (limited to 'tests/volume.rc')
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/volume.rc b/tests/volume.rc
index 470fe9a..9871224 100644
--- a/tests/volume.rc
+++ b/tests/volume.rc
@@ -27,7 +27,12 @@ function volume_option()
function rebalance_status_field {
- $CLI volume rebalance $1 status | awk '{print $7}' | sed -n 3p
+ #The rebalance status can be upto 3 words, (ex:'fix-layout in progress'), hence the awk-print $7 thru $9.
+ #But if the status is less than 3 words, it also prints the next field i.e the run_time_in_secs.(ex:'completed 3.00').
+ #So we trim the numbers out with `tr`. Finally remove the trailing white spaces with sed. What we get is one of the
+ #strings in the 'cli_vol_task_status_str' char array of cli-rpc-ops.c
+ $CLI volume rebalance $1 status | awk '{print $7,$8,$9}' |sed -n 3p |tr -d '[^0-9+\.]'|sed 's/ *$//g'
function remove_brick_status_completed_field {