1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

test-network: wait for bridge slave to be enslaved in test_bridge_ignore_carrier_loss_frequent_loss_and_gain()

This commit is contained in:
Yu Watanabe 2019-05-20 22:40:54 +09:00
parent a0ae96149a
commit be0e1ef9b5

View File

@ -1777,15 +1777,18 @@ class NetworkdNetWorkBridgeTests(unittest.TestCase, Utilities):
self.assertEqual(subprocess.call(['ip', 'link', 'add', 'dummy98', 'type', 'dummy']), 0)
self.assertEqual(subprocess.call(['ip', 'link', 'set', 'dummy98', 'up']), 0)
time.sleep(3)
for trial in range(30):
if trial > 0:
time.sleep(1)
if self.get_operstate('bridge99') == 'routable' and self.get_operstate('dummy98') == 'enslaved':
break
else:
self.assertTrue(False)
output = subprocess.check_output(['ip', 'address', 'show', 'bridge99'], universal_newlines=True).rstrip()
print(output)
self.assertRegex(output, 'inet 192.168.0.15/24 brd 192.168.0.255 scope global bridge99')
self.check_operstate('bridge99', 'routable')
self.check_operstate('dummy98', 'enslaved')
output = subprocess.check_output(['ip', 'rule', 'list', 'table', '100'], universal_newlines=True).rstrip()
print(output)
self.assertEqual(output, '0: from all to 8.8.8.8 lookup 100')