From: Frantisek Sumsal Date: Thu, 29 Feb 2024 10:57:04 +0000 (+0100) Subject: test: avoid SIGPIPE from ssh | tail -n 1 X-Git-Tag: v256-rc1~697^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=38cbb9ab8a406972f39cae590e71c30f22cf9c62;p=thirdparty%2Fsystemd.git test: avoid SIGPIPE from ssh | tail -n 1 Addresses: https://github.com/systemd/systemd/issues/31518#issuecomment-1968295678 --- diff --git a/test/units/testsuite-46.sh b/test/units/testsuite-46.sh index 7952ea2202c..83e96d84741 100755 --- a/test/units/testsuite-46.sh +++ b/test/units/testsuite-46.sh @@ -521,9 +521,8 @@ EOF ssh -t -t -4 -p 4711 -i /tmp/homed.id_ecdsa \ -o "SetEnv PASSWORD=hunter4711" -o "StrictHostKeyChecking no" \ - homedsshtest@localhost echo zzz | tail -n 1 | tr -d '\r' > /tmp/homedsshtest.out - cat /tmp/homedsshtest.out - test "$(cat /tmp/homedsshtest.out)" = "zzz" + homedsshtest@localhost echo zzz | tr -d '\r' | tee /tmp/homedsshtest.out + grep -E "^zzz$" /tmp/homedsshtest.out rm /tmp/homedsshtest.out ssh -t -t -4 -p 4711 -i /tmp/homed.id_ecdsa \