summaryrefslogtreecommitdiffstats
path: root/tests/cluster.rc
diff options
context:
space:
mode:
authoranand <anekkunt@redhat.com>2015-06-13 16:46:10 +0530
committerAtin Mukherjee <amukherj@redhat.com>2015-07-16 23:39:58 -0700
commitee824ccb10e28489907fbf978a2d36b0b2c5dc8c (patch)
treeb7f7b77475460ac01b1a5581bbe47e321c18b14a /tests/cluster.rc
parent4cdeee511ef8bab977cbb31bc2e8f005fe340ef1 (diff)
glusterd: rebalance support for cluster.rc framework
Issue:Rebalance is failing in cluster framework (any simulated cluster environment in same node ). RCA: 1. we are passing always "localhost" as volfile server for rebalance xlator . 2. Rebalance daemons are overwriting unix socket and log files each other. (All rebalance processes are creating socket with same name) . Fix: set vol_file_server, unix socket and log files properly. Change-Id: I6654461e00c2a164b2f1f1db24a316c4180dd8d5 BUG: 1231437 Signed-off-by: anand <anekkunt@redhat.com> Reviewed-on: http://review.gluster.org/11210 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'tests/cluster.rc')
-rw-r--r--tests/cluster.rc16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/cluster.rc b/tests/cluster.rc
index b734f9d..6fd74bc 100644
--- a/tests/cluster.rc
+++ b/tests/cluster.rc
@@ -138,3 +138,19 @@ function define_clis() {
function peer_count() {
$CLI_1 peer status | grep 'Peer in Cluster (Connected)' | wc -l
}
+
+function cluster_rebalance_status_field {
+ #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
+
+ eval \$CLI_$1 volume rebalance $2 status | awk '{print $7,$8,$9}' |sed -n 3p |tr -d '[^0-9+\.]'|sed 's/ *$//g'
+}
+
+function cluster_volinfo_field()
+{
+ local vol=$2;
+ local field=$3;
+ eval \$CLI_$1 volume info $vol | grep "^$field: " | sed 's/.*: //';
+}