From 979fc03445bb27851cd0fc5ed7a0572ca75d41ba Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 27 Oct 2026 18:28:52 +0100 Subject: [PATCH] fix: give the CI sandbox tests a working bwrap Ubuntu 24.04 blocks the unprivileged user namespaces bubblewrap needs, so the campaign refused to run the fake cores and four FakeCorePasses tests failed, also inside the no-jsonschema replay. CI now installs bubblewrap, lifts the AppArmor restriction and proves a sandbox starts. Locally the tests name the missing sandbox instead of failing on a KeyError. --- .github/workflows/validate.yml | 10 ++++++++++ tests/test_campaign.py | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 2821345e9..75fb53dbd 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -239,6 +239,16 @@ jobs: - name: Check that shellcheck is installed run: shellcheck --version + # core_probe and the campaign run third-party cores only inside a + # bubblewrap sandbox and refuse without one. Ubuntu 24.04 blocks the + # unprivileged user namespaces bwrap needs, so the campaign tests saw + # "refused". The last command proves a sandbox starts. + - name: Give the sandbox tests a working bubblewrap + run: | + sudo apt-get install -y --no-install-recommends bubblewrap + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 + bwrap --ro-bind /usr /usr --symlink usr/lib /lib --symlink usr/lib64 /lib64 --symlink usr/bin /bin --proc /proc --dev /dev --unshare-all /bin/true + # The site is built as deploy-site.yml builds it, from the lockfile. - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: diff --git a/tests/test_campaign.py b/tests/test_campaign.py index 52da1cf43..8af9a2853 100644 --- a/tests/test_campaign.py +++ b/tests/test_campaign.py @@ -900,6 +900,11 @@ class FakeCorePasses(Workspace): @classmethod def setUpClass(cls) -> None: + # These passes prove the cores run sandboxed. Without a working bwrap + # the campaign refuses, and the cause is named here instead of a KeyError. + _prefix, isolation = campaign.core_probe.sandbox_argv([Path(tempfile.gettempdir())]) + if isolation != campaign.core_probe.SANDBOX: + raise unittest.SkipTest(f"no sandbox here ({isolation}): install bubblewrap") TMP.mkdir(parents=True, exist_ok=True) cls.build = Path(tempfile.mkdtemp(dir=TMP)) source = cls.build / "fake.c"