diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 11 | ||||
-rwxr-xr-x | tests/libdbi-asyn.sh | 13 | ||||
-rwxr-xr-x | tests/libdbi-basic-vg.sh | 16 | ||||
-rwxr-xr-x | tests/libdbi-basic.sh | 13 | ||||
-rw-r--r-- | tests/testsuites/libdbi-asyn.conf | 12 | ||||
-rw-r--r-- | tests/testsuites/libdbi-basic.conf | 9 |
6 files changed, 74 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index eb7ad94f..ea6860d5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -63,10 +63,16 @@ TESTS += \ tcp-msgreduc-vg.sh endif + if ENABLE_MYSQL_TESTS TESTS += \ mysql-basic.sh \ mysql-asyn.sh +if ENABLE_OMLIBDBI +TESTS += \ + libdbi-basic.sh \ + libdbi-asyn.sh +endif if HAVE_VALGRIND TESTS += \ mysql-basic-vg.sh \ @@ -74,6 +80,7 @@ TESTS += \ endif endif + if ENABLE_IMPTCP TESTS += \ manyptcp.sh \ @@ -367,6 +374,10 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \ resultdata/imuxsock_ccmiddle.log \ testsuites/mysql-truncate.sql \ testsuites/mysql-select-msg.sql \ + libdbi-basic.sh \ + testsuites/libdbi-basic.conf \ + libdbi-asyn.sh \ + testsuites/libdbi-asyn.conf \ mysql-basic.sh \ mysql-basic-vg.sh \ testsuites/mysql-basic.conf \ diff --git a/tests/libdbi-asyn.sh b/tests/libdbi-asyn.sh new file mode 100755 index 00000000..0076da9c --- /dev/null +++ b/tests/libdbi-asyn.sh @@ -0,0 +1,13 @@ +# This file is part of the rsyslog project, released under GPLv3 +echo =============================================================================== +echo \[libdbi-asyn.sh\]: asyn test for libdbi functionality +source $srcdir/diag.sh init +mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql +source $srcdir/diag.sh startup libdbi-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/libdbi-basic-vg.sh b/tests/libdbi-basic-vg.sh new file mode 100755 index 00000000..75d12857 --- /dev/null +++ b/tests/libdbi-basic-vg.sh @@ -0,0 +1,16 @@ +# This file is part of the rsyslog project, released under GPLv3 +# this test is currently not included in the testbench as libdbi +# itself seems to have a memory leak +echo =============================================================================== +echo \[libdbi-basic.sh\]: basic test for libdbi-basic functionality via mysql +source $srcdir/diag.sh init +mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql +source $srcdir/diag.sh startup-vg libdbi-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/libdbi-basic.sh b/tests/libdbi-basic.sh new file mode 100755 index 00000000..a854a565 --- /dev/null +++ b/tests/libdbi-basic.sh @@ -0,0 +1,13 @@ +# This file is part of the rsyslog project, released under GPLv3 +echo =============================================================================== +echo \[libdbi-basic.sh\]: basic test for libdbi-basic functionality via mysql +source $srcdir/diag.sh init +mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql +source $srcdir/diag.sh startup libdbi-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/testsuites/libdbi-asyn.conf b/tests/testsuites/libdbi-asyn.conf new file mode 100644 index 00000000..39b01fbc --- /dev/null +++ b/tests/testsuites/libdbi-asyn.conf @@ -0,0 +1,12 @@ +$IncludeConfig diag-common.conf + +$ModLoad ../plugins/omlibdbi/.libs/omlibdbi + +$ActionQueueType LinkedList + +$ActionLibdbiDriver mysql +$ActionLibdbiHost 127.0.0.1 +$ActionLibdbiUserName root +$ActionLibdbiPassword pass +$ActionLibdbiDBName Syslog +:msg, contains, "msgnum:" :omlibdbi: diff --git a/tests/testsuites/libdbi-basic.conf b/tests/testsuites/libdbi-basic.conf new file mode 100644 index 00000000..212225cc --- /dev/null +++ b/tests/testsuites/libdbi-basic.conf @@ -0,0 +1,9 @@ +$IncludeConfig diag-common.conf + +$ModLoad ../plugins/omlibdbi/.libs/omlibdbi +$ActionLibdbiDriver mysql +$ActionLibdbiHost 127.0.0.1 +$ActionLibdbiUserName root +$ActionLibdbiPassword pass +$ActionLibdbiDBName Syslog +:msg, contains, "msgnum:" :omlibdbi: |