diff options
author | Martin Schwenke <martin@meltin.net> | 2018-10-12 13:49:58 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2018-11-06 07:16:18 +0100 |
commit | 804bdf9719cdc128df7ba4dfe7564e5339426b35 (patch) | |
tree | bbdabe0794f2045d51a7ac402fff499c73c7e120 /ctdb | |
parent | 19de5f463d97673a15fecb97af84fc9c288af8ee (diff) | |
download | samba-804bdf9719cdc128df7ba4dfe7564e5339426b35.tar.gz |
ctdb-tests: Add local_daemons.sh onnode and socket commands
These aren't used by simple tests but they will be useful for
integrating ctdbd local daemons into other test suites and for
debugging.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rwxr-xr-x | ctdb/tests/local_daemons.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ctdb/tests/local_daemons.sh b/ctdb/tests/local_daemons.sh index a48e166bfe2..6f6d03ffa08 100755 --- a/ctdb/tests/local_daemons.sh +++ b/ctdb/tests/local_daemons.sh @@ -350,6 +350,46 @@ local_daemons_stop () onnode -p "$_nodes" "${VALGRIND:-} ${CTDB:-ctdb} shutdown" } +local_daemons_onnode_usage () +{ + cat >&2 <<EOF +usage: $0 <directory> onnode <nodes> <command>... + +<nodes> can be "all", a node number or any specification supported by onnode +EOF + + exit 1 +} + +local_daemons_onnode () +{ + if [ $# -lt 2 ] || [ "$1" = "-h" ] ; then + local_daemons_onnode_usage + fi + + _nodes="$1" + shift + + onnode_common + + onnode "$_nodes" "$@" +} + +local_daemons_print_socket () +{ + if [ $# -ne 1 ] || [ "$1" = "-h" ] ; then + local_daemons_generic_usage "print-socket" + fi + + _nodes="$1" + shift + + onnode_common + + _path="${CTDB_SCRIPTS_HELPER_BINDIR}/ctdb-path" + onnode -q "$_nodes" "${VALGRIND:-} ${_path} socket ctdbd" +} + usage () { cat <<EOF @@ -359,6 +399,8 @@ Commands: setup Set up daemon configuration according to given options start Start specified daemon(s) stop Stop specified daemon(s) + onnode Run a command in the environment of specified daemon(s) + print-socket Print the Unix domain socket used by specified daemon(s) All commands use <directory> for daemon configuration @@ -381,5 +423,7 @@ setup) local_daemons_setup "$@" ;; ssh) local_daemons_ssh "$@" ;; # Internal, not shown by usage() start) local_daemons_start "$@" ;; stop) local_daemons_stop "$@" ;; +onnode) local_daemons_onnode "$@" ;; +print-socket) local_daemons_print_socket "$@" ;; *) usage ;; esac |