]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add test case for UnassignedSubnetPolicy= 33941/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 5 Aug 2024 02:18:45 +0000 (11:18 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 5 Aug 2024 20:24:20 +0000 (05:24 +0900)
test/test-network/conf/25-dhcp6pd-upstream-no-address.network
test/test-network/conf/25-dhcp6pd-upstream-no-assign.network
test/test-network/systemd-networkd-tests.py

index 01f0e9e6d50bc3427b83a4f341e0c46a46bca8ca..051bd400295d617ae0323b87c39347e80fec6f5e 100644 (file)
@@ -11,6 +11,7 @@ DHCPPrefixDelegation=yes
 [DHCPv6]
 WithoutRA=solicit
 UseAddress=no
+UnassignedSubnetPolicy=none
 
 [DHCPPrefixDelegation]
 UplinkInterface=:self
index 5f76390cecc0dbcabd926cec9c37222588118675..7662251de159a11e09a516027c4ba8941e93fd47 100644 (file)
@@ -10,6 +10,7 @@ DHCPPrefixDelegation=yes
 
 [DHCPv6]
 WithoutRA=solicit
+UnassignedSubnetPolicy=blackhole
 
 [DHCPPrefixDelegation]
 UplinkInterface=:self
index 01d871047aafd8c7ee246d7ba803cb9cf7760a8a..4ab6c0749fadb3ea59b43ed17d29b60a5853af6a 100755 (executable)
@@ -7147,6 +7147,11 @@ class NetworkdDHCPPDTests(unittest.TestCase, Utilities):
         print(output)
         self.assertNotIn('inet6 3ffe:501:ffff', output)
 
+        print('### ip -6 route show dev lo')
+        output = check_output('ip -6 route show dev lo')
+        print(output)
+        self.assertNotRegex(output, '3ffe:501:ffff:[2-9a-f]00::/56')
+
         self.check_dhcp6_prefix('veth99')
 
     @unittest.skipUnless(shutil.which('dhcpd'), reason="dhcpd is not available on CentOS Stream 10")
@@ -7165,6 +7170,11 @@ class NetworkdDHCPPDTests(unittest.TestCase, Utilities):
         print(output)
         self.assertNotIn('inet6 3ffe:501:ffff', output)
 
+        print('### ip -6 route show type blackhole')
+        output = check_output('ip -6 route show type blackhole')
+        print(output)
+        self.assertRegex(output, 'blackhole 3ffe:501:ffff:[2-9a-f]00::/56 dev lo proto dhcp')
+
         self.check_dhcp6_prefix('veth99')
 
     @unittest.skipUnless(shutil.which('dhcpd'), reason="dhcpd is not available on CentOS Stream 10")