Add fleet groups, agent screenshots, deploy guards, and Crucible polish.
This commit is contained in:
@@ -337,8 +337,17 @@ func TestIntegrationAgentCommandOffline(t *testing.T) {
|
||||
router, _, _, _ := newTestRouter(t)
|
||||
rec := serveAuthed(t, router, http.MethodPost, "/api/v1/agents/offline-agent/command",
|
||||
[]byte(`{"action":"pause"}`))
|
||||
if rec.Code != http.StatusBadRequest {
|
||||
t.Fatalf("expected 400 for offline agent, got %d body=%s", rec.Code, rec.Body.String())
|
||||
// Command for a non-connected agent returns 200 with success:false (not a 4xx),
|
||||
// so the caller can inspect the error without tripping HTTP error handling.
|
||||
if rec.Code != http.StatusOK {
|
||||
t.Fatalf("expected 200 for offline agent, got %d body=%s", rec.Code, rec.Body.String())
|
||||
}
|
||||
var body map[string]interface{}
|
||||
if err := json.Unmarshal(rec.Body.Bytes(), &body); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if body["success"] != false {
|
||||
t.Fatalf("expected success=false, got %v", body)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user