Skip to content

Commit

Permalink
Fix type of PortLinkStatus constants
Browse files Browse the repository at this point in the history
Closes issue/318
  • Loading branch information
gnuoy committed Apr 29, 2024
1 parent d43ccc5 commit 924145d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions redfish/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,16 @@ type PortLinkStatus string

const (
// LinkUpPortLinkStatus This link on this interface is up.
LinkUpPortLinkStatus LinkStatus = "LinkUp"
LinkUpPortLinkStatus PortLinkStatus = "LinkUp"
// StartingPortLinkStatus This link on this interface is starting. A physical link has been established, but the port
// is not able to transfer data.
StartingPortLinkStatus LinkStatus = "Starting"
StartingPortLinkStatus PortLinkStatus = "Starting"
// TrainingPortLinkStatus This physical link on this interface is training.
TrainingPortLinkStatus LinkStatus = "Training"
TrainingPortLinkStatus PortLinkStatus = "Training"
// LinkDownPortLinkStatus The link on this interface is down.
LinkDownPortLinkStatus LinkStatus = "LinkDown"
LinkDownPortLinkStatus PortLinkStatus = "LinkDown"
// NoLinkPortLinkStatus No physical link detected on this interface.
NoLinkPortLinkStatus LinkStatus = "NoLink"
NoLinkPortLinkStatus PortLinkStatus = "NoLink"
)

type MediumType string
Expand Down
2 changes: 2 additions & 0 deletions redfish/port_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var portBody = `{
"State": "Enabled",
"Health": "OK"
},
"LinkStatus": "LinkUp",
"PortId": "1",
"PortProtocol": "SAS",
"PortType": "BidirectionalPort",
Expand Down Expand Up @@ -50,4 +51,5 @@ func TestPort(t *testing.T) {
assertEquals(t, "BidirectionalPort", fmt.Sprint(result.PortType))
assertEquals(t, "SAS", fmt.Sprint(result.PortProtocol))
assertEquals(t, "48", fmt.Sprint(result.CurrentSpeedGbps))
assertEquals(t, "LinkUp", fmt.Sprint(result.LinkStatus))
}

0 comments on commit 924145d

Please sign in to comment.