summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-03-19 15:14:09 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-03-19 15:14:09 +0100
commit091e4dc1b92db7e516d30df659a46b969274d6bf (patch)
tree0bcbe7a1cd7d6471bb6662e362b5021aded085e0
parentab8af1c38df75fc5757e83a04862bf548a1e98a3 (diff)
downloadrsyslog-091e4dc1b92db7e516d30df659a46b969274d6bf.tar.gz
rsyslog-091e4dc1b92db7e516d30df659a46b969274d6bf.tar.xz
rsyslog-091e4dc1b92db7e516d30df659a46b969274d6bf.zip
added parser test cases to testbench
-rw-r--r--tests/Makefile.am2
-rwxr-xr-xtests/parsertest.sh4
-rw-r--r--tests/testsuites/parse-nodate.conf14
-rw-r--r--tests/testsuites/samples.parse-nodate6
4 files changed, 26 insertions, 0 deletions
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!