diff options
author | Sander van der Burg <svanderburg@gmail.com> | 2022-03-13 14:31:43 +0100 |
---|---|---|
committer | Sander van der Burg <svanderburg@gmail.com> | 2022-03-13 14:31:43 +0100 |
commit | 86fafe5f5026651ae5139f4880f177b350c8ec83 (patch) | |
tree | f0b7c3ee48bea16216cdaa0ab20fe3747bb941d4 /nixos/tests | |
parent | d12186a6017e7fddaa0e97db90c4924485aca92c (diff) | |
download | nixpkgs-86fafe5f5026651ae5139f4880f177b350c8ec83.tar nixpkgs-86fafe5f5026651ae5139f4880f177b350c8ec83.tar.gz nixpkgs-86fafe5f5026651ae5139f4880f177b350c8ec83.tar.bz2 nixpkgs-86fafe5f5026651ae5139f4880f177b350c8ec83.tar.lz nixpkgs-86fafe5f5026651ae5139f4880f177b350c8ec83.tar.xz nixpkgs-86fafe5f5026651ae5139f4880f177b350c8ec83.tar.zst nixpkgs-86fafe5f5026651ae5139f4880f177b350c8ec83.zip |
nixos/tomcat: add basic test case using the example app
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/tomcat.nix | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 043d8a56d0c..23116a6253d 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -524,6 +524,7 @@ in tinc = handleTest ./tinc {}; tinydns = handleTest ./tinydns.nix {}; tinywl = handleTest ./tinywl.nix {}; + tomcat = handleTest ./tomcat.nix {}; tor = handleTest ./tor.nix {}; # traefik test relies on docker-containers traefik = handleTestOn ["x86_64-linux"] ./traefik.nix {}; diff --git a/nixos/tests/tomcat.nix b/nixos/tests/tomcat.nix new file mode 100644 index 00000000000..e383f224e3d --- /dev/null +++ b/nixos/tests/tomcat.nix @@ -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!'" + ) + ''; +}) |