From: Frantisek Sumsal Date: Tue, 5 Sep 2023 11:30:12 +0000 (+0200) Subject: test: set ncat's idle timeout as well X-Git-Tag: v255-rc1~578^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=04bf0452a54a08443aa4988e402c54f6dbe8948d;p=thirdparty%2Fsystemd.git test: set ncat's idle timeout as well Otherwise we'll get stuck waiting indefinitely if the test socket unit fails to fail due the trigger limit, i.e.: [ 111.104906] testsuite-07.sh[743]: + systemctl start issue2467.socket [ OK ] Listening on issue2467.socket. [ 111.746465] testsuite-07.sh[743]: + nc -w20 -U /run/test.ctl Starting systemd-tmpfiles-clean.service... [ OK ] Finished systemd-tmpfiles-clean.service. qemu-system-x86_64: terminating on signal 15 from pid 565814 (timeout) E: Test timed out after 1800s With the idle timeout we should give up after 20 seconds, allowing the next statement to properly fail: [ 34.233084] testsuite-07.sh[450]: + systemctl start issue2467.socket [ 35.475392] testsuite-07.sh[450]: + nc -i20 -w20 -U /run/test.ctl [ 56.122941] testsuite-07.sh[458]: Ncat: Idle timeout expired (20000 ms). [ 56.140871] testsuite-07.sh[450]: + : [ 56.145460] testsuite-07.sh[450]: + timeout 10 bash -c 'while ! [[ "$(systemctl show issue2467.socket -P ActiveState)" == failed ]]; do sleep .5; done' [ 66.197623] testsuite-07.sh[446]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/testsuite-07.issue-2467.sh failed' --- diff --git a/test/units/testsuite-07.issue-2467.sh b/test/units/testsuite-07.issue-2467.sh index a5dcfd55dd9..0d8c16e65a2 100755 --- a/test/units/testsuite-07.issue-2467.sh +++ b/test/units/testsuite-07.issue-2467.sh @@ -8,7 +8,7 @@ set -o pipefail rm -f /tmp/nonexistent systemctl start issue2467.socket -nc -w20 -U /run/test.ctl || : +nc -i20 -w20 -U /run/test.ctl || : # TriggerLimitIntervalSec= by default is set to 2s. A "sleep 10" should give # systemd enough time even on slower machines, to reach the trigger limit.