Skip to content

Commit

Permalink
test-network: add one more test case for DHCP prefix delegation
Browse files Browse the repository at this point in the history
For issue systemd#31349.
  • Loading branch information
yuwata committed Feb 16, 2024
1 parent f197178 commit 8f4492b
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/test-network/conf/25-dhcp6pd-upstream-no-assign.network
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions test/test-network/conf/isc-dhcpd-dhcp6pd-no-range.conf
Original file line number Diff line number Diff line change
@@ -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;
}
17 changes: 17 additions & 0 deletions test/test-network/systemd-networkd-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6603,6 +6603,23 @@ def test_dhcp6pd_no_address(self):

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',
Expand Down

0 comments on commit 8f4492b

Please sign in to comment.