]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add test case for issue #35874 36268/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 5 Feb 2025 00:40:31 +0000 (09:40 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 5 Feb 2025 00:40:31 +0000 (09:40 +0900)
test/test-network/conf/25-routing-policy-rule-test1.network
test/test-network/systemd-networkd-tests.py

index 2cec4334fdaafa06fc54f1f8bd721791f455afd0..6e67f3f105d849a40db574f13dbe7b3f0f565104 100644 (file)
@@ -47,3 +47,21 @@ IncomingInterface=test1
 From=10.1.0.0/16
 Priority=104
 Table=12
+
+# The four routing policy rules below intentionally have the same config
+# excepts for their To= addresses. See issue #35874.
+[RoutingPolicyRule]
+To=192.0.2.0/26
+Table=1001
+
+[RoutingPolicyRule]
+To=192.0.2.64/26
+Table=1001
+
+[RoutingPolicyRule]
+To=192.0.2.128/26
+Table=1001
+
+[RoutingPolicyRule]
+To=192.0.2.192/26
+Table=1001
index c865fbdbe307fdedc18ac2a33136b193ad3f3bab..53de32c4b1edef58ed559cb7d2a114f1570cb180 100755 (executable)
@@ -3847,6 +3847,22 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
         print(output)
         self.assertIn('104:    from 10.1.0.0/16 iif test1 lookup 12 nop', output)
 
+        output = check_output('ip rule list to 192.0.2.0/26')
+        print(output)
+        self.assertIn('to 192.0.2.0/26 lookup 1001', output)
+
+        output = check_output('ip rule list to 192.0.2.64/26')
+        print(output)
+        self.assertIn('to 192.0.2.64/26 lookup 1001', output)
+
+        output = check_output('ip rule list to 192.0.2.128/26')
+        print(output)
+        self.assertIn('to 192.0.2.128/26 lookup 1001', output)
+
+        output = check_output('ip rule list to 192.0.2.192/26')
+        print(output)
+        self.assertIn('to 192.0.2.192/26 lookup 1001', output)
+
     def check_routing_policy_rule_dummy98(self):
         print('### Checking routing policy rules requested by dummy98')