1715 Commits

Author SHA1 Message Date
Jan Gerhards
3fc7a66855 testbench: add simple omsnmp test
currently only checks if module is loaded and checks for
required parameters correctly
2018-09-27 09:03:28 +02:00
Jan Gerhards
94a0e7599d testbench: add very basic ommail test
not a very good test at the moment, but still better than none at all.
2018-09-25 17:54:21 +02:00
Rainer Gerhards
0c9574d8fe
bugfix testbench: kafka test startup was racy
Topic creation was racy: it can happen that the brokers have not
been synced.  This causes follow-on errors and ultimately causes
the test to hang in rsyslog shutdown.

This PR introduces a method to ensure the brokers are acutally
up and running before the rest of the test is carried out. I
assume this fixes the problems we have seen. However, only
practice will show if this really is the case because the
problem happened relatively infrequently (so a couple of good
tests do not necessarily indicate "problem solved").

As such, we close the issue with this commit, but may need
to re-open it if the issue is seen again.

closes https://github.com/rsyslog/rsyslog/issues/3045
2018-09-23 10:54:53 +02:00
Rainer Gerhards
7a7cdc434d
fix trailing whitespace in Python files 2018-09-23 08:51:30 +02:00
Rainer Gerhards
c2578645a3
Merge pull request #3047 from rgerhards/kafka-test-bug
testbench: small test refactor; add pluming to find test bug
2018-09-22 21:03:40 +02:00
Rainer Gerhards
3f3fcd3564
Merge pull request #3036 from rgerhards/imfile-truncate2
imfile: improve truncation detection
2018-09-22 17:39:43 +02:00
Rainer Gerhards
5bc086c292
testbench: small test refactor; add pluming to find test bug
see also https://github.com/rsyslog/rsyslog/issues/3045
2018-09-22 17:37:53 +02:00
Rainer Gerhards
8c7718d34f testbench: try to reproduce imfile "file no longer monitored" error
see also https://github.com/rsyslog/rsyslog/issues/1605
2018-09-22 15:52:57 +02:00
Rainer Gerhards
c1fd554cb6
Merge pull request #3042 from rgerhards/regr-gcov
testbench: fix recent regression in helgrind tests
2018-09-22 13:22:39 +02:00
Rainer Gerhards
da22c531be
Merge pull request #3038 from jsiwrk/testbench/omprog_test_fix
testbench: fix incompatibility of one omprog test with Python3
2018-09-22 11:17:06 +02:00
Rainer Gerhards
2280f25ab1
testbench: fix recent regression in helgrind tests
path info missing, unfortunately undetected when merging
8c38d3647fbf19111fb52ef1fc2c4c8d5f29a023
2018-09-22 10:33:43 +02:00
Rainer Gerhards
8c38d3647f
CI: add valgrind suppressions for -coverage gcc option
These suppressions are always used, as they can never be caused by
actual program code. So it doesn't hurt to always use them.

Also add some support for CodeCov tool.
2018-09-21 18:34:38 +02:00
Joan Sala
0b0a1262f2 testbench: fix incompatibility of one omprog test with Python3
Python3 writes to stderr immediately, and this caused the
captured output to differ with respect to Python2. Simplified
the test to do a single write to stderr. Also a cast to int
was needed when calculating 'numRepeats'.

closes #3030
2018-09-20 23:52:16 +02:00
b08a8e2b51 testbench: Kafka plumbing
- Removed all sleeps where possible.
- Moved all kafka start/stop/download logic into functions.
- Moved kafka/zookeeper stop into error_exit and exit_test.
- Kafka/Zookeeper cleanup only done on success now.
- Kafka/Zookeeper logfiles automatically dumped on error_exit only now.
- Added cleanup for Kafka/Zookeeper instances into CI/buildbot_cleanup.sh
2018-09-19 09:14:42 +02:00
Rainer Gerhards
2e56dc7822
Merge pull request #2962 from richm/mmkubernetes-issue-2949
mmkubertnetes: action fails preparation cycle if kubernetes API destroys resource during bootup sequence
2018-09-17 13:24:19 +02:00
Rich Megginson
3987cd929d mmkubertnetes: action fails preparation cycle if kubernetes API destroys resource during bootup sequence
The plugin was not handling 404 Not Found correctly when looking
up pods and namespaces.  In this case, we assume the pod/namespace
was deleted, annotate the record with whatever metadata we have,
and cache the fact that the pod/namespace is missing so we don't
attempt to look it up again.
In addition, the plugin was not handling error 429 Busy correctly.
In this case, it should also annotate the record with whatever
metadata it has, and _not_ cache anything.  By default the plugin
will retry every 5 seconds to connect to Kubernetes.  This
behavior is controlled by the new config param `busyretryinterval`.
This commit also adds impstats counters so that admins can
view the state of the plugin to see if the lookups are working
or are returning errors.  The stats are reported per-instance
or per-action to facilitate using multiple different actions
for different Kubernetes servers.
This commit also adds support for client cert auth to
Kubernetes via the two new config params `tls.mycert` and
`tls.myprivkey`.
2018-09-14 12:42:06 -06:00
Rainer Gerhards
faa28ed7ae
Merge pull request #2959 from PascalWithopf/relp-certvalid
omrelp: permit new authmode certvalid
2018-09-14 17:58:06 +02:00
PascalWithopf
4ff58bbf26 omrelp: permit all authmodes; updated tests
omrelp for some time limited authentication modes to those
that were known. While this was OK, it prevented the easy
introduction of new auth modes into librel.

