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

test-network: retry several times if expected LLDP info is not obtained

As LLDP thing does not get involved in the link status, `networkctl lldp`
may not provide an expected information even if the link is in
'configured' state.

Fixes #17360.
This commit is contained in:
Yu Watanabe 2021-01-26 21:06:36 +09:00 committed by Lennart Poettering
parent 0de405873c
commit f0d87798ea

View File

@ -3429,10 +3429,16 @@ class NetworkdLLDPTests(unittest.TestCase, Utilities):
start_networkd() start_networkd()
self.wait_online(['veth99:degraded', 'veth-peer:degraded']) self.wait_online(['veth99:degraded', 'veth-peer:degraded'])
for trial in range(10):
if trial > 0:
time.sleep(1)
output = check_output(*networkctl_cmd, 'lldp', env=env) output = check_output(*networkctl_cmd, 'lldp', env=env)
print(output) print(output)
self.assertRegex(output, 'veth-peer') if re.search(r'veth99 .* veth-peer', output):
self.assertRegex(output, 'veth99') break
else:
self.fail()
class NetworkdRATests(unittest.TestCase, Utilities): class NetworkdRATests(unittest.TestCase, Utilities):
links = ['veth99'] links = ['veth99']