summaryrefslogtreecommitdiffstats
path: root/tests/volume.rc
diff options
context:
space:
mode:
authorXavier Hernandez <xhernandez@datalab.es>2014-09-30 17:47:26 +0200
committerVijay Bellur <vbellur@redhat.com>2014-10-04 08:25:53 -0700
commita8744e2bd55db3b8a5625c66b04b21c88f574637 (patch)
tree1f87e0742162e09ff1412fdc798a796acbfeccc1 /tests/volume.rc
parent89de9adbf2b7d446abe9a27c8e384d205a996176 (diff)
ec: Add state dump support
This is a backport of http://review.gluster.org/8891/ Change-Id: I4504f3050674dde217e79af28cb4d2b5370fe2d5 BUG: 1148093 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/8899 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests/volume.rc')
-rw-r--r--tests/volume.rc24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/volume.rc b/tests/volume.rc
index 1d1d58efa66..71d0947c5a6 100644
--- a/tests/volume.rc
+++ b/tests/volume.rc
@@ -110,6 +110,30 @@ function afr_child_up_status {
_afr_child_up_status $vol $brick_id generate_mount_statedump
}
+function ec_get_info {
+ local vol=$1
+ local dist_id=$2
+ local key=$3
+ local fpath=$(generate_mount_statedump $vol)
+ local value=$(sed -n "/^\[cluster\/disperse\.$vol-disperse-$dist_id\]/,/^\[/{s/^$key=\(.*\)/\1/p;}" $fpath | head -1)
+ rm -f $fpath
+ echo "$value"
+}
+
+function ec_child_up_status {
+ local vol=$1
+ local dist_id=$2
+ local brick_id=$(($3 + 1))
+ local mask=$(ec_get_info $vol $dist_id "childs_up_mask")
+ echo "${mask: -$brick_id:1}"
+}
+
+function ec_child_up_count {
+ local vol=$1
+ local dist_id=$2
+ ec_get_info $vol $dist_id "childs_up"
+}
+
function get_shd_process_pid {
local vol=$1
ps aux | grep glusterfs | grep -E "glustershd/run/glustershd.pid" | awk '{print $2}' | head -1