fix: finish progressive Target detection
This commit is contained in:
@@ -80,6 +80,24 @@ func TestShellDiagnosticsRejectSymlinkedPathsWithoutTouchingVictim(t *testing.T)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDetectClassifiesMalformedRecoveryMetadataAsFailure(t *testing.T) {
|
||||
a := newAdapter(t, "/bin/bash", nil)
|
||||
if err := os.MkdirAll(filepath.Dir(a.RecoveryPath()), 0o700); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(a.RecoveryPath(), []byte("{malformed"), 0o600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
detection := a.Detect(context.Background(), activeProfile())
|
||||
if detection.Err == nil || detection.Inspection.State != target.Drifted {
|
||||
t.Fatalf("detection = %#v, want failed Drifted inspection", detection)
|
||||
}
|
||||
if got := a.Inspect(context.Background(), activeProfile()); got.State != target.Drifted {
|
||||
t.Fatalf("maintenance inspection = %#v, want established Drifted semantics", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestShellAvailabilitySupportsOnlyBashAndZsh(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
shell string
|
||||
|
||||
Reference in New Issue
Block a user