fix: finish progressive Target detection

This commit is contained in:
proxyctl coordinator
2026-07-17 21:25:43 +08:00
parent ad651402fd
commit 8348fa3ac8
17 changed files with 672 additions and 221 deletions
@@ -219,6 +219,24 @@ func TestDiagnosticServiceControlAuthorityUsesInjectedEUIDWithoutMutation(t *tes
}
}
func TestDetectClassifiesMalformedDaemonConfigurationAsFailure(t *testing.T) {
a, _, daemonPath, _, _ := fixture(t)
if err := os.MkdirAll(filepath.Dir(daemonPath), 0o700); err != nil {
t.Fatal(err)
}
if err := os.WriteFile(daemonPath, []byte(`{"proxies":[]}`), 0o600); err != nil {
t.Fatal(err)
}
detection := a.Detect(context.Background(), activeProfile())
if detection.Err == nil || detection.Inspection.State != target.Disabled {
t.Fatalf("detection = %#v, want failed Disabled inspection", detection)
}
if got := a.Inspect(context.Background(), activeProfile()); got.State != target.Disabled {
t.Fatalf("maintenance inspection = %#v, want established Disabled semantics", got)
}
}
func TestDiagnosticsAndEnableRejectMalformedDaemonProxyTypesWithoutMutation(t *testing.T) {
for _, document := range []string{
`[]`,