Skip tests when cg_pid_get_path fails
This commit is contained in:
parent
3cb1145229
commit
a46c781ba7
27
0002-tests-skip-tests-when-cg_pid_get_path-fails.patch
Normal file
27
0002-tests-skip-tests-when-cg_pid_get_path-fails.patch
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
From 4a0b4e5eb17ae7af860d874ecc80a1ca51108428 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||||
|
Date: Fri, 6 Oct 2017 17:24:50 +0200
|
||||||
|
Subject: [PATCH] tests: skip tests when cg_pid_get_path fails
|
||||||
|
|
||||||
|
---
|
||||||
|
src/test/test-helper.c | 7 ++++++-
|
||||||
|
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/test/test-helper.c b/src/test/test-helper.c
|
||||||
|
index 5b707c3276..b64623a06e 100644
|
||||||
|
--- a/src/test/test-helper.c
|
||||||
|
+++ b/src/test/test-helper.c
|
||||||
|
@@ -26,7 +26,12 @@ void enter_cgroup_subroot(void) {
|
||||||
|
_cleanup_free_ char *cgroup_root = NULL, *cgroup_subroot = NULL;
|
||||||
|
CGroupMask supported;
|
||||||
|
|
||||||
|
- assert_se(cg_pid_get_path(NULL, 0, &cgroup_root) >= 0);
|
||||||
|
+ r = cg_pid_get_path(NULL, 0, &cgroup_root);
|
||||||
|
+ if (r < 0) {
|
||||||
|
+ log_error_errno(r, "cg_pid_get_path(NULL, 0, ...) failed, bailing out: %m");
|
||||||
|
+ exit(EXIT_TEST_SKIP);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
assert_se(asprintf(&cgroup_subroot, "%s/%" PRIx64, cgroup_root, random_u64()) >= 0);
|
||||||
|
assert_se(cg_mask_supported(&supported) >= 0);
|
||||||
|
|
@ -47,6 +47,7 @@ GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
Patch0001: 0001-po-update-Polish-translation-7015.patch
|
Patch0001: 0001-po-update-Polish-translation-7015.patch
|
||||||
|
Patch0002: 0002-tests-skip-tests-when-cg_pid_get_path-fails.patch
|
||||||
|
|
||||||
Patch0998: 0998-resolved-create-etc-resolv.conf-symlink-at-runtime.patch
|
Patch0998: 0998-resolved-create-etc-resolv.conf-symlink-at-runtime.patch
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user