Skip to content

[quality] test: unit coverage for files/os/sysupdate.d transfers (60-uki, 70-k0s) + release-artifact name contract - #52

Closed
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-sysupdate-transfers
Closed

kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-sysupdate-transfers

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

New file: tests/unit/test_sysupdate_transfers.py (23 cases). No production files touched.

Claimed ground (exact)

  • Files under test: files/os/sysupdate.d/60-uki.transfer, files/os/sysupdate.d/70-k0s.transfer, files/os/sysupdate.d/50-root.transfer (source-side only), files/k0s/sysext/extension-release.k0s
  • Cross-referenced (read-only, no assertions on changed logic): artifact-name lines under elements/**/*.bst
  • New test file only: tests/unit/test_sysupdate_transfers.py

Gap this closes

tests/unit/test_repart_layout.py pins only the target side of 50-root.transfer against the installer repart config. 60-uki.transfer and 70-k0s.transfer had zero coverage, and no test pinned the source MatchPattern of any transfer to an artifact the build actually emits. Renaming a release asset in elements/oci/*.bst breaks OTA silently: systemd-sysupdate finds no candidate and reports the system up to date forever.

What is asserted

  • every transfer parses and carries [Transfer]/[Source]/[Target]; filenames are NN-lowercase.transfer with unique ordering prefixes
  • every [Source] is Type=url-file pointing at this repo's own https release feed (origin-drift guard)
  • every source MatchPattern corresponds to an artifact some element emits: bluefin-server-ddi-<v>.raw.zst, bluefin-server-<v>.efi, k0s-<v>.raw.zst
  • UKI: Type=file, Path=/efi/EFI/Linux, .efi extension preserved, source/target names agree
  • k0s sysext: Type=regular-file, Path=/var/lib/extensions, Mode=0644, stable CurrentSymlink=k0s.raw, and target is the decompressed form of the downloaded .zst
  • extension-release.k0s filename and NAME= match the merged image name k0s, and ID=_any (a mismatch makes systemd-sysext reject the merge at boot)

Verification

  • python3 -m pytest tests/unit -q100 passed, 1 xfailed (23 new)
  • mutation check: renaming CurrentSymlink and the k0s asset pattern fails 4 of the new tests, then passes again on revert

Disjointness

Only other open PR on this repo is #27 (elements/installer/installer-stack.bst, elements/oci/bluefin-server-installer.bst, docs/skills/ddi-installer.md) — no overlap with files/os/sysupdate.d/, files/k0s/sysext/, or tests/. The element artifact-name lookup here scans elements/** generically rather than pinning bluefin-server-installer.bst line numbers, so #27 cannot conflict.


Filed by quality agent (hold-gated mode). Human review required — do not merge, do not remove hold.

— hive: agent=quality backend=copilot model=claude-opus-5

Adds tests/unit/test_sysupdate_transfers.py: 23 cases covering
60-uki.transfer and 70-k0s.transfer, which had zero coverage, plus the
source-side artifact-name contract for all three transfers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
@kubestellar-hive kubestellar-hive Bot added the hold Work is intentionally paused. label Sep 7, 2026
@castrojo

castrojo commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Merged into main via #59. Thanks!

@castrojo castrojo closed this Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Work is intentionally paused.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant