1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00
nixpkgs/nixos/tests/tomcat.nix
Sergei Trofimovich 15a672bf1f nixosTests.tomcat: add lib to imports to fix eval
Without the change eval fails as:

    $ nix build --no-link -f. nixosTests.tomcat

        error: undefined variable 'lib'
2023-12-28 06:50:22 +00:00

28 lines
821 B
Nix

import ./make-test-python.nix ({ lib, pkgs, ... }: {
name = "tomcat";
meta.maintainers = [ lib.maintainers.anthonyroussel ];
nodes.machine = { pkgs, ... }: {
services.tomcat = {
enable = true;
axis2.enable = true;
};
};
testScript = ''
machine.wait_for_unit("tomcat.service")
machine.wait_for_open_port(8080)
machine.wait_for_file("/var/tomcat/webapps/examples");
machine.succeed(
"curl -sS --fail http://localhost:8080/examples/servlets/servlet/HelloWorldExample | grep 'Hello World!'"
)
machine.succeed(
"curl -sS --fail http://localhost:8080/examples/jsp/jsp2/simpletag/hello.jsp | grep 'Hello, world!'"
)
machine.succeed(
"curl -sS --fail http://localhost:8080/axis2/axis2-web/HappyAxis.jsp | grep 'Found Axis2'"
)
'';
})