]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: replace unnecessary assertRegex() with assertIn() 37633/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 27 May 2025 14:42:33 +0000 (23:42 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 27 May 2025 19:38:56 +0000 (04:38 +0900)
This fixes the following warning:
```
/tmp/systemd/test/test-network/systemd-networkd-tests.py:5107: SyntaxWarning: invalid escape sequence '\.'
  self.assertRegex(output, 'inet 10\.234\.77\.111/32.*dummy98')
```

Follow-up for 6479204e567cd55e1bfc5894131fba80ea68a780.

test/test-network/systemd-networkd-tests.py

index 541280a3d7a7247d32ec5e0088620c41e8251255..3f8c6b1b65e9662c9778da849ad47704f01fd670 100755 (executable)
@@ -5104,11 +5104,11 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
 
         output = check_output('ip -4 addr show dev dummy98')
         print(output)
-        self.assertRegex(output, 'inet 10\.234\.77\.111/32.*dummy98')
+        self.assertIn('inet 10.234.77.111/32', output)
 
         output = check_output('ip -6 addr show dev dummy98')
         print(output)
-        self.assertRegex(output, 'inet6 2222:3333::4444/64 scope global')
+        self.assertIn('inet6 2222:3333::4444/64 scope global', output)
 
     def check_nexthop(self, manage_foreign_nexthops, first):
         self.wait_online('veth99:routable', 'veth-peer:routable', 'dummy98:routable')