Skip to content

Commit

Permalink
Merge pull request #4 from treydock/goreport
Browse files Browse the repository at this point in the history
Run gofmt -s
  • Loading branch information
treydock authored Apr 27, 2021
2 parents c45493f + c6941be commit 0a99428
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
8 changes: 4 additions & 4 deletions collectors/hca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import (

var (
hcaDevices = []InfinibandDevice{
InfinibandDevice{Type: "CA", LID: "133", GUID: "0x7cfe9003003b4b96", Rate: (25 * 4 * 125000000), Name: "o0002",
{Type: "CA", LID: "133", GUID: "0x7cfe9003003b4b96", Rate: (25 * 4 * 125000000), Name: "o0002",
Uplinks: map[string]InfinibandUplink{
"1": InfinibandUplink{Type: "SW", LID: "1719", PortNumber: "11", GUID: "0x7cfe9003009ce5b0", Name: "ib-i1l1s01"},
"1": {Type: "SW", LID: "1719", PortNumber: "11", GUID: "0x7cfe9003009ce5b0", Name: "ib-i1l1s01"},
},
},
InfinibandDevice{Type: "CA", LID: "134", GUID: "0x7cfe9003003b4bde", Rate: (25 * 4 * 125000000), Name: "o0001",
{Type: "CA", LID: "134", GUID: "0x7cfe9003003b4bde", Rate: (25 * 4 * 125000000), Name: "o0001",
Uplinks: map[string]InfinibandUplink{
"1": InfinibandUplink{Type: "SW", LID: "1719", PortNumber: "10", GUID: "0x7cfe9003009ce5b0", Name: "ib-i1l1s01"},
"1": {Type: "SW", LID: "1719", PortNumber: "10", GUID: "0x7cfe9003009ce5b0", Name: "ib-i1l1s01"},
},
},
}
Expand Down
28 changes: 14 additions & 14 deletions collectors/ibnetdiscover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,34 +109,34 @@ func TestIbnetdiscoverCollectorTimeout(t *testing.T) {

func TestIbnetdiscoverParse(t *testing.T) {
expectedHCAs := []InfinibandDevice{
InfinibandDevice{Type: "CA", LID: "1432", GUID: "0x506b4b0300cc02a6", Rate: (25 * 4 * 125000000), Name: "p0001",
{Type: "CA", LID: "1432", GUID: "0x506b4b0300cc02a6", Rate: (25 * 4 * 125000000), Name: "p0001",
Uplinks: map[string]InfinibandUplink{
"1": InfinibandUplink{Type: "SW", LID: "2052", PortNumber: "35", GUID: "0x506b4b03005c2740", Name: "ib-i4l1s01"},
"1": {Type: "SW", LID: "2052", PortNumber: "35", GUID: "0x506b4b03005c2740", Name: "ib-i4l1s01"},
},
},
InfinibandDevice{Type: "CA", LID: "133", GUID: "0x7cfe9003003b4b96", Rate: (25 * 4 * 125000000), Name: "o0002",
{Type: "CA", LID: "133", GUID: "0x7cfe9003003b4b96", Rate: (25 * 4 * 125000000), Name: "o0002",
Uplinks: map[string]InfinibandUplink{
"1": InfinibandUplink{Type: "SW", LID: "1719", PortNumber: "11", GUID: "0x7cfe9003009ce5b0", Name: "ib-i1l1s01"},
"1": {Type: "SW", LID: "1719", PortNumber: "11", GUID: "0x7cfe9003009ce5b0", Name: "ib-i1l1s01"},
},
},
InfinibandDevice{Type: "CA", LID: "134", GUID: "0x7cfe9003003b4bde", Rate: (25 * 4 * 125000000), Name: "o0001",
{Type: "CA", LID: "134", GUID: "0x7cfe9003003b4bde", Rate: (25 * 4 * 125000000), Name: "o0001",
Uplinks: map[string]InfinibandUplink{
"1": InfinibandUplink{Type: "SW", LID: "1719", PortNumber: "10", GUID: "0x7cfe9003009ce5b0", Name: "ib-i1l1s01"},
"1": {Type: "SW", LID: "1719", PortNumber: "10", GUID: "0x7cfe9003009ce5b0", Name: "ib-i1l1s01"},
},
},
}

expectSwitches := []InfinibandDevice{
InfinibandDevice{Type: "SW", LID: "2052", GUID: "0x506b4b03005c2740", Rate: (25 * 4 * 125000000), Name: "ib-i4l1s01",
{Type: "SW", LID: "2052", GUID: "0x506b4b03005c2740", Rate: (25 * 4 * 125000000), Name: "ib-i4l1s01",
Uplinks: map[string]InfinibandUplink{
"35": InfinibandUplink{Type: "CA", LID: "1432", PortNumber: "1", GUID: "0x506b4b0300cc02a6", Name: "p0001"},
"35": {Type: "CA", LID: "1432", PortNumber: "1", GUID: "0x506b4b0300cc02a6", Name: "p0001"},
},
},
InfinibandDevice{Type: "SW", LID: "1719", GUID: "0x7cfe9003009ce5b0", Rate: (25 * 4 * 125000000), Name: "ib-i1l1s01",
{Type: "SW", LID: "1719", GUID: "0x7cfe9003009ce5b0", Rate: (25 * 4 * 125000000), Name: "ib-i1l1s01",
Uplinks: map[string]InfinibandUplink{
"1": InfinibandUplink{Type: "SW", LID: "1516", PortNumber: "1", GUID: "0x7cfe900300b07320", Name: "ib-i1l2s01"},
"10": InfinibandUplink{Type: "CA", LID: "134", PortNumber: "1", GUID: "0x7cfe9003003b4bde", Name: "o0001"},
"11": InfinibandUplink{Type: "CA", LID: "133", PortNumber: "1", GUID: "0x7cfe9003003b4b96", Name: "o0002"},
"1": {Type: "SW", LID: "1516", PortNumber: "1", GUID: "0x7cfe900300b07320", Name: "ib-i1l2s01"},
"10": {Type: "CA", LID: "134", PortNumber: "1", GUID: "0x7cfe9003003b4bde", Name: "o0001"},
"11": {Type: "CA", LID: "133", PortNumber: "1", GUID: "0x7cfe9003003b4b96", Name: "o0002"},
},
},
}
Expand Down Expand Up @@ -293,8 +293,8 @@ func TestParseNamesErrors(t *testing.T) {

func TestGetDevicePorts(t *testing.T) {
uplinks := map[string]InfinibandUplink{
"10": InfinibandUplink{Type: "CA", LID: "134", PortNumber: "1", GUID: "0x7cfe9003003b4bde", Name: "o0001"},
"11": InfinibandUplink{Type: "CA", LID: "133", PortNumber: "1", GUID: "0x7cfe9003003b4b96", Name: "o0002"},
"10": {Type: "CA", LID: "134", PortNumber: "1", GUID: "0x7cfe9003003b4bde", Name: "o0001"},
"11": {Type: "CA", LID: "133", PortNumber: "1", GUID: "0x7cfe9003003b4b96", Name: "o0002"},
}
expected := []string{"10", "11"}
ports := getDevicePorts(uplinks)
Expand Down
6 changes: 3 additions & 3 deletions collectors/perfquery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ PortRcvPkts:.....................32262508468`

func TestPerfqueryParse(t *testing.T) {
expected := []PerfQueryCounters{
PerfQueryCounters{
{
device: perfqueryTestDevice,
PortSelect: "1",
PortXmitData: 36298026860928,
Expand Down Expand Up @@ -72,7 +72,7 @@ func TestPerfqueryParse(t *testing.T) {
PortVLMappingErrors: math.NaN(),
PortLoopingErrors: math.NaN(),
},
PerfQueryCounters{
{
device: perfqueryTestDevice,
PortSelect: "2",
PortXmitData: 26006570014026,
Expand Down Expand Up @@ -121,7 +121,7 @@ func TestPerfqueryParse(t *testing.T) {

func TestPerfqueryParseRcvErrorDetails(t *testing.T) {
expected := []PerfQueryCounters{
PerfQueryCounters{
{
device: perfqueryTestDevice,
PortSelect: "1",
PortXmitData: math.NaN(),
Expand Down
12 changes: 6 additions & 6 deletions collectors/switch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ import (

var (
switchDevices = []InfinibandDevice{
InfinibandDevice{Type: "SW", LID: "2052", GUID: "0x506b4b03005c2740", Rate: (25 * 4 * 125000000), Name: "ib-i4l1s01",
{Type: "SW", LID: "2052", GUID: "0x506b4b03005c2740", Rate: (25 * 4 * 125000000), Name: "ib-i4l1s01",
Uplinks: map[string]InfinibandUplink{
"35": InfinibandUplink{Type: "CA", LID: "1432", PortNumber: "1", GUID: "0x506b4b0300cc02a6", Name: "p0001"},
"35": {Type: "CA", LID: "1432", PortNumber: "1", GUID: "0x506b4b0300cc02a6", Name: "p0001"},
},
},
InfinibandDevice{Type: "SW", LID: "1719", GUID: "0x7cfe9003009ce5b0", Rate: (25 * 4 * 125000000), Name: "ib-i1l1s01",
{Type: "SW", LID: "1719", GUID: "0x7cfe9003009ce5b0", Rate: (25 * 4 * 125000000), Name: "ib-i1l1s01",
Uplinks: map[string]InfinibandUplink{
"1": InfinibandUplink{Type: "SW", LID: "1516", PortNumber: "1", GUID: "0x7cfe900300b07320", Name: "ib-i1l2s01"},
"10": InfinibandUplink{Type: "CA", LID: "134", PortNumber: "1", GUID: "0x7cfe9003003b4bde", Name: "o0001"},
"11": InfinibandUplink{Type: "CA", LID: "133", PortNumber: "1", GUID: "0x7cfe9003003b4b96", Name: "o0002"},
"1": {Type: "SW", LID: "1516", PortNumber: "1", GUID: "0x7cfe900300b07320", Name: "ib-i1l2s01"},
"10": {Type: "CA", LID: "134", PortNumber: "1", GUID: "0x7cfe9003003b4bde", Name: "o0001"},
"11": {Type: "CA", LID: "133", PortNumber: "1", GUID: "0x7cfe9003003b4b96", Name: "o0002"},
},
},
}
Expand Down

0 comments on commit 0a99428

Please sign in to comment.