]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: check if networkd forgets routes silently removed by the kernel 31082/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 Jan 2024 03:47:40 +0000 (12:47 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 25 Jan 2024 07:43:44 +0000 (16:43 +0900)
test/test-network/systemd-networkd-tests.py

index 064ca53193b47b33c2032b36c947c9a2231a70c8..20c5f91a5d6bf99b5b108fcdc40f45cf96ddc520 100755 (executable)
@@ -4082,7 +4082,9 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
             self.assertIn('nexthop via 192.168.5.3 dev veth99 weight 3', output)
         self.assertIn('nexthop via 192.168.20.1 dev dummy98 weight 1', output)
 
-        check_json(networkctl_json())
+        output = networkctl_json()
+        check_json(output)
+        self.assertNotIn('"Destination":[10.10.10.14]', output)
 
     def _test_nexthop(self, manage_foreign_nexthops):
         if not manage_foreign_nexthops:
@@ -4141,6 +4143,11 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
         output = networkctl_status('test1')
         self.assertIn('State: routable (configuring)', output)
 
+        # Check if the route which needs nexthop 20 and 21 are forgotten.
+        output = networkctl_json()
+        check_json(output)
+        self.assertNotIn('"Destination":[10.10.10.14]', output)
+
         # Reconfigure the interface that has nexthop with ID 20 and 21,
         # then the route requested by test1 can be configured.
         networkctl_reconfigure('dummy98')