1715 Commits

Author SHA1 Message Date
Joan Sala
c196e8f054 omprog: add feedback timeout and keep-alive feature
Restart the program if it does not respond within timeout.
New setting 'confirmTimeout' (default 10 seconds).

Allow the program to provide keep-alive feedback when a
message requires long-running processing.

Improve efficiency when reading feedback line (use buffer).

Retry interrupted writes/reads to/from pipe.

New setting 'reportFailures' for reporting error messages
from the program.

Report child termination when writing to pipe.

Minor refactor: renamed writePipe function to sendMessage,
renamed readPipe to readStatus.
2018-09-03 22:05:30 +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
de906074d3
Merge pull request #2984 from jsiwrk/bugfix/omprog_parallel_test
testbench: minor fix on some omprog tests for parallel execution
2018-09-03 14:47:14 +02:00
Rainer Gerhards
27cc298a3d squash: content-check 2018-09-03 10:05:18 +02:00
Joan Sala
697f2032c7 testbench: minor fix on some omprog tests for parallel execution 2018-09-02 23:03:29 +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
Rainer Gerhards
fef0ece328
testbench: fix slightly incorrect tests
they use test framework incorrectly, and thus leave files during
"make distcheck"
2018-09-02 10:01:43 +02:00
Rainer Gerhards
20696a754b
testbench: streamline plumbing
no functional changes, but modernization and cleanup
2018-09-01 13:18:50 +02:00
Rainer Gerhards
2b28661246 testbench: short test id and make more reliable
The RSYSLOG_DYNNAME used to make test file unique was very long,
which potentially causes issues with some test scenarios.
see also: https://github.com/rsyslog/rsyslog/pull/2945#issuecomment-417078768

Also, the dynamic port determination method we currently use
is not 100% reliable. That port number was used inside the DYNNAME
and thus was not necessarily unique. This has now changed to the
current time in microseconds plus a hash of the test file name. This
should be sufficiently unique. If still not, we can now simply
extend the test_id program (e.g. read /dev/urandom).
2018-09-01 12:32:33 +02:00
Rainer Gerhards
5d144c0e62 testbench: make plumbing work on AIX
also fix issue with mmanon - tests were executed even if module
was not enabled
2018-08-31 09:06:46 -05:00
Rainer Gerhards
11273d8738 testbench: fix portability issues under AIX 2018-08-31 09:06:46 -05:00
Rainer Gerhards
3741bee656 tcpflood: fix segfauls on some platforms (e.g. AIX)
The default stack size on some platforms is insufficient, so we
need to explicitely set it.
2018-08-31 04:48:00 -05:00
Rainer Gerhards
cb0956071c
testbench: disable journal tests by default
They have very special requirements, so it does not make sense to have
them run by default. Also note that as of now, they have a pretty high
rate of false positives due to bugs in the journal.

see also https://github.com/rsyslog/rsyslog/issues/2931#issuecomment-416914707
2018-08-29 13:17:26 +02:00
Rainer Gerhards
a43a03f17e
testbench: make more test file names dynamic
This is required to support parallel test runs.

Among others, make thise files dynamic:
* test-spool
* rsyslog.input
* rsyslog.out*.log
* tmp.in

Also:
* convert presort test statement to function
* cleanup imfile truncation test
* cleanup imfile-growing-file-id test
  some cruft was left due to copy and paste error
* serialize mysql tests
2018-08-29 10:46:32 +02:00
Rainer Gerhards
bb2ba21ea5
Merge pull request #2958 from PascalWithopf/test_id
testbench: add program to get system time
2018-08-28 12:08:14 +02:00
PascalWithopf
1d0b30376d testbench: add program to get system time
The new program test_id puts out the system time
up to microseconds.
2018-08-28 09:16:20 +02:00
PascalWithopf
7c141425dc uxsockrcvr: add timeout
The program times out after some time.
Default is 60 seconds and can be changed with the parameter -t.

closes https://github.com/rsyslog/rsyslog/issues/2905
2018-08-27 15:16:58 +02:00
Rainer Gerhards
d2494182b5
Merge pull request #2940 from alorbach/master-kafka-testsfix
testbench: use new kafka/zookeeper versions, fixed/added tests.
2018-08-26 19:23:01 +02:00
Rainer Gerhards
70ea76962b
omfile: implement file-id, used in state file
This ensures that files with the same inodes are not accidently treated
as equal, at least within the limits of the file id hash (see doc for
details).

We use the siphash reference implementation to generate our non-cryptographic
hash.

closes https://github.com/rsyslog/rsyslog/issues/2530
closes https://github.com/rsyslog/rsyslog/issues/2231
2018-08-26 14:01:51 +02:00
Rainer Gerhards
4adfefe090
testbench: another step towards parallel testing
Merging in multiple steps to avoid getting new tests with non-correct
plumbing.

- some more dynamic file names
- convert more commands to pure bash functions
- cleanup no longer neede files
2018-08-22 14:56:07 +02:00
95ed2c573b testbench: Switched to newer kafka/zookeeper versions.
Fixed test configurations (socket timeouts with newer kafka).
Reactivated some kafka tests that work now.

omkafka: Fixed "closeTimeout" setting in action shutdown
2018-08-21 15:00:44 +02:00
Rainer Gerhards
130b30c29b
Merge pull request #2944 from rgerhards/tb-makerules
testbench: force sequence of execution for some tests
2018-08-20 16:52:16 +02:00
Rainer Gerhards
1eb5f12f4a
testbench: force sequence of execution for some tests (plus some nits)
also some smaller changes
- some cleanup in testbench tooling
- testbench: better diagnostics in journal test
  prototype change, may be propagated to other tests if it really turns
  out to be useful - but only the next time will show if it is...
