summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/eventscripts
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2013-04-17 13:12:32 +1000
committerMartin Schwenke <martin@meltin.net>2013-04-19 13:13:36 +1000
commit100a0eed900fc5bda5a3cd96c2c81fbec76b49d6 (patch)
tree31623c694239552528afd8442593f43673e8e319 /ctdb/tests/eventscripts
parentf54dab03d571aa1f805d3fe1866e315226cca130 (diff)
scripts: Use $CTDB_SCRIPT_DEBUGLEVEL instead of something more complex
The current logic is horrible and creates an unnecessary file. Let's make the script debug level independent of ctddb's debug level. * Have debug() use $CTDB_SCRIPT_DEBUGLEVEL directly * Remove ctdb_set_current_debuglevel() * Remove the "getdebug" command from ctdb stub in eventscript unit tests * Update relevant eventscript unit tests to use $CTDB_SCRIPT_DEBUGLEVEL Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 85efa446c7f5c5af1c3a960001aa777775ae562f)
Diffstat (limited to 'ctdb/tests/eventscripts')
-rwxr-xr-xctdb/tests/eventscripts/50.samba.monitor.107.sh3
-rwxr-xr-xctdb/tests/eventscripts/50.samba.monitor.109.sh3
-rwxr-xr-xctdb/tests/eventscripts/50.samba.monitor.110.sh3
-rwxr-xr-xctdb/tests/eventscripts/stubs/ctdb18
4 files changed, 3 insertions, 24 deletions
diff --git a/ctdb/tests/eventscripts/50.samba.monitor.107.sh b/ctdb/tests/eventscripts/50.samba.monitor.107.sh
index 4c776ac8aa..573ff80e4f 100755
--- a/ctdb/tests/eventscripts/50.samba.monitor.107.sh
+++ b/ctdb/tests/eventscripts/50.samba.monitor.107.sh
@@ -4,8 +4,7 @@
define_test "port 139 down, default tcp checker, debug"
-# This has to go before the setup, otherwise it will write a dud file.
-export CTDB_DEBUGLEVEL=4
+export CTDB_SCRIPT_DEBUGLEVEL=4
setup_samba
tcp_port_down 139
diff --git a/ctdb/tests/eventscripts/50.samba.monitor.109.sh b/ctdb/tests/eventscripts/50.samba.monitor.109.sh
index f90ba629db..0104fd941d 100755
--- a/ctdb/tests/eventscripts/50.samba.monitor.109.sh
+++ b/ctdb/tests/eventscripts/50.samba.monitor.109.sh
@@ -6,8 +6,7 @@ define_test "port 139 down, ctdb checktcpport not implemented, debug"
ctdb_not_implemented "checktcpport"
-# This has to go before the setup, otherwise it will write a dud file.
-export CTDB_DEBUGLEVEL=4
+export CTDB_SCRIPT_DEBUGLEVEL=4
setup_nmap_output_filter
diff --git a/ctdb/tests/eventscripts/50.samba.monitor.110.sh b/ctdb/tests/eventscripts/50.samba.monitor.110.sh
index 639cc515fe..4697e54925 100755
--- a/ctdb/tests/eventscripts/50.samba.monitor.110.sh
+++ b/ctdb/tests/eventscripts/50.samba.monitor.110.sh
@@ -7,8 +7,7 @@ define_test "port 139 down, ctdb checktcpport/nmap not implemented, debug"
ctdb_not_implemented "checktcpport"
export FAKE_NMAP_NOT_FOUND="yes"
-# This has to go before the setup, otherwise it will write a dud file.
-export CTDB_DEBUGLEVEL=4
+export CTDB_SCRIPT_DEBUGLEVEL=4
setup_nmap_output_filter
diff --git a/ctdb/tests/eventscripts/stubs/ctdb b/ctdb/tests/eventscripts/stubs/ctdb
index 3abdd164b9..34ac47eb58 100755
--- a/ctdb/tests/eventscripts/stubs/ctdb
+++ b/ctdb/tests/eventscripts/stubs/ctdb
@@ -274,24 +274,6 @@ case "$1" in
exit 1
esac
;;
- getdebug)
- case "${CTDB_DEBUGLEVEL:-0}" in
- -3) _t="EMERG" ;;
- -2) _t="ALERT" ;;
- -1) _t="CRIT" ;;
- 0) _t="ERR" ;;
- 1) _t="WARNING" ;;
- 2) _t="NOTICE" ;;
- 3) _t="INFO" ;;
- 4) _t="DEBUG" ;;
- *) _t="ERR" ;;
- esac
-
- cat<<EOF
-:Name:Level:
-:${_t}:${CTDB_DEBUGLEVEL}:
-EOF
- ;;
checktcpport)
for _i in $FAKE_TCP_LISTEN ; do
if [ "$2" = "${_i##*:}" ] ; then