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