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>
This commit is contained in:
parent
ab6ef33d1c
commit
376b404405
@ -34,27 +34,56 @@ function get_mount_process_pid {
|
|||||||
ps aux | grep glusterfs | grep -E "volfile-id[ =]/?$vol " | awk '{print $2}' | head -1
|
ps aux | grep glusterfs | grep -E "volfile-id[ =]/?$vol " | awk '{print $2}' | head -1
|
||||||
}
|
}
|
||||||
|
|
||||||
function generate_mount_statedump {
|
function generate_client_statedump {
|
||||||
local vol=$1
|
|
||||||
local fpath=""
|
local fpath=""
|
||||||
mount_pid=$(get_mount_process_pid $vol)
|
client_pid=$1
|
||||||
#remove old stale statedumps
|
#remove old stale statedumps
|
||||||
rm -f /tmp/glusterdump.$mount_pid.dump.* 2>/dev/null
|
rm -f /tmp/glusterdump.$client_pid.dump.* 2>/dev/null
|
||||||
kill -USR1 $mount_pid
|
kill -USR1 $client_pid
|
||||||
#Wait till the statedump is generated
|
#Wait till the statedump is generated
|
||||||
sleep 1
|
sleep 1
|
||||||
fname=$(ls /tmp | grep -E "glusterdump.$mount_pid.dump.*")
|
fname=$(ls /tmp | grep -E "glusterdump.$client_pid.dump.*")
|
||||||
echo /tmp/$fname
|
echo /tmp/$fname
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 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 {
|
function afr_child_up_status {
|
||||||
local vol=$1
|
local vol=$1
|
||||||
#brick_id is (brick-num in volume info - 1)
|
#brick_id is (brick-num in volume info - 1)
|
||||||
local brick_id=$2
|
local brick_id=$2
|
||||||
local fpath=$(generate_mount_statedump $vol)
|
_afr_child_up_status $vol $brick_id generate_mount_statedump
|
||||||
up=$(grep -B1 trusted.afr.$vol-client-$brick_id $fpath | head -1 | cut -f2 -d'=')
|
}
|
||||||
rm -f $fpath
|
|
||||||
echo "$up"
|
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 {
|
function glustershd_up_status {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user