diff options
Diffstat (limited to 'tests')
25 files changed, 367 insertions, 13 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index b5d6f53..0fa5a36 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,6 +8,11 @@ if ENABLE_IMDIAG TESTS += \ stop-localvar.sh \ stop-msgvar.sh \ + fac_authpriv.sh \ + fac_local0.sh \ + fac_mail.sh \ + fac_news.sh \ + fac_uucp.sh \ rfc5424parser.sh \ arrayqueue.sh \ global_vars.sh \ @@ -128,6 +133,16 @@ TESTS += \ imptcp_conndrop.sh endif +if ENABLE_ELASTICSEARCH +TESTS += \ + elasticsearch-basic.sh \ + elasticsearch-basic-bulk.sh \ + elasticsearch-basic-errorfile-empty.sh \ + elasticsearch-basic-errorfile-populated.sh \ + elasticsearch-bulk-errorfile-empty.sh \ + elasticsearch-bulk-errorfile-populated.sh +endif + if ENABLE_MMPSTRUCDATA TESTS += \ mmpstrucdata.sh @@ -337,6 +352,16 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \ testsuites/global_vars.conf \ rfc5424parser.sh \ testsuites/rfc5424parser.conf \ + fac_authpriv.sh \ + testsuites/fac_authpriv.conf \ + fac_local0.sh \ + testsuites/fac_local0.conf \ + fac_mail.sh \ + testsuites/fac_mail.conf \ + fac_news.sh \ + testsuites/fac_news.conf \ + fac_uucp.sh \ + testsuites/fac_uucp.conf \ rs_optimizer_pri.sh \ testsuites/rs_optimizer_pri.conf \ rscript_prifilt.sh \ @@ -362,6 +387,18 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \ incltest_dir_wildcard.sh \ testsuites/incltest_dir_wildcard.conf \ testsuites/incltest.d/include.conf \ + elasticsearch-basic.sh \ + testsuites/elasticsearch-basic.conf \ + elasticsearch-basic-bulk.sh \ + testsuites/elasticsearch-basic-bulk.conf \ + elasticsearch-basic-errorfile-empty.sh \ + testsuites/elasticsearch-basic-errorfile-empty.conf \ + elasticsearch-basic-errorfile-populated.sh \ + testsuites/elasticsearch-basic-errorfile-populated.conf \ + elasticsearch-bulk-errorfile-empty.sh \ + testsuites/elasticsearch-bulk-errorfile-empty.conf \ + elasticsearch-bulk-errorfile-populated.sh \ + testsuites/elasticsearch-bulk-errorfile-populated.conf \ linkedlistqueue.sh \ testsuites/linkedlistqueue.conf \ da-mainmsg-q.sh \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 807ea62..6524d86 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -49,11 +49,17 @@ host_triplet = @host@ @ENABLE_TESTBENCH_TRUE@ $(am__append_9) $(am__append_10) \ @ENABLE_TESTBENCH_TRUE@ $(am__append_11) $(am__append_12) \ @ENABLE_TESTBENCH_TRUE@ $(am__append_13) $(am__append_14) \ -@ENABLE_TESTBENCH_TRUE@ $(am__append_15) $(am__append_16) +@ENABLE_TESTBENCH_TRUE@ $(am__append_15) $(am__append_16) \ +@ENABLE_TESTBENCH_TRUE@ $(am__append_17) #TESTS = $(TESTRUNS) cfg.sh @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_1 = \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ stop-localvar.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ stop-msgvar.sh \ +@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ fac_authpriv.sh \ +@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ fac_local0.sh \ +@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ fac_mail.sh \ +@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ fac_news.sh \ +@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ fac_uucp.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rfc5424parser.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ arrayqueue.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ global_vars.sh \ @@ -164,10 +170,18 @@ host_triplet = @host@ @ENABLE_IMPTCP_TRUE@@ENABLE_TESTBENCH_TRUE@ imptcp_addtlframedelim.sh \ @ENABLE_IMPTCP_TRUE@@ENABLE_TESTBENCH_TRUE@ imptcp_conndrop.sh -@ENABLE_MMPSTRUCDATA_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_7 = \ +@ENABLE_ELASTICSEARCH_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_7 = \ +@ENABLE_ELASTICSEARCH_TRUE@@ENABLE_TESTBENCH_TRUE@ elasticsearch-basic.sh \ +@ENABLE_ELASTICSEARCH_TRUE@@ENABLE_TESTBENCH_TRUE@ elasticsearch-basic-bulk.sh \ +@ENABLE_ELASTICSEARCH_TRUE@@ENABLE_TESTBENCH_TRUE@ elasticsearch-basic-errorfile-empty.sh \ +@ENABLE_ELASTICSEARCH_TRUE@@ENABLE_TESTBENCH_TRUE@ elasticsearch-basic-errorfile-populated.sh \ +@ENABLE_ELASTICSEARCH_TRUE@@ENABLE_TESTBENCH_TRUE@ elasticsearch-bulk-errorfile-empty.sh \ +@ENABLE_ELASTICSEARCH_TRUE@@ENABLE_TESTBENCH_TRUE@ elasticsearch-bulk-errorfile-populated.sh + +@ENABLE_MMPSTRUCDATA_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_8 = \ @ENABLE_MMPSTRUCDATA_TRUE@@ENABLE_TESTBENCH_TRUE@ mmpstrucdata.sh -@ENABLE_MMJSONPARSE_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_8 = \ +@ENABLE_MMJSONPARSE_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_9 = \ @ENABLE_MMJSONPARSE_TRUE@@ENABLE_TESTBENCH_TRUE@ mmjsonparse_simple.sh \ @ENABLE_MMJSONPARSE_TRUE@@ENABLE_TESTBENCH_TRUE@ mmjsonparse_cim.sh @@ -177,15 +191,15 @@ host_triplet = @host@ # #sndrcv_tls_anon.sh \ # #sndrcv_tls_anon_rebind.sh \ # #imtcp-tls-basic.sh -@ENABLE_GNUTLS_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@am__append_9 = imtcp-tls-basic-vg.sh \ +@ENABLE_GNUTLS_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@am__append_10 = imtcp-tls-basic-vg.sh \ @ENABLE_GNUTLS_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ imtcp_conndrop_tls-vg.sh -@ENABLE_OMUXSOCK_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_10 = uxsock_simple.sh -@ENABLE_RELP_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_11 = sndrcv_relp.sh -@ENABLE_OMUDPSPOOF_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_12 = sndrcv_omudpspoof.sh \ +@ENABLE_OMUXSOCK_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_11 = uxsock_simple.sh +@ENABLE_RELP_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_12 = sndrcv_relp.sh +@ENABLE_OMUDPSPOOF_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_13 = sndrcv_omudpspoof.sh \ @ENABLE_OMUDPSPOOF_TRUE@@ENABLE_TESTBENCH_TRUE@ sndrcv_omudpspoof_nonstdpt.sh -@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_13 = omod-if-array.sh \ +@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_14 = omod-if-array.sh \ @ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ proprepltest.sh \ @ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ parsertest.sh \ @ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ timestamp.sh \ @@ -197,16 +211,16 @@ host_triplet = @host@ @ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ tabescape_off.sh \ @ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ fieldtest.sh -@ENABLE_IMDIAG_TRUE@@ENABLE_OMRULESET_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_14 = omruleset.sh \ +@ENABLE_IMDIAG_TRUE@@ENABLE_OMRULESET_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_15 = omruleset.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_OMRULESET_TRUE@@ENABLE_TESTBENCH_TRUE@ omruleset-queue.sh # random.sh is temporarily disabled as it needs some work # to rsyslog core to complete in reasonable time #TESTS += random.sh -@ENABLE_IMFILE_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_15 = imfile-basic.sh -@ENABLE_IMFILE_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@am__append_16 = imfile-basic-vg.sh -@ENABLE_GNUTLS_TRUE@am__append_17 = -lgcrypt +@ENABLE_IMFILE_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_16 = imfile-basic.sh +@ENABLE_IMFILE_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@am__append_17 = imfile-basic-vg.sh +@ENABLE_GNUTLS_TRUE@am__append_18 = -lgcrypt subdir = tests DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -629,6 +643,16 @@ EXTRA_DIST = 1.rstest 2.rstest 3.rstest err1.rstest \ testsuites/global_vars.conf \ rfc5424parser.sh \ testsuites/rfc5424parser.conf \ + fac_authpriv.sh \ + testsuites/fac_authpriv.conf \ + fac_local0.sh \ + testsuites/fac_local0.conf \ + fac_mail.sh \ + testsuites/fac_mail.conf \ + fac_news.sh \ + testsuites/fac_news.conf \ + fac_uucp.sh \ + testsuites/fac_uucp.conf \ rs_optimizer_pri.sh \ testsuites/rs_optimizer_pri.conf \ rscript_prifilt.sh \ @@ -654,6 +678,18 @@ EXTRA_DIST = 1.rstest 2.rstest 3.rstest err1.rstest \ incltest_dir_wildcard.sh \ testsuites/incltest_dir_wildcard.conf \ testsuites/incltest.d/include.conf \ + elasticsearch-basic.sh \ + testsuites/elasticsearch-basic.conf \ + elasticsearch-basic-bulk.sh \ + testsuites/elasticsearch-basic-bulk.conf \ + elasticsearch-basic-errorfile-empty.sh \ + testsuites/elasticsearch-basic-errorfile-empty.conf \ + elasticsearch-basic-errorfile-populated.sh \ + testsuites/elasticsearch-basic-errorfile-populated.conf \ + elasticsearch-bulk-errorfile-empty.sh \ + testsuites/elasticsearch-bulk-errorfile-empty.conf \ + elasticsearch-bulk-errorfile-populated.sh \ + testsuites/elasticsearch-bulk-errorfile-populated.conf \ linkedlistqueue.sh \ testsuites/linkedlistqueue.conf \ da-mainmsg-q.sh \ @@ -889,7 +925,7 @@ uxsockrcvr_LDADD = $(SOL_LIBS) tcpflood_SOURCES = tcpflood.c tcpflood_CPPFLAGS = $(PTHREADS_CFLAGS) $(GNUTLS_CFLAGS) tcpflood_LDADD = $(SOL_LIBS) $(PTHREADS_LIBS) $(GNUTLS_LIBS) \ - $(am__append_17) + $(am__append_18) minitcpsrv_SOURCES = minitcpsrvr.c minitcpsrv_LDADD = $(SOL_LIBS) syslog_caller_SOURCES = syslog_caller.c diff --git a/tests/diag.sh b/tests/diag.sh index 1eae524..fd294ce 100755 --- a/tests/diag.sh +++ b/tests/diag.sh @@ -22,6 +22,7 @@ case $1 in rm -rf test-spool test-logdir stat-file1 rm -f rsyslog.out.*.log work-presort rsyslog.pipe rm -f rsyslog.input rsyslog.empty + rm -f rsyslog.errorfile rm -f core.* vgcore.* # Note: rsyslog.action.*.include must NOT be deleted, as it # is used to setup some parameters BEFORE calling init. This @@ -35,8 +36,20 @@ case $1 in rm -rf test-spool test-logdir stat-file1 rm -f rsyslog.out.*.log rsyslog.random.data work-presort rsyslog.pipe rm -f rsyslog.input rsyslog.conf.tlscert stat-file1 rsyslog.empty + rm -f rsyslog.errorfile echo ------------------------------------------------------------------------------- ;; + 'es-init') # initialize local Elasticsearch *testbench* instance for the next + # test. NOTE: do NOT put anything useful on that instance! + curl -XDELETE localhost:9200/rsyslog_testbench + ;; + 'es-getdata') # read data from ES to a local file so that we can process + # it with out regular tooling. + # Note: param 2 MUST be number of records to read (ES does + # not return the full set unless you tell it explicitely). + curl localhost:9200/rsyslog_testbench/_search?size=$2 > work + python $srcdir/es_response_get_msgnum.py > rsyslog.out.log + ;; 'startup') # start rsyslogd with default params. $2 is the config file name to use # returns only after successful startup, $3 is the instance (blank or 2!) $valgrind ../tools/rsyslogd -u2 -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 & diff --git a/tests/elasticsearch-basic-bulk.sh b/tests/elasticsearch-basic-bulk.sh new file mode 100755 index 0000000..f62db16 --- /dev/null +++ b/tests/elasticsearch-basic-bulk.sh @@ -0,0 +1,12 @@ +# This file is part of the rsyslog project, released under ASL 2.0 +echo =============================================================================== +echo \[elasticsearch-basic-bulk.sh\]: basic test for elasticsearch functionality +source $srcdir/diag.sh init +source $srcdir/diag.sh es-init +source $srcdir/diag.sh startup elasticsearch-basic-bulk.conf +source $srcdir/diag.sh injectmsg 0 10000 +source $srcdir/diag.sh shutdown-when-empty +source $srcdir/diag.sh wait-shutdown +source $srcdir/diag.sh es-getdata 10000 +source $srcdir/diag.sh seq-check 0 9999 +source $srcdir/diag.sh exit diff --git a/tests/elasticsearch-basic-errorfile-empty.sh b/tests/elasticsearch-basic-errorfile-empty.sh new file mode 100755 index 0000000..6dbcde9 --- /dev/null +++ b/tests/elasticsearch-basic-errorfile-empty.sh @@ -0,0 +1,17 @@ +# This file is part of the rsyslog project, released under ASL 2.0 +echo =============================================================================== +echo \[elasticsearch-basic-errorfile-empty\]: basic test for elasticsearch functionality +source $srcdir/diag.sh init +source $srcdir/diag.sh es-init +source $srcdir/diag.sh startup elasticsearch-basic-errorfile-empty.conf +source $srcdir/diag.sh injectmsg 0 10000 +source $srcdir/diag.sh shutdown-when-empty +source $srcdir/diag.sh wait-shutdown +source $srcdir/diag.sh es-getdata 10000 +if [ -f rsyslog.errorfile ] +then + echo "error: error file exists!" + exit 1 +fi +source $srcdir/diag.sh seq-check 0 9999 +source $srcdir/diag.sh exit diff --git a/tests/elasticsearch-basic-errorfile-populated.sh b/tests/elasticsearch-basic-errorfile-populated.sh new file mode 100755 index 0000000..7239a59 --- /dev/null +++ b/tests/elasticsearch-basic-errorfile-populated.sh @@ -0,0 +1,26 @@ +# This file is part of the rsyslog project, released under ASL 2.0 +echo =============================================================================== +echo \[elasticsearch-basic-errorfile-populated\]: basic test for elasticsearch functionality +source $srcdir/diag.sh init +source $srcdir/diag.sh es-init +curl -XPUT localhost:9200/rsyslog_testbench/ -d '{ + "mappings": { + "test-type": { + "properties": { + "msgnum": { + "type": "integer" + } + } + } + } +}' +source $srcdir/diag.sh startup elasticsearch-basic-errorfile-populated.conf +source $srcdir/diag.sh injectmsg 0 1000 +source $srcdir/diag.sh shutdown-when-empty +source $srcdir/diag.sh wait-shutdown +if [ ! -f rsyslog.errorfile ] +then + echo "error: error file does not exist!" + exit 1 +fi +source $srcdir/diag.sh exit diff --git a/tests/elasticsearch-basic.sh b/tests/elasticsearch-basic.sh new file mode 100755 index 0000000..18c847c --- /dev/null +++ b/tests/elasticsearch-basic.sh @@ -0,0 +1,12 @@ +# This file is part of the rsyslog project, released under ASL 2.0 +echo =============================================================================== +echo \[elasticsearch-basic.sh\]: basic test for elasticsearch functionality +source $srcdir/diag.sh init +source $srcdir/diag.sh es-init +source $srcdir/diag.sh startup elasticsearch-basic.conf +source $srcdir/diag.sh injectmsg 0 10000 +source $srcdir/diag.sh shutdown-when-empty +source $srcdir/diag.sh wait-shutdown +source $srcdir/diag.sh es-getdata 10000 +source $srcdir/diag.sh seq-check 0 9999 +source $srcdir/diag.sh exit diff --git a/tests/elasticsearch-bulk-errorfile-empty.sh b/tests/elasticsearch-bulk-errorfile-empty.sh new file mode 100755 index 0000000..a370e72 --- /dev/null +++ b/tests/elasticsearch-bulk-errorfile-empty.sh @@ -0,0 +1,17 @@ +# This file is part of the rsyslog project, released under ASL 2.0 +echo =============================================================================== +echo \[elasticsearch-bulk-errorfile-empty\]: basic test for elasticsearch functionality +source $srcdir/diag.sh init +source $srcdir/diag.sh es-init +source $srcdir/diag.sh startup elasticsearch-bulk-errorfile-empty.conf +source $srcdir/diag.sh injectmsg 0 10000 +source $srcdir/diag.sh shutdown-when-empty +source $srcdir/diag.sh wait-shutdown +source $srcdir/diag.sh es-getdata 10000 +if [ -f rsyslog.errorfile ] +then + echo "error: error file exists!" + exit 1 +fi +source $srcdir/diag.sh seq-check 0 9999 +source $srcdir/diag.sh exit diff --git a/tests/elasticsearch-bulk-errorfile-populated.sh b/tests/elasticsearch-bulk-errorfile-populated.sh new file mode 100755 index 0000000..169fa1c --- /dev/null +++ b/tests/elasticsearch-bulk-errorfile-populated.sh @@ -0,0 +1,26 @@ +# This file is part of the rsyslog project, released under ASL 2.0 +echo =============================================================================== +echo \[elasticsearch-bulk-errorfile-populated\]: basic test for elasticsearch functionality +source $srcdir/diag.sh init +source $srcdir/diag.sh es-init +curl -XPUT localhost:9200/rsyslog_testbench/ -d '{ + "mappings": { + "test-type": { + "properties": { + "msgnum": { + "type": "integer" + } + } + } + } +}' +source $srcdir/diag.sh startup elasticsearch-bulk-errorfile-populated.conf +source $srcdir/diag.sh injectmsg 0 1000 +source $srcdir/diag.sh shutdown-when-empty +source $srcdir/diag.sh wait-shutdown +if [ ! -f rsyslog.errorfile ] +then + echo "error: error file does not exist!" + exit 1 +fi +source $srcdir/diag.sh exit diff --git a/tests/fac_authpriv.sh b/tests/fac_authpriv.sh new file mode 100755 index 0000000..f2c8544 --- /dev/null +++ b/tests/fac_authpriv.sh @@ -0,0 +1,11 @@ +# This tests proper processing of the authpriv facility. +# added 2014-09-16 by Rgerhards + +# This file is part of the rsyslog project, released under ASL 2.0 +source $srcdir/diag.sh init +source $srcdir/diag.sh startup fac_authpriv.conf +source $srcdir/diag.sh tcpflood -m1000 -P 81 +source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages +source $srcdir/diag.sh wait-shutdown # and wait for it to terminate +source $srcdir/diag.sh seq-check 0 999 +source $srcdir/diag.sh exit diff --git a/tests/fac_local0.sh b/tests/fac_local0.sh new file mode 100755 index 0000000..516d3c0 --- /dev/null +++ b/tests/fac_local0.sh @@ -0,0 +1,10 @@ +# added 2014-09-17 by Rgerhards + +# This file is part of the rsyslog project, released under ASL 2.0 +source $srcdir/diag.sh init +source $srcdir/diag.sh startup fac_local0.conf +source $srcdir/diag.sh tcpflood -m1000 -P 129 +source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages +source $srcdir/diag.sh wait-shutdown # and wait for it to terminate +source $srcdir/diag.sh seq-check 0 999 +source $srcdir/diag.sh exit diff --git a/tests/fac_mail.sh b/tests/fac_mail.sh new file mode 100755 index 0000000..e8873da --- /dev/null +++ b/tests/fac_mail.sh @@ -0,0 +1,10 @@ +# added 2014-09-17 by Rgerhards + +# This file is part of the rsyslog project, released under ASL 2.0 +source $srcdir/diag.sh init +source $srcdir/diag.sh startup fac_mail.conf +source $srcdir/diag.sh tcpflood -m1000 -P 17 +source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages +source $srcdir/diag.sh wait-shutdown # and wait for it to terminate +source $srcdir/diag.sh seq-check 0 999 +source $srcdir/diag.sh exit diff --git a/tests/fac_news.sh b/tests/fac_news.sh new file mode 100755 index 0000000..85ded82 --- /dev/null +++ b/tests/fac_news.sh @@ -0,0 +1,10 @@ +# added 2014-09-17 by Rgerhards + +# This file is part of the rsyslog project, released under ASL 2.0 +source $srcdir/diag.sh init +source $srcdir/diag.sh startup fac_news.conf +source $srcdir/diag.sh tcpflood -m1000 -P 57 +source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages +source $srcdir/diag.sh wait-shutdown # and wait for it to terminate +source $srcdir/diag.sh seq-check 0 999 +source $srcdir/diag.sh exit diff --git a/tests/fac_uucp.sh b/tests/fac_uucp.sh new file mode 100755 index 0000000..6c5c06b --- /dev/null +++ b/tests/fac_uucp.sh @@ -0,0 +1,10 @@ +# added 2014-09-17 by Rgerhards + +# This file is part of the rsyslog project, released under ASL 2.0 +source $srcdir/diag.sh init +source $srcdir/diag.sh startup fac_uucp.conf +source $srcdir/diag.sh tcpflood -m1000 -P 65 +source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages +source $srcdir/diag.sh wait-shutdown # and wait for it to terminate +source $srcdir/diag.sh seq-check 0 999 +source $srcdir/diag.sh exit diff --git a/tests/testsuites/elasticsearch-basic-bulk.conf b/tests/testsuites/elasticsearch-basic-bulk.conf new file mode 100644 index 0000000..69a0495 --- /dev/null +++ b/tests/testsuites/elasticsearch-basic-bulk.conf @@ -0,0 +1,10 @@ +$IncludeConfig diag-common.conf + +template(name="tpl" type="string" + string="{\"msgnum\":\"%msg:F,58:2%\"}") + +module(load="../plugins/omelasticsearch/.libs/omelasticsearch") +:msg, contains, "msgnum:" action(type="omelasticsearch" + template="tpl" + searchIndex="rsyslog_testbench" + bulkmode="on") diff --git a/tests/testsuites/elasticsearch-basic-errorfile-empty.conf b/tests/testsuites/elasticsearch-basic-errorfile-empty.conf new file mode 100644 index 0000000..6b0371c --- /dev/null +++ b/tests/testsuites/elasticsearch-basic-errorfile-empty.conf @@ -0,0 +1,10 @@ +$IncludeConfig diag-common.conf + +template(name="tpl" type="string" + string="{\"msgnum\":\"%msg:F,58:2%\"}") + +module(load="../plugins/omelasticsearch/.libs/omelasticsearch") +:msg, contains, "msgnum:" action(type="omelasticsearch" + template="tpl" + searchIndex="rsyslog_testbench" + errorFile="./rsyslog.errorfile") diff --git a/tests/testsuites/elasticsearch-basic-errorfile-populated.conf b/tests/testsuites/elasticsearch-basic-errorfile-populated.conf new file mode 100644 index 0000000..d13b712 --- /dev/null +++ b/tests/testsuites/elasticsearch-basic-errorfile-populated.conf @@ -0,0 +1,15 @@ +$IncludeConfig diag-common.conf + +# Note: we must mess up with the template, because we can not +# instruct ES to put further constraints on the data type and +# values. So we require integer and make sure it is none. +template(name="tpl" type="string" + string="{\"msgnum\":\"x%msg:F,58:2%\"}") + +module(load="../plugins/omelasticsearch/.libs/omelasticsearch") +:msg, contains, "msgnum:" action(type="omelasticsearch" + template="tpl" + searchIndex="rsyslog_testbench" + searchType="test-type" + bulkmode="off" + errorFile="./rsyslog.errorfile") diff --git a/tests/testsuites/elasticsearch-basic.conf b/tests/testsuites/elasticsearch-basic.conf new file mode 100644 index 0000000..627bacc --- /dev/null +++ b/tests/testsuites/elasticsearch-basic.conf @@ -0,0 +1,9 @@ +$IncludeConfig diag-common.conf + +template(name="tpl" type="string" + string="{\"msgnum\":\"%msg:F,58:2%\"}") + +module(load="../plugins/omelasticsearch/.libs/omelasticsearch") +:msg, contains, "msgnum:" action(type="omelasticsearch" + template="tpl" + searchIndex="rsyslog_testbench") diff --git a/tests/testsuites/elasticsearch-bulk-errorfile-empty.conf b/tests/testsuites/elasticsearch-bulk-errorfile-empty.conf new file mode 100644 index 0000000..46e7cce --- /dev/null +++ b/tests/testsuites/elasticsearch-bulk-errorfile-empty.conf @@ -0,0 +1,11 @@ +$IncludeConfig diag-common.conf + +template(name="tpl" type="string" + string="{\"msgnum\":\"%msg:F,58:2%\"}") + +module(load="../plugins/omelasticsearch/.libs/omelasticsearch") +:msg, contains, "msgnum:" action(type="omelasticsearch" + template="tpl" + searchIndex="rsyslog_testbench" + bulkmode="on" + errorFile="./rsyslog.errorfile") diff --git a/tests/testsuites/elasticsearch-bulk-errorfile-populated.conf b/tests/testsuites/elasticsearch-bulk-errorfile-populated.conf new file mode 100644 index 0000000..21e7ddd --- /dev/null +++ b/tests/testsuites/elasticsearch-bulk-errorfile-populated.conf @@ -0,0 +1,15 @@ +$IncludeConfig diag-common.conf + +# Note: we must mess up with the template, because we can not +# instruct ES to put further constraints on the data type and +# values. So we require integer and make sure it is none. +template(name="tpl" type="string" + string="{\"msgnum\":\"x%msg:F,58:2%\"}") + +module(load="../plugins/omelasticsearch/.libs/omelasticsearch") +:msg, contains, "msgnum:" action(type="omelasticsearch" + template="tpl" + searchIndex="rsyslog_testbench" + searchType="test-type" + bulkmode="on" + errorFile="./rsyslog.errorfile") diff --git a/tests/testsuites/fac_authpriv.conf b/tests/testsuites/fac_authpriv.conf new file mode 100644 index 0000000..6a6484b --- /dev/null +++ b/tests/testsuites/fac_authpriv.conf @@ -0,0 +1,7 @@ +$IncludeConfig diag-common.conf + +$ModLoad ../plugins/imtcp/.libs/imtcp +$InputTCPServerRun 13514 + +$template outfmt,"%msg:F,58:2%,%msg:F,58:3%,%msg:F,58:4%\n" +authpriv.* ./rsyslog.out.log;outfmt diff --git a/tests/testsuites/fac_local0.conf b/tests/testsuites/fac_local0.conf new file mode 100644 index 0000000..2357e63 --- /dev/null +++ b/tests/testsuites/fac_local0.conf @@ -0,0 +1,8 @@ +$IncludeConfig diag-common.conf + +module(load="../plugins/imtcp/.libs/imtcp") +input(type="imtcp" port="13514") + +template(type="string" name="outfmt" string="%msg:F,58:2%,%msg:F,58:3%,%msg:F,58:4%\n") +if $syslogfacility-text == "local0" then + action(type="omfile" file="rsyslog.out.log" template="outfmt") diff --git a/tests/testsuites/fac_mail.conf b/tests/testsuites/fac_mail.conf new file mode 100644 index 0000000..ffe0dfd --- /dev/null +++ b/tests/testsuites/fac_mail.conf @@ -0,0 +1,7 @@ +$IncludeConfig diag-common.conf + +module(load="../plugins/imtcp/.libs/imtcp") +input(type="imtcp" port="13514") + +template(type="string" name="outfmt" string="%msg:F,58:2%,%msg:F,58:3%,%msg:F,58:4%\n") +mail.* action(type="omfile" file="rsyslog.out.log" template="outfmt") diff --git a/tests/testsuites/fac_news.conf b/tests/testsuites/fac_news.conf new file mode 100644 index 0000000..efc6ba0 --- /dev/null +++ b/tests/testsuites/fac_news.conf @@ -0,0 +1,8 @@ +$IncludeConfig diag-common.conf + +module(load="../plugins/imtcp/.libs/imtcp") +input(type="imtcp" port="13514") + +template(type="string" name="outfmt" string="%msg:F,58:2%,%msg:F,58:3%,%msg:F,58:4%\n") +if prifilt("news.*") then + action(type="omfile" file="rsyslog.out.log" template="outfmt") diff --git a/tests/testsuites/fac_uucp.conf b/tests/testsuites/fac_uucp.conf new file mode 100644 index 0000000..90d9646 --- /dev/null +++ b/tests/testsuites/fac_uucp.conf @@ -0,0 +1,7 @@ +$IncludeConfig diag-common.conf + +module(load="../plugins/imtcp/.libs/imtcp") +input(type="imtcp" port="13514") + +template(type="string" name="outfmt" string="%msg:F,58:2%,%msg:F,58:3%,%msg:F,58:4%\n") +uucp.* action(type="omfile" file="rsyslog.out.log" template="outfmt") |