From 89dc86e0fd77857926d78bb6b0bd4f4c72a718f4 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Thu, 7 Apr 2016 13:54:37 +1000 Subject: [PATCH] ctdb-tests: LVS support for ctdb tool stub Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/tests/eventscripts/stubs/ctdb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/ctdb/tests/eventscripts/stubs/ctdb b/ctdb/tests/eventscripts/stubs/ctdb index cd4d3995ffc..44b934a6a41 100755 --- a/ctdb/tests/eventscripts/stubs/ctdb +++ b/ctdb/tests/eventscripts/stubs/ctdb @@ -358,6 +358,28 @@ EOF ###################################################################### +ctdb_lvs_master () +{ + if [ -n "$FAKE_CTDB_LVS_MASTER" ] ; then + echo "Node ${FAKE_CTDB_LVS_MASTER} is LVS master" + return 0 + else + echo "This is no LVS master" + return 255 + fi +} + +ctdb_lvs () +{ + _pnn=0 + while read _ip _opts ; do + echo "${_pnn}:${_ip}" + _pnn=$(($_pnn + 1)) + done <"$CTDB_LVS_NODES" +} + +###################################################################### + case "$1" in gettickles) setup_tickles @@ -455,5 +477,7 @@ case "$1" in shutdown) ctdb_shutdown "$@";; setvar) ctdb_setvar "$@" ;; nodestatus) ctdb_nodestatus "$@" ;; + lvsmaster) ctdb_lvs_master "$@" ;; + lvs) ctdb_lvs "$@" ;; *) not_implemented "$1" ;; esac