2014-04-14 12:02:44 +00:00
|
|
|
import ./make-test.nix {
|
2014-06-28 14:04:49 +00:00
|
|
|
name = "tomcat";
|
2011-08-26 10:17:24 +00:00
|
|
|
|
|
|
|
nodes = {
|
2011-09-14 18:20:50 +00:00
|
|
|
server =
|
2011-08-26 10:17:24 +00:00
|
|
|
{ pkgs, config, ... }:
|
2011-09-14 18:20:50 +00:00
|
|
|
|
2014-04-11 15:15:56 +00:00
|
|
|
{ services.tomcat.enable = true;
|
2011-08-26 10:17:24 +00:00
|
|
|
services.httpd.enable = true;
|
|
|
|
services.httpd.adminAddr = "foo@bar.com";
|
2014-04-11 15:15:56 +00:00
|
|
|
services.httpd.extraSubservices =
|
|
|
|
[ { serviceType = "tomcat-connector"; } ];
|
|
|
|
networking.firewall.allowedTCPPorts = [ 80 ];
|
2011-08-26 10:17:24 +00:00
|
|
|
};
|
2011-09-14 18:20:50 +00:00
|
|
|
|
2011-08-26 10:17:24 +00:00
|
|
|
client = { };
|
|
|
|
};
|
2011-09-14 18:20:50 +00:00
|
|
|
|
2011-08-26 10:17:24 +00:00
|
|
|
testScript = ''
|
|
|
|
startAll;
|
|
|
|
|
2012-10-24 16:22:53 +00:00
|
|
|
$server->waitForUnit("tomcat");
|
2011-08-26 10:17:24 +00:00
|
|
|
$server->sleep(30); # Dirty, but it takes a while before Tomcat handles to requests properly
|
2012-10-24 16:22:53 +00:00
|
|
|
$client->waitForUnit("network.target");
|
2011-08-29 14:23:26 +00:00
|
|
|
$client->succeed("curl --fail http://server/examples/servlets/servlet/HelloWorldExample");
|
|
|
|
$client->succeed("curl --fail http://server/examples/jsp/jsp2/simpletag/hello.jsp");
|
2011-08-26 10:17:24 +00:00
|
|
|
'';
|
2014-04-14 12:02:44 +00:00
|
|
|
|
2011-08-26 10:17:24 +00:00
|
|
|
}
|