diff --git a/cmd/mesh-host/move_out_test.go b/cmd/mesh-host/move_out_test.go index 579c936..53dc445 100644 --- a/cmd/mesh-host/move_out_test.go +++ b/cmd/mesh-host/move_out_test.go @@ -43,9 +43,16 @@ func TestAMoveOutDirectoryKeepsOnlyWhatItKnows(t *testing.T) { t.Fatal(err) } t.Cleanup(apply.UseAccountsFileForTest(passwd)) - was := builtFor + // Independent of the machine: an arch host with a pacman on PATH that answers and holds nothing, as + // TestReplay233 puts one there (it answers with an error); nothing here declares a package. + bin := t.TempDir() + if err := os.WriteFile(filepath.Join(bin, "pacman"), []byte("#!/bin/sh\nexit 0\n"), 0o755); err != nil { + t.Fatal(err) + } + t.Setenv("PATH", bin+string(os.PathListSeparator)+os.Getenv("PATH")) + wasBuilt := builtFor builtFor = "arch" - t.Cleanup(func() { builtFor = was }) + t.Cleanup(func() { builtFor = wasBuilt }) stray := filepath.Join(dir, "id_stray") if err := os.WriteFile(stray, []byte("somebody else's key"), 0o600); err != nil {