]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Add tests for various varlink socket units 37991/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 30 Jun 2025 11:41:04 +0000 (13:41 +0200)
committerDaanDeMeyer <daan.j.demeyer@gmail.com>
Thu, 3 Jul 2025 09:24:03 +0000 (11:24 +0200)
Let's make sure these socket units work as expected by stopping the
related services and making sure the services are started as expected
when a client connects to the corresponding socket.

test/units/TEST-74-AUX-UTILS.varlinkctl.sh

index 2e0bf5f7d6aebad84b2a291a630daeb658fa0ba6..481dc85d6fd2f9cfefa5f3a434f4ca5d0bf65d5d 100755 (executable)
@@ -66,6 +66,20 @@ if [[ -x /usr/lib/systemd/systemd-pcrextend ]]; then
     varlinkctl introspect /usr/lib/systemd/systemd-pcrextend
 fi
 
+# Test various varlink socket units to make sure that we can still connect to the varlink sockets even if the
+# services are currently stopped (or restarting).
+systemctl stop \
+    systemd-networkd.service \
+    systemd-hostnamed.service \
+    systemd-machined.service \
+    systemd-udevd.service
+varlinkctl introspect /run/systemd/netif/io.systemd.Network
+varlinkctl introspect /run/systemd/io.systemd.Hostname
+varlinkctl introspect /run/systemd/machine/io.systemd.Machine
+if ! systemd-detect-virt -qc; then
+    varlinkctl introspect /run/udev/io.systemd.Udev
+fi
+
 # SSH transport
 SSHBINDIR="$(mktemp -d)"