diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2010-07-13 16:15:02 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-07-13 16:15:02 +0200 |
commit | 73ebadd5980f91079416a14ba6463d576ecb6207 (patch) | |
tree | 09d1b1a5aff124d037468295fdacb2214c007547 /tests | |
parent | 824a4b98d5fd96183aa2c0961df604fd5ef48915 (diff) | |
download | rsyslog-73ebadd5980f91079416a14ba6463d576ecb6207.tar.gz rsyslog-73ebadd5980f91079416a14ba6463d576ecb6207.tar.xz rsyslog-73ebadd5980f91079416a14ba6463d576ecb6207.zip |
added new parser modules
most importantly pmlastmsg, which handles the pathetic "last message
repeated n times" messages that some syslogd's emit.
Also some minor fixes, like wrong files names in make dist (for new
files introduced after last release)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 8 | ||||
-rwxr-xr-x | tests/pmlastmsg.sh | 6 | ||||
-rw-r--r-- | tests/testsuites/master.pmlastmsg | 28 | ||||
-rw-r--r-- | tests/testsuites/pmlastmsg.conf | 16 |
4 files changed, 54 insertions, 4 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index a0cc8c7d..7f9d8cd5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -274,13 +274,13 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \ testsuites/execonlyonce.conf \ testsuites/execonlyonce.data \ execonlywhenprevsuspended.sh \ - testsuites/execonlywhenprevsuspended.sh \ + testsuites/execonlywhenprevsuspended.conf \ execonlywhenprevsuspended2.sh \ - testsuites/execonlywhenprevsuspended2.sh \ + testsuites/execonlywhenprevsuspended2.conf \ execonlywhenprevsuspended3.sh \ - testsuites/execonlywhenprevsuspended3.sh \ + testsuites/execonlywhenprevsuspended3.conf \ execonlywhenprevsuspended4.sh \ - testsuites/execonlywhenprevsuspended4.sh \ + testsuites/execonlywhenprevsuspended4.conf \ tabescape_dflt.sh \ testsuites/tabescape_dflt.conf \ testsuites/1.tabescape_dflt \ diff --git a/tests/pmlastmsg.sh b/tests/pmlastmsg.sh new file mode 100755 index 00000000..9a14ce21 --- /dev/null +++ b/tests/pmlastmsg.sh @@ -0,0 +1,6 @@ +echo ============================================================================== +echo \[pmlastmsg.sh\]: tests for pmlastmsg +source $srcdir/diag.sh init +source $srcdir/diag.sh nettester pmlastmsg udp +source $srcdir/diag.sh nettester pmlastmsg tcp +source $srcdir/diag.sh exit diff --git a/tests/testsuites/master.pmlastmsg b/tests/testsuites/master.pmlastmsg new file mode 100644 index 00000000..170538b0 --- /dev/null +++ b/tests/testsuites/master.pmlastmsg @@ -0,0 +1,28 @@ +# the following messages should be processed by pmlastmsg: +<13>last message repeated 5 times +last message repeated 5 times +# +<13>last message repeated 0090909787348927349875 times +last message repeated 0090909787348927349875 times +# now slightly malformed formats that should NOT be processed +# by pmlasmsg: +<13>last message repeated 5 times + repeated 5 times +# +<13>last message repeated 5 times -- more data + repeated 5 times -- more data +# message count invalid: +<13>last message repeated 5.2 times + repeated 5.2 times +# +# +# now follow samples of non-pmlastmsg messages: +# +<167>Mar 6 16:57:54 172.20.245.8 TAG: Rest of message... + Rest of message... +# Now exactly with 32 characters +<167>Mar 6 16:57:54 172.20.245.8 TAG long message ================================================================================ + long message ================================================================================ +# RFC5424 messages +<34>1 2003-11-11T22:14:15.003Z mymachine.example.com su - ID47 last message repeated 5 times +last message repeated 5 times diff --git a/tests/testsuites/pmlastmsg.conf b/tests/testsuites/pmlastmsg.conf new file mode 100644 index 00000000..59142dca --- /dev/null +++ b/tests/testsuites/pmlastmsg.conf @@ -0,0 +1,16 @@ +$ModLoad ../plugins/omstdout/.libs/omstdout +$ModLoad ../plugins/pmlastmsg/.libs/pmlastmsg +$IncludeConfig nettest.input.conf # This picks the to be tested input from the test driver! + +$ErrorMessagesToStderr off + +# in this test, we use pmlastmsg, followed by the one-size-fits-all +# pm3164 (built-in) module. So we can test if non-pmlastmsg messages +# are also correctly detected. +$RulesetParser rsyslog.lastline +$RulesetParser rsyslog.rfc5424 +$RulesetParser rsyslog.rfc3164 + +# use a special format +$template fmt,"%msg%\n" +*.* :omstdout:;fmt |