23 Commits

Author SHA1 Message Date
Rainer Gerhards
e0b8634010
testbench fix: python 3 incompatibility 2020-09-03 12:58:57 +02:00
Rainer Gerhards
63145387cb
testbench: modernize and make more robust
This also modernizes the testbench framework
2020-01-23 18:52:48 +01:00
Rainer Gerhards
3860122f41
testbench: improve speed of elasticsearch tests
we avoid unnecessary ElasticSearch restarts now. This also helps with flakes
on slow CI machines.
2020-01-01 12:23:50 +01:00
Rainer Gerhards
ff4b3558cf
testbench: obtain python binary path via AM_PATH_PYTHON
see also https://github.com/rsyslog/rsyslog/issues/3853
2019-11-22 14:45:10 +01:00
Rich Megginson
37edda0a8d omelasticsearch - retry: set rawmsg to data from original request
https://github.com/rsyslog/rsyslog/issues/3573
Previously, when constructing the message to submit for a retry
for an original request, if the original request did not contain
the field `message`, the system property `rawmsg` was set to
the entire metadata + data from the original request.  This was
causing problems with Elasticsearch.  This patch changes
the code so that the `rawmsg` will be set to only the data part
of the original request if there is no `message` field.
2019-03-29 15:17:38 -06:00
Rainer Gerhards
04f792de8d
testbench: wait function needs to support slow machines 2018-11-12 13:34:02 +01:00
Rainer Gerhards
cd290bdca2
testbench: make es-bulk-retry test more reliable
We now no longer depend on a fixed 'sleep' command but rather
check the output file for what we expect. This is much more
robust on slow test machines.

We believe this closes the below-mentioned issue. If not, it
should be re-opened.

closes https://github.com/rsyslog/rsyslog/issues/3104
2018-11-08 17:47:01 +01:00
Rainer Gerhards
68d203e88b
improvements to elasticsearch tests and framework (#3264)
* testbench: re-structure elasticsearch framework
2018-11-08 15:05:08 +01:00
Rainer Gerhards
f409daa911
testbench: modernize elasticsearch tests 2018-11-08 09:59:23 +01:00
Rich Megginson
718ae1d02c try to debug es-bulk-retry failures
Fix es-bulk-retry.sh script and add additional information
when the test fails.
https://github.com/rsyslog/rsyslog/issues/3104
2018-11-06 09:28:51 -07:00
Rainer Gerhards
c345b6b28b
testbench: try to stabilize es-bulk-retry test
also change test to emit error-message more CI-user friendly (bottom of log);
update a bit up to testbench standards
2018-10-24 09:21:23 +02:00
Rainer Gerhards
69ef6e329b fix bad bash coding style and disable shellcheck false positives
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
2018-10-23 13:27:37 +02:00
Rainer Gerhards
67bdd0d51b cosmetic: remove useless use of cat 2018-10-11 13:32:14 +02:00
Rainer Gerhards
0eae11430b
cosmetic: replace useless use of cat 2018-10-01 14:54:02 +02:00
Rainer Gerhards
a45f3af81d squash: wait until full startup so that imdiag.port exists 2018-09-05 09:21:42 +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
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
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
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
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
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
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
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