-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #165 from cherifimehdi/master
Add verify_eigrp_interfaces_timers API to verify.py ios/iosxe eigrp protocol
- Loading branch information
Showing
4 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...kg/changelog/changelog_add_verify_eigrp_interfaces_timers_apis_202413051436.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-------------------------------------------------------------------------------- | ||
New | ||
-------------------------------------------------------------------------------- | ||
* IOSXE | ||
* Added verify_eigrp_interfaces_timers to verify.py: | ||
* New API supporting IPv4 and IPv6 to verify EIGRP interfaces timers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
...is/tests/iosxe/eigrp/verify/verify_eigrp_interfaces_timers/mock_data/iosxe/mock_data.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
configure: | ||
commands: | ||
end: | ||
new_state: execute | ||
line console 0: | ||
new_state: configure_line | ||
no logging console: '' | ||
prompt: R1(config)# | ||
configure_line: | ||
commands: | ||
end: | ||
new_state: execute | ||
exec-timeout 0: '' | ||
prompt: R1(config-line)# | ||
connect: | ||
commands: | ||
? '' | ||
: new_state: execute | ||
preface: 'Trying mock_device ... | ||
Connected to mock_device. | ||
Escape character is ''^]''.' | ||
prompt: '' | ||
execute: | ||
commands: | ||
config term: | ||
new_state: configure | ||
config-transaction: | ||
new_state: configure | ||
show ip eigrp interfaces detail: | ||
response: | ||
- "EIGRP-IPv4 Interfaces for AS(1)\r\n Xmit Queue\ | ||
\ PeerQ Mean Pacing Time Multicast Pending\r\nInterface \ | ||
\ Peers Un/Reliable Un/Reliable SRTT Un/Reliable Flow Timer\ | ||
\ Routes\r\nFa0/0 1 0/0 0/0 60\ | ||
\ 0/0 50 0\r\n Hello-interval is 5, Hold-time is\ | ||
\ 15\r\n Split-horizon is enabled\r\n Next xmit serial <none>\r\n Packetized\ | ||
\ sent/expedited: 1/0\r\n Hello's sent/expedited: 74/2\r\n Un/reliable mcasts:\ | ||
\ 0/1 Un/reliable ucasts: 1/2\r\n Mcast exceptions: 0 CR packets: 0 ACKs\ | ||
\ suppressed: 0\r\n Retransmissions sent: 1 Out-of-sequence rcvd: 0\r\n\ | ||
\ Topology-ids on interface - 0 \r\n Authentication mode is not set\r\n\ | ||
EIGRP-IPv4 Interfaces for AS(2)\r\n Xmit Queue\ | ||
\ PeerQ Mean Pacing Time Multicast Pending\r\nInterface \ | ||
\ Peers Un/Reliable Un/Reliable SRTT Un/Reliable Flow Timer\ | ||
\ Routes\r\nFa1/0 1 0/0 0/0 164\ | ||
\ 0/0 50 0\r\n Hello-interval is 5, Hold-time is\ | ||
\ 15\r\n Split-horizon is enabled\r\n Next xmit serial <none>\r\n Packetized\ | ||
\ sent/expedited: 1/0\r\n Hello's sent/expedited: 75/2\r\n Un/reliable mcasts:\ | ||
\ 0/1 Un/reliable ucasts: 1/2\r\n Mcast exceptions: 0 CR packets: 0 ACKs\ | ||
\ suppressed: 0\r\n Retransmissions sent: 1 Out-of-sequence rcvd: 1\r\n\ | ||
\ Topology-ids on interface - 0 \r\n Authentication mode is not set" | ||
response_type: circular | ||
show version: '' | ||
show version | include operating mode: '' | ||
term length 0: '' | ||
term width 0: '' | ||
prompt: R1# |
35 changes: 35 additions & 0 deletions
35
...xe/eigrp/verify/verify_eigrp_interfaces_timers/test_api_verify_eigrp_interfaces_timers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import os | ||
import unittest | ||
from pyats.topology import loader | ||
from genie.libs.sdk.apis.iosxe.eigrp.verify import verify_eigrp_interfaces_timers | ||
|
||
|
||
class TestVerifyEigrpInterfacesTimers(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(self): | ||
testbed = f""" | ||
devices: | ||
R1: | ||
connections: | ||
defaults: | ||
class: unicon.Unicon | ||
a: | ||
command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect | ||
protocol: unknown | ||
os: iosxe | ||
platform: iosxe | ||
type: iosxe | ||
""" | ||
self.testbed = loader.load(testbed) | ||
self.device = self.testbed.devices['R1'] | ||
self.device.connect( | ||
learn_hostname=True, | ||
init_config_commands=[], | ||
init_exec_commands=[] | ||
) | ||
|
||
def test_verify_eigrp_interfaces_timers(self): | ||
result = verify_eigrp_interfaces_timers(self.device, {'FastEthernet0/0': [{'hello_interval': 5}, {'hold_time': 15}]}, 'default', 1, 'ipv4', 60, 10) | ||
expected_output = True | ||
self.assertEqual(result, expected_output) |