diff --git a/server/service/integration_enterprise_test.go b/server/service/integration_enterprise_test.go index 790191e94871..4b4516679991 100644 --- a/server/service/integration_enterprise_test.go +++ b/server/service/integration_enterprise_test.go @@ -5279,7 +5279,7 @@ func (s *integrationEnterpriseTestSuite) TestRunHostScript() { // attempt to run an empty script res := s.Do("POST", "/api/latest/fleet/scripts/run", fleet.HostScriptRequestPayload{HostID: host.ID, ScriptContents: ""}, http.StatusUnprocessableEntity) errMsg := extractServerErrorText(res.Body) - require.Contains(t, errMsg, "Script contents must not be empty.") + require.Contains(t, errMsg, "Validation Failed: One of 'script_id', 'script_contents', or 'script_name' is required.") // attempt to run an overly long script res = s.Do("POST", "/api/latest/fleet/scripts/run", fleet.HostScriptRequestPayload{HostID: host.ID, ScriptContents: strings.Repeat("a", fleet.UnsavedScriptMaxRuneLen+1)}, http.StatusUnprocessableEntity) diff --git a/server/service/scripts_test.go b/server/service/scripts_test.go index ffb390988229..aecf67dea446 100644 --- a/server/service/scripts_test.go +++ b/server/service/scripts_test.go @@ -304,7 +304,7 @@ func TestHostRunScript(t *testing.T) { script string wantErr string }{ - {"empty script", "", "Script contents must not be empty."}, + {"empty script", "", "One of 'script_id', 'script_contents', or 'script_name' is required."}, {"overly long script", strings.Repeat("a", fleet.UnsavedScriptMaxRuneLen+1), "Script is too large."}, {"large script", strings.Repeat("a", fleet.UnsavedScriptMaxRuneLen), ""}, {"invalid utf8", "\xff\xfa", "Wrong data format."},