1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

test-network: add test case for issue #29979

This commit is contained in:
Yu Watanabe 2023-11-11 03:30:00 +09:00
parent fc4aa64c2d
commit 1805e2cb05
3 changed files with 23 additions and 3 deletions

View File

@ -10,6 +10,7 @@ DHCPPrefixDelegation=yes
[DHCPv6]
WithoutRA=solicit
UseAddress=no
[DHCPPrefixDelegation]
UplinkInterface=:self
@ -17,3 +18,4 @@ SubnetId=10
Announce=no
Token=eui64
Token=::1a:2b:3c:4d
Assign=no

View File

@ -0,0 +1,6 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[DHCPv6]
UseAddress=yes
[DHCPPrefixDelegation]
Assign=yes

View File

@ -6086,7 +6086,8 @@ class NetworkdDHCPPDTests(unittest.TestCase, Utilities):
'11-dummy.netdev', '25-dhcp-pd-downstream-test1.network',
'25-dhcp-pd-downstream-dummy97.network',
'12-dummy.netdev', '25-dhcp-pd-downstream-dummy98.network',
'13-dummy.netdev', '25-dhcp-pd-downstream-dummy99.network')
'13-dummy.netdev', '25-dhcp-pd-downstream-dummy99.network',
copy_dropins=False)
self.setup_nftset('addr6', 'ipv6_addr')
self.setup_nftset('network6', 'ipv6_addr', 'flags interval;')
@ -6095,8 +6096,14 @@ class NetworkdDHCPPDTests(unittest.TestCase, Utilities):
start_networkd()
self.wait_online(['veth-peer:routable'])
start_isc_dhcpd(conf_file='isc-dhcpd-dhcp6pd.conf', ipv='-6')
self.wait_online(['veth99:routable', 'test1:routable', 'dummy98:routable', 'dummy99:degraded',
'veth97:routable', 'veth97-peer:routable', 'veth98:routable', 'veth98-peer:routable'])
self.wait_online(['veth99:degraded'])
# First, test UseAddress=no and Assign=no (issue #29979).
# Note, due to the bug #29701, this test must be done at first.
print('### ip -6 address show dev veth99 scope global')
output = check_output('ip -6 address show dev veth99 scope global')
print(output)
self.assertNotIn('inet6 3ffe:501:ffff', output)
# Check DBus assigned prefix information to veth99
prefixInfo = get_dhcp6_prefix('veth99')
@ -6114,6 +6121,11 @@ class NetworkdDHCPPDTests(unittest.TestCase, Utilities):
self.assertGreater(prefixInfo['PreferredLifetimeUSec'], 0)
self.assertGreater(prefixInfo['ValidLifetimeUSec'], 0)
copy_network_unit('25-dhcp6pd-upstream.network.d/with-address.conf')
networkctl_reload()
self.wait_online(['veth99:routable', 'test1:routable', 'dummy98:routable', 'dummy99:degraded',
'veth97:routable', 'veth97-peer:routable', 'veth98:routable', 'veth98-peer:routable'])
print('### ip -6 address show dev veth-peer scope global')
output = check_output('ip -6 address show dev veth-peer scope global')
print(output)