diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-09-05 12:14:55 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-09-05 12:14:55 +0200 |
commit | f4906a277b533a9d51b16b3fcc8a651f21e3a3b8 (patch) | |
tree | 2cd097c3487274a4449161ec1e007a17599dd940 | |
parent | c9912c5eafa03fdf53e569eaf2e89d7e0932975b (diff) | |
parent | 3b3a64d7546f77efe5ec7356c2f318401eeae19e (diff) |
Merge pull request #1146 from martinpitt/master
tests: Skip tests which need to access /sys/fs/cgroup if that is not …
-rw-r--r-- | src/libsystemd/sd-bus/test-bus-creds.c | 6 | ||||
-rw-r--r-- | src/test/test-engine.c | 2 | ||||
-rw-r--r-- | src/test/test-path.c | 2 | ||||
-rw-r--r-- | src/test/test-sched-prio.c | 2 |
4 files changed, 9 insertions, 3 deletions
diff --git a/src/libsystemd/sd-bus/test-bus-creds.c b/src/libsystemd/sd-bus/test-bus-creds.c index edd5033db2..580117165a 100644 --- a/src/libsystemd/sd-bus/test-bus-creds.c +++ b/src/libsystemd/sd-bus/test-bus-creds.c @@ -22,11 +22,17 @@ #include "sd-bus.h" #include "bus-dump.h" #include "bus-util.h" +#include "cgroup-util.h" int main(int argc, char *argv[]) { _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; int r; + if (cg_unified() == -ENOEXEC) { + puts("Skipping test: /sys/fs/cgroup/ not available"); + return EXIT_TEST_SKIP; + } + r = sd_bus_creds_new_from_pid(&creds, 0, _SD_BUS_CREDS_ALL); assert_se(r >= 0); diff --git a/src/test/test-engine.c b/src/test/test-engine.c index a7ab21a415..6596069ade 100644 --- a/src/test/test-engine.c +++ b/src/test/test-engine.c @@ -38,7 +38,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)) { + if (IN_SET(r, -EPERM, -EACCES, -EADDRINUSE, -EHOSTDOWN, -ENOENT, -ENOEXEC)) { printf("Skipping test: manager_new: %s", strerror(-r)); return EXIT_TEST_SKIP; } diff --git a/src/test/test-path.c b/src/test/test-path.c index 5d190378f1..676c9f1793 100644 --- a/src/test/test-path.c +++ b/src/test/test-path.c @@ -40,7 +40,7 @@ static int setup_test(Manager **m) { assert_se(m); r = manager_new(MANAGER_USER, true, &tmp); - if (IN_SET(r, -EPERM, -EACCES, -EADDRINUSE, -EHOSTDOWN, -ENOENT)) { + if (IN_SET(r, -EPERM, -EACCES, -EADDRINUSE, -EHOSTDOWN, -ENOENT, -ENOEXEC)) { printf("Skipping test: manager_new: %s", strerror(-r)); return -EXIT_TEST_SKIP; } diff --git a/src/test/test-sched-prio.c b/src/test/test-sched-prio.c index f915539e00..ebc9110c4d 100644 --- a/src/test/test-sched-prio.c +++ b/src/test/test-sched-prio.c @@ -35,7 +35,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)) { + if (IN_SET(r, -EPERM, -EACCES, -EADDRINUSE, -EHOSTDOWN, -ENOENT, -ENOEXEC)) { printf("Skipping test: manager_new: %s", strerror(-r)); return EXIT_TEST_SKIP; } |