test(iso): verify bootloader rewriter handles AL8 inputs (#121 phase 3)#126
Merged
SupremeCommanderHedgehog merged 1 commit intoJun 20, 2026
Merged
Conversation
Phase 3 of #121 (AlmaLinux 8 support). Adds parallel AL8 bootloader fixtures + tests to verify src/ks_gen/iso/bootloader.py rewrites AL8 ISO bootloader configs identically to AL9. The rewriter's regex anchors pin isolinux/grub keywords, not AlmaLinux version strings: isolinux: ^label\s+\S+, ^[ \t]*menu\s+default\s*$, ^timeout\s+\d+\s*$ grub: ^menuentry\s+, ^set\s+timeout=\d+\s*$, ^set\s+default=.*$ So AL8 (isolinux 6.x + grub2) configs flow through unchanged — same output shape as AL9, only the embedded volid/version strings differ (operator-supplied via --volid). Files: - tests/fixtures/alma8-bootloader/{isolinux,grub}.cfg: synthetic AL8.10-shaped fixtures (AlmaLinux-8-10-x86_64-dvd volid + "AlmaLinux 8.10" display strings, otherwise byte-for-byte mirror of the AL9 fixtures). - tests/test_bootloader.py: 4 new tests covering happy-path (isolinux + grub, syrupy-snapshotted) and idempotency (isolinux + grub). Custom-volid case not duplicated for AL8 — the existing AL9 custom-volid test covers the volid plumbing through to the entry, distro-independently. - tests/__snapshots__/test_bootloader.ambr: +80 lines, pure additions for the AL8 happy-path snapshots. ALMA8 volid lands correctly in all three inst.{stage2,repo,ks}=hd:LABEL=ALMA8 knobs, and the unattended-entry idempotency marker is present. No code changes to bootloader.py or _menu.py. Real-world validation against a freshly-mounted AL8.10 DVD ISO is phase 4 install testing. Spec: docs/superpowers/specs/2026-06-20-alma8-phase-3-iso-bootloader-verification-design.md Refs #121.
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.
Summary
Phase 3 of #121 (AlmaLinux 8 support). Verification-only: confirms
src/ks_gen/iso/bootloader.pyrewrites AL8 ISO bootloader configs identically to AL9 — no rewriter code changes needed.The rewriter's regex anchors pin isolinux/grub keywords, not AlmaLinux version strings:
rewrite_isolinuxentry-presence check^label\s+\S+rewrite_isolinuxmenu-default cleanup^[ \t]*menu\s+default\s*$menu defaultdirective (0-or-1 hits handled)rewrite_isolinuxtimeout edit^timeout\s+\d+\s*$timeout NNNdirective (prepended if absent)rewrite_grubentry-presence check^menuentry\s+rewrite_grubtimeout edit^set\s+timeout=\d+\s*$set timeout=NNN(prepended if absent)rewrite_grubdefault-entry edit^set\s+default=.*$set default=...(prepended if absent)AL8 ISO bootloader configs use the same isolinux 6.x + grub2 syntax as AL9. Only the embedded volid labels (
AlmaLinux-8-10-x86_64-dvd) and version display strings (AlmaLinux 8.10) differ — both flow through the rewriter byte-for-byte. Phase 3 ships test coverage that pins this contract; no rewriter changes are required.Spec:
docs/superpowers/specs/2026-06-20-alma8-phase-3-iso-bootloader-verification-design.mdTest plan
tests/fixtures/alma8-bootloader/isolinux.cfgandgrub.cfg— synthetic AL8.10-shaped configs mirroring the AL9 fixtures' structure with AlmaLinux-8-10-x86_64-dvd volid and "AlmaLinux 8.10" version strings.test_bootloader.py):test_rewrite_isolinux_happy_path_al8(snapshot)—volid="ALMA8", syrupy snapshot.test_rewrite_grub_happy_path_al8(snapshot)—volid="ALMA8", syrupy snapshot.test_rewrite_isolinux_al8_idempotent— second call no-ops via theIDEMPOTENCY_MARKERguard.test_rewrite_grub_al8_idempotent— same.tests/__snapshots__/test_bootloader.ambr): pure additions (+80 lines), no AL9 snapshot changes. ALMA8 volid lands correctly in all threeinst.{stage2,repo,ks}=hd:LABEL=ALMA8knobs, idempotency markers present.test_rewrite_{isolinux,grub}_custom_volid) covers the volid plumbing through to the entry — that's distro-independent.ruff check && ruff format --check && mypy && pytest -q— all four green (933 passed = 929 from end of v0.26.0 + 4 new).BE707B220C995478.Conventional commit prefix
This PR uses
test(iso):rather thanfeat(iso):because no production code changes — the rewriter is verified to already work on AL8. release-please will not bump the version on this merge; the next functional change will roll this verification work into its release notes.What's next
Phase 4 of #121 —
ks-gen verifyend-to-end against a real AL8.10 host. Requires:inst.ks=hd:LABEL=ALMA8.oscapagainstssg-almalinux8-ds.xml.ks-gen verifyreconcile against the host.Real-world validation surfaces any quirks the synthetic fixtures miss.
Related: #81 (ubuntu2404 port story, complete), #118 (AppArmor extension for ubuntu2404 container_host).