INNER CODE UNIT · Go
createSyntheticVM
openai/tart · integration-tests/clone_lock_darwin_test.go:191
func createSyntheticVM(t *testing.T, home, name, mac string) string {
t.Helper()
directory := filepath.Join(home, "vms", name)
if err := os.MkdirAll(directory, 0700); err != nil {
t.Fatal(err)
}
config, err := json.Marshal(map[string]any{
"version": 1, "os": "linux", "arch": runtime.GOARCH,
"cpuCountMin": 4, "cpuCount": 4,
"memorySizeMin": 4294967296, "memorySize": 4294967296,
"macAddress": mac, "diskFormat": "raw",
"display": map[string]int{"width": 1024, "height": 768},
})
if err != nil {
t.Fatal(err)
}
for filename, contents := range map[string][]byte{
"config.json": config, "disk.img": make([]byte, 4096), "nvram.bin": {},