1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 03:25:31 +03:00

test-cgroup: skip if /sys/fs/cgroup unknown fs

It's not always mounted, e.g. during the build-time tests, it's running inside
a chroot (that's how Debian/Ubuntu build packages, in chroots) so this test
always fails because /sys/fs/cgroup isn't mounted.
This commit is contained in:
Dan Streetman 2020-03-21 10:59:42 -04:00 committed by Zbigniew Jędrzejewski-Szmek
parent 0bc5f001db
commit af5654d35c

View File

@ -44,6 +44,13 @@ static void test_cg_split_spec(void) {
static void test_cg_create(void) {
log_info("/* %s */", __func__);
int r;
r = cg_unified_cached(false);
if (r < 0) {
log_info_errno(r, "Skipping %s: %m", __func__);
return;
}
_cleanup_free_ char *here = NULL;
assert_se(cg_pid_get_path_shifted(0, NULL, &here) >= 0);
@ -53,7 +60,6 @@ static void test_cg_create(void) {
*test_c = prefix_roota(here, "/test-b/test-c"),
*test_d = prefix_roota(here, "/test-b/test-d");
char *path;
int r;
log_info("Paths for test:\n%s\n%s", test_a, test_b);