Skip to content

Commit

Permalink
Use a real "kind of" real task JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
ofaurax committed Aug 10, 2023
1 parent 6fc9af2 commit 5a6cf26
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion providers/redfish/firmware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,28 @@ func Test_runRequestWithPayload(t *testing.T) {

// referenced in main_test.go
func openbmcStatus(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write([]byte("{\"Id\":\"15\", \"TaskState\": \"TestState\", \"TaskStatus\": \"TestStatus\"}"))
mytask := `{
"@odata.id": "/redfish/v1/TaskService/Tasks/15",
"@odata.type": "#Task.v1_4_3.Task",
"Id": "15",
"Messages": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The task with Id '15' has started.",
"MessageArgs": [
"15"
],
"MessageId": "TaskEvent.1.0.3.TaskStarted",
"MessageSeverity": "OK",
"Resolution": "None."
}
],
"Name": "Task 15",
"TaskState": "TestState",
"TaskStatus": "TestStatus"
}
`
_, _ = w.Write([]byte(mytask))
}

func Test_FirmwareInstall2(t *testing.T) {
Expand All @@ -180,3 +201,4 @@ func Test_FirmwareInstall2(t *testing.T) {
t.Fatal("Wrong test state:", state)
}
}

0 comments on commit 5a6cf26

Please sign in to comment.