Skip to content

Tier-2: install-to-disk + boot-from-disk validation (server edition)#190

Merged
mdheller merged 2 commits into
mainfrom
install-to-disk-test
Jun 23, 2026
Merged

Tier-2: install-to-disk + boot-from-disk validation (server edition)#190
mdheller merged 2 commits into
mainfrom
install-to-disk-test

Conversation

@mdheller

Copy link
Copy Markdown
Contributor

Proves the real clean-disk installer works end to end — not just that an edition config boots (the existing edition-*-boot tests already cover that). This closes the Tier-2 boot-validation gap.

What

  • tests/install/server-install.nix — two-phase nixosTest (the upstream nixpkgs installer-test pattern):
    1. an installation-environment VM runs the actual scripts/install-image.sh against a blank /dev/vda;
    2. the same disk is rebooted as a useBootLoader target and asserted to reach multi-user.target on its own systemd-boot ESP.
    • Installs a prebuilt system toplevel offline (closure seeded read-only via extraDependencies) — no in-VM network build, so it's lighter and more deterministic than upstream's rebuild-in-VM approach. Server edition = smallest closure.
    • Asserts: GPT layout + EFI/nixos labels, systemd-bootx64.efi on the ESP, hostname/sourceos user/sshd active, no display-manager (headless).
  • scripts/install-image.sh — adds the modes the test (and unattended/automated installs) need, with interactive behavior unchanged when unset:
    • --assume-yes / SOURCEOS_ASSUME_YES — skip the typed confirmation + final reboot prompt
    • --system <toplevel> / SOURCEOS_SYSTEM — install a prebuilt system instead of composing+building a flake
  • flake.nixchecks.x86_64-linux.edition-server-install (skip stub on other systems).
  • image-tests.ymlopt-in run_install job (heavy: full install + 2 boots) so it never gates ordinary PRs.

Validation

  • Installer arg parser unit-tested; install-image.sh shellcheck-clean (0.11.0).
  • The full nixosTest evaluates to a build derivation locally (nix eval …edition-server-install.drvPath).
  • The actual KVM run executes in CI via workflow_dispatchrun_install: true. Once it's confirmed green I'll promote it to a required check.

Next Tier-2 item (separate PR): event-driven build status (replace GCS polling with the EventEnvelope stream).

mdheller added 2 commits June 22, 2026 18:25
New Tier-2 boot validation: prove the actual clean-disk installer works end to
end, not just that an edition config boots (edition-*-boot already cover that).

tests/install/server-install.nix — two-phase nixosTest (the nixpkgs installer
pattern): an installation-environment VM runs the REAL scripts/install-image.sh
against a blank /dev/vda, then the same disk is rebooted as a useBootLoader
'target' and asserted to reach multi-user.target on its own systemd-boot ESP
(server edition; smallest closure). Installs a PREBUILT system toplevel offline
(closure seeded read-only via extraDependencies) so the test does no network
build — lighter + more deterministic than rebuilding in-VM. Asserts: GPT layout +
EFI/nixos labels, systemd-bootx64.efi on the ESP, hostname/user/sshd, headless.

scripts/install-image.sh — add the modes the test (and unattended installs) need:
  --assume-yes / SOURCEOS_ASSUME_YES   skip the typed confirmation + final reboot
  --system <toplevel> / SOURCEOS_SYSTEM install a prebuilt system (no flake build)
Refactored arg parsing into a flag loop; interactive behavior unchanged when
neither is set. shellcheck-clean.

flake.nix — checks.x86_64-linux.edition-server-install (skip stub elsewhere).
image-tests.yml — opt-in run_install job (heavy: full install + 2 boots), so it
never gates ordinary PRs. Promote to required once a CI dispatch confirms green.

Validated locally: arg parser unit-tested, installer shellcheck-clean, the full
nixosTest evaluates to a build derivation (KVM run happens in CI via dispatch).
First KVM run failed: the installer VM couldn't mount /sysroot because its root
disk /dev/vdb (an emptyDiskImage) was never formatted. Mirror the nixpkgs
installer-test approach — autoFormat under systemd initrd, mke2fs in
postDeviceCommands under the classic initrd. Bumped vdb to 2 GiB.
@mdheller mdheller merged commit 0728deb into main Jun 23, 2026
12 of 13 checks passed
@mdheller mdheller deleted the install-to-disk-test branch June 23, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant