nixpkgs/nixos/tests/tomcat.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
840 B
Nix
Raw Normal View History

import ./make-test-python.nix ({ lib, pkgs, ... }: {
name = "tomcat";
meta.maintainers = [ lib.maintainers.anthonyroussel ];
2022-03-20 23:15:30 +00:00
nodes.machine = { pkgs, ... }: {
services.tomcat = {
enable = true;
2024-05-13 14:04:55 +00:00
port = 8001;
axis2.enable = true;
};
};
testScript = ''
machine.wait_for_unit("tomcat.service")
2024-05-13 14:04:55 +00:00
machine.wait_for_open_port(8001)
machine.wait_for_file("/var/tomcat/webapps/examples");
machine.succeed(
2024-05-13 14:04:55 +00:00
"curl -sS --fail http://localhost:8001/examples/servlets/servlet/HelloWorldExample | grep 'Hello World!'"
)
machine.succeed(
2024-05-13 14:04:55 +00:00
"curl -sS --fail http://localhost:8001/examples/jsp/jsp2/simpletag/hello.jsp | grep 'Hello, world!'"
)
machine.succeed(
2024-05-13 14:04:55 +00:00
"curl -sS --fail http://localhost:8001/axis2/axis2-web/HappyAxis.jsp | grep 'Found Axis2'"
)
'';
})