summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-10-08 14:19:22 +1100
committerAmitay Isaacs <amitay@samba.org>2014-10-28 05:42:04 +0100
commit0eabbb8c2b91b61a23f20e04605fdbd653c5cbcb (patch)
treea80550d26bf64e2089629a1a1d9db6bf45dec963
parent85cc4efbff601dc25a351ec838de168eb3c7d29a (diff)
downloadsamba-0eabbb8c2b91b61a23f20e04605fdbd653c5cbcb.tar.gz
ctdb-logging: Remove DEBUG_EMERG
It isn't used and shouldn't be. CTDB can't make the system unusable. Update associated test to ensure that EMERG isn't attempted. Actually test all remaining debug levels and modernise the test a bit. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
-rw-r--r--ctdb/common/ctdb_logging.c1
-rw-r--r--ctdb/doc/ctdb.1.xml4
-rw-r--r--ctdb/doc/ctdb.7.xml1
-rw-r--r--ctdb/include/ctdb_logging.h1
-rw-r--r--ctdb/server/ctdb_logging.c3
-rwxr-xr-xctdb/tests/simple/13_ctdb_setdebug.sh42
6 files changed, 16 insertions, 36 deletions
diff --git a/ctdb/common/ctdb_logging.c b/ctdb/common/ctdb_logging.c
index 9b5103a20dd..f6d8df757a9 100644
--- a/ctdb/common/ctdb_logging.c
+++ b/ctdb/common/ctdb_logging.c
@@ -26,7 +26,6 @@
const char *debug_extra = "";
struct debug_levels debug_levels[] = {
- {DEBUG_EMERG, "EMERG"},
{DEBUG_ALERT, "ALERT"},
{DEBUG_CRIT, "CRIT"},
{DEBUG_ERR, "ERR"},
diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml
index efa5d853262..7e12c7a06e2 100644
--- a/ctdb/doc/ctdb.1.xml
+++ b/ctdb/doc/ctdb.1.xml
@@ -902,7 +902,7 @@ DB Statistics: locking.tdb
The list of debug levels from highest to lowest are :
</para>
<para>
- EMERG ALERT CRIT ERR WARNING NOTICE INFO DEBUG
+ ALERT CRIT ERR WARNING NOTICE INFO DEBUG
</para>
</refsect2>
@@ -912,7 +912,7 @@ DB Statistics: locking.tdb
Set the debug level of a node. This controls what information will be logged.
</para>
<para>
- The debuglevel is one of EMERG ALERT CRIT ERR WARNING NOTICE INFO DEBUG
+ The debuglevel is one of ALERT CRIT ERR WARNING NOTICE INFO DEBUG
</para>
</refsect2>
diff --git a/ctdb/doc/ctdb.7.xml b/ctdb/doc/ctdb.7.xml
index a94b62f00a8..61b58828deb 100644
--- a/ctdb/doc/ctdb.7.xml
+++ b/ctdb/doc/ctdb.7.xml
@@ -883,7 +883,6 @@ CTDB_NATGW_DEFAULT_GATEWAY=10.0.0.1
</para>
<simplelist>
- <member>EMERG (-3)</member>
<member>ALERT (-2)</member>
<member>CRIT (-1)</member>
<member>ERR (0)</member>
diff --git a/ctdb/include/ctdb_logging.h b/ctdb/include/ctdb_logging.h
index c0c02660051..1fd61239913 100644
--- a/ctdb/include/ctdb_logging.h
+++ b/ctdb/include/ctdb_logging.h
@@ -23,7 +23,6 @@
extern const char *debug_extra;
enum debug_level {
- DEBUG_EMERG = -3,
DEBUG_ALERT = -2,
DEBUG_CRIT = -1,
DEBUG_ERR = 0,
diff --git a/ctdb/server/ctdb_logging.c b/ctdb/server/ctdb_logging.c
index e09aa94f984..b1e53cf6280 100644
--- a/ctdb/server/ctdb_logging.c
+++ b/ctdb/server/ctdb_logging.c
@@ -218,9 +218,6 @@ static void ctdb_syslog_log(void *private_ptr, int dbglevel, const char *s)
struct sockaddr_in syslog_sin;
switch (dbglevel) {
- case DEBUG_EMERG:
- level = LOG_EMERG;
- break;
case DEBUG_ALERT:
level = LOG_ALERT;
break;
diff --git a/ctdb/tests/simple/13_ctdb_setdebug.sh b/ctdb/tests/simple/13_ctdb_setdebug.sh
index d1d1f22a8d5..e4a03d5e743 100755
--- a/ctdb/tests/simple/13_ctdb_setdebug.sh
+++ b/ctdb/tests/simple/13_ctdb_setdebug.sh
@@ -8,25 +8,6 @@ Verify that 'ctdb setdebug' works as expected.
This is a little superficial. It checks that CTDB thinks the debug
level has been changed but doesn't actually check that logging occurs
at the new level.
-
-A test should also be added to see if setting the debug value via a
-numerical value works too.
-
-Prerequisites:
-
-* An active CTDB cluster with at least 2 active nodes.
-
-Steps:
-
-1. Verify that the status on all of the ctdb nodes is 'OK'.
-2. Get the current debug level on a node, using 'ctdb getdebug'.
-3. Change the debug level to some other value (e.g. EMERG) using
- 'ctdb setdebug'.
-4. Verify that the new debug level is correctly set using 'ctdb getdebug'.
-
-Expected results:
-
-* 'ctdb setdebug' correctly sets the debug level on a node.
EOF
}
@@ -38,9 +19,11 @@ set -e
cluster_is_healthy
+select_test_node_and_ips
+
get_debug ()
{
- # Sets; check_debug
+ # Sets: check_debug
local node="$1"
local out
@@ -61,23 +44,26 @@ set_and_check_debug ()
local check_debug
get_debug $node
- if [ "$level" = "$check_debug" ] ; then
- echo "That seemed to work... cool!"
- else
+ if [ "$level" != "$check_debug" ] ; then
echo "BAD: Debug level should have changed to \"$level\" but it is \"$check_debug\"."
testfailures=1
fi
}
-get_debug 1
+get_debug $test_node
initial_debug="$check_debug"
-new_debug="EMERG"
-[ "$initial_debug" = "$new_debug" ] && new_debug="ALERT"
+levels="ALERT CRIT ERR WARNING NOTICE INFO DEBUG"
+
+for new_debug in $levels ; do
+ [ "$initial_debug" != "$new_debug" ] || continue
-set_and_check_debug 1 "$new_debug"
+ echo
+ set_and_check_debug $test_node "$new_debug"
+done
if [ "$testfailures" != 1 ] ; then
+ echo
echo "Returning the debug level to its initial value..."
- set_and_check_debug 1 "$initial_debug"
+ set_and_check_debug $test_node "$initial_debug"
fi