Unverified Commit 6b6bc55a authored by Anthony Roussel's avatar Anthony Roussel
Browse files

nixosTests.tomcat: test Apache Axis2 container integration

parent 789fe864
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
import ./make-test-python.nix ({ pkgs, ... }:

{
import ./make-test-python.nix ({ pkgs, ... }: {
  name = "tomcat";

  nodes.machine = { pkgs, ... }: {
    services.tomcat.enable = true;
    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 --fail http://localhost:8080/examples/servlets/servlet/HelloWorldExample | grep 'Hello World!'"
        "curl -sS --fail http://localhost:8080/examples/jsp/jsp2/simpletag/hello.jsp | grep 'Hello, world!'"
    )
    machine.succeed(
        "curl --fail http://localhost:8080/examples/jsp/jsp2/simpletag/hello.jsp | grep 'Hello, world!'"
        "curl -sS --fail http://localhost:8080/axis2/axis2-web/HappyAxis.jsp | grep 'Found Axis2'"
    )
  '';
})
+5 −1
Original line number Diff line number Diff line
{ stdenv, lib, fetchurl }:
{ stdenv, lib, fetchurl, nixosTests }:

let

@@ -20,6 +20,10 @@ let
        mv $out/webapps $webapps/
      '';

    passthru.tests = {
      inherit (nixosTests) tomcat;
    };

    meta = with lib; {
      homepage = "https://tomcat.apache.org/";
      description = "An implementation of the Java Servlet and JavaServer Pages technologies";