- make imjournal-basic-vg.sh SKIP in successful run (but when fully done)
  This is an aid to address failures in imjournal-basic.sh, which
  experiences an odd bug that we suspect to be rooted inside the journal.
  see also https://github.com/rsyslog/rsyslog/issues/2931#issuecomment-414269118
2018-08-20 14:05:28 +02:00
Rainer Gerhards
9664f2b059
Merge pull request #2943 from rgerhards/omprog-environ
omprog: remove "hideEnvironment" parameter as this is a bugfix
2018-08-19 12:21:43 +02:00
Rainer Gerhards
7f1f11c5a2
omprog: remove "hideEnvironment" parameter as this is a bugfix
discussion confirmed that not passing environment to called program
should be considered a bug and consequently no parameter to control
this behaviour is needed. I just added that parameter to be able
to carry on with testbench work, and this commit removes it. The
param was never part of any official relase.

closes https://github.com/rsyslog/rsyslog/issues/2921
2018-08-19 08:41:12 +02:00
Rainer Gerhards
5a7d6009c7
testbench: some minor improvements
- DEAD_PORT now uses unassigned IANA port unlike to be used on the system
  (dynamic port querying is racy and we had at least once an issue, so we
  can remove ambiguity here easily)
- replace some diag.sh commands by bash functions
2018-08-19 08:35:19 +02:00
Rainer Gerhards
1ed6859dfd
testbench: replace hardcoded ports and improve cleanup handling
Support tools (like tcpflood) are also upgraded to support the
necessary dynamic port.s

This is part of the effort to make parallel testing possible.

We move parts of the cleanup to the buildbot cleanup, as we cannot
clean out instances on each test when we run parallel tests.
2018-08-18 20:28:31 +02:00
Rainer Gerhards
a5b9fbc026
testbench: remove no longer needed .conf files
they have been replaced by the new config system
2018-08-17 12:05:43 +02:00
Rainer Gerhards
55daa206f7
testbench: make "started" file name dymamically (#2936)
* testbench: make "started" file name dymamic

required for parallel test execution
2018-08-16 20:14:18 +02:00
friedl
493ed7af8f Test Refactor part 9 - DONOTMERGE (#2928)
* Testbench refactoring part 9
2018-08-15 17:20:11 +02:00
Rainer Gerhards
22bdacd70f
Merge pull request #2926 from rgerhards/tb-parallel3
testbench: support dynamic pidfile naming
2018-08-15 11:57:50 +02:00
Rainer Gerhards
223e5e9ced testbench: support dynamic pidfile naming
required for parallel test execution

This also fixes some previously not seen issues with HOSTNAME
file generation inside the test framework.
2018-08-15 08:28:11 +02:00
Rainer Gerhards
6ac5c95dbb
Merge pull request #2906 from richm/omelasticsearch-retry-add-metadata
write all header metadata to omes for retries
2018-08-13 15:33:03 +02:00
Rainer Gerhards
dbe61eb06b
testbench: make some test files dynamic
This is work torward the ability to run the testbench in parallel.
Some small issues in tests have also been detected, which were not
previously seen. They have been fixed. We did not do separate
commits for this as it would clutter the commit log with not
really relevant info.

Also move some cleanup to "make clean" target

To support parallel testbench runs, we need to have dynamic work files.
So deleting work files on each test does not work, especially as we can
no longer assume they are "left-overs" from a failed test - they may
actually (and quite likely) belong to tests that run in parallel.

So the proper solution is to do via "make clean".

closes https://github.com/rsyslog/rsyslog/pull/2916
2018-08-13 15:04:47 +02:00
Florian Riedl
2d22742f32 Test refactoring part 8 2018-08-13 12:58:30 +02:00
Rich Megginson
eb11580336 write all header metadata to omes for retries
Write all of the original request metadata fields to $.omes for
the retry, if present. This may include all of the following:
_index, _type, _id, _parent, pipeline
This is in addition to the fields from the response. If the same
field name exists in the request metadata and the response, the
field from the request will be used, in order to facilitate
retrying the exact same request.
Have to set a tag with `MsgSetTAG` to avoid a UBSAN error.
2018-08-06 14:20:10 -06:00
Rainer Gerhards
fc6edc1fb4
testbench: uxsockrcvr cleanup did try to kill "grep" process
this was harmless, but generated irritating messages in test log
2018-08-03 14:42:04 +02:00
Rainer Gerhards
2cdc12bebc
Merge pull request #2903 from rgerhards/ci-known-issue
testbench: suppress known issue
2018-08-03 13:37:36 +02:00
Rainer Gerhards
3f9c1a423a
Merge pull request #2749 from jvymazal/wildcard_symlink
Symlink support for imfile
2018-08-03 13:32:25 +02:00
Rainer Gerhards
69381fad65
testbench: suppress known issue
see also https://github.com/rsyslog/rsyslog/issues/2902
2018-08-03 12:04:59 +02:00
Jiri Vymazal
3822da837e Symlink support for imfile
this introduces symlink detection and following as well
as monitoring changes on them. Also added test for the new
functionality and ensuring the original symlink behavior
stays as well.
2018-08-03 11:35:28 +02:00
PascalWithopf
866336d997 activate codestyle for all files ending with .c/.h
Last changes to the codestyle and activation of
the codestyle checker.
2018-08-03 09:32:07 +02:00
Rainer Gerhards
e0479e8468
Merge pull request #2901 from rgerhards/codestyle-fix
codestyle fix - rough way
2018-08-03 08:13:39 +02:00