267 Commits

Author SHA1 Message Date
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
Rainer Gerhards
f81502b96f imptcp: add support for regex-based framing
for complex multi-line messages (XML in particular), the multiLine method
does not work. We now have a capability to specify via a regex when a frame
starts (and the previous thus ends).

adds imptcp input parameter "framing.delimiter.regex"
2018-06-22 19:09:45 +02:00
Rainer Gerhards
978cca35a7
Merge pull request #2405 from rgerhards/testbench-improve
some testbench improvements
2018-06-22 11:18:35 +02:00
Rainer Gerhards
9cf9f2e8b7 testbench: change elasticsearch tests to use new plumbing
This makes the ES tests more universally available (they should now
also support running in containers). It also simplifies the tests
as fewer support files are needed.
2018-06-18 17:12:08 +02:00
Rainer Gerhards
8d49eb61d4 testbench: run test that require IPv6 stack only when available
First test was introduced in openssl work; failed when no IPv6 was
present.  Now it skips.
2018-06-18 09:34:03 +02:00
Rich Megginson
6d4635efbb omelasticsearch: write op types; bulk rejection retries
Add support for a 'create' write operation type in addition to
the default 'index'.  Using create allows specifying a unique id
for each record, and allows duplicate document detection.

Add support for checking each record returned in a bulk index
request response.  Allow specifying a ruleset to send each failed
record to.  Add a local variable `omes` which contains the
information in the error response, so that users can control how
to handle responses e.g. retry, or send to an error file.

Add support for response stats - count successes, duplicates, and
different types of failures.

Add testing for bulk index rejections.
2018-06-13 09:48:23 -06:00
Rainer Gerhards
5f3885d115 testbench: add imrelp test for invalid config
both certificate and it's private key must be configured - check that
this is detected

see also https://github.com/rsyslog/rsyslog/issues/2747
2018-06-05 13:17:42 +02:00
Rainer Gerhards
7f1d33e090 testbench: improve queue timeout detection
and also fix that it was accidentely not activated in testbench runs
2018-05-10 17:19:54 +02:00
Rainer Gerhards
a3d4895b78 debug support: add capability to print testbench-specific timeout reports
done by setting RSYSLOG_DEBUG_TIMEOUTS_TO_STDERR to "on"

this is by default activated inside the testbench
2018-05-09 17:15:34 +02:00
Rainer Gerhards
ab1bd8c01b imfile: large refactoring of complete module
This commit greatly refactors imfile internal workings. It changes the
handling of inotify, FEN, and polling modes. Mostly unchanged is the
processing of the way a file is read and state files are kept.

This is about a 50% rewrite of the module.

Polling, inotify, and FEN modes now use greatly unified code. Some
differences still exists and may be changed with further commits. The
internal handling of wildcards and file detection has been completely
re-written from scratch. For example, previously when multi-level
wildcards were used these were not reliably detected. The code also
now provides much of the same functionality in all modes, most importantly
wildcards are now also supported in polling mode.

The refactoring sets ground for further enhancements and smaller
refactorings. This commit provides the same feature set that imfile
had previously and all existing CI tests pass, as do some newly
created tests.

Some specific changes:
- bugfix: module parameter "sortfiles" ignored
  This parameter only works in Solaris FEN mode, but is otherwise
  ignored.  Most importantly it is ignored under Linux.
  fixes https://github.com/rsyslog/rsyslog/issues/2528
- bugfix: imfile did not pick up all files when not present
  at startup
  fixes https://github.com/rsyslog/rsyslog/issues/2241
  fixes https://github.com/rsyslog/rsyslog/issues/2230
  fixes https://github.com/rsyslog/rsyslog/issues/2354
- bugfix: directories only support "*" wildcard, no others
  fixes https://github.com/rsyslog/rsyslog/issues/2303
- bugfix: parameter "sortfiles" did only work in FEN mode
  fixes https://github.com/rsyslog/rsyslog/issues/2528
- provides the ability to dynamically add and remove files via
  multi-level wildcards
  see also https://github.com/rsyslog/rsyslog/issues/1280
- the state file name currently has been changed to inode number
  This will further be worked on in upcoming PRs
  see also https://github.com/rsyslog/rsyslog/issues/2231
- some enhancements were also done to CI tests, most importantly
  they were made more compatibile with BSD

Note that most of the mentioned bug fixes cannot be applied to older
versions, as they fix design issues which are solved by the refactoring.
Thus there are not separate commits for them.

Distro maintainers: you need to decide to apply this patch as whole
or not. Believe me, it is not worth the effort to try to extract
specific patches from this commit. There is a good reason we do
not have multiple commits.

closes https://github.com/rsyslog/rsyslog/issues/2359
2018-03-22 08:25:47 +01:00
Rainer Gerhards
3c32c844b6 testbench: improve cleanup
some tests use rsyslog.out.* file names, which were so far not cleaned up.
This can lead to all sorts of problems, including failure of
"make distcheck" due to leftover files. We now delete all of these files
on cleanup. This should not have any undesired side-effects.

