1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 02:21:16 +02:00

tests: Wait for network *online* and multi-user targets

This should help prevent some test stalls.

By default, multi-user.target does not imply that the network is fully up.
This commit is contained in:
Robert Hensing 2025-01-20 15:47:10 +01:00
parent 263a818bee
commit 15073e86a8
5 changed files with 17 additions and 5 deletions

View file

@ -48,7 +48,10 @@ in {
server.succeed("mkdir -m 700 /root/.ssh")
server.copy_from_host("key.pub", "/root/.ssh/authorized_keys")
server.wait_for_unit("sshd")
client.wait_for_unit("network.target")
server.wait_for_unit("multi-user.target")
server.wait_for_unit("network-online.target")
client.wait_for_unit("network-online.target")
client.succeed(f"ssh -o StrictHostKeyChecking=no {server.name} 'echo hello world'")
# Copy the closure of package A from the client to the server.