|
Zbigniew Jędrzejewski-Szmek |
db38be |
From 8d1d1bf20a1a6175decff979f6b95d831e0b3fc8 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
Date: Sun, 12 Oct 2014 16:05:49 -0400
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
Subject: [PATCH] tests: fix some tests to pass in koji
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
FAIL: test-engine
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
=================
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
Cannot find cgroup mount point: No such file or directory
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
Assertion 'r >= 0' failed at ../src/test/test-engine.c:46, function main(). Aborting.
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
FAIL: test-sched-prio
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
=====================
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
Cannot find cgroup mount point: No such file or directory
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
Assertion 'r >= 0' failed at ../src/test/test-sched-prio.c:42, function main(). Aborting.
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
FAIL: test-bus-cleanup
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
======================
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
Assertion 'sd_bus_open_system(&bus) >= 0' failed at ../src/libsystemd/sd-bus/test-bus-cleanup.c:40, function test_bus_open(). Aborting.
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
after new: refcount 1
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
---
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
src/libsystemd/sd-bus/test-bus-cleanup.c | 22 +++++++++++++++++++---
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
src/test/test-engine.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
src/test/test-sched-prio.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
3 files changed, 21 insertions(+), 5 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
diff --git a/src/libsystemd/sd-bus/test-bus-cleanup.c b/src/libsystemd/sd-bus/test-bus-cleanup.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
index e36a69f0d1..f586880593 100644
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
--- a/src/libsystemd/sd-bus/test-bus-cleanup.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+++ b/src/libsystemd/sd-bus/test-bus-cleanup.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
@@ -34,11 +34,18 @@ static void test_bus_new(void) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
printf("after new: refcount %u\n", REFCNT_GET(bus->n_ref));
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
}
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
-static void test_bus_open(void) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+static int test_bus_open(void) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
_cleanup_bus_unref_ sd_bus *bus = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ int r;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
- assert_se(sd_bus_open_system(&bus) >= 0);
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ r = sd_bus_open_system(&bus;;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ if (r == -ECONNREFUSED || r == -ENOENT)
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ return r;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ assert_se(r >= 0);
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
printf("after open: refcount %u\n", REFCNT_GET(bus->n_ref));
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ return 0;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
}
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
static void test_bus_new_method_call(void) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
@@ -70,11 +77,20 @@ static void test_bus_new_signal(void) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
}
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
int main(int argc, char **argv) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ int r;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
log_parse_environment();
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
log_open();
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
test_bus_new();
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
- test_bus_open();
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ r = test_bus_open();
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ log_info("Failed to connect to bus, skipping tests.");
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ return EXIT_TEST_SKIP;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ }
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
test_bus_new_method_call();
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
test_bus_new_signal();
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ return EXIT_SUCCESS;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
}
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
diff --git a/src/test/test-engine.c b/src/test/test-engine.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
index 1b71416a04..6acd394c67 100644
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
--- a/src/test/test-engine.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+++ b/src/test/test-engine.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
@@ -39,7 +39,7 @@ int main(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
/* prepare the test */
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
assert_se(set_unit_path(TEST_DIR) >= 0);
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
r = manager_new(SYSTEMD_USER, true, &m);
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
- if (r == -EPERM || r == -EACCES || r == -EADDRINUSE || r == -EHOSTDOWN) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ if (IN_SET(r, -EPERM, -EACCES, -EADDRINUSE, -EHOSTDOWN, -ENOENT)) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
printf("Skipping test: manager_new: %s", strerror(-r));
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
return EXIT_TEST_SKIP;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
}
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
diff --git a/src/test/test-sched-prio.c b/src/test/test-sched-prio.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
index 2f559b0413..6b3128d3b7 100644
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
--- a/src/test/test-sched-prio.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+++ b/src/test/test-sched-prio.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
@@ -35,7 +35,7 @@ int main(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
/* prepare the test */
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
assert_se(set_unit_path(TEST_DIR) >= 0);
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
r = manager_new(SYSTEMD_USER, true, &m);
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
- if (r == -EPERM || r == -EACCES || r == -EADDRINUSE || r == -EHOSTDOWN) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ if (IN_SET(r, -EPERM, -EACCES, -EADDRINUSE, -EHOSTDOWN, -ENOENT)) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
printf("Skipping test: manager_new: %s", strerror(-r));
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
return EXIT_TEST_SKIP;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
}
|