host: systemctl show call fixtures read SubState too
Follow-up to 44e9fbbe (final review F2): Show now asks for SubState, so the two tests that pin the exact systemctl argv expect it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+2
−2
internal/host/agent_test.go+2 −2
CI passed — run details
diff --git a/internal/host/agent_test.go b/internal/host/agent_test.go| index fcdd5ee2a..ff39be92e 100644 |
| --- a/internal/host/agent_test.go |
| +++ b/internal/host/agent_test.go |
| @@ -725,7 +725,7 @@ func TestRootRestartRouteCarriesTheNamedUnitArm(t *testing.T) { |
| // The checked arm reads the unit first (show), finds no binding it can |
| // verify from the fake's empty answer, and falls back to the plain |
| // try-restart: the argv this test pins is the last call. |
| - if want := "show console.service -p ActiveState -p InvocationID -p MainPID -p NRestarts -p ExecStart\ntry-restart console.service\n"; string(got) != want { |
| + if want := "show console.service -p ActiveState -p SubState -p InvocationID -p MainPID -p NRestarts -p ExecStart\ntry-restart console.service\n"; string(got) != want { |
| t.Fatalf("systemctl calls = %q, want %q", got, want) |
| } |
| } |
| @@ -974,7 +974,7 @@ func TestAdoptPassStartsTheNamedUnitAgainAfterAFailedRestart(t *testing.T) { |
| } |
| // The checked arm's show comes first (its empty fake answer verifies no |
| // binding, so the restart falls back to the plain try-restart). |
| - if want := "show console.service -p ActiveState -p InvocationID -p MainPID -p NRestarts -p ExecStart\ntry-restart console.service\nstart console.service\n"; string(got) != want { |
| + if want := "show console.service -p ActiveState -p SubState -p InvocationID -p MainPID -p NRestarts -p ExecStart\ntry-restart console.service\nstart console.service\n"; string(got) != want { |
| t.Fatalf("systemctl calls = %q, want %q — the rolled-back unit must be STARTED (try-restart would no-op on it)", got, want) |
| } |
| if v, err := release.LiveVersion(optDir, "console.test"); err != nil || v != "old" { |