Commit 67fe2772 authored by Nigel Kukard's avatar Nigel Kukard

tests: Added RIP tests

parent 92bda0d6
Pipeline #4651 passed with stage
in 41 seconds
......@@ -554,3 +554,50 @@ class TestBirdClient():
}
assert result == correct_result, 'The show_route_table() result does not match what it should be'
def test_show_route_table_t_rip4(self):
"""Test show_route_table."""
birdclient = BirdClient()
result = birdclient.show_route_table('t_rip4', self._load_file('test_show_route_table_t_rip4.txt'))
correct_result = {
'192.168.10.0/24': [{'metric1': '3',
'nexthops': [{'gateway': '192.168.0.1',
'interface': 'eth0'}],
'pref': '120',
'prefix_type': 'unicast',
'protocol': 'rip4',
'since': '2019-10-01 17:59:41'}],
'192.168.21.0/24': [{'nexthops': [{'gateway': '192.168.20.3',
'interface': 'eth1'}],
'pref': '200',
'prefix_type': 'unicast',
'protocol': 'static4',
'since': '2019-10-01 17:59:38'}]
}
assert result == correct_result, 'The show_route_table() result does not match what it should be'
def test_show_route_table_t_rip6(self):
"""Test show_route_table."""
birdclient = BirdClient()
result = birdclient.show_route_table('t_rip6', self._load_file('test_show_route_table_t_rip6.txt'))
correct_result = {
'fc10::/64': [{'metric1': '3',
'nexthops': [{'gateway': 'fe80::1:ff:fe00:1',
'interface': 'eth0'}],
'pref': '120',
'prefix_type': 'unicast',
'protocol': 'rip6',
'since': '2019-10-01 17:59:42'}],
'fc21::/64': [{'nexthops': [{'gateway': 'fc20::3', 'interface': 'eth1'}],
'pref': '200',
'prefix_type': 'unicast',
'protocol': 'static6',
'since': '2019-10-01 17:59:38'}]
}
assert result == correct_result, 'The show_route_table() result does not match what it should be'
0001 BIRD 2.0.6 ready.
1007-Table t_rip4:
192.168.21.0/24 unicast [static4 2019-10-01 17:59:38] * (200)
via 192.168.20.3 on eth1
192.168.10.0/24 unicast [rip4 2019-10-01 17:59:41] (120/3)
via 192.168.0.1 on eth0
0000
0001 BIRD 2.0.6 ready.
1007-Table t_rip6:
fc10::/64 unicast [rip6 2019-10-01 17:59:42] (120/3)
via fe80::1:ff:fe00:1 on eth0
fc21::/64 unicast [static6 2019-10-01 17:59:38] * (200)
via fc20::3 on eth1
0000
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment