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-03 02:00:46 -0700
commit7e76bd24305ee29506dd11be5a0691cfa65b6d0c (patch)
tree353e5ab7a64358418db794e52ddc7312b1a04d0b /tests/volume.rc
parent0a8371bdfdd88e662d09def717cc0b822feb64e8 (diff)
ec: Add state dump support
Change-Id: I4504f3050674dde217e79af28cb4d2b5370fe2d5 BUG: 1148010 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/8891 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Emmanuel Dreyfus <manu@netbsd.org> 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 009f58b7c60..a216ba5fb7f 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 auxww | grep glusterfs | grep -E "glustershd/run/glustershd.pid" | awk '{print $2}' | head -1