Skip to content

Commit

Permalink
added new parameter MediaType to VirtualMediaConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksim Kovshov committed Nov 29, 2023
1 parent 22a60a7 commit f55395b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions redfish/virtualmedia.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ func (virtualmedia *VirtualMedia) Update() error {
readWriteFields := []string{
"Image",
"Inserted",
"MediaType",
"Password",
"TransferMethod",
"TransferProtocolType",
Expand Down Expand Up @@ -230,6 +231,7 @@ func (virtualmedia *VirtualMedia) InsertMedia(image string, inserted, writeProte
type VirtualMediaConfig struct {
Image string
Inserted bool `json:",omitempty"`
MediaType string `json:",omitempty"`
Password string `json:",omitempty"`
TransferMethod string `json:",omitempty"`
TransferProtocolType string `json:",omitempty"`
Expand Down
5 changes: 4 additions & 1 deletion redfish/virtualmedia_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ func TestVirtualMediaUpdate(t *testing.T) {

testClient := &common.TestClient{}
result.SetClient(testClient)

result.UserName = "Fred"
result.WriteProtected = false
err = result.Update()
Expand Down Expand Up @@ -206,6 +205,7 @@ func TestVirtualMediaInsertConfig(t *testing.T) {
virtualMediaConfig := VirtualMediaConfig{
Image: "https://example.com/image",
Inserted: true,
MediaType: "CD",
Password: "test1234",
UserName: "root",
WriteProtected: true,
Expand All @@ -224,6 +224,9 @@ func TestVirtualMediaInsertConfig(t *testing.T) {
if !strings.Contains(calls[0].Payload, "Inserted:true") {
t.Errorf("Unexpected InsertMedia Inserted payload: %s", calls[0].Payload)
}
if !strings.Contains(calls[0].Payload, "MediaType:CD") {
t.Errorf("Unexpected InsertMedia Inserted payload: %s", calls[0].Payload)
}
if !strings.Contains(calls[0].Payload, "Password:test1234") {
t.Errorf("Unexpected InsertMedia Image payload: %s", calls[0].Payload)
}
Expand Down

0 comments on commit f55395b

Please sign in to comment.