mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 10:53:52 +00:00
Tests: Depend on ‘network.target’
This commit is contained in:
parent
2d9258da67
commit
719aeb36ca
@ -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");
|
||||
|
@ -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}");
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
'';
|
||||
|
||||
|
@ -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
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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");
|
||||
'';
|
||||
}
|
||||
|
@ -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");
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user