Skip to content

Commit

Permalink
improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
roverflow committed Jul 14, 2023
1 parent 0fc390c commit 1690813
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 8 deletions.
1 change: 1 addition & 0 deletions plugins/module_utils/network/ios/config/ospfv2/ospfv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def __init__(self, module):
"shutdown",
"summary_address",
"timers.throttle.lsa",
"timers.pacing",
"timers.throttle.spf",
"traffic_share",
"ttl_security",
Expand Down
4 changes: 3 additions & 1 deletion plugins/modules/ios_ospfv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
This module configures and manages the Open Shortest Path First (OSPF)
version 2 on IOS platforms.
version_added: 1.0.0
author: Vinay M (@roverflow)
author:
- Sumit Jaiswal (@justjais)
- Vinay M (@roverflow)
notes:
- Tested against Cisco IOSXE Version 17.3 on CML.
- This module works with connection C(network_cli).
Expand Down
50 changes: 43 additions & 7 deletions tests/unit/modules/network/ios/test_ios_ospfv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ def test_ios_ospfv2_overridden(self):
"summary_address": {
"address": "172.16.1.0",
"mask": "0.0.0.255",
"not_advertise": True,
"nssa_only": True,
"tag": 12,
},
Expand Down Expand Up @@ -569,7 +568,8 @@ def test_ios_ospfv2_overridden(self):
"queue-depth update 30",
"router-id router1",
"shutdown",
"summary-address 172.16.1.0 0.0.0.255 not-advertise",
"summary-address 172.16.1.0 0.0.0.255 nssa-only tag 12",
"timers pacing flood 25",
"traffic-share min across-interfaces",
"ttl-security all-interfaces hops 12",
"area 5 authentication message-digest",
Expand Down Expand Up @@ -902,8 +902,6 @@ def test_ios_ospfv2_rendered(self):
"timers": {
"lsa": 12,
"pacing": {
"flood": 25,
"lsa_group": 15,
"retransmission": 30,
},
"throttle": {
Expand Down Expand Up @@ -981,11 +979,13 @@ def test_ios_ospfv2_rendered(self):
"router-id router1",
"shutdown",
"summary-address 172.16.1.0 0.0.0.255 not-advertise",
"timers pacing retransmission 30",
"topology base",
"traffic-share min across-interfaces",
"ttl-security all-interfaces hops 12",
]
result = self.execute_module(changed=False)
self.maxDiff = None
self.assertEqual(sorted(result["rendered"]), commands)

def test_ios_ospfv2_overridden_2(self):
Expand All @@ -1007,7 +1007,6 @@ def test_ios_ospfv2_overridden_2(self):
distribute-list 10 out
distribute-list 123 in
domain-id 192.0.3.1
max-metric router-lsa on-startup 100
area 10 capability default-exclusion
passive-interface default
no passive-interface GigabitEthernet0/1
Expand All @@ -1029,7 +1028,20 @@ def test_ios_ospfv2_overridden_2(self):
{"name": "123", "direction": "in"},
],
},
"domain_id": {"ip_address": {"address": "192.0.3.1"}},
"queue_depth": {
"hello": {
"unlimited": True,
},
"update": {
"unlimited": True,
},
},
"domain_id": {"null": True},
"timers" : {
"pacing" : {
"lsa_group" : 25,
}
},
"max_metric": {"router_lsa": True, "on_startup": {"time": 100}},
"areas": [{"area_id": "10", "capability": True}],
"passive_interfaces": {
Expand All @@ -1051,7 +1063,22 @@ def test_ios_ospfv2_overridden_2(self):
],
},
"domain_id": {"ip_address": {"address": "192.0.3.1"}},
"max_metric": {"router_lsa": True, "on_startup": {"time": 100}},
"nsf": {
"ietf": {
"strict_lsa_checking": True,
},
},
"mpls": {
"ldp": {
"sync": True,
},
},
"timers" : {
"pacing" : {
"flood" : 25,
}
},
"max_metric": {"router_lsa": True, "on_startup": {"wait_for_bgp": True}},
"areas": [{"area_id": "11", "capability": True}],
"passive_interfaces": {
"default": True,
Expand All @@ -1068,13 +1095,22 @@ def test_ios_ospfv2_overridden_2(self):
)

result = self.execute_module(changed=True)
print(result["commands"])
commands = [
"router ospf 200 vrf blue",
"domain-id null",
'queue-depth hello unlimited',
'queue-depth update unlimited',
"timers pacing lsa-group 25",
"no area 10 filter-list prefix test_prefix_in in",
"distribute-list 110 out",
"no distribute-list 10 out",
"router ospf 210 vrf green",
"auto-cost reference-bandwidth 5",
'max-metric router-lsa on-startup wait-for-bgp',
'mpls ldp sync',
'nsf ietf helper strict-lsa-checking',
"timers pacing flood 25",
"area 11 capability default-exclusion",
"no area 10 capability default-exclusion",
"distribute-list 5120 out",
Expand Down

0 comments on commit 1690813

Please sign in to comment.