* Make some tests more robust. In particular, tests should make sure

that the network-interfaces job is up before accessing the network.

svn path=/nixos/trunk/; revision=28877
This commit is contained in:
Eelco Dolstra 2011-08-29 14:23:26 +00:00
parent 5ee15d4986
commit 51006ffdc7
4 changed files with 9 additions and 5 deletions

View file

@ -27,6 +27,7 @@
$walled->waitForJob("firewall"); $walled->waitForJob("firewall");
$walled->waitForJob("httpd"); $walled->waitForJob("httpd");
$attacker->waitForJob("network-interfaces");
# Local connections should still work. # Local connections should still work.
$walled->succeed("curl -v http://localhost/ >&2"); $walled->succeed("curl -v http://localhost/ >&2");

View file

@ -35,11 +35,11 @@
# Check whether ConsoleKit/udev gives and removes device # Check whether ConsoleKit/udev gives and removes device
# ownership as needed. # ownership as needed.
subtest "device permissions", sub { subtest "device permissions", sub {
$machine->fail("getfacl /dev/snd/timer | grep -q alice");
$machine->succeed("chvt 1"); $machine->succeed("chvt 1");
$machine->sleep(1); # urgh $machine->waitUntilSucceeds("getfacl /dev/snd/timer | grep -q alice");
$machine->succeed("getfacl /dev/snd/timer | grep -q alice");
$machine->succeed("chvt 2"); $machine->succeed("chvt 2");
$machine->sleep(1); # urgh $machine->sleep(2); # urgh
$machine->fail("getfacl /dev/snd/timer | grep -q alice"); $machine->fail("getfacl /dev/snd/timer | grep -q alice");
}; };

View file

@ -41,10 +41,12 @@
# The router should have access to the server. # The router should have access to the server.
$server->waitForJob("httpd"); $server->waitForJob("httpd");
$router->waitForJob("network-interfaces");
$router->succeed("curl --fail http://server/ >&2"); $router->succeed("curl --fail http://server/ >&2");
# The client should be also able to connect via the NAT router. # The client should be also able to connect via the NAT router.
$router->waitForJob("nat"); $router->waitForJob("nat");
$client->waitForJob("network-interfaces");
$client->succeed("curl --fail http://server/ >&2"); $client->succeed("curl --fail http://server/ >&2");
$client->succeed("ping -c 1 server >&2"); $client->succeed("ping -c 1 server >&2");

View file

@ -25,7 +25,8 @@
$server->waitForJob("tomcat"); $server->waitForJob("tomcat");
$server->sleep(30); # Dirty, but it takes a while before Tomcat handles to requests properly $server->sleep(30); # Dirty, but it takes a while before Tomcat handles to requests properly
$client->mustSucceed("curl --fail http://server/examples/servlets/servlet/HelloWorldExample"); $client->waitForJob("network-interfaces");
$client->mustSucceed("curl --fail http://server/examples/jsp/jsp2/simpletag/hello.jsp"); $client->succeed("curl --fail http://server/examples/servlets/servlet/HelloWorldExample");
$client->succeed("curl --fail http://server/examples/jsp/jsp2/simpletag/hello.jsp");
''; '';
} }