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

IOS-XR: fix and test v6 and v4 acls fighting on interfaces #7827

Merged
merged 2 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -4139,13 +4139,11 @@ public void exitIf_ipv6_access_group(If_ipv6_access_groupContext ctx) {
CiscoXrStructureUsage usage = null;
if (ctx.INGRESS() != null) {
for (Interface currentInterface : _currentInterfaces) {
currentInterface.setIncomingFilter(name);
usage = INTERFACE_IPV6_ACCESS_GROUP_INGRESS;
}
} else {
assert ctx.EGRESS() != null;
for (Interface currentInterface : _currentInterfaces) {
currentInterface.setOutgoingFilter(name);
usage = INTERFACE_IPV6_ACCESS_GROUP_EGRESS;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,16 @@ private static void assertRoutingPolicyPermitsRoute(
return builder.build();
}

@Test
public void testInterfaceAclExtraction() {
CiscoXrConfiguration c = parseVendorConfig("interface-acl");

assertThat(c.getInterfaces(), hasKey("Bundle-Ether1"));
org.batfish.representation.cisco_xr.Interface be1 = c.getInterfaces().get("Bundle-Ether1");
assertThat(be1.getIncomingFilter(), equalTo("acl-in"));
assertThat(be1.getOutgoingFilter(), equalTo("acl-out"));
}

@Test
public void testAclExtraction() {
CiscoXrConfiguration c = parseVendorConfig("acl");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
!RANCID-CONTENT-TYPE: cisco-xr
!
hostname interface-acl
!
ipv4 access-list acl-in
ipv4 access-list acl-out
!
ipv6 access-list acl6-in
ipv6 access-list acl6-out
!
interface Bundle-Ether1
ipv4 access-group acl-in ingress
ipv4 access-group acl-out egress
ipv6 access-group acl6-in ingress
ipv6 access-group acl6-out egress
!