[quality] test: unit coverage for scripts/build-iso.sh named-arg wrapper — tests/test_build_iso_args.py - #148
Open
kubestellar-hive[bot] wants to merge 1 commit into
Open
Conversation
scripts/build-iso.sh translates the named-flag interface used by .github/workflows/test-plain-install.yml into the positional interface of live/src/build-iso.sh. The two interfaces order their arguments differently (--squashfs/--boot-tar vs <boot-tar> <squashfs>), so a slip in the wrapper silently swaps the rootfs squashfs and the boot tar and yields an ISO that builds cleanly and then fails to boot in the QEMU E2E lane. Adds tests/test_build_iso_args.py: 13 tests running the wrapper against a recording stub delegate in a temporary scripts/ + live/src/ tree, covering positional translation, flag-order independence, repeated flags, values with spaces, exit-status propagation, required-flag enforcement, missing flag values, unknown and stray positional arguments, and a contract test that test-plain-install.yml passes exactly the flag set the wrapper accepts. No production code changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
5 tasks
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.
Test Improvement
Adds
tests/test_build_iso_args.py— the first behavioural coverage forscripts/build-iso.sh.Exact ground claimed by this PR
scripts/build-iso.sh(33-line named-flag wrapper) — argument parsing loop, required-flag guard, and theexecdelegation tolive/src/build-iso.sh.tests/test_build_iso_args.py(only file added or changed)..github/workflows/test-plain-install.ymlcall site,live/src/build-iso.shexistence check.Why it matters
scripts/build-iso.shtranslates the named-flag interface used by.github/workflows/test-plain-install.yml:into the positional interface of
live/src/build-iso.sh:The two interfaces order boot tar and rootfs squashfs differently. A slip in the wrapper swaps them, which still produces an ISO — one that only fails hours later in the QEMU plain-install E2E lane, with no unit signal.
What the 13 tests cover
TestArgumentTranslation<boot-tar> <squashfs> <output-iso>orderexecs, so a failed build must not report success)TestArgumentValidation--squashfs,--boot-tar,--outputis individually required (3 subtests)--oci-image) are rejectedTestWorkflowContractbash -ntest-plain-install.ymlpasses exactly the flag set the wrapper acceptsMethod
Each test copies the real wrapper into a temporary
<root>/scripts+<root>/live/srctree whose delegate is a recording stub, because the wrapper resolves its delegate as"$(dirname "$0")/../live/src/build-iso.sh". The reallive/src/build-iso.sh(needs xorriso, mtools, root) is never executed — the suite stays fast and hermetic and needs no new CI dependencies.Verification
pytest tests/test_build_iso_args.py→ 13 passed, 9 subtests passed"$BOOT_TAR" "$SQUASHFS"in the wrapper fails 6 testspytest tests/→ 116 passed, 2 skipped, 1 pre-existing unrelated failure (TestSkillCatalogUpToDate, already tracked as [quality] TestSkillCatalogUpToDate fails every day after index.json is written — generated_at uses date.today() #137)Disjointness with open PRs
scripts/{build-live-squashfs,iso-sd-boot,luks-install-qemu,plain-install-qemu}.sh,justfile,tests/test_variant_config.py— notscripts/build-iso.sh.scripts/generate_skill_index.py; [quality] test: unit coverage for scripts/fisherman-install.sh #138 coversscripts/fisherman-install.sh.scripts/verify-image-signature.sh; [architect] refactor: make live/src the single source of the live ISO tree — delete unreferenced dakota/src/ #140 deletesdakota/src/and editstests/test_live_build_invariants.py/tests/test_luks_unlock.py.tests/test_build_iso_args.pyorscripts/build-iso.sh.No production code changes.
Filed by quality agent (hold-gated mode). Human review required — do not merge automatically.
— hive: agent=quality backend=copilot model=claude-opus-5