From: Donald Sharp Date: Wed, 13 Oct 2021 13:03:27 +0000 (-0400) Subject: tests: Fix `Invalid escape sequence` warnings in test runs X-Git-Tag: base_8.2~342^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=48f05b233fbc95f3601dfde9335073070b3c1c76;p=matthieu%2Ffrr.git tests: Fix `Invalid escape sequence` warnings in test runs Test runs are creating these warnings: bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_linux_mpls :7: DeprecationWarning: invalid escape sequence \d bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_linux_mpls :19: DeprecationWarning: invalid escape sequence \d bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_scale_up :24: DeprecationWarning: invalid escape sequence \d bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_scale_up :191: DeprecationWarning: invalid escape sequence \d -- Docs: https://docs.pytest.org/en/stable/warnings.html Find and destroy these warnings Signed-off-by: Donald Sharp --- diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py index a5f95f94bf..91a7adf997 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py @@ -4,7 +4,7 @@ from lib import topotest ret = luCommand( "r2", "ip -M route show", - "\d*(?= via inet 10.0.2.4 dev r2-eth1)", + r"\d*(?= via inet 10.0.2.4 dev r2-eth1)", "wait", "See mpls route to r4", ) @@ -16,7 +16,7 @@ if ret != False and found != None: ret = luCommand( "r2", "ip -M route show", - "\d*(?= via inet 10.0.1.1 dev r2-eth0)", + r"\d*(?= via inet 10.0.1.1 dev r2-eth0)", "wait", "See mpls route to r1", ) diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/scale_up.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/scale_up.py index 9f100b7c30..eaa6aa4c30 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/scale_up.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/scale_up.py @@ -21,7 +21,7 @@ for rtr in rtrs: ret = luCommand( rtr, 'vtysh -c "show memory"', - "zebra: System allocator statistics: Total heap allocated: *(\d*) ([A-Za-z]*) .*bgpd: System allocator statistics: Total heap allocated: *(\d*) ([A-Za-z]*)", + r"zebra: System allocator statistics: Total heap allocated: *(\d*) ([A-Za-z]*) .*bgpd: System allocator statistics: Total heap allocated: *(\d*) ([A-Za-z]*)", "none", "collect bgpd memory stats", ) @@ -188,7 +188,7 @@ else: ret = luCommand( rtr, 'vtysh -c "show memory"', - "zebra: System allocator statistics: Total heap allocated: *(\d*) ([A-Za-z]*) .*bgpd: System allocator statistics: Total heap allocated: *(\d*) ([A-Za-z]*)", + r"zebra: System allocator statistics: Total heap allocated: *(\d*) ([A-Za-z]*) .*bgpd: System allocator statistics: Total heap allocated: *(\d*) ([A-Za-z]*)", "none", "collect bgpd memory stats", ) diff --git a/tests/topotests/lib/ltemplate.py b/tests/topotests/lib/ltemplate.py index c98bfac9ee..18882285ed 100644 --- a/tests/topotests/lib/ltemplate.py +++ b/tests/topotests/lib/ltemplate.py @@ -291,7 +291,7 @@ def ltemplateVersionCheck( # collect/log info on iproute2 cc = ltemplateRtrCmd() found = cc.doCmd( - tgen, rname, "apt-cache policy iproute2", "Installed: ([\d\.]*)" + tgen, rname, "apt-cache policy iproute2", r"Installed: ([\d\.]*)" ) if found != None: iproute2Ver = found.group(1)