nixos/tomcat: add basic test case using the example app
This commit is contained in:
parent
d12186a601
commit
86fafe5f50
@ -524,6 +524,7 @@ in
|
|||||||
tinc = handleTest ./tinc {};
|
tinc = handleTest ./tinc {};
|
||||||
tinydns = handleTest ./tinydns.nix {};
|
tinydns = handleTest ./tinydns.nix {};
|
||||||
tinywl = handleTest ./tinywl.nix {};
|
tinywl = handleTest ./tinywl.nix {};
|
||||||
|
tomcat = handleTest ./tomcat.nix {};
|
||||||
tor = handleTest ./tor.nix {};
|
tor = handleTest ./tor.nix {};
|
||||||
# traefik test relies on docker-containers
|
# traefik test relies on docker-containers
|
||||||
traefik = handleTestOn ["x86_64-linux"] ./traefik.nix {};
|
traefik = handleTestOn ["x86_64-linux"] ./traefik.nix {};
|
||||||
|
21
nixos/tests/tomcat.nix
Normal file
21
nixos/tests/tomcat.nix
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import ./make-test-python.nix ({ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "tomcat";
|
||||||
|
|
||||||
|
machine = { pkgs, ... }: {
|
||||||
|
services.tomcat.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 --fail http://localhost:8080/examples/servlets/servlet/HelloWorldExample | grep 'Hello World!'"
|
||||||
|
)
|
||||||
|
machine.succeed(
|
||||||
|
"curl --fail http://localhost:8080/examples/jsp/jsp2/simpletag/hello.jsp | grep 'Hello, world!'"
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user