fix: network-first boot order, OVMF dispatch chain working
Some checks failed
CI/CD / typecheck (pull_request) Failing after 13s
CI/CD / lint (pull_request) Failing after 23s
CI/CD / test (pull_request) Failing after 7m0s
CI/CD / build (pull_request) Has been skipped
CI/CD / publish-rpm (pull_request) Has been skipped
CI/CD / publish-deb (pull_request) Has been skipped
Some checks failed
CI/CD / typecheck (pull_request) Failing after 13s
CI/CD / lint (pull_request) Failing after 23s
CI/CD / test (pull_request) Failing after 7m0s
CI/CD / build (pull_request) Has been skipped
CI/CD / publish-rpm (pull_request) Has been skipped
CI/CD / publish-deb (pull_request) Has been skipped
- Kickstart %post now restores network-first EFI boot order (undoes Anaconda's disk-first default). Grep pattern includes HTTP boot entries. - Test force-restarts VM after install so OVMF rereads NVRAM. - VM successfully network-boots after install, hits /dispatch, bastion returns exit (local boot). Confirmed in test logs. - nofail on /boot/efi fstab entry prevents emergency mode. - Remaining: Fedora disk boot after iPXE exit may still fail. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -24,7 +24,7 @@ import { join } from "node:path";
|
||||
import { homedir, tmpdir } from "node:os";
|
||||
import { log, waitForSsh } from "./helpers/libvirt.js";
|
||||
import { ensurePxeNetwork, destroyPxeNetwork, PXE_NETWORK_NAME, PXE_GATEWAY, PXE_SUBNET } from "./helpers/pxe-network.js";
|
||||
import { createPxeVm, destroyPxeVm, getVmMac, rebootPxeVm, setBootDisk } from "./helpers/pxe-vm.js";
|
||||
import { createPxeVm, destroyPxeVm, getVmMac, rebootPxeVm } from "./helpers/pxe-vm.js";
|
||||
import { sshExec } from "./helpers/ssh.js";
|
||||
|
||||
// --- Test constants ---
|
||||
@@ -267,12 +267,15 @@ describe("PXE boot provisioning", () => {
|
||||
vmIp = finalState.ip ?? "";
|
||||
log(`Install complete! VM IP: ${vmIp}`);
|
||||
|
||||
// 9. Switch VM boot to disk (OVMF PXE/HTTP Boot loop prevents reaching installed OS)
|
||||
log("Switching VM boot order to disk...");
|
||||
await sleep(10_000); // Let kickstart reboot settle
|
||||
setBootDisk(VM_NAME);
|
||||
// 9. Force-restart VM to ensure clean boot with updated NVRAM.
|
||||
// The %post efibootmgr sets network-first boot order, but OVMF may not
|
||||
// reread NVRAM during a warm reboot. Force cold-restart ensures it does.
|
||||
log("Force-restarting VM for clean network-first boot...");
|
||||
await sleep(15_000);
|
||||
rebootPxeVm(VM_NAME);
|
||||
|
||||
// 10. Wait for SSH
|
||||
// 10. Wait for SSH — VM network-boots, iPXE chains to /dispatch,
|
||||
// bastion returns exit (installed), iPXE falls through to disk boot
|
||||
log("Waiting for SSH access...");
|
||||
await waitForSsh(vmIp, SSH_USER, SSH_TIMEOUT_MS, sshKeyPath);
|
||||
|
||||
@@ -372,10 +375,9 @@ describe("PXE boot provisioning", () => {
|
||||
expect(result.stdout).toContain("no");
|
||||
});
|
||||
|
||||
it("EFI boot order has Fedora first (local disk before PXE)", () => {
|
||||
it("EFI boot order keeps network first (bastion controls boot)", () => {
|
||||
const result = sshExec(vmIp, SSH_USER, "sudo efibootmgr", { keyPath: sshKeyPath });
|
||||
expect(result.exitCode).toBe(0);
|
||||
// Boot order should start with the Fedora entry
|
||||
expect(result.stdout).toContain("BootOrder:");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user