feat: nvme disk on m6

This commit is contained in:
Harivansh Rathi 2026-04-10 04:04:08 +00:00
parent 54a4c423a6
commit eb9d2a76df
9 changed files with 240 additions and 22 deletions

View file

@ -758,6 +758,7 @@ func testConfig(root string) appconfig.Config {
SnapshotsDir: filepath.Join(root, "snapshots"),
RuntimeDir: filepath.Join(root, "runtime"),
DiskCloneMode: appconfig.DiskCloneModeCopy,
DriveIOEngine: firecracker.DriveIOEngineSync,
SocketPath: filepath.Join(root, "firecracker-host.sock"),
EgressInterface: "eth0",
FirecrackerBinaryPath: "/usr/bin/firecracker",
@ -765,6 +766,22 @@ func testConfig(root string) appconfig.Config {
}
}
func TestGuestKernelArgsDisablesPCIByDefault(t *testing.T) {
t.Parallel()
if got := guestKernelArgs(false); !strings.Contains(got, "pci=off") {
t.Fatalf("guestKernelArgs(false) = %q, want pci=off", got)
}
}
func TestGuestKernelArgsRemovesPCIOffWhenPCIEnabled(t *testing.T) {
t.Parallel()
if got := guestKernelArgs(true); strings.Contains(got, "pci=off") {
t.Fatalf("guestKernelArgs(true) = %q, want no pci=off", got)
}
}
func stubGuestSSHPublicKeyReader(hostDaemon *Daemon) {
hostDaemon.readGuestSSHPublicKey = func(context.Context, string) (string, error) {
return "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO0j1AyW0mQm9a1G2rY0R4fP2G5+4Qx2V3FJ9P2mA6N3", nil