mirror of
https://github.com/systemd/systemd
synced 2024-07-21 10:17:21 +00:00
test-network: add test for static route with preferred source
This adds possible reproducer for issue #28009 (though, the issue is highly racy, hence this may not trigger the issue reliably).
This commit is contained in:
parent
7e30527806
commit
e4948bb2cd
12
test/test-network/conf/25-route-preferred-source.network
Normal file
12
test/test-network/conf/25-route-preferred-source.network
Normal file
|
@ -0,0 +1,12 @@
|
|||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
[Match]
|
||||
Name=dummy98
|
||||
|
||||
[Network]
|
||||
Address=2001:1234:56:8f63::1/64
|
||||
IPv6AcceptRA=no
|
||||
|
||||
[Route]
|
||||
Destination=abcd::/16
|
||||
Gateway=2001:1234:56:8f63::1:1
|
||||
PreferredSource=2001:1234:56:8f63::1
|
|
@ -2975,6 +2975,21 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
|||
print(output)
|
||||
self.assertIn('abcd::/16 via 2001:1234:56:8f63::1:1 proto static src 2001:1234:56:8f63::2', output)
|
||||
|
||||
def test_route_preferred_source_with_existing_address(self):
|
||||
# See issue #28009.
|
||||
copy_network_unit('25-route-preferred-source.network', '12-dummy.netdev')
|
||||
start_networkd()
|
||||
|
||||
for i in range(3):
|
||||
if i != 0:
|
||||
networkctl_reconfigure('dummy98')
|
||||
|
||||
self.wait_online(['dummy98:routable'])
|
||||
|
||||
output = check_output('ip -6 route list dev dummy98')
|
||||
print(output)
|
||||
self.assertIn('abcd::/16 via 2001:1234:56:8f63::1:1 proto static src 2001:1234:56:8f63::1', output)
|
||||
|
||||
def test_ip_link_mac_address(self):
|
||||
copy_network_unit('25-address-link-section.network', '12-dummy.netdev')
|
||||
start_networkd()
|
||||
|
|
Loading…
Reference in a new issue