3
0
Fork 0
forked from mirrors/nixpkgs

* 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("httpd");
$attacker->waitForJob("network-interfaces");
# Local connections should still work.
$walled->succeed("curl -v http://localhost/ >&2");

View file

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

View file

@ -41,10 +41,12 @@
# The router should have access to the server.
$server->waitForJob("httpd");
$router->waitForJob("network-interfaces");
$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->succeed("curl --fail http://server/ >&2");
$client->succeed("ping -c 1 server >&2");

View file

@ -25,7 +25,8 @@
$server->waitForJob("tomcat");
$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->mustSucceed("curl --fail http://server/examples/jsp/jsp2/simpletag/hello.jsp");
$client->waitForJob("network-interfaces");
$client->succeed("curl --fail http://server/examples/servlets/servlet/HelloWorldExample");
$client->succeed("curl --fail http://server/examples/jsp/jsp2/simpletag/hello.jsp");
'';
}