mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-19 20:50:42 +01:00
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.
54 lines
1.2 KiB
Bash
Executable File
54 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# This file is part of the rsyslog project, released under ASL 2.0
|
|
|
|
# This test tests the feedback feature of omprog (confirmMessages=on),
|
|
# by checking that omprog re-sends to the external program the messages
|
|
# it has failed to process.
|
|
|
|
. $srcdir/diag.sh init
|
|
. $srcdir/diag.sh startup omprog-feedback.conf
|
|
. $srcdir/diag.sh wait-startup
|
|
. $srcdir/diag.sh injectmsg 0 10
|
|
. $srcdir/diag.sh wait-queueempty
|
|
. $srcdir/diag.sh shutdown-when-empty
|
|
. $srcdir/diag.sh wait-shutdown
|
|
|
|
expected_output="<= OK
|
|
=> msgnum:00000000:
|
|
<= OK
|
|
=> msgnum:00000001:
|
|
<= OK
|
|
=> msgnum:00000002:
|
|
<= OK
|
|
=> msgnum:00000003:
|
|
<= OK
|
|
=> msgnum:00000004:
|
|
<= Error: could not process log message
|
|
=> msgnum:00000004:
|
|
<= Error: could not process log message
|
|
=> msgnum:00000004:
|
|
<= OK
|
|
=> msgnum:00000005:
|
|
<= OK
|
|
=> msgnum:00000006:
|
|
<= OK
|
|
=> msgnum:00000007:
|
|
<= Error: could not process log message
|
|
=> msgnum:00000007:
|
|
<= Error: could not process log message
|
|
=> msgnum:00000007:
|
|
<= OK
|
|
=> msgnum:00000008:
|
|
<= OK
|
|
=> msgnum:00000009:
|
|
<= OK"
|
|
|
|
written_output=$(<rsyslog.out.log)
|
|
if [[ "$expected_output" != "$written_output" ]]; then
|
|
echo unexpected omprog script output:
|
|
echo "$written_output"
|
|
. $srcdir/diag.sh error-exit 1
|
|
fi
|
|
|
|
. $srcdir/diag.sh exit
|