]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add test case for issue #29979 29981/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 Nov 2023 18:30:00 +0000 (03:30 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 Nov 2023 18:57:59 +0000 (03:57 +0900)
test/test-network/conf/25-dhcp6pd-upstream.network
test/test-network/conf/25-dhcp6pd-upstream.network.d/with-address.conf [new file with mode: 0644]
test/test-network/systemd-networkd-tests.py

index 4b8cd7d3244fe8d9a69e3260198be72e0997cb39..01f0e9e6d50bc3427b83a4f341e0c46a46bca8ca 100644 (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
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 (file)
index 0000000..4514755
--- /dev/null
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[DHCPv6]
+UseAddress=yes
+
+[DHCPPrefixDelegation]
+Assign=yes
index c77a0e0eb2db2d6afe19feb4d731e6d310711b0a..041dfd313b8bd661693b65190bc63e987d555ad6 100755 (executable)
@@ -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)