diff options
author | Martin Schwenke <martin@meltin.net> | 2011-08-19 13:54:20 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2011-08-30 16:51:55 +1000 |
commit | 21c17cc1005269b07e33c3b976fde16ede838621 (patch) | |
tree | 0b930cabffbb20577bcd8b3854b94b0b3086c799 | |
parent | d2527e3e5bad11c3946799c4e9609d269309d00b (diff) | |
download | samba-21c17cc1005269b07e33c3b976fde16ede838621.tar.gz samba-21c17cc1005269b07e33c3b976fde16ede838621.tar.xz samba-21c17cc1005269b07e33c3b976fde16ede838621.zip |
Tests - add hooks to simulate ctdb commands that aren't implemented
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit e9bdfd43af3ed28a7f69a36e3fb037f252a23869)
-rwxr-xr-x | ctdb/tests/eventscripts/stubs/ctdb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/ctdb/tests/eventscripts/stubs/ctdb b/ctdb/tests/eventscripts/stubs/ctdb index ce06a35cbd..4806cc7899 100755 --- a/ctdb/tests/eventscripts/stubs/ctdb +++ b/ctdb/tests/eventscripts/stubs/ctdb @@ -2,6 +2,8 @@ prog="ctdb" +not_implemented_exit_code=1 + usage () { cat >&2 <<EOF @@ -13,12 +15,10 @@ FAKE_CTDB_PNN (default 0) depending on command-line options. Note that -Y is ignored. EOF - exit 1 + exit $not_implemented_exit_code } -# $POSIXLY_CORRECT means that the command passed to onnode can take -# options and getopt won't reorder things to make them options to this -# script. +# Don't set $POSIXLY_CORRECT here. _temp=$(getopt -n "$prog" -o "Yvh" -l help -- "$@") || \ usage @@ -51,6 +51,13 @@ setup_pstore () mkdir -p "$pstore_dir" } +# For testing backward compatibility... +for i in $CTDB_NOT_IMPLEMENTED ; do + if [ "$i" = "$1" ] ; then + usage + fi +done + case "$1" in ip) # NOTE: all nodes share the same public addresses file. |