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
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.
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'.
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).
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
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
Fixed test configurations (socket timeouts with newer kafka).
Reactivated some kafka tests that work now.
omkafka: Fixed "closeTimeout" setting in action shutdown
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
- 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
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.
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
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.
by default, we now use 10s timeout for terminating inputs. On some
slow machines (CI under heavy load) the system default is not sufficient,
what can lead to memory leaks and thus valgrind failures.
In theory, this should work without the sleep, but in practice
this triggers some issues I could not yet diagnost. Reducing,
however, seems possible. This will lead to notable speedup of
testbench runs.
changes some of the test commands to use bash functions
includes some small bug fixes to tests where bugs were
previously not seen due to different plumbing.
This does not work reliably if multiple instances of rsyslog
builds run on a single machine. We need to improve, but this
commit makes conflict less likely and provides some diagnostic
info to help guide us towards a final solution.
Also a couple of changes to testbench worth mentioning:
* use cp -f to ensure files can be overwirtten in VBUILD
* fix issue of missing include test file in EXTRA_DIST
* new supressions
* testbench: try to use local system dependency cache
avoid going to Internet repos if not absolutely necessary. For
development containers, they should be pre-populated with the
important dependencies.
* do not enable libfaketime if ASAN is selected
unfortunately, libfaketime does not work in that case
see also https://github.com/rsyslog/rsyslog/issues/174
Some old tests are carried out via the nettester tool. This was
our initial shot at a testbench a couple of years ago. While it
worked back then, the testbench framework has been much enhanced.
These old tests are nowadays very hard to handle, as they miss
debug support etc. So it is time to refactor them to new style.
As a side-activity, the testbench plumbing has been enhanced to
support some operations commonly needed by these tests. Contrary
to pre-existing plumbing, these new operations are now crafted
using bash functions, which we consider superior to the current
method. So this is also the start of converting the older-style
functionality into bash functions. We just did this now because
it was required and we entangled it into the test refactoring
because it was really needed. Else we had to write old-style
operations and convert them in another commit, which would
have been a waste of time.
Special thanks to Pascal Withopf for the initial step of taking
old tests and putting config as well as test data together into
the refactored tests, on which Rainer Gerhards than could build
to create the new tests and update testbench plumbing.