From 8b3aa503c171acdb9ec63484a8c50e2680d31e79 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Tue, 1 Dec 2015 22:35:16 -0500 Subject: tests: turn check if manager cannot be intialized into macro We need to check the same thing in multiple tests. Use a shared macro to make it easier to update the list of errnos. Change the errno code for "unitialized cgroup fs" for ENOMEDIUM. Exec format error looks like something more serious. This fixes test-execute invocation in mock. --- src/test/test-sched-prio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/test/test-sched-prio.c') diff --git a/src/test/test-sched-prio.c b/src/test/test-sched-prio.c index 8396ae60f3..7958a6c71a 100644 --- a/src/test/test-sched-prio.c +++ b/src/test/test-sched-prio.c @@ -23,6 +23,7 @@ #include "macro.h" #include "manager.h" +#include "test-helper.h" int main(int argc, char *argv[]) { Manager *m = NULL; @@ -35,7 +36,7 @@ int main(int argc, char *argv[]) { /* prepare the test */ assert_se(set_unit_path(TEST_DIR) >= 0); r = manager_new(MANAGER_USER, true, &m); - if (IN_SET(r, -EPERM, -EACCES, -EADDRINUSE, -EHOSTDOWN, -ENOENT, -ENOEXEC)) { + if (MANAGER_SKIP_TEST(r)) { printf("Skipping test: manager_new: %s", strerror(-r)); return EXIT_TEST_SKIP; } -- cgit v1.2.3-54-g00ecf