mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
tests/nixos: Work around network-online.target inactivity
This commit is contained in:
parent
55297f865c
commit
58b657b976
10 changed files with 20 additions and 20 deletions
|
@ -45,14 +45,14 @@
|
||||||
client.succeed("chmod 600 /root/.ssh/id_ed25519")
|
client.succeed("chmod 600 /root/.ssh/id_ed25519")
|
||||||
|
|
||||||
# Install the SSH key on the builders.
|
# Install the SSH key on the builders.
|
||||||
client.wait_for_unit("network-online.target")
|
client.wait_for_unit("network-addresses-eth1.service")
|
||||||
|
|
||||||
remote.succeed("mkdir -p -m 700 /root/.ssh")
|
remote.succeed("mkdir -p -m 700 /root/.ssh")
|
||||||
remote.copy_from_host("key.pub", "/root/.ssh/authorized_keys")
|
remote.copy_from_host("key.pub", "/root/.ssh/authorized_keys")
|
||||||
remote.wait_for_unit("sshd")
|
remote.wait_for_unit("sshd")
|
||||||
remote.wait_for_unit("multi-user.target")
|
remote.wait_for_unit("multi-user.target")
|
||||||
remote.wait_for_unit("network-online.target")
|
remote.wait_for_unit("network-addresses-eth1.service")
|
||||||
client.wait_for_unit("network-online.target")
|
client.wait_for_unit("network-addresses-eth1.service")
|
||||||
client.succeed(f"ssh -o StrictHostKeyChecking=no {remote.name} 'echo hello world'")
|
client.succeed(f"ssh -o StrictHostKeyChecking=no {remote.name} 'echo hello world'")
|
||||||
|
|
||||||
remote.succeed("""
|
remote.succeed("""
|
||||||
|
|
|
@ -187,9 +187,9 @@ in
|
||||||
github.succeed("cat /var/log/httpd/*.log >&2")
|
github.succeed("cat /var/log/httpd/*.log >&2")
|
||||||
|
|
||||||
github.wait_for_unit("httpd.service")
|
github.wait_for_unit("httpd.service")
|
||||||
github.wait_for_unit("network-online.target")
|
github.wait_for_unit("network-addresses-eth1.service")
|
||||||
|
|
||||||
client.wait_for_unit("network-online.target")
|
client.wait_for_unit("network-addresses-eth1.service")
|
||||||
client.succeed("curl -v https://github.com/ >&2")
|
client.succeed("curl -v https://github.com/ >&2")
|
||||||
out = client.succeed("nix registry list")
|
out = client.succeed("nix registry list")
|
||||||
print(out)
|
print(out)
|
||||||
|
|
|
@ -70,9 +70,9 @@ in
|
||||||
server.copy_from_host("key.pub", "/root/.ssh/authorized_keys")
|
server.copy_from_host("key.pub", "/root/.ssh/authorized_keys")
|
||||||
server.wait_for_unit("sshd")
|
server.wait_for_unit("sshd")
|
||||||
server.wait_for_unit("multi-user.target")
|
server.wait_for_unit("multi-user.target")
|
||||||
server.wait_for_unit("network-online.target")
|
server.wait_for_unit("network-addresses-eth1.service")
|
||||||
|
|
||||||
client.wait_for_unit("network-online.target")
|
client.wait_for_unit("network-addresses-eth1.service")
|
||||||
client.succeed(f"ssh -o StrictHostKeyChecking=no {server.name} 'echo hello world'")
|
client.succeed(f"ssh -o StrictHostKeyChecking=no {server.name} 'echo hello world'")
|
||||||
|
|
||||||
# Copy the closure of package A from the client to the server.
|
# Copy the closure of package A from the client to the server.
|
||||||
|
|
|
@ -79,9 +79,9 @@ in
|
||||||
|
|
||||||
server.wait_for_unit("sshd")
|
server.wait_for_unit("sshd")
|
||||||
server.wait_for_unit("multi-user.target")
|
server.wait_for_unit("multi-user.target")
|
||||||
server.wait_for_unit("network-online.target")
|
server.wait_for_unit("network-addresses-eth1.service")
|
||||||
|
|
||||||
client.wait_for_unit("network-online.target")
|
client.wait_for_unit("network-addresses-eth1.service")
|
||||||
client.wait_for_unit("getty@tty1.service")
|
client.wait_for_unit("getty@tty1.service")
|
||||||
# Either the prompt: ]#
|
# Either the prompt: ]#
|
||||||
# or an OCR misreading of it: 1#
|
# or an OCR misreading of it: 1#
|
||||||
|
|
|
@ -61,7 +61,7 @@ in
|
||||||
{ nodes }:
|
{ nodes }:
|
||||||
''
|
''
|
||||||
cache.wait_for_unit("harmonia.service")
|
cache.wait_for_unit("harmonia.service")
|
||||||
cache.wait_for_unit("network-online.target")
|
cache.wait_for_unit("network-addresses-eth1.service")
|
||||||
|
|
||||||
machine.succeed("mkdir -p /etc/containers")
|
machine.succeed("mkdir -p /etc/containers")
|
||||||
machine.succeed("""echo '{"default":[{"type":"insecureAcceptAnything"}]}' > /etc/containers/policy.json""")
|
machine.succeed("""echo '{"default":[{"type":"insecureAcceptAnything"}]}' > /etc/containers/policy.json""")
|
||||||
|
|
|
@ -145,7 +145,7 @@ in
|
||||||
testScript =
|
testScript =
|
||||||
{ nodes, ... }:
|
{ nodes, ... }:
|
||||||
''
|
''
|
||||||
http_dns.wait_for_unit("network-online.target")
|
http_dns.wait_for_unit("network-addresses-eth1.service")
|
||||||
http_dns.wait_for_unit("nginx")
|
http_dns.wait_for_unit("nginx")
|
||||||
http_dns.wait_for_open_port(80)
|
http_dns.wait_for_open_port(80)
|
||||||
http_dns.wait_for_unit("unbound")
|
http_dns.wait_for_unit("unbound")
|
||||||
|
@ -153,7 +153,7 @@ in
|
||||||
|
|
||||||
client.start()
|
client.start()
|
||||||
client.wait_for_unit('multi-user.target')
|
client.wait_for_unit('multi-user.target')
|
||||||
client.wait_for_unit('network-online.target')
|
client.wait_for_unit('network-addresses-eth1.service')
|
||||||
|
|
||||||
with subtest("can fetch data from a remote server outside sandbox"):
|
with subtest("can fetch data from a remote server outside sandbox"):
|
||||||
client.succeed("nix --version >&2")
|
client.succeed("nix --version >&2")
|
||||||
|
|
|
@ -102,12 +102,12 @@ in
|
||||||
client.succeed("chmod 600 /root/.ssh/id_ed25519")
|
client.succeed("chmod 600 /root/.ssh/id_ed25519")
|
||||||
|
|
||||||
# Install the SSH key on the builder.
|
# Install the SSH key on the builder.
|
||||||
client.wait_for_unit("network-online.target")
|
client.wait_for_unit("network-addresses-eth1.service")
|
||||||
builder.succeed("mkdir -p -m 700 /root/.ssh")
|
builder.succeed("mkdir -p -m 700 /root/.ssh")
|
||||||
builder.copy_from_host("key.pub", "/root/.ssh/authorized_keys")
|
builder.copy_from_host("key.pub", "/root/.ssh/authorized_keys")
|
||||||
builder.wait_for_unit("sshd")
|
builder.wait_for_unit("sshd")
|
||||||
builder.wait_for_unit("multi-user.target")
|
builder.wait_for_unit("multi-user.target")
|
||||||
builder.wait_for_unit("network-online.target")
|
builder.wait_for_unit("network-addresses-eth1.service")
|
||||||
|
|
||||||
client.succeed(f"ssh -o StrictHostKeyChecking=no {builder.name} 'echo hello world'")
|
client.succeed(f"ssh -o StrictHostKeyChecking=no {builder.name} 'echo hello world'")
|
||||||
|
|
||||||
|
|
|
@ -123,12 +123,12 @@ in
|
||||||
client.succeed("chmod 600 /root/.ssh/id_ed25519")
|
client.succeed("chmod 600 /root/.ssh/id_ed25519")
|
||||||
|
|
||||||
# Install the SSH key on the builders.
|
# Install the SSH key on the builders.
|
||||||
client.wait_for_unit("network-online.target")
|
client.wait_for_unit("network-addresses-eth1.service")
|
||||||
for builder in [builder1, builder2]:
|
for builder in [builder1, builder2]:
|
||||||
builder.succeed("mkdir -p -m 700 /root/.ssh")
|
builder.succeed("mkdir -p -m 700 /root/.ssh")
|
||||||
builder.copy_from_host("key.pub", "/root/.ssh/authorized_keys")
|
builder.copy_from_host("key.pub", "/root/.ssh/authorized_keys")
|
||||||
builder.wait_for_unit("sshd")
|
builder.wait_for_unit("sshd")
|
||||||
builder.wait_for_unit("network-online.target")
|
builder.wait_for_unit("network-addresses-eth1.service")
|
||||||
# Make sure the builder can handle our login correctly
|
# Make sure the builder can handle our login correctly
|
||||||
builder.wait_for_unit("multi-user.target")
|
builder.wait_for_unit("multi-user.target")
|
||||||
# Make sure there's no funny business on the client either
|
# Make sure there's no funny business on the client either
|
||||||
|
|
|
@ -67,14 +67,14 @@ in
|
||||||
|
|
||||||
# Create a binary cache.
|
# Create a binary cache.
|
||||||
server.wait_for_unit("minio")
|
server.wait_for_unit("minio")
|
||||||
server.wait_for_unit("network-online.target")
|
server.wait_for_unit("network-addresses-eth1.service")
|
||||||
|
|
||||||
server.succeed("mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} --api s3v4")
|
server.succeed("mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} --api s3v4")
|
||||||
server.succeed("mc mb minio/my-cache")
|
server.succeed("mc mb minio/my-cache")
|
||||||
|
|
||||||
server.succeed("${env} nix copy --to '${storeUrl}' ${pkgA}")
|
server.succeed("${env} nix copy --to '${storeUrl}' ${pkgA}")
|
||||||
|
|
||||||
client.wait_for_unit("network-online.target")
|
client.wait_for_unit("network-addresses-eth1.service")
|
||||||
|
|
||||||
# Test fetchurl on s3:// URLs while we're at it.
|
# 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\"; }'")
|
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\"; }'")
|
||||||
|
|
|
@ -139,8 +139,8 @@ in
|
||||||
start_all()
|
start_all()
|
||||||
|
|
||||||
sourcehut.wait_for_unit("httpd.service")
|
sourcehut.wait_for_unit("httpd.service")
|
||||||
sourcehut.wait_for_unit("network-online.target")
|
sourcehut.wait_for_unit("network-addresses-eth1.service")
|
||||||
client.wait_for_unit("network-online.target")
|
client.wait_for_unit("network-addresses-eth1.service")
|
||||||
|
|
||||||
client.succeed("curl -v https://git.sr.ht/ >&2")
|
client.succeed("curl -v https://git.sr.ht/ >&2")
|
||||||
client.succeed("nix registry list | grep nixpkgs")
|
client.succeed("nix registry list | grep nixpkgs")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue