test-network: add test for issue #17304

This commit is contained in:
Yu Watanabe 2020-10-13 12:36:26 +09:00
parent b1476b5210
commit 21266e60e9
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,9 @@
[Match]
Name=dummy98
[Network]
IPv6AcceptRA=no
[Address]
Address=100.64.0.1/32
Peer=100.64.0.2/32

View File

@ -1742,6 +1742,7 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
'25-address-dad-veth-peer.network',
'25-address-dad-veth99.network',
'25-address-link-section.network',
'25-address-peer-ipv4.network',
'25-address-preferred-lifetime-zero.network',
'25-address-static.network',
'25-bind-carrier.network',
@ -1886,6 +1887,21 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
print(output)
self.assertNotRegex(output, '192.168.100.10/24')
def test_address_peer_ipv4(self):
# test for issue #17304
copy_unit_to_networkd_unit_path('25-address-peer-ipv4.network', '12-dummy.netdev')
for trial in range(2):
if trial == 0:
start_networkd()
else:
restart_networkd()
self.wait_online(['dummy98:routable'])
output = check_output('ip -4 address show dev dummy98')
self.assertIn('inet 100.64.0.1 peer 100.64.0.2/32 scope global', output)
@expectedFailureIfModuleIsNotAvailable('vrf')
def test_prefix_route(self):
copy_unit_to_networkd_unit_path('25-prefix-route-with-vrf.network', '12-dummy.netdev',