1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

tests: New function get_ctdbd_command_line_option() for integration testing

This allows, for example, the public addresses file used by a
particular daemon to be known.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f4b7d14f2e3c7345e7a09abb27c32923fb78cbc4)
This commit is contained in:
Martin Schwenke 2012-05-14 15:00:32 +10:00
parent e3d357b9c3
commit 8880484658

View File

@ -739,6 +739,27 @@ ctdb_restart_when_done ()
ctdb_test_restart_scheduled=true
}
get_ctdbd_command_line_option ()
{
local pnn="$1"
local option="$2"
try_command_on_node "$pnn" "$CTDB getpid" || \
die "Unable to get PID of ctdbd on node $pnn"
local pid="${out#*:}"
try_command_on_node "$pnn" "ps -p $pid -o args hww" || \
die "Unable to get command-line of PID $pid"
# Strip everything up to and including --option
local t="${out#*--${option}}"
# Strip leading '=' or space if present
t="${t#=}"
t="${t# }"
# Strip any following options and print
echo "${t%% -*}"
}
#######################################
install_eventscript ()