Repository navigation
Fix CI failures on GitHub-hosted runners - #1
Merged
Merged
Conversation
Lower-dir fixtures are owned by the user running the tests, so the hardcoded 1000:1000 owner made recreated entries look modified when the suite runs under another uid (GitHub runners use uid 1001).
The test assumed /usr/local/bin is not writable by the current user, which does not hold on GitHub-hosted runners.
Ubuntu 24.04 runners set kernel.apparmor_restrict_unprivileged_userns=1, so writing uid_map fails with EPERM and prereq::tests::test_probe_userns cannot pass.
The container user was hardcoded to uid 1000, so on GitHub runners (uid 1001) cargo could not create /work/target-docker in the bind-mounted checkout.
On the bare runner the privileged e2e tests write to the real /usr/local/bin, which is user-writable there, so root-ownership assertions fail. Skip privileged tests (and the userns probe test) when AppArmor restricts unprivileged user namespaces, and lift the restriction only for the Docker job, where INSTALLCTL_REQUIRE_PRIV_TESTS=1 forbids skipping.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI fails on GitHub runners because of environment assumptions that only hold on the developer machine (uid 1000, restricted AppArmor off).
changestests: use the current uid/gid instead of hardcoded 1000:1000; lower-dir fixtures are owned by the runner user (uid 1001), so recreated entries were reported as modified.apply::tests::test_needs_root_detection: check against a read-only temp dir instead of/usr/local/bin, which is writable on runners.kernel.apparmor_restrict_unprivileged_userns=0beforecargo test, otherwise writinguid_mapfails with EPERM (prereq::tests::test_probe_userns).testeruser with the host uid/gid so cargo can create/work/target-dockerin the bind-mounted checkout.