From: Martin Winter Date: Wed, 29 Aug 2018 14:35:51 +0000 (-0700) Subject: lib: Add support for Ubuntu 18.04 with installed FRR package X-Git-Tag: frr-7.1-dev~151^2~17 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=2f726781b671e0634a322af6a9e53876265c3f1f;p=mirror%2Ffrr.git lib: Add support for Ubuntu 18.04 with installed FRR package Signed-off-by: Martin Winter --- diff --git a/tests/topotests/README.md b/tests/topotests/README.md index 823f5d72bf..47668f4bba 100644 --- a/tests/topotests/README.md +++ b/tests/topotests/README.md @@ -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) diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index ab3e5d34e0..40222b7612 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -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':