Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Test case for static routes (v4+v6) #233

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions napalm_base/test/getters.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,36 @@ def test_get_route_to(self, test_case):

return get_route_to

@wrap_test_cases
def test_get_route_to_static_v4(self, test_case):
"""Test get_route_to with static ipv4 route"""
destination = '1.0.4.0/24'
protocol = 'static'
get_route_to = self.device.get_route_to(destination=destination, protocol=protocol)

assert len(get_route_to) > 0

for prefix, routes in get_route_to.items():
for route in routes:
assert helpers.test_model(models.route, route)

return get_route_to

@wrap_test_cases
def test_get_route_to_static_v6(self, test_case):
"""Test get_route_to with static ipv6 route"""
destination = 'dead:beef:210:210::53/64'
protocol = 'static'
get_route_to = self.device.get_route_to(destination=destination, protocol=protocol)

assert len(get_route_to) > 0

for prefix, routes in get_route_to.items():
for route in routes:
assert helpers.test_model(models.route, route)

return get_route_to

@wrap_test_cases
def test_get_snmp_information(self, test_case):
"""Test get_snmp_information."""
Expand Down