]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: actually check metric and preference 35255/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 20 Nov 2024 18:43:32 +0000 (03:43 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 20 Nov 2024 18:43:35 +0000 (03:43 +0900)
Otherwise, nexthop ID may contain e.g. 300, then
===
AssertionError: '300' unexpectedly found in
'default nhid 3860882700 via fe80::1034:56ff:fe78:9a99 proto ra metric 512 expires 1798sec pref high\n
 default nhid 2639230080 via fe80::1034:56ff:fe78:9a98 proto ra metric 2048 expires 1798sec pref low'
===

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

index 462d40d83994a2d9e30481347a77f16dc32c44cd..215f3cb1ccf4e16cb93e34aab6c97c0d60aa19b4 100755 (executable)
@@ -6406,11 +6406,11 @@ class NetworkdRATests(unittest.TestCase, Utilities):
 
         for i in [100, 200, 300, 512, 1024, 2048]:
             if i not in [metric_1, metric_2]:
-                self.assertNotIn(f'{i}', output)
+                self.assertNotIn(f'metric {i} ', output)
 
         for i in ['low', 'medium', 'high']:
             if i not in [preference_1, preference_2]:
-                self.assertNotIn(f'{i}', output)
+                self.assertNotIn(f'pref {i}', output)
 
     def test_router_preference(self):
         copy_network_unit('25-veth-client.netdev',