Skip to content

Commit

Permalink
fix arp acl issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Girish5tri committed Nov 10, 2024
1 parent a71f345 commit 4429ad3
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/module_utils/network/ios/facts/acls/acls.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, module):
def get_acl_data(self, connection):
# Removed the show access-list
# Removed the show running-config | include ip(v6)* access-list|remark
return connection.get("show running-config | section access-list")
return connection.get("show running-config | section 'ip[v6]* access-list'")

def get_acl_names(self, connection):
# this information is required to scoop out the access lists which has no aces
Expand Down
56 changes: 56 additions & 0 deletions tests/unit/modules/network/ios/test_ios_acls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2303,3 +2303,59 @@ def test_ios_acls_overridden_remarks_complex(self):
"no ip access-list extended test_acl",
]
self.assertEqual(sorted(result["commands"]), sorted(commands))

def test_ios_acls_with_arp_acl(self):
self.execute_show_command.return_value = dedent(
"""\
ip access-list standard 10
10 permit 192.168.1.0 0.0.0.255
arp access-list arp-test
permit ip any mac any
ip access-list extended ext_acl
10 permit ip 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255
"""
)
self.execute_show_command_name.return_value = dedent(
"""\
Standard IP access list 10
Extended IP access list ext_acl
"""
)

set_module_args(
dict(
config=[
dict(
afi="ipv4",
acls=[
dict(
name="test_ext_acl",
acl_type="extended",
aces=[
dict(
grant="permit",
protocol="ip",
source=dict(
address="192.0.2.0",
wildcard_bits="0.0.0.255"
),
destination=dict(
address="192.0.3.0",
wildcard_bits="0.0.0.255"
)
)
]
)
]
)
],
state="merged"
)
)

result = self.execute_module(changed=True)
commands = [
"ip access-list extended test_ext_acl",
"permit ip 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255"
]
self.assertEqual(sorted(result["commands"]), sorted(commands))

0 comments on commit 4429ad3

Please sign in to comment.