This has now been changed; omrelp now checks the validity of
the authmode directly via librelp by doing some librelp calls
upon processing the configuration.

Also, some tests have been updated to check this feature and
also ensure that the new librelp mode "certvalid" works
(if it is available).
2018-09-14 15:33:47 +02:00
97308b5610 Imkafka: Added multithreaded support for kafka consumers (#3013)
* imkafka: implement multithreading support for kafka consumers.

Each consumer runs in it's own consumer thread now. New tests have also been
added for this.
2018-09-14 14:42:35 +02:00
Rainer Gerhards
8f12199cc4
Merge pull request #3020 from PascalWithopf/pmnormalize-test
pmnormalize: fix memory leak
2018-09-14 14:40:38 +02:00
PascalWithopf
77193c3077 bugfix pmnormalize/core: several memory leaks, invld property handling
- major memory leak which occurred once per message processed
  So this could lead to OOM. Caused by improper free of json
  structure
- another two major leaks of similar magnitued could occur if
  "fromhost-ip" and/or "fromhost" properties were set
- minor leaks upon termination. these were unproblematic as
  static and only occured immediately before shutdown.
  But they triggered memory debugger errors.
- fixed test which did not check for mem leaks albeit it should
- core invalid handling of the "fromhost" property, if set via
  the MsgSetPropsViaJSON() call. This was primarily of concern
  for pmnormalize and mmexternal, and only if these properties
  were used by either the rulebase or the external program
  response.

Actually, most of the leaks go back to rsyslog core, but that
core functionality was not used by other modules in the same
way. But if some other would have used it, the effects would
have been the same (so be aware if you wrote custom modules).
2018-09-14 13:11:31 +02:00
Rainer Gerhards
8ff3a710e9
Merge pull request #3009 from jsiwrk/bugfix/omprog_force_single_instance
omprog: fix forceSingleInstance flag
2018-09-14 09:28:41 +02:00
Rainer Gerhards
d0ba9d36e5
Merge pull request #3014 from richm/imfile-endmsg.regex
imfile: support for endmsg.regex
2018-09-14 09:08:50 +02:00
Rainer Gerhards
b7b4453cff
testbench: make imrelp tests faster and avoid imtcp
imtcp was primarily used for historical reasons and is actually
to inferior method of injection messages for such cases
2018-09-13 17:44:21 +02:00
Rainer Gerhards
74207603ad
testbench: remove imtcp in kafka test where not strictly needed
This method currently has some race associated with it, also it is
really not required and the injectmsg method is superior.

Also fix imdiag's new $imdiagInjectDelayMode config directive. While
it was added, it was forgotten to actually apply the value.
We are not doing a separate commit as this is thightly coupled into
our testing here (which also as a side-effect tests the new imdiag
functionality).
2018-09-13 14:25:17 +02:00
Rich Megginson
c902a0938f imfile: support for endmsg.regex
This adds support for endmsg.regex.  It is similar to
startmsg.regex except that it matches the line that denotes
the end of the message, rather than the start of the next message.
This is primarily for container log file use cases such as this:

    date stdout P start of message
    date stdout P  middle of message
    date stdout F  end of message

The `F` means this is the line which contains the final part of
the message.  The fully assembled message should be
`start of message middle of message end of message`.
`startmsg.regex="^[^ ]+ stdout F "` will match.
2018-09-11 20:01:47 -06:00
Rainer Gerhards
07978e7431 testbench: make cleanup not try to cancel grep itself 2018-09-10 10:55:43 +02:00
Joan Sala
f342794bfd omprog: fix forceSingleInstance flag
Closes #2813
Closes #2468
2018-09-09 20:56:10 +02:00
Rainer Gerhards
cd8fb150c2
testbench debug 2018-09-08 10:44:04 +02:00
Rainer Gerhards
e072935450
prototype change of sndrcv test via injectmsg 2018-09-08 10:40:09 +02:00
Rainer Gerhards
c096f21c46
testbench: some more modernization 2018-09-07 17:56:22 +02:00
Rainer Gerhards
14ee6a0d59
Merge pull request #3004 from rgerhards/tb18
testbench: modernize, next part
2018-09-07 17:36:12 +02:00
Rainer Gerhards
ca5452fe74
Merge pull request #2993 from PascalWithopf/m2782
add contrib module omhttp
2018-09-07 17:33:21 +02:00
Rainer Gerhards
5cb4060a0e
Merge pull request #2974 from alorbach/master-kafka-newtests
testbench: Added new kafka tests using kafkacat for better debugging.
2018-09-07 17:29:13 +02:00
Rainer Gerhards
74541cf56c
testbench: modernize, next part 2018-09-07 14:58:26 +02:00
847d4223ef testbench: Incremented input timeout to 60000 because kafka tests may fail on load otherwise.
Also fixed minor configuration and syntax issues.
Moved test init in kafka tests as far as possible to the top.
2018-09-07 11:52:57 +02:00
Rainer Gerhards
d716d659ea testbench: replace importable zcat tool by better method
seen on AIX, but also enables test on Solaris
2018-09-07 01:09:31 -05:00
48c48207f8 kafka: Fixed failing imkafka/omkafka when "debug" parameter was set.
also added some debug output when reporterr is off fo failed parameters.
2018-09-06 17:31:03 +02:00
Christian Tramnitz
73ca164715 add contrib module omhttp
closes https://github.com/rsyslog/rsyslog/issues/1797
replaces https://github.com/rsyslog/rsyslog/pull/2782
2018-09-06 10:00:47 +02:00
0d8f02b87e omkafka: When Timestamp was NULL, wrong dynamic timestamp was used.
Setting timestamp to 0 now lets kafka handle this.
Also added "RD_KAFKA_V_KEY(NULL,0) if no key is configured.

testbench: Changed kafka server configuration "log.retention.hours"
property to 5000 which avoids that the log cleaner is deleting our
records before they can be processed.
2018-09-06 09:59:45 +02:00
Rainer Gerhards
292c8ac4a7
Merge pull request #2989 from rgerhards/i2880
provide better error information if gone-away config directive is used
2018-09-05 14:40:08 +02:00
Rainer Gerhards
2324162b79
Merge pull request #2992 from rgerhards/centos69-supp
CI: add valgrind suppressions file for CentOS 6.9
2018-09-05 13:22:30 +02:00
Rainer Gerhards
a0b869b99d provide better error information if gone-away config directive is used
closes https://github.com/rsyslog/rsyslog/issues/2880
2018-09-05 11:57:34 +02:00
9d0933bccf testbench: Added new kafka tests using kafkacat for better debugging.
Fixed some issues with sndrcv kafka tests.
Generating kafka topics dynamically now it kafka tests.

Limited messagecount in some tests to 50000 for now.
2018-09-05 11:55:33 +02:00
Rainer Gerhards
4e2314f7bf
Merge pull request #2983 from jsiwrk/feature/omprog_feedback_improvements
omprog: add feedback timeout and keep-alive feature
2018-09-05 11:07:46 +02:00
Rainer Gerhards
001498d5a5 CI: add valgrind suppressions file for CentOS 6.9 2018-09-05 10:24:05 +02:00
Rainer Gerhards
a45f3af81d squash: wait until full startup so that imdiag.port exists 2018-09-05 09:21:42 +02:00
Rainer Gerhards
566788ecac * remove unnecessary calls to "wait_startup"
This is automatically called by "startup" and "startup_vg". Tests
  looked like a left-over from old testbench plumbing.
2018-09-04 10:50:57 +02:00
Rainer Gerhards
97a6730a92
testbench: use a reliable dynamic imdiag port
this also requires changes to some tooling.

Also, when assigning a dynamic port in tcpserver, the same port
number is used for IPv4 and IPv6.

Also removing some left-over debug output.

closes https://github.com/rsyslog/rsyslog/issues/2987
2018-09-04 09:09:50 +02:00
Rainer Gerhards
3aaf36a2ed
Merge pull request #2985 from rgerhards/tb16
modernize testbench plumbing
2018-09-03 22:20:56 +02:00