From: Yu Watanabe Date: Mon, 5 Aug 2024 02:18:45 +0000 (+0900) Subject: test-network: add test case for UnassignedSubnetPolicy= X-Git-Tag: v257-rc1~730^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F33941%2Fhead;p=thirdparty%2Fsystemd.git test-network: add test case for UnassignedSubnetPolicy= --- diff --git a/test/test-network/conf/25-dhcp6pd-upstream-no-address.network b/test/test-network/conf/25-dhcp6pd-upstream-no-address.network index 01f0e9e6d50..051bd400295 100644 --- a/test/test-network/conf/25-dhcp6pd-upstream-no-address.network +++ b/test/test-network/conf/25-dhcp6pd-upstream-no-address.network @@ -11,6 +11,7 @@ DHCPPrefixDelegation=yes [DHCPv6] WithoutRA=solicit UseAddress=no +UnassignedSubnetPolicy=none [DHCPPrefixDelegation] UplinkInterface=:self diff --git a/test/test-network/conf/25-dhcp6pd-upstream-no-assign.network b/test/test-network/conf/25-dhcp6pd-upstream-no-assign.network index 5f76390cecc..7662251de15 100644 --- a/test/test-network/conf/25-dhcp6pd-upstream-no-assign.network +++ b/test/test-network/conf/25-dhcp6pd-upstream-no-assign.network @@ -10,6 +10,7 @@ DHCPPrefixDelegation=yes [DHCPv6] WithoutRA=solicit +UnassignedSubnetPolicy=blackhole [DHCPPrefixDelegation] UplinkInterface=:self diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 01d871047aa..4ab6c0749fa 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -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")