Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"make check" broken since unified cgroup rework if cgroupfs is not mounted #1132

Closed
martinpitt opened this issue Sep 3, 2015 · 3 comments
Closed

Comments

@martinpitt
Copy link
Contributor

Since commit efdb023 ("core: unified cgroup hierarchy support") I am seeing 4 test case failures during "make check", in test-engine, test-path, test-sched-prio, and test-bus-creds. They all fail for the same reason:

$ SYSTEMD_LOG_LEVEL=debug ./test-path
Cannot determine cgroup we are running in: Exec format error
Assertion 'r >= 0' failed at src/test/test-path.c:47, function setup_test(). Aborting.
Aborted (core dumped)

This negative r result comes from manager_new(MANAGER_USER, true, &tmp);

This only happens in a build chroot, the test programs run fine in my "real" system. Once I bind-mount /sys/fs/cgroup into the chroot it works again, but introducing this requirement would mean that we have to stop running these tests on package build as our production buildds don't do this. Was introducing this requirement deliberate, or at least unavoidable? If so I'm okay with disabling the tests, but I'd like to ask first.

@martinpitt martinpitt changed the title "make check" broken since unified cgroup rework "make check" broken since unified cgroup rework if cgroupfs is not mounted Sep 3, 2015
@poettering
Copy link
Member

I'd be willing to add a patch that changes the tests in question to run cg_unified() early, and if that fails exits with the right exit code that causes the tests to be skipped... If cgroupfs is not accessible the tests are not useful anyway... I am surprised this worked earlier though...

martinpitt added a commit to martinpitt/systemd that referenced this issue Sep 4, 2015
…available

Commit efdb023 ("core: unified cgroup hierarchy support") introduced a new
error ENOEXEC in cg_unified() if /sys/fs/cgroup/ is not available. Adjust the
"skip" checks in various tests accordingly.

Add a corresponding "skip" check to test-bus-creds as well, as
sd_bus_creds_new_from_pid() now calls cg_unified() as well.

This re-fixes "make check" in build chroots without /sys/fs/cgroup.

systemd#1132
@martinpitt
Copy link
Contributor Author

I am surprised this worked earlier though...

It worked because these tests already skip themselves on a handful of known errno codes. But commit efdb023 now makes cg_unified() return the (admittedly a bit strange) code ENOEXEC, which needs to be added there. Either that, or we make cg_unified() return an (IMHO a bit more obvious) ENOENT?

PR coming.

@martinpitt
Copy link
Contributor Author

This got merged, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants