Martyn J. Pearce > Log-Info > xt/syslog.t

Download:
Log-Info-2.00.tar.gz

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Source  

Unit Test Package for Log::Info functions ^

This package tests the syslog-writing functionality of Log::Info

Test 1: compilation

This test confirms that the test script and the modules it calls compiled successfully.

The :DEFAULT, :log_levels, and :syslog_facilities tags are passed to the use call for Log::Info.

Test 2: set up syslog channel

Create a channel TESTCHAN1 (at default level) with sink SINK1 connected to syslog at level LOG_WARNING.

Test no exception thrown.

Test 3: log test message

Log MESSAGE1 at level LOG_ERR, MESSAGE2 at level LOG_NOTICE.

Test that no exception is thrown.

Test 4: test for presence of log message in syslog

Grep syslog for messages; test MESSAGE1 is present, MESSAGE2 is not.

Test 5: set up syslog channel with duff facility

Create a channel TESTCHAN2 at level LOG_ERR with sink SINK1 connected to syslog at level LOG_NOTICE, with facility mail.

Test exception thrown at add_sink point.

Test 6: set up syslog channel with FTY_MAIL facility

Add sink SINK1 to TESTCHAN2 connected to syslog at level LOG_NOTICE, with facility FTY_MAIL.

Test no exception thrown.

Test 7: log test message (2)

Log MESSAGE2 at level LOG_WARNING, MESSAGE3 at level LOG_CRIT.

Test that no exception is thrown.

Test 8: test for presence of log message in syslog (2)

Grep syslog for messages; test MESSAGE3 is present, MESSAGE2 is not.

Test 9: test for presence of log message in maillog

Grep syslog for messages; test MESSAGE3 is present, MESSAGE2 is not.

syntax highlighting: