summaryrefslogtreecommitdiffstats
path: root/test/test-network/systemd-networkd-tests.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:18:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:18:14 +0000
commit67c5de60daa85b91fa68be4157e248fa31e75316 (patch)
tree7d567f3360f705ac21600343ef7f7cea645a9222 /test/test-network/systemd-networkd-tests.py
parentAdding upstream version 256.1. (diff)
downloadsystemd-upstream/256.2.tar.xz
systemd-upstream/256.2.zip
Adding upstream version 256.2.upstream/256.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/test-network/systemd-networkd-tests.py')
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index 0355c7a..7c336ba 100755
--- a/test/test-network/systemd-networkd-tests.py
+++ b/test/test-network/systemd-networkd-tests.py
@@ -5824,6 +5824,30 @@ class NetworkdRATests(unittest.TestCase, Utilities):
self.assertIn('pref high', output)
self.assertNotIn('pref low', output)
+ def test_ndisc_vs_static_route(self):
+ copy_network_unit('25-veth.netdev', '25-ipv6-prefix.network', '25-ipv6-prefix-veth-static-route.network')
+ start_networkd()
+ self.wait_online('veth99:routable', 'veth-peer:degraded')
+
+ output = check_output('ip -6 route show dev veth99 table all')
+ print(output)
+
+ # If a conflicting static route is already configured, do not override the static route.
+ output = check_output('ip -6 route show dev veth99 default via fe80::1034:56ff:fe78:9abd')
+ print(output)
+ self.assertIn('default proto static metric 256 pref medium', output)
+ self.assertNotIn('proto ra', output)
+
+ if not os.path.exists(test_ndisc_send):
+ self.skipTest(f"{test_ndisc_send} does not exist.")
+
+ # Also check if the static route is protected from RA with zero lifetime
+ check_output(f'{test_ndisc_send} --interface veth-peer --type router-advertisement --lifetime 0')
+ time.sleep(2)
+ output = check_output('ip -6 route show dev veth99 default via fe80::1034:56ff:fe78:9abd')
+ print(output)
+ self.assertIn('default proto static metric 256 pref medium', output)
+
# radvd supports captive portal since v2.20.
# https://github.com/radvd-project/radvd/commit/791179a7f730decbddb2290ef0e34aa85d71b1bc
@unittest.skipUnless(radvd_check_config('captive-portal.conf'), "Installed radvd doesn't support captive portals")