27 Commits

Author SHA1 Message Date
Rainer Gerhards
8e4a6f4836
testbench: modernize some tests
This also makes port use more reliable.
2020-01-11 16:30:26 +01:00
Rainer Gerhards
8612bd8583
improve bash coding style and fix a some bug in testbench
- duplicate diag.sh init call was not detected due to typo
- queue-persits test did not work correctly
- some general testbench framework improvements

issues found be shellcheck, fixes brought up other work to do
2018-11-02 17:25:11 +01: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
73e8182b24
testbench: modernize shutdown_immediate command 2018-09-28 10:10:32 +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
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
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
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
Florian Riedl
e13dc61049 Test refactor part 6 2018-07-25 17:32:05 +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
b17476af8d testbench: fix only partially executed test
this is a regression from some month ago, when we changed
the shell calls. Only the first of three tests was executed.
2016-10-11 14:31:25 +02:00
df3d4a3922 test-suite: Added !#/bin/bash into all test scripts.
Most of the tests will not work in other default shells like
on Freebsd or Solaris. So we make /bin/bash default now.
2015-07-30 15:38:17 +00:00
be940cf970 testbench: made work on FreeBSD
bash "source" extension is not supported in FreeBSD default shell"
2015-07-15 09:33:31 +00:00
Rainer Gerhards
24cd5aee47 fixed race condition during queue shutdown
Problems could happen if the queue worker needed to be cancelled
and this cancellation happened inside queue-code (including
wtp, wti). We have now solved this by disabling cancellation while
in this code and only enabling it when working inside the user consumer.
This exactly matches the use case for which cancellation may be needed.
2009-10-27 10:00:23 +01:00
Rainer Gerhards
b585a4e909 addressed some race issues during queue shutdown
these occured in very unusual scenarios where we had a DA-queue running
in parallel and very lengthy actions. Then, in some situations, the
shutdown could hang. The code needs some addition lab time, but
is believed to be much better than any previous version.
2009-10-26 18:53:01 +01:00
Rainer Gerhards
da53802c96 implemented solution for cancel at shutdown/unprocessed entries
We do now enqueue those objects that are left unprocessed. This enables
us to delete the full batch, what is exactly what we need to do.
2009-10-26 12:21:07 +01:00
Rainer Gerhards
33e216daf7 Begun to work on partial batch deletes...
... but this brings a lot of problems with it. The issue is that
we still have a sequential store and we do not know how we could
delete the one entry right in the middle of processing. I keep this
branch if we intend to move on with it - but for now I look into a
different solution...
2009-10-22 14:57:34 +02:00
Rainer Gerhards
9079f66830 improved testbench
- added a test to check handling of damaged .qi files on startup
- made sure each test identifies itself on startup
2009-10-21 15:17:19 +02:00
Rainer Gerhards
d3e5a24143 bugfix (testbench): left-over from manual test removed 2009-10-21 12:38:09 +02:00
Rainer Gerhards
90e8475260 bugfix: message processing states were not set correctly in all cases
however, this had no negative effect, as the message processing state
was not evaluated when a batch was deleted, and that was the only case
where the state could be wrong.
2009-10-19 09:41:45 +02:00
Rainer Gerhards
c5408da3d8 new queue engine - initial commit (probably not 100% working!)
simplified and thus speeded up the queue engine, also fixed some
potential race conditions (in very unusual shutdown conditions)
along the way. The threading model has seriously changes, so there may
be some regressions.

NOTE: the code passed basic tests, but there is still more work
and testing to be done. This commit should be treated with care.
2009-10-14 11:01:21 +02:00
Rainer Gerhards
4d70c9b3e5 added some debug settings plus improved shutdown sequence
... non-working version!
2009-10-13 14:38:45 +02:00
Rainer Gerhards
5625dbd1b6 bugfix and testbench improvements
- bugfix: solved potential (temporary) stall of messages when the queue was
  almost empty and few new data added (caused testbench to sometimes hang!)
- fixed some race condition in testbench
- added more elaborate diagnostics to parts of the testbench
- solved a potential race inside the queue engine
2009-10-07 18:40:30 +02:00
Rainer Gerhards
13d4a23e92 some more fixes for queue engine
The enhanced testbench now runs without failures, again
2009-05-28 14:24:37 +02:00
Rainer Gerhards
d4564f8399 interim commit: working on failure cases
slightly improved situation, would like to save it before carrying on
2009-05-27 19:43:28 +02:00
Rainer Gerhards
affa217cc2 adapted testbench to new capabilities
... and now make check fails again, we have obviously found some new
bugs thanks to the additional cases
2009-05-27 12:52:28 +02:00