summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2013-02-06 08:39:41 +0530
committerAnand Avati <avati@redhat.com>2013-02-06 09:50:10 -0800
commit2dbc9a53a1a8149f6a4fdcfd1be4a632f65d6e83 (patch)
tree2684b0e5504df521a5d4eb7228bf847d28021d95
parent55feb734c757cdf64e356afb7b6e36f98f4b5c19 (diff)
tests: Added function to generate brick statedump
Change-Id: I5f394a028a3251ec673c8787b2c67691a8b57449 BUG: 908146 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/4470 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--tests/volume.rc35
1 files changed, 21 insertions, 14 deletions
diff --git a/tests/volume.rc b/tests/volume.rc
index 9d579aa22be..9daf560b7b8 100644
--- a/tests/volume.rc
+++ b/tests/volume.rc
@@ -39,21 +39,21 @@ function get_mount_process_pid {
ps aux | grep glusterfs | grep -E "volfile-id[ =]/?$vol " | awk '{print $2}' | head -1
}
-function generate_client_statedump {
+function generate_statedump {
local fpath=""
- client_pid=$1
+ pid=$1
#remove old stale statedumps
- rm -f $statedumpdir/glusterdump.$client_pid.dump.* 2>/dev/null
- kill -USR1 $client_pid
+ rm -f "$statedumpdir/*$pid.dump.*"
+ kill -USR1 $pid
#Wait till the statedump is generated
sleep 1
- fname=$(ls $statedumpdir | grep -E "glusterdump.$client_pid.dump.*")
+ fname=$(ls $statedumpdir | grep -E "*$pid.dump.*")
echo $statedumpdir/$fname
}
function generate_mount_statedump {
local vol=$1
- generate_client_statedump $(get_mount_process_pid $vol)
+ generate_statedump $(get_mount_process_pid $vol)
}
function _afr_child_up_status {
@@ -81,7 +81,14 @@ function get_shd_process_pid {
function generate_shd_statedump {
local vol=$1
- generate_client_statedump $(get_shd_process_pid $vol)
+ generate_statedump $(get_shd_process_pid $vol)
+}
+
+function generate_brick_statedump {
+ local vol=$1
+ local host=$2
+ local brick=$3
+ generate_statedump $(get_brick_pid $vol $host $brick)
}
function afr_child_up_status_in_shd {
@@ -96,17 +103,17 @@ function glustershd_up_status {
}
function get_brick_pid {
- vol=$1
- host=$2
- brick=$3
- brick_hiphenated=$(echo $brick | tr '/' '-')
+ local vol=$1
+ local host=$2
+ local brick=$3
+ local brick_hiphenated=$(echo $brick | tr '/' '-')
echo `cat /var/lib/glusterd/vols/$vol/run/${host}${brick_hiphenated}.pid`
}
function kill_brick {
- vol=$1
- host=$2
- brick=$3
+ local vol=$1
+ local host=$2
+ local brick=$3
kill -9 $(get_brick_pid $vol $host $brick)
}