From 856a247e193760b490428d673188f55644546d99 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 29 Jun 2023 21:58:23 +0900 Subject: [PATCH] test-network: add test for global IPv6PrivacyExtensions= setting --- .../conf/25-global-ipv6-privacy-extensions.conf | 3 +++ test/test-network/conf/25-sysctl.network | 7 +++---- .../25-ipv6-privacy-extensions.conf | 3 +++ test/test-network/systemd-networkd-tests.py | 11 +++++++++-- 4 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 test/test-network/conf/25-global-ipv6-privacy-extensions.conf create mode 100644 test/test-network/conf/25-sysctl.network.d/25-ipv6-privacy-extensions.conf diff --git a/test/test-network/conf/25-global-ipv6-privacy-extensions.conf b/test/test-network/conf/25-global-ipv6-privacy-extensions.conf new file mode 100644 index 00000000000..ced7f7bd9bb --- /dev/null +++ b/test/test-network/conf/25-global-ipv6-privacy-extensions.conf @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Network] +IPv6PrivacyExtensions=prefer-public diff --git a/test/test-network/conf/25-sysctl.network b/test/test-network/conf/25-sysctl.network index 72575eec8d8..e7d078aba08 100644 --- a/test/test-network/conf/25-sysctl.network +++ b/test/test-network/conf/25-sysctl.network @@ -3,11 +3,10 @@ Name=dummy98 [Network] -IPForward=true -IPv6PrivacyExtensions=true +IPForward=yes IPv6DuplicateAddressDetection=3 IPv6HopLimit=5 -IPv4ProxyARP=true -IPv6ProxyNDP=true +IPv4ProxyARP=yes +IPv6ProxyNDP=yes IPv6AcceptRA=no IPv4AcceptLocal=yes diff --git a/test/test-network/conf/25-sysctl.network.d/25-ipv6-privacy-extensions.conf b/test/test-network/conf/25-sysctl.network.d/25-ipv6-privacy-extensions.conf new file mode 100644 index 00000000000..35782d75559 --- /dev/null +++ b/test/test-network/conf/25-sysctl.network.d/25-ipv6-privacy-extensions.conf @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Network] +IPv6PrivacyExtensions=yes diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index c068f37a8a0..e70d359fa93 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -3121,12 +3121,13 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertRegex(output, 'inet6 .* scope link') def test_sysctl(self): - copy_network_unit('25-sysctl.network', '12-dummy.netdev') + copy_networkd_conf_dropin('25-global-ipv6-privacy-extensions.conf') + copy_network_unit('25-sysctl.network', '12-dummy.netdev', copy_dropins=False) start_networkd() self.wait_online(['dummy98:degraded']) self.check_ipv6_sysctl_attr('dummy98', 'forwarding', '1') - self.check_ipv6_sysctl_attr('dummy98', 'use_tempaddr', '2') + self.check_ipv6_sysctl_attr('dummy98', 'use_tempaddr', '1') self.check_ipv6_sysctl_attr('dummy98', 'dad_transmits', '3') self.check_ipv6_sysctl_attr('dummy98', 'hop_limit', '5') self.check_ipv6_sysctl_attr('dummy98', 'proxy_ndp', '1') @@ -3134,6 +3135,12 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.check_ipv4_sysctl_attr('dummy98', 'proxy_arp', '1') self.check_ipv4_sysctl_attr('dummy98', 'accept_local', '1') + copy_network_unit('25-sysctl.network.d/25-ipv6-privacy-extensions.conf') + networkctl_reload() + self.wait_online(['dummy98:degraded']) + + self.check_ipv6_sysctl_attr('dummy98', 'use_tempaddr', '2') + def test_sysctl_disable_ipv6(self): copy_network_unit('25-sysctl-disable-ipv6.network', '12-dummy.netdev')