summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-05-28 10:31:17 +0200
committerPaul Jakma <paul.jakma@sun.com>2006-05-28 10:31:17 +0200
commitf783c1d7bcf0674920cbae066de954fe926fd3ac (patch)
tree03c87b6ede5786f2e456b7a75c1c8ee86f80e626 /tests
parent[lib] Add support for Sun libc printstack to zlog_backtrace_sigsafe (diff)
downloadfrr-f783c1d7bcf0674920cbae066de954fe926fd3ac.tar.xz
frr-f783c1d7bcf0674920cbae066de954fe926fd3ac.zip
[tests] test-sig.c: configure logging
2006-05-28 Paul Jakma <paul.jakma@sun.com> * test-sig.c: (main) configure logging, there's no terminal to write to for one thing, but we do want stdout, and we don't want a test to spam syslog.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog6
-rw-r--r--tests/test-sig.c9
2 files changed, 14 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 8f6e0ce84..74118e63c 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,9 @@
+2006-05-28 Paul Jakma <paul.jakma@sun.com>
+
+ * test-sig.c: (main) configure logging, there's no terminal
+ to write to for one thing, but we do want stdout, and we
+ don't want a test to spam syslog.
+
2006-03-16 Paul Jakma <paul.jakma@sun.com>
* heavy-wq.c: (heavy_wq_init) delay is gone from workqueue
diff --git a/tests/test-sig.c b/tests/test-sig.c
index 69c0b721c..4cb74da9d 100644
--- a/tests/test-sig.c
+++ b/tests/test-sig.c
@@ -1,6 +1,7 @@
#include <zebra.h>
#include <sigevent.h>
+#include "lib/log.h">
void
sighup (void)
@@ -44,7 +45,13 @@ main (void)
{
master = thread_master_create ();
signal_init (master, Q_SIGC(sigs), sigs);
-
+
+ zlog_default = openzlog("testsig", ZLOG_NONE,
+ LOG_CONS|LOG_NDELAY|LOG_PID, LOG_DAEMON);
+ zlog_set_level (NULL, ZLOG_DEST_SYSLOG, ZLOG_DISABLED);
+ zlog_set_level (NULL, ZLOG_DEST_STDOUT, LOG_DEBUG);
+ zlog_set_level (NULL, ZLOG_DEST_MONITOR, ZLOG_DISABLED);
+
while (thread_fetch (master, &t))
thread_call (&t);