mirror of
https://github.com/getcompanion-ai/computer-host.git
synced 2026-04-15 09:01:12 +00:00
feat: nvme disk on m6
This commit is contained in:
parent
54a4c423a6
commit
eb9d2a76df
9 changed files with 240 additions and 22 deletions
|
|
@ -26,7 +26,7 @@ func TestLaunchJailedFirecrackerPassesDaemonAndLoggingFlags(t *testing.T) {
|
|||
t.Fatalf("create log dir: %v", err)
|
||||
}
|
||||
|
||||
if _, err := launchJailedFirecracker(paths, "vm-1", "/usr/bin/firecracker", jailerPath); err != nil {
|
||||
if _, err := launchJailedFirecracker(paths, "vm-1", "/usr/bin/firecracker", jailerPath, false); err != nil {
|
||||
t.Fatalf("launch jailed firecracker: %v", err)
|
||||
}
|
||||
|
||||
|
|
@ -45,6 +45,33 @@ func TestLaunchJailedFirecrackerPassesDaemonAndLoggingFlags(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestLaunchJailedFirecrackerPassesEnablePCIWhenConfigured(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
argsPath := filepath.Join(root, "args.txt")
|
||||
jailerPath := filepath.Join(root, "fake-jailer.sh")
|
||||
script := "#!/bin/sh\nprintf '%s\n' \"$@\" > " + shellQuote(argsPath) + "\n"
|
||||
if err := os.WriteFile(jailerPath, []byte(script), 0o755); err != nil {
|
||||
t.Fatalf("write fake jailer: %v", err)
|
||||
}
|
||||
|
||||
paths, err := buildMachinePaths(root, "vm-1", "/usr/bin/firecracker")
|
||||
if err != nil {
|
||||
t.Fatalf("build machine paths: %v", err)
|
||||
}
|
||||
if err := os.MkdirAll(paths.LogDir, 0o755); err != nil {
|
||||
t.Fatalf("create log dir: %v", err)
|
||||
}
|
||||
|
||||
if _, err := launchJailedFirecracker(paths, "vm-1", "/usr/bin/firecracker", jailerPath, true); err != nil {
|
||||
t.Fatalf("launch jailed firecracker: %v", err)
|
||||
}
|
||||
|
||||
args := waitForFileContents(t, argsPath)
|
||||
if !containsLine(args, "--enable-pci") {
|
||||
t.Fatalf("missing launch argument %q in %v", "--enable-pci", args)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWaitForPIDFileReadsPID(t *testing.T) {
|
||||
pidFilePath := filepath.Join(t.TempDir(), "firecracker.pid")
|
||||
if err := os.WriteFile(pidFilePath, []byte("4321\n"), 0o644); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue