]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: find routing policy rule by priority
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 21 Aug 2024 19:16:09 +0000 (04:16 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 21 Aug 2024 19:16:12 +0000 (04:16 +0900)
We usually configure a test rule with a unique priority. Hence, finding
rule by priority reduces the lines of output, and we can debug easily.

Also print short comments on check. That's helpful when the check is
called several times.

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

index fae7b58fccbe0c43cde0f748e94b431662b16029..42af0145b3a896d5e7e11e0d8e4d22c3ed291462 100755 (executable)
@@ -3211,6 +3211,8 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
                 self.assertRegex(output, routable_map[carrier])
 
     def check_routing_policy_rule_test1(self):
+        print('### Checking routing policy rules requested by test1')
+
         output = check_output('ip rule list iif test1 priority 111')
         print(output)
         self.assertRegex(output, r'111:        from 192.168.100.18 tos (0x08|throughput) iif test1 oif test1 lookup 7')
@@ -3236,7 +3238,9 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
         self.assertIn('104:    from 10.1.0.0/16 iif test1 lookup 12 nop', output)
 
     def check_routing_policy_rule_dummy98(self):
-        output = check_output('ip rule list table 8')
+        print('### Checking routing policy rules requested by dummy98')
+
+        output = check_output('ip rule list priority 112')
         print(output)
         self.assertRegex(output, r'112:        from 192.168.101.18 tos (0x08|throughput) iif dummy98 oif dummy98 lookup 8')