Skip to content
Permalink
Browse files

lib: Add support for Ubuntu 18.04 with installed FRR package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
  • Loading branch information...
mwinter-osr committed Aug 29, 2018
1 parent 5a261bb commit 8a59dcaa0825104ad9eb7998dadc11c811f14fd1
Showing with 21 additions and 3 deletions.
  1. +1 −1 README.md
  2. +20 −2 lib/topotest.py
@@ -13,7 +13,7 @@ new topology, preferably, using the newest


## Installation of Mininet for running tests
Only tested with Ubuntu 16.04 (which uses Mininet 2.2.0)
Only tested with Ubuntu 16.04 and Ubuntu 18.04 (which uses Mininet 2.2.x)

Instructions are the same for all setups (ie ExaBGP is only used for BGP
tests)
@@ -434,6 +434,22 @@ def ip4_route_zebra(node, vrf_name=None):
lines = lines[1:]
return '\n'.join(lines)

def proto_name_to_number(protocol):
return {
'bgp': '186',
'isis': '187',
'ospf': '188',
'rip': '189',
'ripng': '190',
'nhrp': '191',
'eigrp': '192',
'ldp': '193',
'sharp': '194',
'pbr': '195',
'static': '196'
}.get(protocol, protocol) # default return same as input


def ip4_route(node):
"""
Gets a structured return of the command 'ip route'. It can be used in
@@ -464,7 +480,8 @@ def ip4_route(node):
if prev == 'via':
route['via'] = column
if prev == 'proto':
route['proto'] = column
# translate protocol names back to numbers
route['proto'] = proto_name_to_number(column)
if prev == 'metric':
route['metric'] = column
if prev == 'scope':
@@ -502,7 +519,8 @@ def ip6_route(node):
if prev == 'via':
route['via'] = column
if prev == 'proto':
route['proto'] = column
# translate protocol names back to numbers
route['proto'] = proto_name_to_number(column)
if prev == 'metric':
route['metric'] = column
if prev == 'pref':

0 comments on commit 8a59dca

Please sign in to comment.
You can’t perform that action at this time.