lol

nixosTests.tomcat: test Apache Axis2 container integration

+16 -7
+11 -6
nixos/tests/tomcat.nix
··· 1 - import ./make-test-python.nix ({ pkgs, ... }: 2 - 3 - { 1 + import ./make-test-python.nix ({ pkgs, ... }: { 4 2 name = "tomcat"; 5 3 6 4 nodes.machine = { pkgs, ... }: { 7 - services.tomcat.enable = true; 5 + services.tomcat = { 6 + enable = true; 7 + axis2.enable = true; 8 + }; 8 9 }; 9 10 10 11 testScript = '' 11 12 machine.wait_for_unit("tomcat.service") 12 13 machine.wait_for_open_port(8080) 13 14 machine.wait_for_file("/var/tomcat/webapps/examples"); 15 + 14 16 machine.succeed( 15 - "curl --fail http://localhost:8080/examples/servlets/servlet/HelloWorldExample | grep 'Hello World!'" 17 + "curl -sS --fail http://localhost:8080/examples/servlets/servlet/HelloWorldExample | grep 'Hello World!'" 16 18 ) 17 19 machine.succeed( 18 - "curl --fail http://localhost:8080/examples/jsp/jsp2/simpletag/hello.jsp | grep 'Hello, world!'" 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'" 19 24 ) 20 25 ''; 21 26 })
+5 -1
pkgs/servers/http/tomcat/default.nix
··· 1 - { stdenv, lib, fetchurl }: 1 + { stdenv, lib, fetchurl, nixosTests }: 2 2 3 3 let 4 4 ··· 19 19 mkdir -p $webapps/webapps 20 20 mv $out/webapps $webapps/ 21 21 ''; 22 + 23 + passthru.tests = { 24 + inherit (nixosTests) tomcat; 25 + }; 22 26 23 27 meta = with lib; { 24 28 homepage = "https://tomcat.apache.org/";