test-network: use wait_online() in test_link_local_addressing()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 21 Mar 2019 20:48:12 +0000 (05:48 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 29 Mar 2019 17:27:22 +0000 (02:27 +0900)
This also disables IPv6AcceptRA= to speed up the test.

test/test-network/conf/25-link-local-addressing-yes.network
test/test-network/systemd-networkd-tests.py

index 91e03c0..c39250c 100755 (executable)
@@ -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')