Add fleet groups, agent screenshots, deploy guards, and Crucible polish.
This commit is contained in:
@@ -588,8 +588,15 @@ func TestFleetPostAgentCommandErrors(t *testing.T) {
|
||||
req := httptest.NewRequest(http.MethodPost, "/agents/offline-agent/command",
|
||||
strings.NewReader(`{"action":"pause"}`))
|
||||
fleetChiRoute(http.MethodPost, "/agents/{id}/command", fh.PostAgentCommand).ServeHTTP(rec, req)
|
||||
if rec.Code != http.StatusBadRequest {
|
||||
t.Fatalf("expected 400, got %d body %s", rec.Code, rec.Body.String())
|
||||
if rec.Code != http.StatusOK {
|
||||
t.Fatalf("expected 200, 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 || body["error"] != "agent not connected" {
|
||||
t.Fatalf("unexpected body: %v", body)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user