mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-11-05 17:56:46 +01:00
32 lines
917 B
Nix
32 lines
917 B
Nix
import ./make-test.nix ({ pkgs, ...} : {
|
|
name = "tomcat";
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
|
maintainers = [ eelco chaoflow ];
|
|
};
|
|
|
|
nodes = {
|
|
server =
|
|
{ pkgs, config, ... }:
|
|
|
|
{ services.tomcat.enable = true;
|
|
services.httpd.enable = true;
|
|
services.httpd.adminAddr = "foo@bar.com";
|
|
services.httpd.extraSubservices =
|
|
[ { serviceType = "tomcat-connector"; } ];
|
|
networking.firewall.allowedTCPPorts = [ 80 ];
|
|
};
|
|
|
|
client = { };
|
|
};
|
|
|
|
testScript = ''
|
|
startAll;
|
|
|
|
$server->waitForUnit("tomcat");
|
|
$server->sleep(30); # Dirty, but it takes a while before Tomcat handles to requests properly
|
|
$client->waitForUnit("network.target");
|
|
$client->succeed("curl --fail http://server/examples/servlets/servlet/HelloWorldExample");
|
|
$client->succeed("curl --fail http://server/examples/jsp/jsp2/simpletag/hello.jsp");
|
|
'';
|
|
})
|