]> git.proxmox.com Git - mirror_frr.git/commitdiff
tests: fix check for nhid in ipv6 table output
authorMartin Winter <mwinter@opensourcerouting.org>
Fri, 20 Mar 2020 22:53:39 +0000 (23:53 +0100)
committerMartin Winter <mwinter@opensourcerouting.org>
Fri, 20 Mar 2020 22:53:39 +0000 (23:53 +0100)
Check based on actual output instead of assuming output based
on kernel version

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
tests/topotests/ospf6-topo1/test_ospf6_topo1.py

index cb0c4af221bff13184a3d1b4f019ac5ec420cb61..2f7a4ce4e38c998f832346832d1165bfcc82b646 100755 (executable)
@@ -319,18 +319,18 @@ def test_linux_ipv6_kernel_routingTable():
     # Now compare the routing tables (after substituting link-local addresses)
 
     for i in range(1, 5):
-       if topotest.version_cmp(platform.release(), '5.3') < 0:
+        # Actual output from router
+        actual = tgen.gears['r{}'.format(i)].run('ip -6 route').rstrip()
+        if "nhid" in actual:
+            refTableFile = os.path.join(CWD, 'r{}/ip_6_address.nhg.ref'.format(i))
+        else:
             refTableFile = os.path.join(CWD, 'r{}/ip_6_address.ref'.format(i))
-       else:
-           refTableFile = os.path.join(CWD, 'r{}/ip_6_address.nhg.ref'.format(i))
-        if os.path.isfile(refTableFile):
 
+        if os.path.isfile(refTableFile):
             expected = open(refTableFile).read().rstrip()
             # Fix newlines (make them all the same)
             expected = ('\n'.join(expected.splitlines())).splitlines(1)
 
-            # Actual output from router
-            actual = tgen.gears['r{}'.format(i)].run('ip -6 route').rstrip()
             # Mask out Link-Local mac addresses
             for ll in linklocals:
                 actual = actual.replace(ll[1], "fe80::__(%s)__" % ll[0])