mirror of
https://github.com/systemd/systemd.git
synced 2024-11-07 09:56:51 +03:00
test: exit early if we would conflict with running user systemd
This commit is contained in:
parent
911121a7c8
commit
a454d241ef
@ -35,7 +35,7 @@ int main(int argc, char *argv[]) {
|
|||||||
/* prepare the test */
|
/* prepare the test */
|
||||||
assert_se(set_unit_path(TEST_DIR) >= 0);
|
assert_se(set_unit_path(TEST_DIR) >= 0);
|
||||||
r = manager_new(SYSTEMD_USER, false, &m);
|
r = manager_new(SYSTEMD_USER, false, &m);
|
||||||
if (r == -EPERM || r == -EACCES) {
|
if (r == -EPERM || r == -EACCES || r == -EADDRINUSE) {
|
||||||
puts("manager_new: Permission denied. Skipping test.");
|
puts("manager_new: Permission denied. Skipping test.");
|
||||||
return EXIT_TEST_SKIP;
|
return EXIT_TEST_SKIP;
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ static int test_unit_printf(void) {
|
|||||||
assert_se(asprintf(&root_uid, "%d", (int) root->pw_uid) > 0);
|
assert_se(asprintf(&root_uid, "%d", (int) root->pw_uid) > 0);
|
||||||
|
|
||||||
r = manager_new(SYSTEMD_USER, false, &m);
|
r = manager_new(SYSTEMD_USER, false, &m);
|
||||||
if (r == -EPERM || r == -EACCES) {
|
if (r == -EPERM || r == -EACCES || r == -EADDRINUSE) {
|
||||||
puts("manager_new: Permission denied. Skipping test.");
|
puts("manager_new: Permission denied. Skipping test.");
|
||||||
return EXIT_TEST_SKIP;
|
return EXIT_TEST_SKIP;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user