Skip to content

Commit

Permalink
added a unit test to test_ios_bgp_global.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Girish5tri authored Oct 9, 2024
1 parent c05cc8d commit 4fc0d7d
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions tests/unit/modules/network/ios/test_ios_bgp_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,3 +790,50 @@ def test_ios_bgp_global_action_states_no_default(self):
commands = ["router bgp 6500", "no neighbor 192.0.2.2 shutdown"]
result = self.execute_module(changed=True)
self.assertEqual(sorted(result["commands"]), sorted(commands))


def test_ios_bgp_global_asdot_parsed(self):
set_module_args(
dict(
running_config=dedent(
"""\
router bgp 65000
bgp asnotation dot
bgp log-neighbor-changes
bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
neighbor 192.0.2.1 remote-as 500.65083
neighbor 192.0.2.1 local-as 501.65083 no-prepend replace-as
""",
),
state="parsed",
),
)
result = self.execute_module(changed=False)
parsed_list = {
"as_number": "65000",
"bgp": {
"asnotation": True,
"log_neighbor_changes": True,
"default": {'ipv4_unicast': True, 'route_target': {'filter': True}},
"graceful_shutdown": {
"neighbors": {"time": 50},
"local_preference": 100,
"community": "100"
}
},
"neighbors": [
{
"neighbor_address": "192.0.2.1",
"remote_as": "500.65083",
"local_as": {
"number": "501.65083",
"no_prepend": {
"replace_as": True,
"set": True
},
"set": True
}
}
]
}
self.assertEqual(parsed_list, result["parsed"])

0 comments on commit 4fc0d7d

Please sign in to comment.