1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

test-network: add one more test case for LinkLocalAddressing=

This commit is contained in:
Yu Watanabe 2019-09-16 06:16:48 +09:00
parent 5539fc0f73
commit 7b3770a75f
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,6 @@
[Match]
Name=dummy98
[Network]
LinkLocalAddressing=ipv6
IPv6AcceptRA=no

View File

@ -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()