test-network: add one more test case for DHCP prefix delegation

For issue #31349.
This commit is contained in:
Yu Watanabe 2024-02-17 05:56:27 +09:00 committed by Luca Boccassi
parent ab06b74fd3
commit 3b677c6f94
3 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,20 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Match]
Name=veth99
[Network]
IPv6PrivacyExtensions=yes
IPv6AcceptRA=no
DHCP=ipv6
DHCPPrefixDelegation=yes
[DHCPv6]
WithoutRA=solicit
[DHCPPrefixDelegation]
UplinkInterface=:self
SubnetId=10
Announce=no
Token=eui64
Token=::1a:2b:3c:4d
Assign=no

View file

@ -0,0 +1,18 @@
default-lease-time 2592000;
preferred-lifetime 604800;
option dhcp-renewal-time 3600;
option dhcp-rebinding-time 7200;
# Enable RFC 5007 support (same than for DHCPv4)
allow leasequery;
option dhcp6.name-servers 3ffe:501:ffff:100:200:ff:fe00:3f3e;
option dhcp6.domain-search "test.example.com","example.com";
option dhcp6.info-refresh-time 21600;
subnet6 3ffe:501:ffff:100::/64 {
# Some /64 prefixes available for Prefix Delegation (RFC 3633)
prefix6 3ffe:501:ffff:200:: 3ffe:501:ffff:f00:: /56;
}

View file

@ -6603,6 +6603,23 @@ class NetworkdDHCPPDTests(unittest.TestCase, Utilities):
self.check_dhcp6_prefix('veth99')
def test_dhcp6pd_no_assign(self):
# Similar to test_dhcp6pd_no_assign(), but in this case UseAddress=yes (default),
# However, the server does not provide IA_NA. For issue #31349.
copy_network_unit('25-veth.netdev', '25-dhcp6pd-server.network', '25-dhcp6pd-upstream-no-assign.network')
start_networkd()
self.wait_online('veth-peer:routable')
start_isc_dhcpd(conf_file='isc-dhcpd-dhcp6pd-no-range.conf', ipv='-6')
self.wait_online('veth99:degraded')
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)
self.check_dhcp6_prefix('veth99')
def test_dhcp6pd(self):
copy_network_unit('25-veth.netdev', '25-dhcp6pd-server.network', '25-dhcp6pd-upstream.network',
'25-veth-downstream-veth97.netdev', '25-dhcp-pd-downstream-veth97.network', '25-dhcp-pd-downstream-veth97-peer.network',