Skip to content

Commit

Permalink
add MediaType to VirtualMedia (#274)
Browse files Browse the repository at this point in the history
Co-authored-by: Maksim Kovshov <m.kovshov@yadro.com>
  • Loading branch information
Muyk33rus and Maksim Kovshov authored Sep 15, 2023
1 parent 108becb commit 9c6205f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions redfish/virtualmedia.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ type VirtualMedia struct {
// MediaTypes shall be the supported media
// types for this connection.
MediaTypes []VirtualMediaType
// Indicates which MediaTypes is used
MediaType string
// Password shall represent the password to access the
// Image parameter-specified URI. The value shall be null in responses.
Password string
Expand Down
4 changes: 4 additions & 0 deletions redfish/virtualmedia_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var vmBody = `{
"Image": "https://example.com/mygoldimage.iso",
"ImageName": "mygoldimage.iso",
"Inserted": false,
"MediaType": "USBStick",
"MediaTypes": [
"Floppy",
"USBStick"
Expand Down Expand Up @@ -97,6 +98,9 @@ func TestVirtualMedia(t *testing.T) {
if result.SupportsMediaInsert == false {
t.Error("Expected SupportsMediaInsert to be true since target is set")
}
if result.MediaType != "USBStick" {
t.Errorf("Received invalid MediaType: %s", result.MediaType)
}
}

// TestVirtualMediaUpdate tests the Update call.
Expand Down

0 comments on commit 9c6205f

Please sign in to comment.