Thanks to Kasumi Hanazuki for spotting this problem.

see also https://github.com/rsyslog/rsyslog/pull/2527
2018-03-18 13:05:24 +01:00
Rainer Gerhards
93bebb1f1f template: add option to generate json "container"
This enables easy JSON generation via template.

This commit also corrects an issue with the constant "jsonf"
format. That was recently added, and the implementation problem
only became visible when used inside a larger json object. No
officially released code is affected, thought - so it rellay
is just a side-note.

closes https://github.com/rsyslog/rsyslog/issues/2347
2018-02-16 08:22:49 +01:00
Rainer Gerhards
d01ea7e2eb core: set TZ on startup if not already set
In theory, TZ should be set by the OS. Unfortuantely, this seems
to be not the case any longer on many Linux distros. We now check
it and set it appropriate if not already given.

closes https://github.com/rsyslog/rsyslog/issues/2054
2018-01-19 10:29:56 +01:00
Rainer Gerhards
bcdce73362
Merge pull request #2402 from rgerhards/i2396-teste
improve testbench plumbing, new test
2018-01-18 10:54:43 +01:00
Rainer Gerhards
58fcfc4909 testbench: work-around racy tests
some omprog tests are racy as they depend on sleep calls to "synchoronize".
We have mostly been able to change this to more reliable synchronization.
A small window of raciness remains for some tests, but this seem to be
inevitable. Tests on fully loaded systems seem to incidate that we have
solved the issue sufficiently.

If that doesn't solve the sporadic failures, we need to further think about
how to handle this.

see also https://github.com/rsyslog/rsyslog/issues/2403
2018-01-17 15:53:49 +01:00
Rainer Gerhards
76ef7a58b2 testbench: ensure we have the necessary commands to execute test
this might have caused sporadic failures on platform where "lsof" was
missing.

see also https://github.com/rsyslog/rsyslog/issues/2403
2018-01-17 13:30:46 +01:00
Rainer Gerhards
3e058ba9ea testbench: fix/upgrade diag.sh framework
fixed some obvious copy&paste error, removed invalid verboseness and
added a standard way of doing grep checks on test result
2018-01-17 11:44:52 +01:00
af09d33b49 imfile: Partially fixed issues not detecting files in directory when wildcards are used.
When directories and files are created at the same time,
imfile may missed subdirs or file if the machine is on high load.

The handling has been enhanced to scan newly created directories ALWAYS for
matching files.

This should fix following issues:
closes https://github.com/rsyslog/rsyslog/issues/2271

However we still have a problem when a multilevel directory configurations.
Details are discussed here https://github.com/rsyslog/rsyslog/issues/2354
2018-01-05 12:59:19 +01:00
Rainer Gerhards
31cc4355bd testbench: check if external URLs can be accessed, skip if not
They may not be accessible because they (or parts of the
network) can be down or access is not permitted. In this
case, the affected tests skip themselves.

Special thanks to Thomas D. (Whissi) for providing the check
function.

closes https://github.com/rsyslog/rsyslog/issues/2339
2018-01-03 17:25:12 +01:00
Rainer Gerhards
b83647fc97 testbench: try to provide minimal locaction info on aborts
While we try to keep the testbench output brief, we try to do a single
stacktrace if we find a core file.
2017-12-31 18:31:02 +01:00
Rainer Gerhards
02761dd0d8 testbench: clean up "normal" error message in kafka test plumbing
The error message regularly occurs if no kafka/zk instance is running,
which should be the case at start of test. However, the message
tends to make think reviewers that it is a real error. So we now
hide it.
2017-12-30 10:58:14 +01:00
Rainer Gerhards
ac209cd471 testbench: update and activate mmexternal test for invalid program
closes https://github.com/rsyslog/rsyslog/issues/1976
2017-12-20 15:58:25 +01:00
Rainer Gerhards
f23a1d3959 testbench: reduce startup timeout for tests
previous timeout caused very long runtime in cases where rsyslog
segfaulted on startup, which made the testbench failure harder to
diagnose than necessary.
2017-12-12 11:39:54 +01:00
7508010750 Basic Imfile FEN API support for Solaris (#2141)
imfile: Initial implementation of solaris FEN API (without wildcards)

FEN API is used to implement simular event based file
monitoring like with inotify.

This commit provides partial functionality. It supports event-driven
processing of files but does not yet provide wildcard functionality.
Wildscards will be provided by a later commit.

This can be committed as-is because the previous code did also
not provide wildcard support, so this is an improvement for
Solaris in any case.

see also https://github.com/rsyslog/rsyslog/issues/1954
2017-12-01 12:49:38 +01:00
Rainer Gerhards
dfe89f29e0
Merge pull request #2071 from rgerhards/es-testbench-additions
testbench: improvements in elasticsearch testing
2017-11-24 10:43:15 +01:00