Skip to content

Commit

Permalink
updated new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Girish5tri committed Oct 10, 2024
1 parent 85c758b commit c0aeb5a
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@
replace_as: true
set: true
set: true
- neighbor_address: 192.0.2.2
remote_as: 200
local_as:
number: 501
no_prepend:
replace_as: true
set: true
set: true
timers:
keepalive: 100
holdtime: 200
Expand Down
10 changes: 10 additions & 0 deletions tests/integration/targets/ios_bgp_global/vars/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ merged:
- bgp asnotation dot
- neighbor 192.0.2.1 remote-as 500.65083
- neighbor 192.0.2.1 local-as 501.65083 no-prepend replace-as
- neighbor 192.0.2.2 remote-as 200
- neighbor 192.0.2.2 local-as 501 no-prepend replace-as

after:
as_number: "65000"
Expand All @@ -38,6 +40,14 @@ merged:
set: true
neighbor_address: "192.0.2.1"
remote_as: "500.65083"
- local_as:
no_prepend:
replace_as: true
set: true
number: "501"
set: true
neighbor_address: "192.0.2.2"
remote_as: "200"
- description: merge neighbor
neighbor_address: 198.0.2.1
remote_as: "100"
Expand Down
43 changes: 43 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 @@ -880,6 +880,49 @@ def test_ios_bgp_global_asdot_merged(self):
result = self.execute_module(changed=True)
self.assertEqual(sorted(result["commands"]), sorted(commands))

def test_ios_bgp_global_int_merged(self):
set_module_args(
dict(
config=dict(
as_number="65000",
bgp=dict(
asnotation=True,
log_neighbor_changes=True,
graceful_shutdown=dict(
neighbors=dict(time=50),
local_preference=100,
community="100",
),
),
neighbors=[
dict(
neighbor_address="192.0.2.1",
remote_as="500.65083",
local_as=dict(
number="501",
no_prepend=dict(
replace_as=True,
set=True,
),
set=True,
),
),
],
),
state="merged",
),
)
commands = [
"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 no-prepend replace-as",
]
result = self.execute_module(changed=True)
self.assertEqual(sorted(result["commands"]), sorted(commands))

def test_ios_bgp_global_asdot_rendered(self):
set_module_args(
dict(
Expand Down

0 comments on commit c0aeb5a

Please sign in to comment.