test-network: use wait_online() in test_link_local_addressing()

This also disables IPv6AcceptRA= to speed up the test.
This commit is contained in:
Yu Watanabe 2019-03-22 05:48:12 +09:00
parent d06f30fc73
commit 2dcfcc08d9
2 changed files with 3 additions and 3 deletions

View file

@ -3,3 +3,4 @@ Name=test1
[Network]
LinkLocalAddressing=yes
IPv6AcceptRA=no

View file

@ -1204,13 +1204,12 @@ class NetworkdNetWorkTests(unittest.TestCase, Utilities):
def test_link_local_addressing(self):
self.copy_unit_to_networkd_unit_path('25-link-local-addressing-yes.network', '11-dummy.netdev',
'25-link-local-addressing-no.network', '12-dummy.netdev')
self.start_networkd()
self.start_networkd(0)
self.wait_online(['test1:degraded', 'dummy98:carrier'])
self.assertTrue(self.link_exits('test1'))
self.assertTrue(self.link_exits('dummy98'))
time.sleep(10)
output = subprocess.check_output(['ip', 'address', 'show', 'dev', 'test1']).rstrip().decode('utf-8')
print(output)
self.assertRegex(output, 'inet .* scope link')