INNER CODE UNIT · Go
TestClonePreservesRunningDestination
openai/tart · integration-tests/clone_lock_darwin_test.go:20
func TestClonePreservesRunningDestination(t *testing.T) {
home := t.TempDir()
t.Setenv("TART_HOME", home)
t.Setenv("TART_NO_AUTO_PRUNE", "1")
createSyntheticVM(t, home, "source", "92:81:b5:ab:39:37")
destination := createSyntheticVM(t, home, "destination", "92:81:b5:ab:39:38")
if _, stderr, err := tart.Tart(t, "clone", "source", "new-destination"); err != nil {
t.Fatalf("clone to new destination: %v: %s", err, stderr)
}
config := filepath.Join(destination, "config.json")
original, err := os.ReadFile(config)
if err != nil {
t.Fatal(err)
}
held, err := os.OpenFile(config, os.O_RDWR, 0)
if err != nil {
t.Fatal(err)