diff options
author | Mark Stapp <mjs@voltanet.io> | 2019-06-06 17:49:15 +0200 |
---|---|---|
committer | Mark Stapp <mjs@voltanet.io> | 2019-06-06 19:22:04 +0200 |
commit | e394d9aa5fdc67dc902bf48c02c340ca94bea99c (patch) | |
tree | 529102b6cb1d1f54e6192c598b7bf810d483cad7 /tests | |
parent | topotests: migrate ospf6 test to topogen framework (diff) | |
download | frr-e394d9aa5fdc67dc902bf48c02c340ca94bea99c.tar.xz frr-e394d9aa5fdc67dc902bf48c02c340ca94bea99c.zip |
tests: Add ip6_route_zebra lib function
Add a common function to retrieve and canonicalize
'show ipv6 route' output for use in topotests. Use that in
the test_ospf6_topo1 test; update the corresponding 'expected'
results files to match the lib function.
Replace some 'print' with 'logger' statements in that test also.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/topotests/lib/topotest.py | 27 | ||||
-rw-r--r-- | tests/topotests/ospf6-topo1/r1/ospf6d.conf-pre-v4 | 27 | ||||
-rw-r--r-- | tests/topotests/ospf6-topo1/r1/show_ipv6_route.ref | 18 | ||||
-rw-r--r-- | tests/topotests/ospf6-topo1/r2/ospf6d.conf-pre-v4 | 27 | ||||
-rw-r--r-- | tests/topotests/ospf6-topo1/r2/show_ipv6_route.ref | 18 | ||||
-rw-r--r-- | tests/topotests/ospf6-topo1/r3/ospf6d.conf-pre-v4 | 31 | ||||
-rw-r--r-- | tests/topotests/ospf6-topo1/r3/show_ipv6_route.ref | 18 | ||||
-rw-r--r-- | tests/topotests/ospf6-topo1/r4/ospf6d.conf-pre-v4 | 27 | ||||
-rw-r--r-- | tests/topotests/ospf6-topo1/r4/show_ipv6_route.ref | 18 | ||||
-rwxr-xr-x | tests/topotests/ospf6-topo1/test_ospf6_topo1.py | 67 |
10 files changed, 90 insertions, 188 deletions
diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index e0da20e07..2acb04fb0 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -429,6 +429,33 @@ def ip4_route_zebra(node, vrf_name=None): lines = lines[1:] return '\n'.join(lines) +def ip6_route_zebra(node, vrf_name=None): + """ + Retrieves the output of 'show ipv6 route [vrf vrf_name]', then + canonicalizes it by eliding link-locals. + """ + + if vrf_name == None: + tmp = node.vtysh_cmd('show ipv6 route') + else: + tmp = node.vtysh_cmd('show ipv6 route vrf {0}'.format(vrf_name)) + + # Mask out timestamp + output = re.sub(r" [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", " XX:XX:XX", tmp) + + # Mask out the link-local addresses + output = re.sub(r'fe80::[^ ]+,', 'fe80::XXXX:XXXX:XXXX:XXXX,', output) + + lines = output.splitlines() + header_found = False + while lines and (not lines[0].strip() or not header_found): + if '> - selected route' in lines[0]: + header_found = True + lines = lines[1:] + + return '\n'.join(lines) + + def proto_name_to_number(protocol): return { 'bgp': '186', diff --git a/tests/topotests/ospf6-topo1/r1/ospf6d.conf-pre-v4 b/tests/topotests/ospf6-topo1/r1/ospf6d.conf-pre-v4 deleted file mode 100644 index c4b382171..000000000 --- a/tests/topotests/ospf6-topo1/r1/ospf6d.conf-pre-v4 +++ /dev/null @@ -1,27 +0,0 @@ -hostname r1 -log file ospf6d.log -! -debug ospf6 message all -debug ospf6 lsa unknown -debug ospf6 zebra -debug ospf6 interface -debug ospf6 neighbor -debug ospf6 route table -debug ospf6 flooding -! -interface r1-stubnet - ipv6 ospf6 network broadcast -! -interface r1-sw5 - ipv6 ospf6 network broadcast -! -router ospf6 - router-id 10.0.0.1 - log-adjacency-changes detail - redistribute static - interface r1-stubnet area 0.0.0.0 - interface r1-sw5 area 0.0.0.0 -! -line vty - exec-timeout 0 0 -! diff --git a/tests/topotests/ospf6-topo1/r1/show_ipv6_route.ref b/tests/topotests/ospf6-topo1/r1/show_ipv6_route.ref index c961512bd..2db6f620f 100644 --- a/tests/topotests/ospf6-topo1/r1/show_ipv6_route.ref +++ b/tests/topotests/ospf6-topo1/r1/show_ipv6_route.ref @@ -1,9 +1,9 @@ -O fc00:1:1:1::/64 [110/10] is directly connected, r1-stubnet -O>* fc00:2:2:2::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r1-sw5 -O>* fc00:3:3:3::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r1-sw5 -O>* fc00:4:4:4::/64 [110/30] via fe80::XXXX:XXXX:XXXX:XXXX, r1-sw5 -O fc00:a:a:a::/64 [110/10] is directly connected, r1-sw5 -O>* fc00:b:b:b::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r1-sw5 -O>* fc00:2222:2222:2222::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r1-sw5 -O>* fc00:3333:3333:3333::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r1-sw5 -O>* fc00:4444:4444:4444::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r1-sw5 +O fc00:1:1:1::/64 [110/10] is directly connected, r1-stubnet, XX:XX:XX +O>* fc00:2:2:2::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r1-sw5, XX:XX:XX +O>* fc00:3:3:3::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r1-sw5, XX:XX:XX +O>* fc00:4:4:4::/64 [110/30] via fe80::XXXX:XXXX:XXXX:XXXX, r1-sw5, XX:XX:XX +O fc00:a:a:a::/64 [110/10] is directly connected, r1-sw5, XX:XX:XX +O>* fc00:b:b:b::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r1-sw5, XX:XX:XX +O>* fc00:2222:2222:2222::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r1-sw5, XX:XX:XX +O>* fc00:3333:3333:3333::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r1-sw5, XX:XX:XX +O>* fc00:4444:4444:4444::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r1-sw5, XX:XX:XX diff --git a/tests/topotests/ospf6-topo1/r2/ospf6d.conf-pre-v4 b/tests/topotests/ospf6-topo1/r2/ospf6d.conf-pre-v4 deleted file mode 100644 index bb9958d17..000000000 --- a/tests/topotests/ospf6-topo1/r2/ospf6d.conf-pre-v4 +++ /dev/null @@ -1,27 +0,0 @@ -hostname r2 -log file ospf6d.log -! -debug ospf6 message all -debug ospf6 lsa unknown -debug ospf6 zebra -debug ospf6 interface -debug ospf6 neighbor -debug ospf6 route table -debug ospf6 flooding -! -interface r2-stubnet - ipv6 ospf6 network broadcast -! -interface r2-sw5 - ipv6 ospf6 network broadcast -! -router ospf6 - router-id 10.0.0.2 - log-adjacency-changes detail - redistribute static - interface r2-stubnet area 0.0.0.0 - interface r2-sw5 area 0.0.0.0 -! -line vty - exec-timeout 0 0 -! diff --git a/tests/topotests/ospf6-topo1/r2/show_ipv6_route.ref b/tests/topotests/ospf6-topo1/r2/show_ipv6_route.ref index 014eddbcb..9060b0739 100644 --- a/tests/topotests/ospf6-topo1/r2/show_ipv6_route.ref +++ b/tests/topotests/ospf6-topo1/r2/show_ipv6_route.ref @@ -1,10 +1,10 @@ -O>* fc00:1:1:1::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r2-sw5 -O fc00:2:2:2::/64 [110/10] is directly connected, r2-stubnet -O>* fc00:3:3:3::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r2-sw5 -O>* fc00:4:4:4::/64 [110/30] via fe80::XXXX:XXXX:XXXX:XXXX, r2-sw5 -O fc00:a:a:a::/64 [110/10] is directly connected, r2-sw5 -O>* fc00:b:b:b::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r2-sw5 -O>* fc00:1111:1111:1111::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r2-sw5 -O>* fc00:3333:3333:3333::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r2-sw5 -O>* fc00:4444:4444:4444::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r2-sw5 +O>* fc00:1:1:1::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r2-sw5, XX:XX:XX +O fc00:2:2:2::/64 [110/10] is directly connected, r2-stubnet, XX:XX:XX +O>* fc00:3:3:3::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r2-sw5, XX:XX:XX +O>* fc00:4:4:4::/64 [110/30] via fe80::XXXX:XXXX:XXXX:XXXX, r2-sw5, XX:XX:XX +O fc00:a:a:a::/64 [110/10] is directly connected, r2-sw5, XX:XX:XX +O>* fc00:b:b:b::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r2-sw5, XX:XX:XX +O>* fc00:1111:1111:1111::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r2-sw5, XX:XX:XX +O>* fc00:3333:3333:3333::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r2-sw5, XX:XX:XX +O>* fc00:4444:4444:4444::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r2-sw5, XX:XX:XX diff --git a/tests/topotests/ospf6-topo1/r3/ospf6d.conf-pre-v4 b/tests/topotests/ospf6-topo1/r3/ospf6d.conf-pre-v4 deleted file mode 100644 index d2dbc4a41..000000000 --- a/tests/topotests/ospf6-topo1/r3/ospf6d.conf-pre-v4 +++ /dev/null @@ -1,31 +0,0 @@ -hostname r3 -log file ospf6d.log -! -debug ospf6 message all -debug ospf6 lsa unknown -debug ospf6 zebra -debug ospf6 interface -debug ospf6 neighbor -debug ospf6 route table -debug ospf6 flooding -! -interface r3-stubnet - ipv6 ospf6 network broadcast -! -interface r3-sw5 - ipv6 ospf6 network broadcast -! -interface r3-sw6 - ipv6 ospf6 network broadcast -! -router ospf6 - router-id 10.0.0.3 - log-adjacency-changes detail - redistribute static - interface r3-stubnet area 0.0.0.0 - interface r3-sw5 area 0.0.0.0 - interface r3-sw6 area 0.0.0.1 -! -line vty - exec-timeout 0 0 -! diff --git a/tests/topotests/ospf6-topo1/r3/show_ipv6_route.ref b/tests/topotests/ospf6-topo1/r3/show_ipv6_route.ref index 1ac7cbd6b..9406f41e9 100644 --- a/tests/topotests/ospf6-topo1/r3/show_ipv6_route.ref +++ b/tests/topotests/ospf6-topo1/r3/show_ipv6_route.ref @@ -1,10 +1,10 @@ -O>* fc00:1:1:1::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r3-sw5 -O>* fc00:2:2:2::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r3-sw5 -O fc00:3:3:3::/64 [110/10] is directly connected, r3-stubnet -O>* fc00:4:4:4::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r3-sw6 -O fc00:a:a:a::/64 [110/10] is directly connected, r3-sw5 -O fc00:b:b:b::/64 [110/10] is directly connected, r3-sw6 -O>* fc00:1111:1111:1111::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r3-sw5 -O>* fc00:2222:2222:2222::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r3-sw5 -O>* fc00:4444:4444:4444::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r3-sw6 +O>* fc00:1:1:1::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r3-sw5, XX:XX:XX +O>* fc00:2:2:2::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r3-sw5, XX:XX:XX +O fc00:3:3:3::/64 [110/10] is directly connected, r3-stubnet, XX:XX:XX +O>* fc00:4:4:4::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r3-sw6, XX:XX:XX +O fc00:a:a:a::/64 [110/10] is directly connected, r3-sw5, XX:XX:XX +O fc00:b:b:b::/64 [110/10] is directly connected, r3-sw6, XX:XX:XX +O>* fc00:1111:1111:1111::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r3-sw5, XX:XX:XX +O>* fc00:2222:2222:2222::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r3-sw5, XX:XX:XX +O>* fc00:4444:4444:4444::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r3-sw6, XX:XX:XX diff --git a/tests/topotests/ospf6-topo1/r4/ospf6d.conf-pre-v4 b/tests/topotests/ospf6-topo1/r4/ospf6d.conf-pre-v4 deleted file mode 100644 index 6f9c30d75..000000000 --- a/tests/topotests/ospf6-topo1/r4/ospf6d.conf-pre-v4 +++ /dev/null @@ -1,27 +0,0 @@ -hostname r4 -log file ospf6d.log -! -debug ospf6 message all -debug ospf6 lsa unknown -debug ospf6 zebra -debug ospf6 interface -debug ospf6 neighbor -debug ospf6 route table -debug ospf6 flooding -! -interface r4-stubnet - ipv6 ospf6 network broadcast -! -interface r4-sw6 - ipv6 ospf6 network broadcast -! -router ospf6 - router-id 10.0.0.4 - log-adjacency-changes detail - redistribute static - interface r4-stubnet area 0.0.0.1 - interface r4-sw6 area 0.0.0.1 -! -line vty - exec-timeout 0 0 -! diff --git a/tests/topotests/ospf6-topo1/r4/show_ipv6_route.ref b/tests/topotests/ospf6-topo1/r4/show_ipv6_route.ref index 698dea6c7..9bf032b5e 100644 --- a/tests/topotests/ospf6-topo1/r4/show_ipv6_route.ref +++ b/tests/topotests/ospf6-topo1/r4/show_ipv6_route.ref @@ -1,9 +1,9 @@ -O>* fc00:1:1:1::/64 [110/30] via fe80::XXXX:XXXX:XXXX:XXXX, r4-sw6 -O>* fc00:2:2:2::/64 [110/30] via fe80::XXXX:XXXX:XXXX:XXXX, r4-sw6 -O>* fc00:3:3:3::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r4-sw6 -O fc00:4:4:4::/64 [110/10] is directly connected, r4-stubnet -O>* fc00:a:a:a::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r4-sw6 -O fc00:b:b:b::/64 [110/10] is directly connected, r4-sw6 -O>* fc00:1111:1111:1111::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r4-sw6 -O>* fc00:2222:2222:2222::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r4-sw6 -O>* fc00:3333:3333:3333::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r4-sw6 +O>* fc00:1:1:1::/64 [110/30] via fe80::XXXX:XXXX:XXXX:XXXX, r4-sw6, XX:XX:XX +O>* fc00:2:2:2::/64 [110/30] via fe80::XXXX:XXXX:XXXX:XXXX, r4-sw6, XX:XX:XX +O>* fc00:3:3:3::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r4-sw6, XX:XX:XX +O fc00:4:4:4::/64 [110/10] is directly connected, r4-stubnet, XX:XX:XX +O>* fc00:a:a:a::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r4-sw6, XX:XX:XX +O fc00:b:b:b::/64 [110/10] is directly connected, r4-sw6, XX:XX:XX +O>* fc00:1111:1111:1111::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r4-sw6, XX:XX:XX +O>* fc00:2222:2222:2222::/64 [110/20] via fe80::XXXX:XXXX:XXXX:XXXX, r4-sw6, XX:XX:XX +O>* fc00:3333:3333:3333::/64 [110/10] via fe80::XXXX:XXXX:XXXX:XXXX, r4-sw6, XX:XX:XX diff --git a/tests/topotests/ospf6-topo1/test_ospf6_topo1.py b/tests/topotests/ospf6-topo1/test_ospf6_topo1.py index 150ba19ae..b70ae0226 100755 --- a/tests/topotests/ospf6-topo1/test_ospf6_topo1.py +++ b/tests/topotests/ospf6-topo1/test_ospf6_topo1.py @@ -154,17 +154,13 @@ def setup_module(mod): tgen = Topogen(NetworkTopo, mod.__name__) tgen.start_topology() - print("\n\n** %s: Setup Topology" % mod.__name__) - print("******************************************\n") + logger.info("** %s: Setup Topology" % mod.__name__) + logger.info("******************************************") # For debugging after starting net, but before starting FRR, # uncomment the next line # tgen.mininet_cli() - ospf_config = 'ospf6d.conf' - if tgen.gears['r1'].has_version('<', '4.0'): - ospf_config = 'ospf6d.conf-pre-v4' - router_list = tgen.routers() for rname, router in router_list.iteritems(): router.load_config( @@ -173,7 +169,7 @@ def setup_module(mod): ) router.load_config( TopoRouter.RD_OSPF6, - os.path.join(CWD, '{}/{}'.format(rname, ospf_config)) + os.path.join(CWD, '{}/ospf6d.conf'.format(rname)) ) # Initialize all routers. @@ -201,8 +197,7 @@ def test_ospf6_converged(): #tgen.mininet_cli() # Wait for OSPF6 to converge (All Neighbors in either Full or TwoWay State) - print("\n\n** Verify OSPF6 daemons' convergence") - print("******************************************\n") + logger.info("Waiting for OSPF6 convergence") # Set up for regex pat1 = re.compile('^[0-9]') @@ -210,7 +205,7 @@ def test_ospf6_converged(): timeout = 60 while timeout > 0: - print("Timeout in %s: " % timeout), + logger.info("Timeout in %s: " % timeout), sys.stdout.flush() # Look for any node not yet converged @@ -230,12 +225,12 @@ def test_ospf6_converged(): break if isConverged == False: - print('Waiting for {}'.format(router)) + logger.info('Waiting for {}'.format(router)) sys.stdout.flush() break if isConverged: - print('Done\n') + logger.info('Done') break else: sleep(5) @@ -246,12 +241,7 @@ def test_ospf6_converged(): ospfStatus = rnode.vtysh_cmd('show ipv6 ospf neigh') assert False, "OSPFv6 did not converge:\n{}".format(ospfStatus) - print("OSPFv3 converged.") - - if timeout < 60: - # Only wait if we actually went through a convergence - print("\nwaiting 15s for routes to populate") - sleep(15) + logger.info("OSPFv3 converged.") # For debugging, uncomment the next line # tgen.mininet_cli() @@ -266,7 +256,9 @@ def compare_show_ipv6(rname, expected): result with the expected output. """ tgen = get_topogen() - current = tgen.gears[rname].vtysh_cmd('show ipv6 route') + + # Use the vtysh output, with some masking to make comparison easy + current = topotest.ip6_route_zebra(tgen.gears[rname]) # Use just the 'O'spf lines of the output linearr = [] @@ -276,14 +268,6 @@ def compare_show_ipv6(rname, expected): current = '\n'.join(linearr) - # Remove the link addresses - current = re.sub(r'fe80::[^ ]+', 'fe80::xxxx:xxxx:xxxx:xxxx', current) - expected = re.sub(r'fe80::[^ ]+', 'fe80::xxxx:xxxx:xxxx:xxxx', expected) - - # Remove the time - current = re.sub(r', \d+:\d{2}:\d{2}', '', current) - expected = re.sub(r'\d+:\d{2}:\d{2}', '', expected) - return topotest.difflines(topotest.normalize_text(current), topotest.normalize_text(expected), title1="Current output", @@ -322,8 +306,8 @@ def test_linux_ipv6_kernel_routingTable(): pytest.skip('skipped because of router(s) failure') # Verify Linux Kernel Routing Table - print("\n\n** Verifying Linux IPv6 Kernel Routing Table") - print("******************************************\n") + logger.info("Verifying Linux IPv6 Kernel Routing Table") + failures = 0 # Get a list of all current link-local addresses first as they change for @@ -332,7 +316,8 @@ def test_linux_ipv6_kernel_routingTable(): for i in range(1, 5): linklocals += tgen.net['r{}'.format(i)].get_ipv6_linklocal() - # Now compare the routing tables (after substituting link-local addresses) + # Now compare the routing tables (after substituting link-local addresses) + for i in range(1, 5): refTableFile = os.path.join(CWD, 'r{}/ip_6_address.ref'.format(i)) if os.path.isfile(refTableFile): @@ -365,9 +350,9 @@ def test_linux_ipv6_kernel_routingTable(): actual = '\n'.join(filtered_lines).splitlines(1) # Print Actual table - # print("Router r%s table" % i) + # logger.info("Router r%s table" % i) # for line in actual: - # print(line.rstrip()) + # logger.info(line.rstrip()) # Generate Diff diff = topotest.get_textdiff(actual, expected, @@ -379,7 +364,7 @@ def test_linux_ipv6_kernel_routingTable(): sys.stderr.write('r%s failed Linux IPv6 Kernel Routing Table Check:\n%s\n' % (i, diff)) failures += 1 else: - print("r%s ok" % i) + logger.info("r%s ok" % i) assert failures == 0, "Linux Kernel IPv6 Routing Table verification failed for router r%s:\n%s" % (i, diff) @@ -392,29 +377,29 @@ def test_shutdown_check_stderr(): pytest.skip('skipped because of router(s) failure') if os.environ.get('TOPOTESTS_CHECK_STDERR') is None: - print("SKIPPED final check on StdErr output: Disabled (TOPOTESTS_CHECK_STDERR undefined)\n") + logger.info("SKIPPED final check on StdErr output: Disabled (TOPOTESTS_CHECK_STDERR undefined)\n") pytest.skip('Skipping test for Stderr output') net = tgen.net - print("\n\n** Verifying unexpected STDERR output from daemons") - print("******************************************\n") + logger.info("\n\n** Verifying unexpected STDERR output from daemons") + logger.info("******************************************") for i in range(1, 5): net['r%s' % i].stopRouter() log = net['r%s' % i].getStdErr('ospf6d') if log: - print("\nRouter r%s OSPF6d StdErr Log:\n%s" % (i, log)) + logger.info("\nRouter r%s OSPF6d StdErr Log:\n%s" % (i, log)) log = net['r%s' % i].getStdErr('zebra') if log: - print("\nRouter r%s Zebra StdErr Log:\n%s" % (i, log)) + logger.info("\nRouter r%s Zebra StdErr Log:\n%s" % (i, log)) def test_shutdown_check_memleak(): "Run the memory leak test and report results." if os.environ.get('TOPOTESTS_CHECK_MEMLEAK') is None: - print("SKIPPED final check on Memory leaks: Disabled (TOPOTESTS_CHECK_MEMLEAK undefined)\n") + logger.info("SKIPPED final check on Memory leaks: Disabled (TOPOTESTS_CHECK_MEMLEAK undefined)") pytest.skip('Skipping test for memory leaks') tgen = get_topogen() @@ -430,7 +415,9 @@ def test_shutdown_check_memleak(): if __name__ == '__main__': - # To suppress tracebacks, either use the following pytest call or add "--tb=no" to cli + # To suppress tracebacks, either use the following pytest call or + # add "--tb=no" to cli # retval = pytest.main(["-s", "--tb=no"]) + retval = pytest.main(["-s"]) sys.exit(retval) |