mirror of
https://github.com/systemd/systemd.git
synced 2025-03-13 00:58:27 +03:00
tests: skip tests when executed without privileges but which require them
This commit is contained in:
parent
d4ac85c6f6
commit
f04ca8c214
@ -35,7 +35,7 @@ int main(int argc, char *argv[]) {
|
||||
/* prepare the test */
|
||||
assert_se(set_unit_path(TEST_DIR) >= 0);
|
||||
r = manager_new(SYSTEMD_USER, false, &m);
|
||||
if (r == -EPERM) {
|
||||
if (r == -EPERM || r == -EACCES) {
|
||||
puts("manager_new: Permission denied. Skipping test.");
|
||||
return EXIT_TEST_SKIP;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ static int test_unit_printf(void) {
|
||||
assert_se(asprintf(&root_uid, "%d", (int) root->pw_uid) > 0);
|
||||
|
||||
r = manager_new(SYSTEMD_USER, false, &m);
|
||||
if (r == -EPERM) {
|
||||
if (r == -EPERM || r == -EACCES) {
|
||||
puts("manager_new: Permission denied. Skipping test.");
|
||||
return EXIT_TEST_SKIP;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user