Also now permit interactivly running tests without explicitly setting
$srcdir. This now works if we are inside ./tests and fails, as before,
when we are in a different directory.
Detected by shellcheck via CodeFactor.io
shellcheck does not do deep inspection and so does not see that
we use the EXPECTED variable. Let's help it understand this is
valid. This doesn't really cost us something, but it helps us
enforce useful policies (in many other cases this may be a valid
error indication).
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'.
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
- 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
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
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.
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
Refactor omprog tests. Fix sync issues in these tests by
using the feedback mode (confirmMessages=on) to synchronize
the test with the external program. Closes#2403 (I hope)
Fix omprog not properly closing child process when
signalOnClose=on. Needed for the new tests. Closes#2599
Fix omprog not waiting for the child process to terminate
when signalOnClose=off. Needed for the new tests. Closes#2600
Close all fds before executing the child even when valgrind
is enabled (--enable-valgrind). Needed for the new tests.
Fix memory leak when the xxxTransactionMark parameters were
used.