Skip to content

[quality] test: BATS coverage for build_scripts/overrides/nvidia/20-nvidia.sh + overrides/x86_64/20-zfs.sh - #561

Open
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-nvidia-zfs-overrides
Open

[quality] test: BATS coverage for build_scripts/overrides/nvidia/20-nvidia.sh + overrides/x86_64/20-zfs.sh#561
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-nvidia-zfs-overrides

Conversation

@kubestellar-hive

Copy link
Copy Markdown

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

build_scripts/overrides/nvidia/20-nvidia.sh (128 lines) and
build_scripts/overrides/x86_64/20-zfs.sh (38 lines) had zero unit
coverage. Both run inside the image build with set -euo pipefail and
decide which akmods RPMs get installed against the qualified kernel;
a regression there ships a broken initramfs.

Adds tests/unit/nvidia_test.bats (27 tests) and tests/unit/zfs_test.bats
(14 tests) using the existing sandbox pattern from packages_test.bats:
absolute paths sed-rewritten into BATS_TEST_TMPDIR, stub rpm/dnf/dracut/
depmod/systemctl/semodule/nvidia-ctk on PATH, invocations asserted from
log files.

Covered behaviour:
- nvidia: kmod RPM filtering on 'kernel-uname-r = $QUALIFIED_KERNEL',
  empty-match fail-closed, non-kmod RPM passthrough, ublue-os maxdepth 1,
  FEDORA_VERSION resolution (default 43 / FEDORA_AKMODS_VERSION / .fc NVR),
  repofrompath + gpgcheck pinning, 3:$KMOD_VERSION driver pinning,
  kmod/driver version-mismatch fail-closed, nouveau blacklist and bootc
  kargs contents, dracut omit_drivers -> force_drivers rewrite with
  i915/amdgpu injection, missing nvidia-modeset.conf tolerance on SBSA,
  initramfs rebuild flags, nvidia-ctk no-cgroups patch.
- zfs: empty-RPM-set fail-closed, python3-pyzfs split out of the main
  transaction and installed with --skip-broken, maxdepth/non-rpm
  filtering, depmod on KERNEL_VRA, modules-load.d autoload, initramfs
  rebuild flags, last-kernel selection.

No production code changed.

Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>

@hanthor hanthor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New tests/unit/nvidia_test.bats (26 tests) + zfs_test.bats (13 tests), test-only. Not vacuous — sandboxes the real scripts with stubbed rpm/dnf/dracut/etc. and asserts concrete side effects (exact dnf args, kmod-kernel matching, generated file contents, specific failure messages). CI (Lint, bats) green.


Generated by Claude Code

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