summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-03-09 17:37:47 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-03-09 17:37:47 +0100
commit6124df83ff69682c0bc6d29eeaea7f9a1b1a2317 (patch)
tree112d86ed8645b6a6435380855329d3a4a77f111e
parentfe52af4d409a30d50e66f870b9eb503bee47cbfb (diff)
parent8d79906d500c5760f093123b3ef3c43508ffce58 (diff)
downloadrsyslog-6124df83ff69682c0bc6d29eeaea7f9a1b1a2317.tar.gz
rsyslog-6124df83ff69682c0bc6d29eeaea7f9a1b1a2317.tar.xz
rsyslog-6124df83ff69682c0bc6d29eeaea7f9a1b1a2317.zip
Merge branch 'v5-beta' into v5-devel
Conflicts: ChangeLog
-rw-r--r--ChangeLog16
-rw-r--r--configure.ac18
-rw-r--r--plugins/omlibdbi/omlibdbi.c2
-rw-r--r--tests/Makefile.am24
-rwxr-xr-xtests/discard-allmark-vg.sh13
-rwxr-xr-xtests/discard-allmark.sh10
-rwxr-xr-xtests/mysql-asyn-vg.sh14
-rwxr-xr-xtests/mysql-asyn.sh13
-rwxr-xr-xtests/mysql-basic-vg.sh14
-rwxr-xr-xtests/mysql-basic.sh13
-rwxr-xr-xtests/tcp-msgreduc-vg.sh2
-rw-r--r--tests/testsuites/discard-allmark.conf15
-rw-r--r--tests/testsuites/mysql-asyn.conf5
-rw-r--r--tests/testsuites/mysql-basic.conf4
-rw-r--r--tests/testsuites/mysql-select-msg.sql2
-rw-r--r--tests/testsuites/mysql-truncate.sql2
16 files changed, 164 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 636617bf..ea25be7f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,17 @@
---------------------------------------------------------------------------
-Version 5.9.0 [V5-BETA] (rgerhards), 2011-03-??
+Version 5.9.0 [V5-DEVEL] (rgerhards), 2011-03-??
- this begins a new devel branch for v5
- enhanced omhdfs to support batching mode. This permits to increase
performance, as we now call the HDFS API with much larger message
sizes and far more infrequently
+---------------------------------------------------------------------------
+Version 5.7.9 [V5-BETA] (rgerhards), 2011-03-??
+- improved testbench
+ among others, life tests for ommysql (against a test database) have
+ been added, valgrind-based testing enhanced, ...
- bugfix: (regression) omhdfs did no longer compile
+- bugfix: omlibdbi did not use password from rsyslog.con
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=203
---------------------------------------------------------------------------
Version 5.7.8 [V5-BETA] (rgerhards), 2011-03-09
- systemd support somewhat improved (can now take over existing log sockt)
@@ -126,6 +133,8 @@ Version 5.7.0 [V5-DEVEL] (rgerhards), 2010-09-16
* sd-systemd API added as part of rsyslog runtime library
---------------------------------------------------------------------------
Version 5.6.5 [V5-STABLE] (rgerhards), 2011-03-??
+- bugfix: omlibdbi did not use password from rsyslog.con
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=203
- bugfix(kind of): tell users that config graph can currently not be
generated
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=232
@@ -761,6 +770,11 @@ Version 4.6.6 [v4-stable] (rgerhards), 2010-11-??
- bugfix: imfile utilizes 32 bit to track offset. Most importantly,
this problem can not experienced on Fedora 64 bit OS (which has
64 bit long's!)
+- bugfix: abort if imfile reads file line of more than 64KiB
+ Thanks to Peter Eisentraut for reporting and analysing this problem.
+ bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=221
+- bugfix: omlibdbi did not use password from rsyslog.con
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=203
- some improvements thanks to clang's static code analyzer
o overall cleanup (mostly unnecessary writes and otherwise unused stuff)
o bugfix: fixed a very remote problem in msg.c which could occur when
diff --git a/configure.ac b/configure.ac
index b5666d66..58b203ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -736,6 +736,23 @@ AC_ARG_ENABLE(extended_tests,
AM_CONDITIONAL(ENABLE_EXTENDED_TESTS, test x$enable_extended_tests = xyes)
+# capability to enable MySQL testbench tests. This requries that a Syslog database
+# with the default schema has been created on the local (127.0.0.1) MySQL server and
+# a user "rsyslog" with password "testbench" exists, is able to login with default
+# parameters and has sufficient (read: all) privileges on that database.
+# rgerhards, 2011-03-09
+AC_ARG_ENABLE(mysql_tests,
+ [AS_HELP_STRING([--enable-mysql-tests],[enable MySQL specific tests in testbench @<:@default=no@:>@])],
+ [case "${enableval}" in
+ yes) enable_mysql_tests="yes" ;;
+ no) enable_mysql_tests="no" ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-mysql-tests) ;;
+ esac],
+ [enable_mysql_tests=no]
+)
+AM_CONDITIONAL(ENABLE_MYSQL_TESTS, test x$enable_mysql_tests = xyes)
+
+
# Mail support (so far we do not need a library, but we need to turn this on and off)
AC_ARG_ENABLE(mail,
[AS_HELP_STRING([--enable-mail],[Enable mail support @<:@default=no@:>@])],
@@ -1221,6 +1238,7 @@ echo
echo "---{ debugging support }---"
echo " Testbench enabled: $enable_testbench"
echo " Extended Testbench enabled: $enable_extended_tests"
+echo " MySQL Tests enabled: $enable_mysql_tests"
echo " Debug mode enabled: $enable_debug"
echo " Runtime Instrumentation enabled: $enable_rtinst"
echo " Diagnostic tools enabled: $enable_diagtools"
diff --git a/plugins/omlibdbi/omlibdbi.c b/plugins/omlibdbi/omlibdbi.c
index 4b190ce3..f49bef42 100644
--- a/plugins/omlibdbi/omlibdbi.c
+++ b/plugins/omlibdbi/omlibdbi.c
@@ -288,7 +288,7 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
if(dbName != NULL)
if((pData->dbName = (uchar*) strdup((char*)dbName)) == NULL) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
if(pwd != NULL)
- if((pData->pwd = (uchar*) strdup((char*)"")) == NULL) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
+ if((pData->pwd = (uchar*) strdup((char*)pwd)) == NULL) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_RQD_TPL_OPT_SQL, (uchar*) " StdDBFmt"));
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a720c0c3..acadda04 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -51,6 +51,7 @@ TESTS += \
imuxsock_traillf_root.sh \
imuxsock_ccmiddle_root.sh \
discard-rptdmsg.sh \
+ discard-allmark.sh \
discard.sh \
queue-persist.sh \
arrayqueue.sh \
@@ -60,9 +61,21 @@ endif
if HAVE_VALGRIND
TESTS += \
discard-rptdmsg-vg.sh \
+ discard-allmark-vg.sh \
tcp-msgreduc-vg.sh
endif
+if ENABLE_MYSQL_TESTS
+TESTS += \
+ mysql-basic.sh \
+ mysql-asyn.sh
+if HAVE_VALGRIND
+TESTS += \
+ mysql-basic-vg.sh \
+ mysql-asyn-vg.sh
+endif
+endif
+
if ENABLE_IMPTCP
TESTS += \
manyptcp.sh \
@@ -236,6 +249,9 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \
discard-rptdmsg.sh \
discard-rptdmsg-vg.sh \
testsuites/discard-rptdmsg.conf \
+ discard-allmark.sh \
+ discard-allmark-vg.sh \
+ testsuites/discard-allmark.conf \
diag.sh \
testsuites/diag-common.conf \
testsuites/diag-common2.conf \
@@ -349,6 +365,14 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \
imuxsock_ccmiddle_root.sh \
testsuites/imuxsock_ccmiddle_root.conf \
resultdata/imuxsock_ccmiddle.log \
+ testsuites\mysql-truncate.sql \
+ testsuites\mysql-select-msg.sql \
+ mysql-basic.sh \
+ mysql-basic-vg.sh \
+ testsuites\mysql-basic.sh \
+ mysql-asyn.sh \
+ mysql-asyn-vg.sh \
+ testsuites\mysql-asyn.sh \
cfg.sh
ourtail_SOURCES = ourtail.c
diff --git a/tests/discard-allmark-vg.sh b/tests/discard-allmark-vg.sh
new file mode 100755
index 00000000..57ce8e3e
--- /dev/null
+++ b/tests/discard-allmark-vg.sh
@@ -0,0 +1,13 @@
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[discard-allmark.sh\]: testing discard-allmark functionality
+source $srcdir/diag.sh init
+source $srcdir/diag.sh startup-vg discard-allmark.conf
+source $srcdir/diag.sh tcpflood -m10 -i1
+# we need to give rsyslog a little time to settle the receiver
+./msleep 1500
+source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
+source $srcdir/diag.sh wait-shutdown-vg
+source $srcdir/diag.sh check-exit-vg
+source $srcdir/diag.sh seq-check 2 10
+source $srcdir/diag.sh exit
diff --git a/tests/discard-allmark.sh b/tests/discard-allmark.sh
new file mode 100755
index 00000000..eb46ae70
--- /dev/null
+++ b/tests/discard-allmark.sh
@@ -0,0 +1,10 @@
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[discard-allmark.sh\]: testing discard-allmark functionality
+source $srcdir/diag.sh init
+source $srcdir/diag.sh startup discard-allmark.conf
+source $srcdir/diag.sh tcpflood -m10 -i1
+source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
+source $srcdir/diag.sh wait-shutdown
+source $srcdir/diag.sh seq-check 2 10
+source $srcdir/diag.sh exit
diff --git a/tests/mysql-asyn-vg.sh b/tests/mysql-asyn-vg.sh
new file mode 100755
index 00000000..dfe68665
--- /dev/null
+++ b/tests/mysql-asyn-vg.sh
@@ -0,0 +1,14 @@
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[mysql-asyn.sh\]: asyn test for mysql functionality
+source $srcdir/diag.sh init
+mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql
+source $srcdir/diag.sh startup-vg mysql-asyn.conf
+source $srcdir/diag.sh injectmsg 0 50000
+source $srcdir/diag.sh shutdown-when-empty
+source $srcdir/diag.sh wait-shutdown-vg
+source $srcdir/diag.sh check-exit-vg
+# note "-s" is requried to suppress the select "field header"
+mysql -s --user=rsyslog --password=testbench < testsuites/mysql-select-msg.sql > rsyslog.out.log
+source $srcdir/diag.sh seq-check 0 49999
+source $srcdir/diag.sh exit
diff --git a/tests/mysql-asyn.sh b/tests/mysql-asyn.sh
new file mode 100755
index 00000000..de6d6fde
--- /dev/null
+++ b/tests/mysql-asyn.sh
@@ -0,0 +1,13 @@
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[mysql-asyn.sh\]: asyn test for mysql functionality
+source $srcdir/diag.sh init
+mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql
+source $srcdir/diag.sh startup mysql-asyn.conf
+source $srcdir/diag.sh injectmsg 0 50000
+source $srcdir/diag.sh shutdown-when-empty
+source $srcdir/diag.sh wait-shutdown
+# note "-s" is requried to suppress the select "field header"
+mysql -s --user=rsyslog --password=testbench < testsuites/mysql-select-msg.sql > rsyslog.out.log
+source $srcdir/diag.sh seq-check 0 49999
+source $srcdir/diag.sh exit
diff --git a/tests/mysql-basic-vg.sh b/tests/mysql-basic-vg.sh
new file mode 100755
index 00000000..215f41f0
--- /dev/null
+++ b/tests/mysql-basic-vg.sh
@@ -0,0 +1,14 @@
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[mysql-basic-vg.sh\]: basic test for mysql-basic functionality/valgrind
+source $srcdir/diag.sh init
+mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql
+source $srcdir/diag.sh startup-vg mysql-basic.conf
+source $srcdir/diag.sh injectmsg 0 5000
+source $srcdir/diag.sh shutdown-when-empty
+source $srcdir/diag.sh wait-shutdown-vg
+source $srcdir/diag.sh check-exit-vg
+# note "-s" is requried to suppress the select "field header"
+mysql -s --user=rsyslog --password=testbench < testsuites/mysql-select-msg.sql > rsyslog.out.log
+source $srcdir/diag.sh seq-check 0 4999
+source $srcdir/diag.sh exit
diff --git a/tests/mysql-basic.sh b/tests/mysql-basic.sh
new file mode 100755
index 00000000..ba9d00f2
--- /dev/null
+++ b/tests/mysql-basic.sh
@@ -0,0 +1,13 @@
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[mysql-basic.sh\]: basic test for mysql-basic functionality
+source $srcdir/diag.sh init
+mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql
+source $srcdir/diag.sh startup mysql-basic.conf
+source $srcdir/diag.sh injectmsg 0 5000
+source $srcdir/diag.sh shutdown-when-empty
+source $srcdir/diag.sh wait-shutdown
+# note "-s" is requried to suppress the select "field header"
+mysql -s --user=rsyslog --password=testbench < testsuites/mysql-select-msg.sql > rsyslog.out.log
+source $srcdir/diag.sh seq-check 0 4999
+source $srcdir/diag.sh exit
diff --git a/tests/tcp-msgreduc-vg.sh b/tests/tcp-msgreduc-vg.sh
index 7e388360..cd8534e4 100755
--- a/tests/tcp-msgreduc-vg.sh
+++ b/tests/tcp-msgreduc-vg.sh
@@ -12,5 +12,5 @@ source $srcdir/diag.sh wait-startup
./msleep 1500
source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
source $srcdir/diag.sh wait-shutdown-vg
-source $srcdir/diag.sh wait-shutdown-vg
+source $srcdir/diag.sh check-exit-vg
source $srcdir/diag.sh exit
diff --git a/tests/testsuites/discard-allmark.conf b/tests/testsuites/discard-allmark.conf
new file mode 100644
index 00000000..8a4983c1
--- /dev/null
+++ b/tests/testsuites/discard-allmark.conf
@@ -0,0 +1,15 @@
+# Test for discard functionality
+# rgerhards, 2009-07-30
+$IncludeConfig diag-common.conf
+
+$ModLoad ../plugins/imtcp/.libs/imtcp
+$MainMsgQueueTimeoutShutdown 10000
+$InputTCPServerRun 13514
+
+$ActionWriteAllMarkMessages on
+
+:msg, contains, "00000001" ~
+
+$template outfmt,"%msg:F,58:2%\n"
+$template dynfile,"rsyslog.out.log" # trick to use relative path names!
+:msg, contains, "msgnum:" ?dynfile;outfmt
diff --git a/tests/testsuites/mysql-asyn.conf b/tests/testsuites/mysql-asyn.conf
new file mode 100644
index 00000000..acdf9bbd
--- /dev/null
+++ b/tests/testsuites/mysql-asyn.conf
@@ -0,0 +1,5 @@
+$IncludeConfig diag-common.conf
+
+$ModLoad ../plugins/ommysql/.libs/ommysql
+$ActionQueueType LinkedList
+:msg, contains, "msgnum:" :ommysql:127.0.0.1,Syslog,rsyslog,testbench;
diff --git a/tests/testsuites/mysql-basic.conf b/tests/testsuites/mysql-basic.conf
new file mode 100644
index 00000000..070094f5
--- /dev/null
+++ b/tests/testsuites/mysql-basic.conf
@@ -0,0 +1,4 @@
+$IncludeConfig diag-common.conf
+
+$ModLoad ../plugins/ommysql/.libs/ommysql
+:msg, contains, "msgnum:" :ommysql:127.0.0.1,Syslog,rsyslog,testbench;
diff --git a/tests/testsuites/mysql-select-msg.sql b/tests/testsuites/mysql-select-msg.sql
new file mode 100644
index 00000000..2d27a331
--- /dev/null
+++ b/tests/testsuites/mysql-select-msg.sql
@@ -0,0 +1,2 @@
+use Syslog;
+select substring(Message,9,8) from SystemEvents;
diff --git a/tests/testsuites/mysql-truncate.sql b/tests/testsuites/mysql-truncate.sql
new file mode 100644
index 00000000..ca852beb
--- /dev/null
+++ b/tests/testsuites/mysql-truncate.sql
@@ -0,0 +1,2 @@
+use Syslog;
+truncate table SystemEvents;