Skip to content

Commit

Permalink
repair tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ulrichSchreiner committed May 7, 2024
1 parent dd1a625 commit bdd2755
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions cmd/switch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ ID PARTITION RACK OS STATUS LAST SYNC
2 1 rack-1 🐢 ● 0s ago
`),
wantWideTable: pointer.Pointer(`
ID PARTITION RACK OS METALCORE IP MODE LAST SYNC SYNC DURATION LAST SYNC ERROR
ID PARTITION RACK OS METALCORE IP MODE LAST SYNC SYNC DURATION LAST ERROR
1 1 rack-1 SONiC (1) 1.2.3 1.2.3.4 operational 0s ago 1s 5m ago: error
2 1 rack-1 Cumulus (2) operational 0s ago 1s 5m ago: error
`),
Expand Down Expand Up @@ -196,7 +196,7 @@ ID PARTITION RACK OS STATUS LAST SYNC
1 1 rack-1 🦔 ● 0s ago
`),
wantWideTable: pointer.Pointer(`
ID PARTITION RACK OS METALCORE IP MODE LAST SYNC SYNC DURATION LAST SYNC ERROR
ID PARTITION RACK OS METALCORE IP MODE LAST SYNC SYNC DURATION LAST ERROR
1 1 rack-1 SONiC (1) 1.2.3 1.2.3.4 operational 0s ago 1s 5m ago: error
`),
template: pointer.Pointer("{{ .id }} {{ .name }}"),
Expand Down Expand Up @@ -321,18 +321,18 @@ func Test_SwitchCmd_ConnectedMachinesResult(t *testing.T) {
},
},
wantTable: pointer.Pointer(`
ID NIC NAME IDENTIFIER PARTITION RACK SIZE PRODUCT SERIAL
1 1 rack-1
└─╴machine-1 a-name a-mac 1 rack-1 n1-medium-x86 123
2 1 rack-1
└─╴machine-1 a-name a-mac 1 rack-1 n1-medium-x86 123
`),
wantWideTable: pointer.Pointer(`
ID NIC NAME IDENTIFIER PARTITION RACK SIZE HOSTNAME PRODUCT SERIAL
ID NIC NAME IDENTIFIER PARTITION RACK SIZE PRODUCT SERIAL
1 1 rack-1
└─╴machine-1 a-name a-mac 1 rack-1 n1-medium-x86 alloc-1 123
└─╴machine-1 a-name a-mac 1 rack-1 n1-medium-x86 123
2 1 rack-1
└─╴machine-1 ❓ a-name a-mac 1 rack-1 n1-medium-x86 alloc-1 123
└─╴machine-1 a-name (DOWN) a-mac 1 rack-1 n1-medium-x86 123
`),
wantWideTable: pointer.Pointer(`
ID NIC NAME IDENTIFIER PARTITION RACK SIZE HOSTNAME PRODUCT SERIAL
1 1 rack-1
└─╴machine-1 ❓ a-name a-mac 1 rack-1 n1-medium-x86 alloc-1 123
2 1 rack-1
└─╴machine-1 ❓ a-name (DOWN) a-mac 1 rack-1 n1-medium-x86 alloc-1 123
`),
template: pointer.Pointer(`{{ $machines := .machines }}{{ range .switches }}{{ $switch := . }}{{ range .connections }}{{ $switch.id }},{{ $switch.rack_id }},{{ .nic.name }},{{ .machine_id }},{{ (index $machines .machine_id).ipmi.fru.product_serial }}{{ printf "\n" }}{{ end }}{{ end }}`),
wantTemplate: pointer.Pointer(`
Expand Down Expand Up @@ -366,7 +366,7 @@ ID PARTITION RACK OS STATUS LAST SYNC
1 1 rack-1 🦔 ● 0s ago
`),
wantWideTable: pointer.Pointer(`
ID PARTITION RACK OS METALCORE IP MODE LAST SYNC SYNC DURATION LAST SYNC ERROR
ID PARTITION RACK OS METALCORE IP MODE LAST SYNC SYNC DURATION LAST ERROR
1 1 rack-1 SONiC (1) 1.2.3 1.2.3.4 operational 0s ago 1s 5m ago: error
`),
template: pointer.Pointer("{{ .id }} {{ .name }}"),
Expand Down

0 comments on commit bdd2755

Please sign in to comment.