diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 16:28:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 16:28:20 +0000 |
commit | dcc721a95bef6f0d8e6d8775b8efe33e5aecd562 (patch) | |
tree | 66a2774cd0ee294d019efd71d2544c70f42b2842 /tests/testsuites/omprog-single-instance-bin.sh | |
parent | Initial commit. (diff) | |
download | rsyslog-dcc721a95bef6f0d8e6d8775b8efe33e5aecd562.tar.xz rsyslog-dcc721a95bef6f0d8e6d8775b8efe33e5aecd562.zip |
Adding upstream version 8.2402.0.upstream/8.2402.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/testsuites/omprog-single-instance-bin.sh')
-rwxr-xr-x | tests/testsuites/omprog-single-instance-bin.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/testsuites/omprog-single-instance-bin.sh b/tests/testsuites/omprog-single-instance-bin.sh new file mode 100755 index 0000000..bde73da --- /dev/null +++ b/tests/testsuites/omprog-single-instance-bin.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +outfile=$RSYSLOG_OUT_LOG + +# This line should appear only once in the output file for the test to pass: +echo "Starting" >> $outfile + +# Write also to stderr (useful for testing the 'output' setting) +>&2 echo "[stderr] Starting" + +echo "OK" + +read line +while [[ -n "$line" ]]; do + echo "Received $line" >> $outfile + >&2 echo "[stderr] Received $line" + echo "OK" + read line +done + +# This line should appear only once in the output file for the test to pass: +echo "Terminating" >> $outfile +>&2 echo "[stderr] Terminating" + +exit 0 |