fix: complete target diagnostics and reset inspection

This commit is contained in:
proxyctl coordinator
2026-07-17 10:29:41 +08:00
parent f6c6ead325
commit 0fbaa71e37
14 changed files with 366 additions and 10 deletions
+24
View File
@@ -46,6 +46,30 @@ func TestAvailabilityRequiresDebianMarkerAPTToolAndConfigurationDirectory(t *tes
}
}
func TestDiagnosticChecksCoverCommandSchemaAndAuthorityWithoutMutation(t *testing.T) {
a, _ := newAdapter(t, nil)
checks := a.DiagnosticChecks(context.Background(), compatibleProfile())
assertDiagnosticNames(t, checks, "required command", "configuration schema", "write authority")
if _, err := os.Stat(a.OverlayPath()); !errors.Is(err, os.ErrNotExist) {
t.Fatalf("diagnostics created APT overlay: %v", err)
}
}
func assertDiagnosticNames(t *testing.T, checks []target.Check, names ...string) {
t.Helper()
for _, name := range names {
found := false
for _, check := range checks {
if check.Name == name {
found = true
}
}
if !found {
t.Errorf("diagnostics missing %q: %#v", name, checks)
}
}
}
func TestDescriptionExplainsEnvironmentPersistenceAndPrivilegeBoundary(t *testing.T) {
a, _ := newAdapter(t, nil)
got := a.Description()