291 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Rainer Gerhards
e53fae6224
Merge pull request #2904 from rgerhards/uxsocksrvr-cleanup
testbench: cleanup hanging uxsocksrvr instances
2018-08-02 20:52:27 +02:00
Rainer Gerhards
616c45a733
testbench: cleanup hanging uxsocksrvr instances
We still see hanging instances, so we for now resort to kill them.
The uxsockrcvr tool itself should timeout after a while.
2018-08-02 17:22:17 +02:00
Rainer Gerhards
d8b6dc52af
testbench: more modernization of testbench plumbing 2018-08-02 14:47:19 +02:00
Rainer Gerhards
8ea166d89d
testbench: fix some hardcoded names (#2895)
* testbench: fix some hardcoded names

This is prework to make parallel execution of tests possible.
2018-08-01 12:52:17 +02:00
Rainer Gerhards
6bb5bc91f5
testbench: prototype of sndrcv test in modern style 2018-07-31 15:26:46 +02:00
Rainer Gerhards
aecb19bb5a
Merge pull request #2891 from rgerhards/imdiag-dynamic-port
testbench: make port for imdiag dynamic
2018-07-31 10:17:28 +02:00
Rainer Gerhards
861751b24e
testbench: make port for imdiag dynamic 2018-07-30 19:34:25 +02:00
Rainer Gerhards
5a37ea4f1a testbench: cleanup no-longer needed "nettester" command 2018-07-30 15:20:59 +02:00
Rainer Gerhards
b572423733 testbench: fix some races on test termination
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.
2018-07-27 09:09:38 +02:00
Rainer Gerhards
79754aa13b testbench: reduce sleep during shutdown processing
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.
2018-07-27 09:09:38 +02:00
Rainer Gerhards
2ba3c8ddde
testbench: modernize testbench plumbing
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.
2018-07-23 17:26:34 +02:00
Rainer Gerhards
ef901048dd
testbench: do not hang on mmkubernetes tests
also provide some more info on startup error
2018-07-22 13:27:23 +02:00
Rainer Gerhards
c8fe700d05
testbench: do not unnecessarily persist test data to disk 2018-07-20 08:55:03 +02:00
Rainer Gerhards
b76e48711f
testbench: increase ElasticSearch start timeout
On slow machines (ARM in CI env e.g.) the previous timeout was insufficient.
2018-07-17 21:17:58 +02:00
Rainer Gerhards
aadbc32009
testbench: relax hanging instance detection
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.
2018-07-13 08:18:49 +02:00
Rainer Gerhards
e27b59634c enable better testing via "make distcheck"
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
2018-07-11 15:01:55 +02:00
Rainer Gerhards
abce4630d5
testbench: refactor tests which used "nettester" tool
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.
2018-07-05 15:59:59 +02:00