Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CumulusNclu: be robust to bad interface neighbor #6471

Merged
merged 1 commit into from
Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ public void enterBn_interface(Bn_interfaceContext ctx) {
String.format(
"Cannot create BGP neighbor for illegal abstract interface name '%s' in: %s",
_currentBgpNeighborName, getFullText(ctx)));
_currentBgpNeighbor = new BgpPeerGroupNeighbor("dummy");
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,12 @@ public void testBgpPeerGroup() throws IOException {
assertThat(i3, hasRemoteAs(17L));
}

@Test
public void testBgpInvalidInterfaceNeighbor() throws IOException {
CumulusNcluConfiguration c = parseVendorConfig("cumulus_nclu_bgp_invalid_interface_neighbor");
assertThat(c.getBgpProcess().getDefaultVrf().getNeighbors(), anEmptyMap());
}

@Test
public void testBgpIpNeighbor() throws IOException {
Configuration c = parseConfig("cumulus_nclu_bgp_ip_neighbor");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
net del all
#
net add hostname cumulus_nclu_bgp_invalid_interface_neighbor
#
net add bgp autonomous-system 65500
net add bgp neighbor NOT_AN_IFACE_NAME interface remote-as 5
#
net commit