test: allow to allocate test scope even running with unprivileged user

This commit is contained in:
Yu Watanabe
2025-05-10 00:17:52 +09:00
parent ad446c8ceb
commit 7ded1bcf04
+4 -1
View File
@@ -219,7 +219,10 @@ static int allocate_scope(void) {
return 0;
}
r = sd_bus_default_system(&bus);
if (geteuid() == 0)
r = sd_bus_default_system(&bus);
else
r = sd_bus_default_user(&bus);
if (r < 0)
return log_error_errno(r, "Failed to connect to system bus: %m");