From: Duncan Eastoe Date: Tue, 26 Jan 2021 16:59:48 +0000 (+0000) Subject: tests: more robust show route header stripping X-Git-Tag: base_8.0~458^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=ec20380c347b92dddee342b46995dce512a571e4;p=mirror%2Ffrr.git tests: more robust show route header stripping In test_converge_protocols() use sed to match the "show ip(v6) route" header and strip it, rather than using tail which requires hardcoding the expected length of the header (which is subject to change). Signed-off-by: Duncan Eastoe --- diff --git a/tests/topotests/all-protocol-startup/test_all_protocol_startup.py b/tests/topotests/all-protocol-startup/test_all_protocol_startup.py index 24bef07ec2..d4c831e1c4 100644 --- a/tests/topotests/all-protocol-startup/test_all_protocol_startup.py +++ b/tests/topotests/all-protocol-startup/test_all_protocol_startup.py @@ -344,7 +344,7 @@ def test_converge_protocols(): actual = ( net["r%s" % i] .cmd( - 'vtysh -c "show ip route" | /usr/bin/tail -n +7 | env LC_ALL=en_US.UTF-8 sort 2> /dev/null' + 'vtysh -c "show ip route" | sed -e \'/^Codes: /,/^\s*$/d\' | env LC_ALL=en_US.UTF-8 sort 2> /dev/null' ) .rstrip() ) @@ -375,7 +375,7 @@ def test_converge_protocols(): actual = ( net["r%s" % i] .cmd( - 'vtysh -c "show ipv6 route" | /usr/bin/tail -n +7 | env LC_ALL=en_US.UTF-8 sort 2> /dev/null' + 'vtysh -c "show ipv6 route" | sed -e \'/^Codes: /,/^\s*$/d\' | env LC_ALL=en_US.UTF-8 sort 2> /dev/null' ) .rstrip() )