2543 Commits

Author SHA1 Message Date
Rainer Gerhards
ff4b3558cf
testbench: obtain python binary path via AM_PATH_PYTHON
see also https://github.com/rsyslog/rsyslog/issues/3853
2019-11-22 14:45:10 +01:00
Rainer Gerhards
cf6b9c5931 testbench: add some debugging instrumentation
We have a long-standing issue with the mysql tests. We can't find the
root cause with special test runs. This commit now adds some debug
info. The idea is to merge this and run it in all upcoming tests, so
that we can hopefully get a sufficiently large sample that we can
address the problem.
2019-11-21 17:05:14 +01:00
Rainer Gerhards
54a4095760
Merge pull request #3978 from rgerhards/tb-clean-logfiles
build system: remove ./tests/*.log during "make clean"
2019-11-20 12:15:03 +01:00
Rainer Gerhards
b80c9497b0
Merge pull request #3965 from rgerhards/travis-no-trusty
travis: remove no longer needed Trusty install scripts
2019-11-20 10:28:42 +01:00
Rainer Gerhards
025f3a1cf0
build system: remove ./tests/*.log during "make clean" 2019-11-19 18:36:40 +01:00
Rainer Gerhards
26d5d83353
omprog: detect violation of interface protocol
The spec for the omprog interaction with the program it calls specifies
that the program receives one message via one line. In other words:
it must be a string terminated by LF.

However, omprog does currently rely on a proper template to fulfill this
requirement, If the template does not provide for the LF, it is never
written. For the called program, this looks like it does not receive any
input at all. Even if it finally reads data (e.g. due to full buffer),
it will not properly be able to discern the messages.

This handling is improved with this commit.

We cannot just check the template, because at the end of the template
may by a non-constant value. As such, we do not know at config load
time if there is this problem or not.

So the correct approach is to, during runtime, check if each message
is properly terminated. For those that are not:
* we append a LF, because anything else makes matters worse
* log a warning message, at least for a sample of the messages

The warning is useful in the (expected most often) case that the template
is simply missing the LF. While appending works, it slows down processing.
As such the user should be given a chance to correct the config bug.

To avoid clutter, the warning is emitted at most once every 30 seconds.
This value is hardcoded as we do not envison a need to adjust it. Usually
users should quickly fix the template.

closes https://github.com/rsyslog/rsyslog/issues/3975
2019-11-19 18:06:37 +01:00
Rainer Gerhards
0d7cc6c653
Merge pull request #3966 from rgerhards/i77
core queue: emit warning if parameters are set for direct queue
2019-11-19 14:41:20 +01:00
Rainer Gerhards
fb943cf918
Merge pull request #3967 from turchanov/mmutf8fix-corrections
Enhance mmutf8fix handling of incorrect UTF-8 sequences
2019-11-19 14:36:20 +01:00
Sergei Turchanov
30bd511954 Enhance mmutf8fix handling of incorrect UTF-8 sequences
1. Invalid utf8 detection didn't handle 3 and 4-byte overlong encodings (2
   byte overlong econdings were handled explicitly by rejection E0 and E1
   start bytes). Unified checks for overlong encodings.
2. Surrogates U+D800..U+DFFF are not valid codepoints (Unicode Standard, D92)
3. Replacement of characters in invalid 3 or 4-bytes encodings was too
   eager. It must not replace bytes which are valid UTF-8 sequences. For
   example, in [0xE0 0xC2 0xA7] sequence the 0xC2 is invalid as a continuation
   byte, but it starts a valid UTF8 symbol [0xC2 0xA7]. That is, with current
   code processing the sequence will result in "???" but the correct result is "?§"
   (provided that the replacement character is "?").
4. Various tests for UTF-8 invalid/valid sequences.
2019-11-15 17:03:38 +10:00
Rainer Gerhards
1b2769f5ec
travis: remove no longer needed Trusty install scripts
This also removes all remaining references to LLVM repos, as such
closes https://github.com/rsyslog/rsyslog/issues/2380
2019-11-14 16:59:29 +01:00
Rainer Gerhards
3b571a9201
core queue: emit warning if parameters are set for direct queue
Direct queues do not apply queue parameters because they are actually
no physical queue. As such, any parameter set is ignored. This can
lead to unintentional results.

The new code detects this case and warns the user.

closes https://github.com/rsyslog/rsyslog/issues/77
2019-11-14 16:57:12 +01:00
Rainer Gerhards
370b86133b
imfile: add new input parameter escapeLF.replacement
The new parameter permits to specify a replacement to be configured
when "escapeLF" is set to "on". Previously, a fixed replacement string
was used ("#012"/"\n") depending on circumstances. If the parameter is
set to an empty string, the LF is simply discarded.

closes https://github.com/rsyslog/rsyslog/issues/3889
2019-11-14 14:31:24 +01:00
73934b06c5 ossl driver: fix wrong OpenSSL Version check
(OPENSSL_VERSION_NUMBER)

Fix OpenSSL Version check in:
- SetGnutlsPriorityString function in nsd_ossl.c
- initTLS() function tcpflood.c

See https://www.openssl.org/docs/man1.1.0/man3/OPENSSL_VERSION_NUMBER.html
for more.

Removed "MinProtocol=TLSv1.1" from two testcases because MinProtocol
is only supported by OpenSSl 1.1.0 or higher and was not really
necessary for the testcases.

closes https://github.com/rsyslog/rsyslog/issues/3939
2019-11-05 15:02:22 +01:00
Rainer Gerhards
36231cb020
Merge pull request #3882 from n2yen/improg-fix
bug fix: allow improg to handle multi-line inputs
2019-10-30 18:48:08 +01:00
Rainer Gerhards
716f4136e8
Merge pull request #3927 from rgerhards/i3885-tb
testbench: add test for async dynafile writer
2019-10-30 18:25:51 +01:00
Rainer Gerhards
d71205e05d
Merge pull request #3937 from rgerhards/i1650
mmdblookup: fix missing space in city name
2019-10-30 17:05:59 +01:00
Rainer Gerhards
9ca744c074
Merge pull request #3926 from rgerhards/i3833
enhancement: multithread disk queue
2019-10-30 13:22:59 +01:00
Rainer Gerhards
ae66007173
mmdblookup: fix missing space in city name
This fixes the issue that spaces in city names are dropped. However, the
fix is more or less a work-around. As it turns out, the libmaxmindb API
is not correctly used. In the somewhat longer term, we should fix this.

see also https://github.com/maxmind/libmaxminddb/issues/218
closes https://github.com/rsyslog/rsyslog/issues/1650
2019-10-30 11:00:30 +01:00
Rainer Gerhards
3b35c98578
testbench: fix issuesn regard to ElasticSearch, modernize tests
Fix some minor issue that were detected as part of other work.
2019-10-30 10:04:22 +01:00
Rainer Gerhards
e88b956e9d
core/queue: provide ability to run diskqueue on multiple threads
see also https://github.com/rsyslog/rsyslog/issues/3543
closes https://github.com/rsyslog/rsyslog/issues/3833
2019-10-30 10:04:09 +01:00
Rainer Gerhards
a9445bbc5c
testbench: add test for async dynafile writer
This models a problem from practice which was pretty hard
to reproduce.

see also https://github.com/rsyslog/rsyslog/issues/3885
2019-10-25 13:11:26 +02:00
Rainer Gerhards
08f897efb7
testbench bugfix: make python scripts use print python 2/3 compatible 2019-10-24 12:03:55 +02:00
Rainer Gerhards
a1c92c1c9c
Merge pull request #3900 from rgerhards/diskq-multi-file-del
core queue bugfix: handle multi-queue-file delete correctly
2019-10-16 17:15:42 +02:00
Rainer Gerhards
103a44263d
core queue bugfix: handle multi-queue-file delete correctly
Rsyslog may leave some dangling disk queue files under the following
conditions:

- batch sizes and/or messages are large
- queue files are comparatively small
- a batch spans more than two queue files (from n to n+m with m>1)

In this case, queue files n+1 to (n+m-1) are not deleted. This can
lead to problems when the queue is re-opened again. In extreme cases
this can also lead to stalled processing when the max disk space is
used up by such left-over queue files.

Using defaults this scenario is very unlikely, but it can happen,
especially when large messages are being processed.
2019-10-15 10:51:05 +02:00
Rainer Gerhards
73dc50ad0c
testbench: fix unreliable gzipwrite test
The test was timing-sensitive as we did not properly check all data
was output to the output file - we just relied on sleep periods.

This has been changed. Also, we made some changes to the testing
framework to fully support sequence checking of multiple ZIP files.
2019-10-15 10:28:03 +02:00
Rainer Gerhards
4d7d8ce227
Merge pull request #3888 from rgerhards/tb-mmpstrucdata-escape
testbench: add test for mmpstrucdata with RFC5424 escape sequences
2019-10-10 18:10:44 +02:00
Rainer Gerhards
a8e7f3e7b6
Merge pull request #3891 from alorbach/al-openssl-oldapiwarn
openssl: added link to doc for gnutlsPriorityString error msg when op…
2019-10-10 18:10:27 +02:00
Rainer Gerhards
4a4a09c5a0
testbench: improve dynstats tests and make them more portable 2019-10-09 12:21:14 +02:00
aa17c24570 openssl: added link to doc for gnutlsPriorityString error msg
When openssl version is too old, a documention link will be added
to the error message now.

Also changed openssl too old check in testsuite
2019-10-08 15:36:28 +02:00
Rainer Gerhards
2c0a300e35
testbench: add test for mmpstrucdata with RFC5424 escape sequences 2019-10-07 12:50:16 +02:00
Nelson Yen
cc0537c808 bug fix: allow improg to handle multi-line inputs
miscellaneous bug fixes in improg:
- properly truncate string after an input event is submitted
- set msgoffset to 0.
- tests added to check above fixes
2019-10-02 10:46:13 -07:00
Rainer Gerhards
5f85577cd8
testbench: add basic test for immark 2019-08-20 09:11:16 +02:00
Rainer Gerhards
255a6882f5
testbench: add more tests for $allowedSender directive 2019-08-19 15:35:27 +02:00
Rainer Gerhards
9b0c917f1b
Merge pull request #3826 from rgerhards/tb-allowed-sender
testbench: add tests for $AllowedSender functionality
2019-08-19 09:03:44 +02:00
Rainer Gerhards
4638699bce
testbench: modernize and stabilize some tests 2019-08-17 18:24:54 +02:00
Rainer Gerhards
f447fda845
testbench: add tests for $AllowedSender functionality
while this is deprecated, it is still used in practice. So far no
test guarded this functionality.
2019-08-16 20:45:33 +02:00
Rainer Gerhards
42a8051ad9
testbench: make most tests use a port file and assign listen port 0
This makes the test much more robust against heavily loaded test
systems.
2019-08-16 17:31:52 +02:00
Rainer Gerhards
f9d4b3778b
testbench: disable test known to fail
temporarily disabled because it fails quite often - fix in progress
If we do not disable it, most CI runs fail.
2019-08-16 11:45:35 +02:00
Rainer Gerhards
56086da5b8
Merge pull request #3828 from rgerhards/tb-asynwr_deadlock
testbench: experimentally increase queue empty check period
2019-08-16 11:36:48 +02:00
Rainer Gerhards
fa294c73ac
Merge pull request #3823 from rgerhards/trailing-whitespace
core/action: guard action.externalstate.file content against whitspace
2019-08-16 10:23:41 +02:00
Rainer Gerhards
e7f3649da1
Merge pull request #3822 from rgerhards/i3817
imtcp bugfix: multiple listnerPortFile parameter did not work
2019-08-15 18:27:26 +02:00
Rainer Gerhards
bb32ae005f
testbench: experimentally increase queue empty check period
The test frequently failed in a way that suggests rsyslog terminated too
early. We try if we can improve the situation by prolonging the empty
check. While there are better solutions for this special case, there are
some cases where we do no have them. So it is good to know if this
method works.
2019-08-15 17:16:52 +02:00
Rainer Gerhards
185b388fb0
testbench: add test for imtcp multiple listener port files
This also enhances the testbench plumbing a bit and updates other tests
to support that.
2019-08-15 10:22:48 +02:00
Rainer Gerhards
f958e1556b
testbench: modernize tests and make them more reliable 2019-08-15 09:59:52 +02:00
Rainer Gerhards
3a28a6fab4
core/action: guard action.externalstate.file content against whitspace
remove trailing whitespace before checking the status string. This is
most important as a line usually ends with \n, which is considered
trailing whitespace. Accepting this increases usability.
2019-08-15 08:59:21 +02:00
Rainer Gerhards
3896f9a768
Merge pull request #3818 from rgerhards/tb-mmpstrucdata-case
testbench: modernize mmpstrucdata-case test
2019-08-15 08:28:05 +02:00
Rainer Gerhards
d75533fa69
Merge pull request #3809 from rgerhards/test3796
testbench: add tests for omelasticsearch error configs
2019-08-14 16:58:18 +02:00
Rainer Gerhards
9bba4643b9
testbench: modernize mmpstrucdata-case test 2019-08-14 16:57:23 +02:00
Rainer Gerhards
721b2372b3
Merge pull request #3819 from rgerhards/tb-es-reduce_restart
testbench: add test for imuxsock legacy format
2019-08-14 16:16:42 +02:00
Rainer Gerhards
4816262912
Merge pull request #3821 from rgerhards/tb-gzipwr_large
testbench: make gzipwr_large test more reliable and improve plumbing
2019-08-14 14:44:42 +02:00