summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-11-28 19:37:32 +0100
committerLennart Poettering <lennart@poettering.net>2017-12-05 13:49:13 +0100
commit9b45c2bf02a43e3e1b42de1ab0c3fe29c64dc5f5 (patch)
tree148bc8ea88569711c6e9f3e864e6455264a9a2bd /test
parentf2d566b7280ea09a624671c2c4aad432a9976244 (diff)
downloadsystemd-9b45c2bf02a43e3e1b42de1ab0c3fe29c64dc5f5.tar.gz
systemd-9b45c2bf02a43e3e1b42de1ab0c3fe29c64dc5f5.tar.bz2
systemd-9b45c2bf02a43e3e1b42de1ab0c3fe29c64dc5f5.zip
tests: don't use "netcat" for testing TEST-10-ISSUE-2467
Apparently there are a myriad of netcat implementations around, and they all behave slightly differently. The one I have on my Fedora 27 installation will cause a failure when invoked as "nc -U" on an AF_UNIX socket whose connections are immediately disconnected, thus causing the test to fail. Let's avoid all ambiguities in this regard, and drop usage of netcat altoegther. Instead let's use a FIFO in the file system, which we can connect to with only shell commands, and is hence much simpler and more reliable to test with. The actual test is supposed to validate that PID 1 doesn't hang when activation of a socket-activated service fails, hence which transport mechanism is used ultimately doesn't matter, as long as we activate the service, and we do here...
Diffstat (limited to 'test')
-rwxr-xr-xtest/TEST-10-ISSUE-2467/test.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/TEST-10-ISSUE-2467/test.sh b/test/TEST-10-ISSUE-2467/test.sh
index e027c9d81d..2f95e9062d 100755
--- a/test/TEST-10-ISSUE-2467/test.sh
+++ b/test/TEST-10-ISSUE-2467/test.sh
@@ -18,7 +18,7 @@ test_setup() {
eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
setup_basic_environment
- dracut_install nc true rm
+ dracut_install true rm
# setup the testsuite service
cat >$initdir/etc/systemd/system/testsuite.service <<'EOF'
@@ -28,13 +28,15 @@ After=multi-user.target
[Service]
Type=oneshot
-ExecStart=/bin/sh -e -x -c 'rm -f /tmp/nonexistent; systemctl start test.socket; echo a | nc -U /run/test.ctl; >/testok'
+StandardOutput=tty
+StandardError=tty
+ExecStart=/bin/sh -e -x -c 'rm -f /tmp/nonexistent; systemctl start test.socket; echo > /run/test.ctl; >/testok'
TimeoutStartSec=10s
EOF
cat >$initdir/etc/systemd/system/test.socket <<'EOF'
[Socket]
-ListenStream=/run/test.ctl
+ListenFIFO=/run/test.ctl
EOF
cat > $initdir/etc/systemd/system/test.service <<'EOF'