10 Commits

Author SHA1 Message Date
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
4e2314f7bf
Merge pull request #2983 from jsiwrk/feature/omprog_feedback_improvements
omprog: add feedback timeout and keep-alive feature
2018-09-05 11:07:46 +02:00
Rainer Gerhards
a45f3af81d squash: wait until full startup so that imdiag.port exists 2018-09-05 09:21:42 +02:00
Joan Sala
c196e8f054 omprog: add feedback timeout and keep-alive feature
Restart the program if it does not respond within timeout.
New setting 'confirmTimeout' (default 10 seconds).

Allow the program to provide keep-alive feedback when a
message requires long-running processing.

Improve efficiency when reading feedback line (use buffer).

Retry interrupted writes/reads to/from pipe.

New setting 'reportFailures' for reporting error messages
from the program.

Report child termination when writing to pipe.

Minor refactor: renamed writePipe function to sendMessage,
renamed readPipe to readStatus.
2018-09-03 22:05:30 +02:00
Rainer Gerhards
b5a385a13d testbench: modernize plumbing
another set of changes for testbench modernization
2018-09-02 17:29:39 +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
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
Florian Riedl
aa0b3e4657 Test refactor part 2 2018-07-24 13:05:02 +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
Joan Sala
1089bd4146 omprog: refactor tests, fix child closing issues
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.
2018-04-14 23:41:03 +02:00