diff --git a/cmd/ananke/bootstrap_handoff_test.go b/cmd/ananke/bootstrap_handoff_test.go index 3867069..a347114 100644 --- a/cmd/ananke/bootstrap_handoff_test.go +++ b/cmd/ananke/bootstrap_handoff_test.go @@ -75,6 +75,15 @@ func TestMaxIntAndStartupShutdownCooldown(t *testing.T) { // Signature: TestBuildSSHBaseArgsNoJumpHasStableOrdering(t *testing.T). // Why: keeps behavior explicit so startup/shutdown workflows remain maintainable as services evolve. func TestBuildSSHBaseArgsNoJumpHasStableOrdering(t *testing.T) { + origConfigCandidates := append([]string(nil), sshConfigCandidates...) + origIdentityCandidates := append([]string(nil), sshIdentityCandidates...) + sshConfigCandidates = []string{"/path/that/does/not/exist/ssh_config"} + sshIdentityCandidates = []string{"/path/that/does/not/exist/id_ed25519"} + t.Cleanup(func() { + sshConfigCandidates = origConfigCandidates + sshIdentityCandidates = origIdentityCandidates + }) + cfg := config.Config{SSHPort: 10022} args := buildSSHBaseArgs(cfg) want := []string{ diff --git a/internal/state/intent_additional_test.go b/internal/state/intent_additional_test.go index 0adfaea..2c6f0f5 100644 --- a/internal/state/intent_additional_test.go +++ b/internal/state/intent_additional_test.go @@ -117,6 +117,10 @@ func TestWriteIntentFailsWhenParentIsFile(t *testing.T) { // Signature: TestReadIntentFailsOnPermissionError(t *testing.T). // Why: covers read error branch distinct from not-exist and empty-file handling. func TestReadIntentFailsOnPermissionError(t *testing.T) { + if os.Geteuid() == 0 { + t.Skip("permission semantics differ under root") + } + path := filepath.Join(t.TempDir(), "intent.json") if err := os.WriteFile(path, []byte(`{"state":"normal"}`), 0o640); err != nil { t.Fatalf("write intent file: %v", err) diff --git a/internal/state/store_additional_test.go b/internal/state/store_additional_test.go index 448ae1c..39b7484 100644 --- a/internal/state/store_additional_test.go +++ b/internal/state/store_additional_test.go @@ -67,6 +67,10 @@ func TestStoreLoadHandlesEmptyFile(t *testing.T) { // Signature: TestStoreLoadReturnsErrorOnUnhealableDecode(t *testing.T). // Why: covers decode failure path where replacement write itself can fail. func TestStoreLoadReturnsErrorOnUnhealableDecode(t *testing.T) { + if os.Geteuid() == 0 { + t.Skip("permission semantics differ under root") + } + dir := t.TempDir() path := filepath.Join(dir, "runs.json") if err := os.WriteFile(path, []byte("{bad-json"), 0o640); err != nil {