Tests - eventscripts - add a new ctdb_not_implemented() function
authorMartin Schwenke <martin@meltin.net>
Mon, 22 Aug 2011 06:06:16 +0000 (16:06 +1000)
committerMartin Schwenke <martin@meltin.net>
Tue, 30 Aug 2011 06:51:55 +0000 (16:51 +1000)
This allowed a single ctdb command to be defined as not-implemented
and provided the associated output from the ctdb stub in
$ctdb_not_implemented.

Signed-off-by: Martin Schwenke <martin@meltin.net>
tests/eventscripts/common.sh

index 1a83811caee4b7c12981158e040453e8b4477c53..235cdaf8868ac34ba7040bad2b13fdf16f0907ce 100644 (file)
@@ -285,6 +285,19 @@ ctdb_get_1_public_address ()
     echo "${_addrs%% *}" | sed -r -e 's#(.*)/(.*)@(.*)#\3 \1 \2#g'
 }
 
+ctdb_not_implemented ()
+{
+    export CTDB_NOT_IMPLEMENTED="$1"
+    ctdb_not_implemented="\
+DEBUG: ctdb: command \"$1\" not implemented
+DEBUG: Usage: ctdb [-Y] cmd
+DEBUG: 
+DEBUG: A fake CTDB stub that prints items depending on the variables
+DEBUG: FAKE_CTDB_PNN (default 0) depending on command-line options.
+DEBUG: 
+DEBUG: Note that -Y is ignored."
+}
+
 ######################################################################
 
 # Samba fakery