diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2017-02-02 10:22:00 -0500 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2017-02-07 22:22:19 -0500 |
commit | 4a7fd196d4a141f2b693d5b49995733f6ad1776f (patch) | |
tree | f6b5eb35bb42cb4f5fabe4e8613690f0117927f2 /tests/cluster.rc | |
parent | 3cbf73225111b2fd04414f1fa0aea33ffedf10b2 (diff) |
tests: fix online_brick_count for multiplexing
The number of brick processes no longer matches the number of bricks,
therefore counting processes doesn't work. Counting *pidfiles* does.
Ironically, the fix broke multiplex.t which used this function, so it
now uses a different function with the old process-counting behavior.
Also had to fix online_brick_count and kill_node in cluster.rc to be
consistent with the new reality.
Change-Id: I4e81a6633b93227e10604f53e18a0b802c75cbcc
BUG: 1385758
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: https://review.gluster.org/16527
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests/cluster.rc')
-rw-r--r-- | tests/cluster.rc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/cluster.rc b/tests/cluster.rc index 467bbcb06e1..6dece8182e4 100644 --- a/tests/cluster.rc +++ b/tests/cluster.rc @@ -95,6 +95,7 @@ function kill_node() { h="H$index"; kill -9 $(ps -ef | grep gluster | grep ${!h} | awk '{print $2}'); + find $B0/$index/glusterd/vols -name '*.pid' | xargs rm -f } @@ -177,3 +178,14 @@ function brick_up_status_1 { local brick=$3 $CLI_1 volume status $vol $host:$brick --xml | sed -ne 's/.*<status>\([01]\)<\/status>/\1/p' } + +function online_brick_count { + local bricks + local total=0 + local i + for i in $(seq 1 $CLUSTER_COUNT); do + bricks=$(find $B0/$i/glusterd/vols -name '*.pid' | wc -l) + total=$((total+bricks)) + done + echo $total +} |