naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
2aacef
From f2a1b51350d535cbb6ed3a3d11071651e54f5c3c Mon Sep 17 00:00:00 2001
2aacef
From: Frantisek Sumsal <frantisek@sumsal.cz>
2aacef
Date: Tue, 17 Jan 2023 18:04:30 +0100
2aacef
Subject: [PATCH] test: bump D-Bus service start timeout if we run without
2aacef
 accel
2aacef
2aacef
The default (25s) doesn't seem to be enough in some cases (especially
2aacef
in VMs without acceleration), causing spurious timeouts:
2aacef
2aacef
[  174.297658] dbus-daemon[647]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.0' (uid=0 pid=645 comm="hostnamectl " label="kernel")
2aacef
[  184.202313] systemd[1]: systemd-update-utmp-runlevel.service: Consumed 1.253s CPU time.
2aacef
[  197.335422] systemd[1]: Started dbus.service.
2aacef
[  199.211468] testsuite-71.sh[639]: + assert_in 'Static hostname: H' ''
2aacef
[  199.347192] dbus-daemon[647]: [system] Failed to activate service 'org.freedesktop.hostname1': timed out (service_start_timeout=25000ms)
2aacef
[  199.394879] testsuite-71.sh[657]: + set +ex
2aacef
[  199.438918] testsuite-71.sh[657]: FAIL: 'Static hostname: H' not found in:
2aacef
[  200.966006] systemd-logind[631]: Watching system buttons on /dev/input/event0 (Power Button)
2aacef
[  201.008178] systemd-logind[631]: Watching system buttons on /dev/input/event1 (AT Translated Set 2 keyboard)
2aacef
[  201.034106] systemd-logind[631]: New seat seat0.
2aacef
[  201.238267] sh[658]: + systemctl poweroff --no-block
2aacef
[  201.329890] systemd[1]: Starting systemd-hostnamed.service...
2aacef
[  202.156622] systemd[1]: systemd-update-utmp-runlevel.service: Deactivated successfully.
2aacef
[  204.818913] hostnamectl[645]: Failed to query system properties: Connection timed out
2aacef
[  205.195583] systemd[1]: testsuite-71.service: Main process exited, code=exited, status=1/FAILURE
2aacef
[  205.227237] systemd[1]: testsuite-71.service: Failed with result 'exit-code'.
2aacef
[  205.712780] systemd[1]: Failed to start testsuite-71.service.
2aacef
2aacef
(cherry picked from commit c78d18215b3e5b0f0896ddb1d0d72c666b5e830b)
2aacef
2aacef
Related: #2138081
2aacef
---
2aacef
 test/test-functions | 12 ++++++++++++
2aacef
 1 file changed, 12 insertions(+)
2aacef
2aacef
diff --git a/test/test-functions b/test/test-functions
2aacef
index 94e11a686a..6e4ea80d89 100644
2aacef
--- a/test/test-functions
2aacef
+++ b/test/test-functions
2aacef
@@ -1909,6 +1909,18 @@ install_dbus() {
2aacef
     </policy>
2aacef
 </busconfig>
2aacef
 EOF
2aacef
+
2aacef
+    # If we run without KVM, bump the service start timeout
2aacef
+    if ! get_bool "$QEMU_KVM"; then
2aacef
+        cat >"$initdir/etc/dbus-1/system.d/service.timeout.conf" <
2aacef
+
2aacef
+
2aacef
+        "https://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
2aacef
+<busconfig>
2aacef
+    <limit name="service_start_timeout">60000</limit>
2aacef
+</busconfig>
2aacef
+EOF
2aacef
+    fi
2aacef
 }
2aacef
 
2aacef
 install_user_dbus() {