diff --git a/test/units/testsuite-77-socket.sh b/test/units/testsuite-77-client.sh similarity index 100% rename from test/units/testsuite-77-socket.sh rename to test/units/testsuite-77-client.sh diff --git a/test/units/testsuite-77-netcat.service b/test/units/testsuite-77-netcat.service deleted file mode 100644 index 8ae399a26f..0000000000 --- a/test/units/testsuite-77-netcat.service +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-77-OPENFILE - -[Service] -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=simple diff --git a/test/units/testsuite-77-netcat.sh b/test/units/testsuite-77-netcat.sh deleted file mode 100755 index 73b4c8794d..0000000000 --- a/test/units/testsuite-77-netcat.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later - -echo "Socket" | nc -lkU /tmp/test.sock diff --git a/test/units/testsuite-77-server.socket b/test/units/testsuite-77-server.socket new file mode 100644 index 0000000000..4305077501 --- /dev/null +++ b/test/units/testsuite-77-server.socket @@ -0,0 +1,6 @@ +[Unit] +Description=TEST-77-OPENFILE server socket + +[Socket] +ListenStream=/tmp/test.sock +Accept=yes diff --git a/test/units/testsuite-77-server@.service b/test/units/testsuite-77-server@.service new file mode 100644 index 0000000000..8e99ac8334 --- /dev/null +++ b/test/units/testsuite-77-server@.service @@ -0,0 +1,7 @@ +[Unit] +Description=TEST-77-OPENFILE server + +[Service] +ExecStart=echo "Socket" +StandardInput=socket +StandardOutput=socket diff --git a/test/units/testsuite-77-socket.service b/test/units/testsuite-77-socket.service deleted file mode 100644 index 9b6cfc6e6b..0000000000 --- a/test/units/testsuite-77-socket.service +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-77-OPENFILE - -[Service] -OpenFile=/tmp/test.sock:socket:read-only -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-77.sh b/test/units/testsuite-77.sh index 2675f054dc..13db238ba9 100755 --- a/test/units/testsuite-77.sh +++ b/test/units/testsuite-77.sh @@ -16,8 +16,11 @@ read -r -u 4 text assert_eq "$text" "File" # Test for socket -systemctl start testsuite-77-netcat.service -systemctl start testsuite-77-socket.service +systemctl start testsuite-77-server.socket +systemd-run -p OpenFile=/tmp/test.sock:socket:read-only \ + --wait \ + --pipe \ + /usr/lib/systemd/tests/testdata/units/testsuite-77-client.sh # Tests for D-Bus diff <(systemctl show -p OpenFile testsuite-77) - <