]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Add support for Ubuntu 18.04 with installed FRR package
authorMartin Winter <mwinter@opensourcerouting.org>
Wed, 29 Aug 2018 14:35:51 +0000 (07:35 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:14 +0000 (20:22 -0500)
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
tests/topotests/README.md
tests/topotests/lib/topotest.py

index 823f5d72bf4b88fbe9c2d20f5dcffa3184e205f5..47668f4bba3fa607c6fac2cc33fc7bc752d17530 100644 (file)
@@ -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)
index ab3e5d34e0f655607ee4df812187d03734d67372..40222b7612c00dd6e02a35a9ed509ef7215de273 100644 (file)
@@ -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':