From 091e4dc1b92db7e516d30df659a46b969274d6bf Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 19 Mar 2010 15:14:09 +0100 Subject: added parser test cases to testbench --- tests/Makefile.am | 2 ++ tests/parsertest.sh | 4 ++++ tests/testsuites/parse-nodate.conf | 14 ++++++++++++++ tests/testsuites/samples.parse-nodate | 6 ++++++ 4 files changed, 26 insertions(+) create mode 100644 tests/testsuites/parse-nodate.conf create mode 100644 tests/testsuites/samples.parse-nodate diff --git a/tests/Makefile.am b/tests/Makefile.am index 47a68bd1..98b97d44 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -104,6 +104,8 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \ testsuites/rfc5424-4.parse1 \ testsuites/parse3.conf \ testsuites/reallife.parse3 \ + testsuites/parse-nodate.conf \ + testsuites/reallife.parse-nodate \ testsuites/parse_invld_regex.conf \ testsuites/samples.parse_invld_regex \ testsuites/parse-3164-buggyday.conf \ diff --git a/tests/parsertest.sh b/tests/parsertest.sh index 83c5e614..10a7f450 100755 --- a/tests/parsertest.sh +++ b/tests/parsertest.sh @@ -8,6 +8,8 @@ source $srcdir/diag.sh nettester parse_invld_regex udp source $srcdir/diag.sh nettester parse_invld_regex tcp source $srcdir/diag.sh nettester parse-3164-buggyday udp source $srcdir/diag.sh nettester parse-3164-buggyday tcp +source $srcdir/diag.sh nettester parse-nodate udp +source $srcdir/diag.sh nettester parse-nodate tcp echo \[parsertest.sh]: redoing tests in IPv4-only mode source $srcdir/diag.sh nettester parse1 udp -4 @@ -18,4 +20,6 @@ source $srcdir/diag.sh nettester parse_invld_regex udp -4 source $srcdir/diag.sh nettester parse_invld_regex tcp -4 source $srcdir/diag.sh nettester parse-3164-buggyday udp -4 source $srcdir/diag.sh nettester parse-3164-buggyday tcp -4 +source $srcdir/diag.sh nettester parse-nodate udp -4 +source $srcdir/diag.sh nettester parse-nodate tcp -4 source $srcdir/diag.sh exit diff --git a/tests/testsuites/parse-nodate.conf b/tests/testsuites/parse-nodate.conf new file mode 100644 index 00000000..570638d9 --- /dev/null +++ b/tests/testsuites/parse-nodate.conf @@ -0,0 +1,14 @@ +# test is a test config that does not include the timestamp. This is necessary to +# test some illformed messages that do not contain a date. In that case, the system's +# current timestamp is used, and that of course is a bit hard to compare against +# a fixed template. So the solution in this case is to use a format that does +# not contain any timestamp. Maybe not optimal, but it works ;) +# rgerhards, 2010-03-19 +$ModLoad ../plugins/omstdout/.libs/omstdout +$IncludeConfig nettest.input.conf # This picks the to be tested input from the test driver! + +$ErrorMessagesToStderr off + +# use a special format that we can easily parse +$template fmt,"%PRI%,%syslogfacility-text%,%syslogseverity-text%,%hostname%,%programname%,%syslogtag%,%msg%\n" +*.* :omstdout:;fmt diff --git a/tests/testsuites/samples.parse-nodate b/tests/testsuites/samples.parse-nodate new file mode 100644 index 00000000..7f16181c --- /dev/null +++ b/tests/testsuites/samples.parse-nodate @@ -0,0 +1,6 @@ +<27>xapi: [error|xen3|15|Guest liveness monitor D:bca30ab3f1c1|master_connection] Connection to master died. I will continue to retry indefinitely (supressing future logging of this message) +27,daemon,err,localhost,xapi,xapi:, [error|xen3|15|Guest liveness monitor D:bca30ab3f1c1|master_connection] Connection to master died. I will continue to retry indefinitely (supressing future logging of this message) +# a message with just text (as permitted by rfc 3164) +# it is questionable if the current sample result is really correct as of 3164! +This is a message! +13,user,notice,This,is,is, a message! -- cgit