|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
From 62e20ce3dc0210e331147b717ea36b17a3d555f2 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
Date: Tue, 6 Mar 2018 00:01:36 +0100
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
Subject: [PATCH] test-cgroup-util: bail out when running under mock
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
The builds were failing in Fedora koji, where something strange is mounted
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
on /sys/fs/cgroup.
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
src/test/test-cgroup-util.c | 10 ++++++++--
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
index c4163fc3a9..9ef7c97c74 100644
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
--- a/src/test/test-cgroup-util.c
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
+++ b/src/test/test-cgroup-util.c
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
@@ -408,9 +408,15 @@ static void test_cg_tests(void) {
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
static void test_cg_get_keyed_attribute(void) {
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
_cleanup_free_ char *val = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
char *vals3[3] = {}, *vals3a[3] = {};
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
- int i;
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
+ int i, r;
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
- assert_se(cg_get_keyed_attribute("cpu", "/init.scope", "no_such_file", STRV_MAKE("no_such_attr"), &val) == -ENOENT);
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
+ r = cg_get_keyed_attribute("cpu", "/init.scope", "no_such_file", STRV_MAKE("no_such_attr"), &val;;
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
+ if (r == -ENOMEDIUM) {
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
+ log_info_errno(r, "Skipping most of %s, /sys/fs/cgroup not accessible: %m", __func__);
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
+ return;
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
+ }
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
+ assert_se(r == -ENOENT);
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
assert_se(val == NULL);
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
|
|
Zbigniew Jędrzejewski-Szmek |
77f7c6 |
if (access("/sys/fs/cgroup/init.scope/cpu.stat", R_OK) < 0) {
|