diff --git a/tests/avahi.nix b/tests/avahi.nix index d29e0ff77c6..f1536f2eafa 100644 --- a/tests/avahi.nix +++ b/tests/avahi.nix @@ -22,13 +22,13 @@ with pkgs; '' startAll; # mDNS. - $one->waitForJob("network-interfaces"); + $one->waitForJob("network.target"); $one->mustSucceed("avahi-resolve-host-name one.local | tee out >&2"); $one->mustSucceed("test \"`cut -f1 < out`\" = one.local"); $one->mustSucceed("avahi-resolve-host-name two.local | tee out >&2"); $one->mustSucceed("test \"`cut -f1 < out`\" = two.local"); - $two->waitForJob("network-interfaces"); + $two->waitForJob("network.target"); $two->mustSucceed("avahi-resolve-host-name one.local | tee out >&2"); $two->mustSucceed("test \"`cut -f1 < out`\" = one.local"); $two->mustSucceed("avahi-resolve-host-name two.local | tee out >&2"); diff --git a/tests/bittorrent.nix b/tests/bittorrent.nix index 8951e5bad1b..c0cd7cd1843 100644 --- a/tests/bittorrent.nix +++ b/tests/bittorrent.nix @@ -79,7 +79,7 @@ in $tracker->succeed("chmod 644 /tmp/test.torrent"); # Start the tracker. !!! use a less crappy tracker - $tracker->waitForJob("network-interfaces"); + $tracker->waitForJob("network.target"); $tracker->succeed("bittorrent-tracker --port 6969 --dfile /tmp/dstate >&2 &"); $tracker->waitForOpenPort(6969); @@ -88,7 +88,7 @@ in # Now we should be able to download from the client behind the NAT. $tracker->waitForJob("httpd"); - $client1->waitForJob("network-interfaces"); + $client1->waitForJob("network.target"); $client1->succeed("transmission-cli http://tracker/test.torrent -w /tmp >&2 &"); $client1->waitForFile("/tmp/test.tar.bz2"); $client1->succeed("cmp /tmp/test.tar.bz2 ${file}"); @@ -98,7 +98,7 @@ in # Now download from the second client. This can only succeed if # the first client created a NAT hole in the router. - $client2->waitForJob("network-interfaces"); + $client2->waitForJob("network.target"); $client2->succeed("transmission-cli http://tracker/test.torrent -M -w /tmp >&2 &"); $client2->waitForFile("/tmp/test.tar.bz2"); $client2->succeed("cmp /tmp/test.tar.bz2 ${file}"); diff --git a/tests/firewall.nix b/tests/firewall.nix index b38cd988b76..060dbb6082c 100644 --- a/tests/firewall.nix +++ b/tests/firewall.nix @@ -27,7 +27,7 @@ $walled->waitForJob("firewall"); $walled->waitForJob("httpd"); - $attacker->waitForJob("network-interfaces"); + $attacker->waitForJob("network.target"); # Local connections should still work. $walled->succeed("curl -v http://localhost/ >&2"); diff --git a/tests/installer.nix b/tests/installer.nix index 65542ae862e..09c51c1e19e 100644 --- a/tests/installer.nix +++ b/tests/installer.nix @@ -169,13 +169,12 @@ let my $machine = createMachine({ hda => "harddisk", hdaInterface => "${iface}" }); # Did /boot get mounted, if appropriate? - # !!! There is currently no good way to wait for the - # `filesystems' task to finish. - $machine->waitForFile("/boot/grub"); + $machine->waitForUnit("local-fs.target"); + $machine->succeed("test -e /boot/grub"); # Did the swap device get activated? - # !!! Idem. - $machine->waitUntilSucceeds("cat /proc/swaps | grep -q /dev"); + $machine->waitForUnit("swap.target"); + $machine->succeed("cat /proc/swaps | grep -q /dev"); $machine->mustSucceed("nix-env -i coreutils >&2"); $machine->mustSucceed("type -tP ls | tee /dev/stderr") =~ /.nix-profile/ @@ -188,7 +187,7 @@ let # And just to be sure, check that the machine still boots after # "nixos-rebuild switch". my $machine = createMachine({ hda => "harddisk", hdaInterface => "${iface}" }); - $machine->waitForJob("network-interfaces"); + $machine->waitForJob("network.target"); $machine->shutdown; ''; diff --git a/tests/ipv6.nix b/tests/ipv6.nix index 4a308416aef..a5f1a65a73d 100644 --- a/tests/ipv6.nix +++ b/tests/ipv6.nix @@ -35,8 +35,8 @@ startAll; - $client->waitForJob("network-interfaces"); - $server->waitForJob("network-interfaces"); + $client->waitForJob("network.target"); + $server->waitForJob("network.target"); # Wait until the given interface has a non-tentative address of # the desired scope (i.e. has completed Duplicate Address diff --git a/tests/nat.nix b/tests/nat.nix index 5adbf3ce57d..24f390f24cb 100644 --- a/tests/nat.nix +++ b/tests/nat.nix @@ -41,12 +41,12 @@ # The router should have access to the server. $server->waitForJob("httpd"); - $router->waitForJob("network-interfaces"); + $router->waitForJob("network.target"); $router->succeed("curl --fail http://server/ >&2"); # The client should be also able to connect via the NAT router. $router->waitForJob("nat"); - $client->waitForJob("network-interfaces"); + $client->waitForJob("network.target"); $client->succeed("curl --fail http://server/ >&2"); $client->succeed("ping -c 1 server >&2"); diff --git a/tests/openssh.nix b/tests/openssh.nix index 7a3d789327a..734925989a3 100644 --- a/tests/openssh.nix +++ b/tests/openssh.nix @@ -29,7 +29,7 @@ $client->copyFileFromHost("key", "/root/.ssh/id_dsa"); $client->mustSucceed("chmod 600 /root/.ssh/id_dsa"); - $client->waitForJob("network-interfaces"); + $client->waitForJob("network.target"); $client->mustSucceed("ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no server 'echo hello world' >&2"); ''; } diff --git a/tests/tomcat.nix b/tests/tomcat.nix index 0726a782250..3fd99da413c 100644 --- a/tests/tomcat.nix +++ b/tests/tomcat.nix @@ -25,7 +25,7 @@ $server->waitForJob("tomcat"); $server->sleep(30); # Dirty, but it takes a while before Tomcat handles to requests properly - $client->waitForJob("network-interfaces"); + $client->waitForJob("network.target"); $client->succeed("curl --fail http://server/examples/servlets/servlet/HelloWorldExample"); $client->succeed("curl --fail http://server/examples/jsp/jsp2/simpletag/hello.jsp"); '';