Run the test suite as root in CI and mark the install tests as needing root - #194
Conversation
…g root Every case in mport_install_test performs a real install into a scratch root, and installing chowns each extracted file to root:wheel. The CI job ran kyua as the unprivileged VM user, so all six cases failed with "Unable to set permissions on file" on every run since the program was added; only the atf install step used sudo. Run kyua under sudo so the install tests are actually exercised, and declare require.user=root on each case so an unprivileged local run reports them as skipped rather than failed. Bump MPORT_VERSION to 2.8.2; 2.8.1 has already been released. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VqVYKWFCX58Cb5NiGHHjzo AI-Assisted-By: Claude Fable 5.1
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR aligns test execution with the install tests’ root requirement by running Kyua as root in CI and declaring root prerequisites on all six cases, while bumping the library version to 2.8.2. Sequence diagram for root-required install tests in CIsequenceDiagram
participant CI as CI runner
participant Kyua as kyua
participant Tests as mport_install_test
participant ScratchRoot as Scratch install root
CI->>Kyua: sudo kyua test -k tests/Kyuafile
Kyua->>Tests: run install test cases as root
Tests->>ScratchRoot: install files and set root:wheel ownership
ScratchRoot-->>Tests: installation succeeds
Tests-->>Kyua: test results
Flow diagram for non-root handling of install testsflowchart LR
User[Unprivileged user] --> Kyua[kyua test]
Kyua --> Requirement{require.user = root}
Requirement -->|root unavailable| Skipped[Tests skipped]
Requirement -->|running as root| Executed[Install tests execute]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Claude finished @laffer1's task in 55s —— View job Review: Run the test suite as root in CI (#194)
Verdict: LGTM. Small, well-scoped fix; verified each claim against the diff and repo history.
No correctness, memory-safety, SQL-injection, or path-traversal concerns — this PR only adds test metadata annotations and a CI/version constant change, touching no runtime logic. |
Problem
The CI job has never passed since
mport_install_testwas added in July. Every case there performs a real install into a scratch root, and installing chowns each extracted file to root:wheel (bundle_read_install_pkg.c:960). Inci.ymlonly the atf install step ran undersudo;kyua testran as the unprivileged VM user, so all six cases failed with "Unable to set permissions on file". The latest run onmainbefore #190 shows the same five failures and nothing else.Change
ci.yml: runkyua testundersudo, so the install tests are actually exercised in CI.tests/mport_install_test.c: declarerequire.user=rooton each case, so an unprivileged local run reports them as skipped rather than failed.libmport/mport_private.h: bumpMPORT_VERSIONto 2.8.2, since 2.8.1 is already released.Verified
nobody, running the built program under kyua from a copy in/tmp: all six are reportedskipped: Requires root privileges.mport_install_test.c:115.🤖 Generated with Claude Code
https://claude.ai/code/session_01VqVYKWFCX58Cb5NiGHHjzo
Summary by Sourcery
Run privileged installation tests correctly in CI and identify their root requirement while advancing the mport version.
Bug Fixes:
Enhancements:
CI:
Chores: