2015-07-12 11:09:40 +01:00
|
|
|
import ./make-test.nix ({ pkgs, ...} : {
|
2014-06-28 15:04:49 +01:00
|
|
|
name = "tomcat";
|
2015-07-12 11:09:40 +01:00
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
|
|
|
maintainers = [ eelco chaoflow ];
|
|
|
|
};
|
2011-08-26 11:17:24 +01:00
|
|
|
|
|
|
|
nodes = {
|
2011-09-14 19:20:50 +01:00
|
|
|
server =
|
2011-08-26 11:17:24 +01:00
|
|
|
{ pkgs, config, ... }:
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2014-04-11 16:15:56 +01:00
|
|
|
{ services.tomcat.enable = true;
|
2011-08-26 11:17:24 +01:00
|
|
|
services.httpd.enable = true;
|
|
|
|
services.httpd.adminAddr = "foo@bar.com";
|
2014-04-11 16:15:56 +01:00
|
|
|
services.httpd.extraSubservices =
|
|
|
|
[ { serviceType = "tomcat-connector"; } ];
|
|
|
|
networking.firewall.allowedTCPPorts = [ 80 ];
|
2011-08-26 11:17:24 +01:00
|
|
|
};
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2011-08-26 11:17:24 +01:00
|
|
|
client = { };
|
|
|
|
};
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2011-08-26 11:17:24 +01:00
|
|
|
testScript = ''
|
|
|
|
startAll;
|
|
|
|
|
2012-10-24 17:22:53 +01:00
|
|
|
$server->waitForUnit("tomcat");
|
2011-08-26 11:17:24 +01:00
|
|
|
$server->sleep(30); # Dirty, but it takes a while before Tomcat handles to requests properly
|
2012-10-24 17:22:53 +01:00
|
|
|
$client->waitForUnit("network.target");
|
2011-08-29 15:23:26 +01: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 11:17:24 +01:00
|
|
|
'';
|
2015-07-12 11:09:40 +01:00
|
|
|
})
|