]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: avoid SIGPIPE from ssh | tail -n 1
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 29 Feb 2024 10:57:04 +0000 (11:57 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 29 Feb 2024 12:43:40 +0000 (13:43 +0100)
Addresses: https://github.com/systemd/systemd/issues/31518#issuecomment-1968295678

test/units/testsuite-46.sh

index 7952ea2202c19979c8c3f53389331ef56dbd27df..83e96d8474196f0de464afbfa47ca4b5ad627eaf 100755 (executable)
@@ -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 \