Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions internal/commands/vxc/vxc_inputs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,49 @@ func TestParseVRouterConfigBGP(t *testing.T) {
},
expectedError: "importWhitelist must be a number",
},
{
name: "second of two BGP connections wrong type reports index 1, not index 0",
config: map[string]interface{}{
"connectType": "VROUTER",
"interfaces": []interface{}{
map[string]interface{}{
"bgpConnections": []interface{}{
map[string]interface{}{
"peerAsn": 65000.0,
"localIpAddress": "192.168.1.1",
"peerIpAddress": "192.168.1.2",
},
map[string]interface{}{"shutdown": "yes"},
},
},
},
},
expectedError: "shutdown must be a boolean in BGP connection 1 of interface 0",
},
{
name: "third of three BGP connections wrong type reports index 2",
config: map[string]interface{}{
"connectType": "VROUTER",
"interfaces": []interface{}{
map[string]interface{}{
"bgpConnections": []interface{}{
map[string]interface{}{
"peerAsn": 65000.0,
"localIpAddress": "192.168.1.1",
"peerIpAddress": "192.168.1.2",
},
map[string]interface{}{
"peerAsn": 65001.0,
"localIpAddress": "192.168.1.3",
"peerIpAddress": "192.168.1.4",
},
map[string]interface{}{"medIn": "lots"},
},
},
},
},
expectedError: "medIn must be a number in BGP connection 2 of interface 0",
},
}

for _, tt := range tests {
Expand Down
Loading