summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-09-16 06:16:48 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-09-17 09:45:22 +0900
commit7b3770a75f3c2999cd415f8b7d0160e6c92800e7 (patch)
tree21e26d4c14d81adaaecb37cf8f5bf1b2bf143cc6 /test
parent5539fc0f73402add1f60298e75c91a454aa3a05c (diff)
downloadsystemd-7b3770a75f3c2999cd415f8b7d0160e6c92800e7.tar.gz
systemd-7b3770a75f3c2999cd415f8b7d0160e6c92800e7.tar.bz2
systemd-7b3770a75f3c2999cd415f8b7d0160e6c92800e7.zip
test-network: add one more test case for LinkLocalAddressing=
Diffstat (limited to 'test')
-rw-r--r--test/test-network/conf/26-link-local-addressing-ipv6.network6
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py18
2 files changed, 24 insertions, 0 deletions
diff --git a/test/test-network/conf/26-link-local-addressing-ipv6.network b/test/test-network/conf/26-link-local-addressing-ipv6.network
new file mode 100644
index 0000000000..b4b5362a4a
--- /dev/null
+++ b/test/test-network/conf/26-link-local-addressing-ipv6.network
@@ -0,0 +1,6 @@
+[Match]
+Name=dummy98
+
+[Network]
+LinkLocalAddressing=ipv6
+IPv6AcceptRA=no
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index dd031de383..f1a58158e1 100755
--- a/test/test-network/systemd-networkd-tests.py
+++ b/test/test-network/systemd-networkd-tests.py
@@ -1435,6 +1435,7 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
'25-gateway-next-static.network',
'25-sysctl-disable-ipv6.network',
'25-sysctl.network',
+ '26-link-local-addressing-ipv6.network',
'configure-without-carrier.network',
'routing-policy-rule-dummy98.network',
'routing-policy-rule-test1.network']
@@ -1814,6 +1815,23 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
if os.path.exists(os.path.join(os.path.join(network_sysctl_ipv6_path, 'dummy98'), 'addr_gen_mode')):
self.assertEqual(read_ipv6_sysctl_attr('dummy98', 'addr_gen_mode'), '1')
+ def test_link_local_addressing_remove_ipv6ll(self):
+ copy_unit_to_networkd_unit_path('26-link-local-addressing-ipv6.network', '12-dummy.netdev')
+ start_networkd()
+ self.wait_online(['dummy98:degraded'])
+
+ output = check_output('ip address show dev dummy98')
+ print(output)
+ self.assertRegex(output, 'inet6 .* scope link')
+
+ copy_unit_to_networkd_unit_path('25-link-local-addressing-no.network')
+ restart_networkd(1)
+ self.wait_online(['dummy98:carrier'])
+
+ output = check_output('ip address show dev dummy98')
+ print(output)
+ self.assertNotRegex(output, 'inet6* .* scope link')
+
def test_sysctl(self):
copy_unit_to_networkd_unit_path('25-sysctl.network', '12-dummy.netdev')
start_networkd()