mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
tests: Wait for network *online* targets
More prevalent than I thought in15073e86a
See also3588783032
which is a failed github-flakes test without "Network is Online"
This commit is contained in:
parent
fcc501b730
commit
6f0bdd9ae7
6 changed files with 11 additions and 0 deletions
|
@ -46,6 +46,7 @@
|
|||
remote.wait_for_unit("sshd")
|
||||
remote.wait_for_unit("multi-user.target")
|
||||
remote.wait_for_unit("network-online.target")
|
||||
client.wait_for_unit("network-online.target")
|
||||
client.succeed(f"ssh -o StrictHostKeyChecking=no {remote.name} 'echo hello world'")
|
||||
|
||||
remote.succeed("""
|
||||
|
|
|
@ -161,7 +161,9 @@ in
|
|||
github.succeed("cat /var/log/httpd/*.log >&2")
|
||||
|
||||
github.wait_for_unit("httpd.service")
|
||||
github.wait_for_unit("network-online.target")
|
||||
|
||||
client.wait_for_unit("network-online.target")
|
||||
client.succeed("curl -v https://github.com/ >&2")
|
||||
out = client.succeed("nix registry list")
|
||||
print(out)
|
||||
|
|
|
@ -37,6 +37,7 @@ in {
|
|||
|
||||
testScript = { nodes }: ''
|
||||
cache.wait_for_unit("harmonia.service")
|
||||
cache.wait_for_unit("network-online.target")
|
||||
|
||||
machine.succeed("mkdir -p /etc/containers")
|
||||
machine.succeed("""echo '{"default":[{"type":"insecureAcceptAnything"}]}' > /etc/containers/policy.json""")
|
||||
|
|
|
@ -102,6 +102,7 @@ in
|
|||
};
|
||||
|
||||
testScript = { nodes, ... }: ''
|
||||
http_dns.wait_for_unit("network-online.target")
|
||||
http_dns.wait_for_unit("nginx")
|
||||
http_dns.wait_for_open_port(80)
|
||||
http_dns.wait_for_unit("unbound")
|
||||
|
@ -109,6 +110,7 @@ in
|
|||
|
||||
client.start()
|
||||
client.wait_for_unit('multi-user.target')
|
||||
client.wait_for_unit('network-online.target')
|
||||
|
||||
with subtest("can fetch data from a remote server outside sandbox"):
|
||||
client.succeed("nix --version >&2")
|
||||
|
|
|
@ -52,12 +52,15 @@ in {
|
|||
|
||||
# Create a binary cache.
|
||||
server.wait_for_unit("minio")
|
||||
server.wait_for_unit("network-online.target")
|
||||
|
||||
server.succeed("mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} --api s3v4")
|
||||
server.succeed("mc mb minio/my-cache")
|
||||
|
||||
server.succeed("${env} nix copy --to '${storeUrl}' ${pkgA}")
|
||||
|
||||
client.wait_for_unit("network-online.target")
|
||||
|
||||
# Test fetchurl on s3:// URLs while we're at it.
|
||||
client.succeed("${env} nix eval --impure --expr 'builtins.fetchurl { name = \"foo\"; url = \"s3://my-cache/nix-cache-info?endpoint=http://server:9000®ion=eu-west-1\"; }'")
|
||||
|
||||
|
|
|
@ -122,6 +122,8 @@ in
|
|||
start_all()
|
||||
|
||||
sourcehut.wait_for_unit("httpd.service")
|
||||
sourcehut.wait_for_unit("network-online.target")
|
||||
client.wait_for_unit("network-online.target")
|
||||
|
||||
client.succeed("curl -v https://git.sr.ht/ >&2")
|
||||
client.succeed("nix registry list | grep nixpkgs")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue