test: set ncat's idle timeout as well
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 5 Sep 2023 11:30:12 +0000 (13:30 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 5 Sep 2023 11:30:12 +0000 (13:30 +0200)
commit04bf0452a54a08443aa4988e402c54f6dbe8948d
tree5192e65ba70da1a28df366327a4d7b1a7fe05a03
parent54bf13a46a826d5918861df74ace249b77a4fc7e
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'
test/units/testsuite-07.issue-2467.sh