summaryrefslogtreecommitdiffstats
path: root/tests/volume.rc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/volume.rc')
-rw-r--r--tests/volume.rc7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/volume.rc b/tests/volume.rc
index 470fe9a7c3b..98712242020 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 {