diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-11-18 20:32:50 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-11-18 20:48:39 +0100 |
commit | c295b558bf0a130a0756667867ec9b4f8d1b33da (patch) | |
tree | 91bf5552a9c67ede826bf06692e18af2e7508e29 /test | |
parent | test-network: split out check_router_preference() from test_router_preference() (diff) | |
download | systemd-c295b558bf0a130a0756667867ec9b4f8d1b33da.tar.xz systemd-c295b558bf0a130a0756667867ec9b4f8d1b33da.zip |
test-network: add test case for IPv6 Core Conformance test v6LC.2.2.23
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 7c2de4201f..462d40d839 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -6454,6 +6454,24 @@ class NetworkdRATests(unittest.TestCase, Utilities): networkctl_reload() self.check_router_preference('01', 200, 'medium', 200, 'medium') + # Use route options to configure default routes. + # The preference specified in the RA header should be ignored. See issue #33468. + with open(os.path.join(network_unit_dir, '25-veth-router-high.network'), mode='a', encoding='utf-8') as f: + f.write('\n[IPv6SendRA]\nRouterPreference=high\n[IPv6RoutePrefix]\nRoute=::/0\nLifetimeSec=1200\n') + with open(os.path.join(network_unit_dir, '25-veth-router-low.network'), mode='a', encoding='utf-8') as f: + f.write('\n[IPv6SendRA]\nRouterPreference=low\n[IPv6RoutePrefix]\nRoute=::/0\nLifetimeSec=1200\n') + networkctl_reload() + self.check_router_preference('01', 200, 'medium', 200, 'medium') + + # Set zero lifetime to the route options. + # The preference specified in the RA header should be used. + with open(os.path.join(network_unit_dir, '25-veth-router-high.network'), mode='a', encoding='utf-8') as f: + f.write('LifetimeSec=0\n') + with open(os.path.join(network_unit_dir, '25-veth-router-low.network'), mode='a', encoding='utf-8') as f: + f.write('LifetimeSec=0\n') + networkctl_reload() + self.check_router_preference('01', 100, 'high', 300, 'low') + def _test_ndisc_vs_static_route(self, manage_foreign_nexthops): if not manage_foreign_nexthops: copy_networkd_conf_dropin('networkd-manage-foreign-nexthops-no.conf') |