nixpkgs-suyu/tests/tomcat.nix
Eelco Dolstra 51006ffdc7 * 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
2011-08-29 14:23:26 +00:00

32 lines
854 B
Nix

{ pkgs, ... }:
{
nodes = {
server =
{ pkgs, config, ... }:
{
services.tomcat.enable = true;
services.httpd.enable = true;
services.httpd.adminAddr = "foo@bar.com";
services.httpd.extraSubservices = [
{ serviceType = "tomcat-connector";
stateDir = "/var/run/httpd";
logDir = "/var/log/httpd";
}
];
};
client = { };
};
testScript = ''
startAll;
$server->waitForJob("tomcat");
$server->sleep(30); # Dirty, but it takes a while before Tomcat handles to requests properly
$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");
'';
}