fix: complete target diagnostics and reset inspection
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user