diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-08-05 04:18:45 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-08-05 22:24:20 +0200 |
commit | d133508493f13ed7d98356966cc5feb049b919f5 (patch) | |
tree | 85c476d8df8335a692729cad3b062d03b19ae7aa /test/test-network | |
parent | network/dhcp-pd: allow to customize route type for delegated prefix (diff) | |
download | systemd-d133508493f13ed7d98356966cc5feb049b919f5.tar.xz systemd-d133508493f13ed7d98356966cc5feb049b919f5.zip |
test-network: add test case for UnassignedSubnetPolicy=
Diffstat (limited to 'test/test-network')
3 files changed, 12 insertions, 0 deletions
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 01f0e9e6d5..051bd40029 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 5f76390cec..7662251de1 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 01d871047a..4ab6c0749f 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") |