]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: wait for veth99 being configured 21736/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 16 Dec 2021 14:54:17 +0000 (23:54 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 16 Dec 2021 15:14:30 +0000 (00:14 +0900)
As the address, which should be kept, may not be just removed yet.
Let's check that the address is actually kept.

test/test-network/systemd-networkd-tests.py

index 68cdad30ac5db9fd1d262645e083736f97fa5835..a55ac4de7e47bf0a62fd2701193a9bf4f9d4b593 100755 (executable)
@@ -4588,12 +4588,11 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
         print(output)
         self.assertRegex(output, r'192.168.5.*')
 
-        output = check_output(*networkctl_cmd, '-n', '0', 'status', 'veth99', env=env)
-        print(output)
-        self.assertRegex(output, r'192.168.5.*')
+        with open(os.path.join(network_unit_file_path, 'dhcp-client-keep-configuration-dhcp.network'), mode='a') as f:
+            f.write('[Network]\nDHCP=no\n')
 
-        start_networkd(3)
-        self.wait_online(['veth-peer:routable'])
+        start_networkd()
+        self.wait_online(['veth99:routable', 'veth-peer:routable'])
 
         print('Still the lease address should be kept after networkd restarted')
         output = check_output('ip address show dev veth99 scope global')