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