summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-03-08 17:56:11 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-03-08 17:56:11 +0100
commitd97ad63e218112d7cd3a390854b2918407804976 (patch)
treecce3d9a615cc4c5d13f33dc78351a1c0c289545f /tests
parent0b84d47f7a244c25f63fadcec92d12ebfbe319a4 (diff)
downloadrsyslog-d97ad63e218112d7cd3a390854b2918407804976.tar.gz
rsyslog-d97ad63e218112d7cd3a390854b2918407804976.tar.xz
rsyslog-d97ad63e218112d7cd3a390854b2918407804976.zip
added new property replacer option "date-rfc3164-buggyday"
primarily to ease migration from syslog-ng. See property replacer doc for details. [backport from 5.5.3 because urgently needed by some]
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am2
-rwxr-xr-xtests/parsertest.sh4
-rw-r--r--tests/testsuites/diag-common2.conf16
-rw-r--r--tests/testsuites/parse-3164-buggyday.conf8
-rw-r--r--tests/testsuites/samples.parse-3164-buggyday6
5 files changed, 36 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7cc25e41..8849c3dc 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -94,6 +94,8 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \
testsuites/reallife.parse3 \
testsuites/parse_invld_regex.conf \
testsuites/samples.parse_invld_regex \
+ testsuites/parse-3164-buggyday.conf \
+ testsuites/samples.parse-3164-buggyday \
testsuites/omod-if-array.conf \
testsuites/1.omod-if-array \
testsuites/1.field1 \
diff --git a/tests/parsertest.sh b/tests/parsertest.sh
index 5966a11b..83c5e614 100755
--- a/tests/parsertest.sh
+++ b/tests/parsertest.sh
@@ -6,6 +6,8 @@ source $srcdir/diag.sh nettester parse3 udp
source $srcdir/diag.sh nettester parse3 tcp
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
echo \[parsertest.sh]: redoing tests in IPv4-only mode
source $srcdir/diag.sh nettester parse1 udp -4
@@ -14,4 +16,6 @@ source $srcdir/diag.sh nettester parse3 udp -4
source $srcdir/diag.sh nettester parse3 tcp -4
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 exit
diff --git a/tests/testsuites/diag-common2.conf b/tests/testsuites/diag-common2.conf
new file mode 100644
index 00000000..94f7e87f
--- /dev/null
+++ b/tests/testsuites/diag-common2.conf
@@ -0,0 +1,16 @@
+# This is a config include file. It sets up rsyslog so that the
+# diag system can successfully be used. Also, it generates a file
+# "rsyslogd.started" after rsyslogd is initialized. This config file
+# should be included in all tests that intend to use common code for
+# controlling the daemon.
+# NOTE: we assume that rsyslogd's current working directory is
+# ./tests (or the distcheck equivalent), in particlular that this
+# config file resides in the testsuites subdirectory.
+# rgerhards, 2009-05-27
+$ModLoad ../plugins/imdiag/.libs/imdiag
+$IMDiagServerRun 13501
+
+$template startupfile,"rsyslogd2.started" # trick to use relative path names!
+:syslogtag, contains, "rsyslogd" ?startupfile
+
+$ErrorMessagesToStderr off
diff --git a/tests/testsuites/parse-3164-buggyday.conf b/tests/testsuites/parse-3164-buggyday.conf
new file mode 100644
index 00000000..937f423a
--- /dev/null
+++ b/tests/testsuites/parse-3164-buggyday.conf
@@ -0,0 +1,8 @@
+$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 in expect
+$template expect,"%PRI%,%syslogfacility-text%,%syslogseverity-text%,%timestamp:::date-rfc3164-buggyday%,%hostname%,%programname%,%syslogtag%,%msg%\n"
+*.* :omstdout:;expect
diff --git a/tests/testsuites/samples.parse-3164-buggyday b/tests/testsuites/samples.parse-3164-buggyday
new file mode 100644
index 00000000..e21df980
--- /dev/null
+++ b/tests/testsuites/samples.parse-3164-buggyday
@@ -0,0 +1,6 @@
+# in 3164-buggyday mode, we need to have a leading zero in front of the day
+<38> Mar 7 19:06:53 example tag: testmessage (only date actually tested)
+38,auth,info,Mar 07 19:06:53,example,tag,tag:, testmessage (only date actually tested)
+# and now one with a complete date:
+<38> Mar 17 19:06:53 example tag: testmessage (only date actually tested)
+38,auth,info,Mar 17 19:06:53,example,tag,tag:, testmessage (only date actually tested)