379 Commits

Author SHA1 Message Date
Rainer Gerhards
c621349b40
Merge pull request #3155 from rgerhards/i3117
queue bugfix: invalid error message on queue startup
2018-10-23 12:13:14 +02:00
Rainer Gerhards
9e002422b1
testbench: reproduce imkafka hang on unavailable kafaka server
This also includes some improvements to the testbench plumbing
(new options etc).

see also https://github.com/rsyslog/rsyslog/issues/3154
2018-10-23 10:50:58 +02:00
Rainer Gerhards
7d2a3b9e5d
cleanup and small testbench plumbing improvement 2018-10-22 18:01:44 +02:00
Rainer Gerhards
65deedbc1c
testbench: do no longer output netstat on failed test
it looks like we have solved the issue that we wanted to debug
with this - still leave it commented out if problems resurface
2018-10-22 09:11:15 +02:00
Rainer Gerhards
55269d482e
Merge pull request #3146 from rgerhards/i3144
testbench: do test error reporting only if requested
2018-10-19 17:54:30 +02:00
Rainer Gerhards
ca1af1b459
cleanup: shellcheck-found minor issues 2018-10-19 12:55:59 +02:00
Rainer Gerhards
fef823c4b7
testbench: do test error reporting only if requested
the newly introduced test status reporting now always tries to connect
to our stats server. This can be considered a privacy invasion and
also can wreck our stats. so make this optional and only happen when
an explicit URL is given. This can than be set in our CI environment.

request by setting stats reporting url env var RSYSLOG_STATSURL

closes https://github.com/rsyslog/rsyslog/issues/3144
2018-10-19 11:41:05 +02:00
b503b6c6b2 testbench: Added stats counter call for failed tests 2018-10-12 15:11:58 +02:00
Rainer Gerhards
41ee00e569 bugfix core: potential hang on rsyslog termination
The root cause was a deadlock during worker startup. This could
happen for example when a DA queue needed to persist data during
shutdown.

Fail condition:
* startup request for a new worker
* initialization of that worker
* immediate detection that the worker can or must shutdown
* main thread waiting for worker running state, which it skips,
  and so the main thread hangs inside a loop

closes https://github.com/rsyslog/rsyslog/issues/3094
2018-10-10 16:51:24 +00:00
bae734abdd testbench: Changed kafka server to kafka_2.11-2.0.0.tgz
Also adjusted some kafka server settings related to log retention.
Hardened stop function for kafka and zookeeper.
See also https://github.com/rsyslog/rsyslog/issues/3057
2018-10-01 17:06:47 +02:00
Rainer Gerhards
2e05168275
Merge pull request #3096 from rgerhards/tb-diag-backticks
cleanup: replace legacy bash backticks by current $() syntax
2018-10-01 09:31:33 +02:00
Rainer Gerhards
dabc8628b4
Merge pull request #3089 from rgerhards/tb-timeout
testbench: improve shutdown timeout diagnostics
2018-10-01 08:19:21 +02:00
Rainer Gerhards
70f85d2fed
cleanup: replace legacy bash backticks by current $() syntax
no functional changes
2018-09-30 19:17:27 +02:00
Rainer Gerhards
f4883fb2d9
testbench: improve shutdown timeout diagnostics 2018-09-30 19:04:38 +02:00
Rainer Gerhards
95a2d4043c
Merge pull request #3090 from rgerhards/tb-kafka-broker
testbench: detect kafka broker failure and skip test if so
2018-09-30 11:30:53 +02:00
Rainer Gerhards
650ec84c56
testbench: detect kafka broker failure and skip test if so
Nothing in our code has to do with the failure...

see also https://github.com/rsyslog/rsyslog/issues/3088
2018-09-30 08:55:15 +02:00
Rainer Gerhards
17ca039b44
clenup: useless use of cat (cosmetic) 2018-09-28 21:17:52 +02:00
Rainer Gerhards
8cbeb6305c
testbench: add test for encrypted disk queue
see also https://github.com/rsyslog/rsyslog/issues/3066
2018-09-28 11:24:04 +02:00
Rainer Gerhards
73e8182b24
testbench: modernize shutdown_immediate command 2018-09-28 10:10:32 +02:00
Rainer Gerhards
cffc60b416
testbench: remove useless "cat" command (cosmetic) 2018-09-27 12:06:20 +02:00
Rainer Gerhards
5e11cecb3b
testbench: restart kafka if brokers do not come up
kafka tests are plagued by brokers failing to start, which then causes
(false positive) test failures.

We now to detect missing brokers, and do a kafka/zookeepr shutdown and
restart in this case. If that fails again, let's skip the test instead
of failing it - after all, it's not the issue of the to-be-checked code.

see also https://github.com/rsyslog/rsyslog/issues/3057
2018-09-26 08:41:41 +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
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
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
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
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
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
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
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
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
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
a45f3af81d squash: wait until full startup so that imdiag.port exists 2018-09-05 09:21:42 +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
7d943b0faa
testbench: modernize plumbing
* unify content-cmp with cmp_exact
* remove no longer needed content-check commands
* change to bash functions
  - custom-content-check
  - check-command-available
2018-09-03 16:27:00 +02:00
Rainer Gerhards
27cc298a3d squash: content-check 2018-09-03 10:05:18 +02:00
Rainer Gerhards
d051a9bdb6 squash: more changes 2018-09-02 17:46:16 +02:00
Rainer Gerhards
b5a385a13d testbench: modernize plumbing
another set of changes for testbench modernization
2018-09-02 17:29:39 +02:00
Rainer Gerhards
1dd0b9c20d
testbench: avoid "readlink" which is not available on AIX
The testbench framework uses it, but as it looks for no good reason.
2018-09-02 14:12:20 +02:00
Rainer Gerhards
77399659f6
Merge branch 'feature/omprog_child_output' of https://github.com/jsiwrk/rsyslog into merge 2018-09-02 13:54:43 +02:00
Rainer Gerhards
609f25ffae
Merge pull request #2978 from rgerhards/tb12
testbench: streamline plumbing
2018-09-02 12:49:56 +02:00
Rainer Gerhards
8ff395ccd6
Merge pull request #2968 from rgerhards/tb10
testbench: short test id and make more reliable
2018-09-02 12:31:27 +02:00
Rainer Gerhards
b9dd4beda2
testbench: make mmkubernetes tests use an "official" testbenach API
to wait for process startup, the rsyslog startup calles were (ab)used. This
caused issues whenever they were updated to new rsyslog needs. Now a dedicated
"API" for process startup has been added and the tests been modified to use it.
2018-09-02 10:58:12 +02:00
Joan Sala
4a54c23dc0 omprog: improve child process output capture/redirection
Capture program output using a pipe shared with all child processes,
and write to the file using a dedicated thread. Ensures lines emitted
by the child processes will not be intermingled in the output file if
the lines are less than PIPE_BUF chars long and are written in line-
buffered mode.

Reopen output file on HUP, to support external rotation of the file.

New setting 'fileCreateMode' as in omfile.

With these improvements the 'output' setting should now be usable for
production (it was originally intended only for debugging).

Redirect stdout/stderr of child process to /dev/null when not captured.
Closes #2787

Minor: simplify some test code: 'wait-startup' not needed after
'startup', 'wait-queueempty' not needed before 'shutdown_when_empty'.
2018-09-02 10:35:59 +02:00