summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2013-01-21 23:32:38 +0530
committerAnand Avati <avati@redhat.com>2013-01-21 22:07:08 -0800
commit376b4044052a4e5d25e2390bbb8c2659028d6b09 (patch)
treeb809b1d603378cffa1b7b24973365d44e6ad8d08
parentab6ef33d1c0afc4d265440e52f6e0cb5d2ed007d (diff)
Tests: functions for shd statedump, child_up_status
Change-Id: Ifed91d25b7c62e79019ece336e1065fa35beddb0 BUG: 861015 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/4400 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--tests/volume.rc45
1 files changed, 37 insertions, 8 deletions
diff --git a/tests/volume.rc b/tests/volume.rc
index 9e6671c3b4b..2cae421ae5b 100644
--- a/tests/volume.rc
+++ b/tests/volume.rc
@@ -34,29 +34,58 @@ function get_mount_process_pid {
ps aux | grep glusterfs | grep -E "volfile-id[ =]/?$vol " | awk '{print $2}' | head -1
}
-function generate_mount_statedump {
- local vol=$1
+function generate_client_statedump {
local fpath=""
- mount_pid=$(get_mount_process_pid $vol)
+ client_pid=$1
#remove old stale statedumps
- rm -f /tmp/glusterdump.$mount_pid.dump.* 2>/dev/null
- kill -USR1 $mount_pid
+ rm -f /tmp/glusterdump.$client_pid.dump.* 2>/dev/null
+ kill -USR1 $client_pid
#Wait till the statedump is generated
sleep 1
- fname=$(ls /tmp | grep -E "glusterdump.$mount_pid.dump.*")
+ fname=$(ls /tmp | grep -E "glusterdump.$client_pid.dump.*")
echo /tmp/$fname
}
-function afr_child_up_status {
+function generate_mount_statedump {
+ local vol=$1
+ generate_client_statedump $(get_mount_process_pid $vol)
+}
+
+function _afr_child_up_status {
local vol=$1
#brick_id is (brick-num in volume info - 1)
local brick_id=$2
- local fpath=$(generate_mount_statedump $vol)
+ local gen_state_dump=$3
+ local fpath=$($gen_state_dump $vol)
up=$(grep -B1 trusted.afr.$vol-client-$brick_id $fpath | head -1 | cut -f2 -d'=')
rm -f $fpath
echo "$up"
}
+function afr_child_up_status {
+ local vol=$1
+ #brick_id is (brick-num in volume info - 1)
+ local brick_id=$2
+ _afr_child_up_status $vol $brick_id generate_mount_statedump
+}
+
+function get_shd_process_pid {
+ local vol=$1
+ ps aux | grep glusterfs | grep -E "glustershd/run/glustershd.pid" | awk '{print $2}' | head -1
+}
+
+function generate_shd_statedump {
+ local vol=$1
+ generate_client_statedump $(get_shd_process_pid $vol)
+}
+
+function afr_child_up_status_in_shd {
+ local vol=$1
+ #brick_id is (brick-num in volume info - 1)
+ local brick_id=$2
+ _afr_child_up_status $vol $brick_id generate_shd_statedump
+}
+
function glustershd_up_status {
gluster volume status | grep "Self-heal Daemon" | awk '{print $6}'
}