diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-02-06 17:35:53 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-02-06 19:29:33 -0500 |
commit | c5e33bf8342daa6bab22f495ef774741184de09d (patch) | |
tree | be7c25b203db65fb9cdde0277ebfe0e6b44b92c4 /src/test/test-sched-prio.c | |
parent | 10ddd913f0d13584e13b5e6bbcb381f1618c90c0 (diff) |
tests: skip tests if manager cannot be created
When running without a user session, tests fail.
Diffstat (limited to 'src/test/test-sched-prio.c')
-rw-r--r-- | src/test/test-sched-prio.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/test/test-sched-prio.c b/src/test/test-sched-prio.c index 63f7ebda08..c57f6a3671 100644 --- a/src/test/test-sched-prio.c +++ b/src/test/test-sched-prio.c @@ -30,10 +30,16 @@ int main(int argc, char *argv[]) { Service *ser; FILE *serial = NULL; FDSet *fdset = NULL; + int r; /* prepare the test */ assert_se(set_unit_path(TEST_DIR) >= 0); - assert_se(manager_new(SYSTEMD_USER, &m) >= 0); + r = manager_new(SYSTEMD_USER, &m); + if (r == -EPERM) { + puts("manager_new: Permission denied. Skipping test."); + return EXIT_SUCCESS; + } + assert(r >= 0); assert_se(manager_startup(m, serial, fdset) >= 0); /* load idle ok */ @@ -82,5 +88,5 @@ int main(int argc, char *argv[]) { assert_se(ser->exec_context.cpu_sched_policy == SCHED_RR); assert_se(ser->exec_context.cpu_sched_priority == 99); - return 0; + return EXIT_SUCCESS; } |