From 1805e2cb05f634903ff81ba71f1cbab32c7581c6 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 11 Nov 2023 03:30:00 +0900 Subject: [PATCH] test-network: add test case for issue #29979 --- .../conf/25-dhcp6pd-upstream.network | 2 ++ .../with-address.conf | 6 ++++++ test/test-network/systemd-networkd-tests.py | 18 +++++++++++++++--- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 test/test-network/conf/25-dhcp6pd-upstream.network.d/with-address.conf diff --git a/test/test-network/conf/25-dhcp6pd-upstream.network b/test/test-network/conf/25-dhcp6pd-upstream.network index 4b8cd7d3244..01f0e9e6d50 100644 --- a/test/test-network/conf/25-dhcp6pd-upstream.network +++ b/test/test-network/conf/25-dhcp6pd-upstream.network @@ -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 diff --git a/test/test-network/conf/25-dhcp6pd-upstream.network.d/with-address.conf b/test/test-network/conf/25-dhcp6pd-upstream.network.d/with-address.conf new file mode 100644 index 00000000000..451475509d1 --- /dev/null +++ b/test/test-network/conf/25-dhcp6pd-upstream.network.d/with-address.conf @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[DHCPv6] +UseAddress=yes + +[DHCPPrefixDelegation] +Assign=yes diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index c77a0e0eb2d..041dfd313b8 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -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)