1{ lib, pkgs, ... }:
2{
3 name = "tomcat";
4 meta.maintainers = [ lib.maintainers.anthonyroussel ];
5
6 nodes.machine =
7 { pkgs, ... }:
8 {
9 services.tomcat = {
10 enable = true;
11 port = 8001;
12 axis2.enable = true;
13 };
14 };
15
16 testScript = ''
17 machine.wait_for_unit("tomcat.service")
18 machine.wait_for_open_port(8001)
19 machine.wait_for_file("/var/tomcat/webapps/examples");
20
21 machine.succeed(
22 "curl -sS --fail http://localhost:8001/examples/servlets/servlet/HelloWorldExample | grep 'Hello World!'"
23 )
24 machine.succeed(
25 "curl -sS --fail http://localhost:8001/examples/jsp/jsp2/simpletag/hello.jsp | grep 'Hello, world!'"
26 )
27 machine.succeed(
28 "curl -sS --fail http://localhost:8001/axis2/axis2-web/HappyAxis.jsp | grep 'Found Axis2'"
29 )
30 '';
31}