From dcc721a95bef6f0d8e6d8775b8efe33e5aecd562 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 18:28:20 +0200 Subject: Adding upstream version 8.2402.0. Signed-off-by: Daniel Baumann --- tests/testsuites/omprog-feedback-timeout-bin.sh | 49 +++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 tests/testsuites/omprog-feedback-timeout-bin.sh (limited to 'tests/testsuites/omprog-feedback-timeout-bin.sh') diff --git a/tests/testsuites/omprog-feedback-timeout-bin.sh b/tests/testsuites/omprog-feedback-timeout-bin.sh new file mode 100755 index 0000000..fa1565c --- /dev/null +++ b/tests/testsuites/omprog-feedback-timeout-bin.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +outfile=$RSYSLOG_OUT_LOG + +echo "Starting" >> $outfile +echo "<= OK" >> $outfile +echo "OK" + +just_started=true + +read line +while [[ -n "$line" ]]; do + message=${line//$'\n'} + echo "=> $message" >> $outfile + + if [[ $message == *02* ]]; then + # Test partial reads from pipe + echo "<= OK" >> $outfile + printf 'O' + printf 'K' + printf '\n' + elif [[ $message == *04* ]]; then + if [[ $just_started == false ]]; then + # Force a restart due to 'confirmTimeout' (2 seconds) exceeded + echo "<= (timeout)" >> $outfile + ./msleep 10000 + else + # When the message is retried (just after restart), confirm it correctly + echo "<= OK" >> $outfile + echo "OK" + fi + elif [[ $message == *07* ]]; then + # Test keep-alive feature for long-running processing (more than 2 seconds) + echo "<= ........OK" >> $outfile + for i in {1..8}; do + ./msleep 500 + printf '.' + done + printf 'OK\n' + else + echo "<= OK" >> $outfile + echo "OK" + fi + + just_started=false + read line +done + +exit 0 -- cgit v1.2.3