nixpkgs/tests/tomcat.nix
Sander van der Burg abfdab0d3e Added testcase for Tomcat, with HTTP proxy
svn path=/nixos/trunk/; revision=28824
2011-08-26 10:17:24 +00:00

32 lines
815 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->mustSucceed("curl --fail http://server/examples/servlets/servlet/HelloWorldExample");
$client->mustSucceed("curl --fail http://server/examples/jsp/jsp2/simpletag/hello.jsp");
'';
}