]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: replace sleep with wait_address() and wait_address_dropped()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 9 Jul 2022 01:07:17 +0000 (10:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 9 Jul 2022 02:44:25 +0000 (11:44 +0900)
test/test-network/systemd-networkd-tests.py

index 4a6ef889557359e405566f6558d5f3729d174d1a..b5baef49a506e06c5e241a9fbc19e1b5a7ec03c1 100755 (executable)
@@ -4590,7 +4590,8 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
 
         # Sleep for 120 sec as the dnsmasq minimum lease time can only be set to 120
         print('Wait for the DHCP lease to be expired')
-        time.sleep(120)
+        self.wait_address_dropped('veth99', r'inet 192.168.5.11[0-9]*/24', ipv='-4', timeout_sec=120)
+        self.wait_address('veth99', r'inet 192.168.5.12[0-9]*/24', ipv='-4')
 
         self.wait_online(['veth99:routable', 'veth-peer:routable'])