]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: Fix `Invalid escape sequence` warnings in test runs
authorDonald Sharp <sharpd@nvidia.com>
Wed, 13 Oct 2021 13:03:27 +0000 (09:03 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 13 Oct 2021 13:03:27 +0000 (09:03 -0400)
Test runs are creating these warnings:
bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_linux_mpls
  <string>:7: DeprecationWarning: invalid escape sequence \d

bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_linux_mpls
  <string>:19: DeprecationWarning: invalid escape sequence \d

bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_scale_up
  <string>:24: DeprecationWarning: invalid escape sequence \d

bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_scale_up
  <string>: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 <sharpd@nvidia.com>
tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py
tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/scale_up.py
tests/topotests/lib/ltemplate.py

index a5f95f94bf38dadcadced75f93d628417bf9da8b..91a7adf9970e672a24ec3077acd375ef06b7548e 100644 (file)
@@ -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",
     )
index 9f100b7c3060861be3cdc27f415fa213b1484e60..eaa6aa4c3072c7269397c08cbc54a1fad118e45b 100644 (file)
@@ -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",
         )
index c98bfac9ee6dc79e87c404f65662771e7b1e5e2a..18882285ed5c4fc1dea7c72b8c57d141a3e418b9 100644 (file)
@@ -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)