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