From: Yu Watanabe Date: Tue, 16 Jan 2024 03:47:40 +0000 (+0900) Subject: test-network: check if networkd forgets routes silently removed by the kernel X-Git-Tag: v256-rc1~1041^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F31082%2Fhead;p=thirdparty%2Fsystemd.git test-network: check if networkd forgets routes silently removed by the kernel --- diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 064ca53193b..20c5f91a5d6 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -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')