From 6b6bc55a6f943115acd0e69a4eb1bce08da39b3e Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Thu, 26 Oct 2023 11:01:09 +0200 Subject: [PATCH] nixosTests.tomcat: test Apache Axis2 container integration --- nixos/tests/tomcat.nix | 17 +++++++++++------ pkgs/servers/http/tomcat/default.nix | 6 +++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/nixos/tests/tomcat.nix b/nixos/tests/tomcat.nix index 4cfb3cc5a7d8..a5f219e104ad 100644 --- a/nixos/tests/tomcat.nix +++ b/nixos/tests/tomcat.nix @@ -1,21 +1,26 @@ -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 --fail http://localhost:8080/examples/servlets/servlet/HelloWorldExample | grep 'Hello World!'" + "curl -sS --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!'" + "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'" ) ''; }) diff --git a/pkgs/servers/http/tomcat/default.nix b/pkgs/servers/http/tomcat/default.nix index ede01d350d4b..f57645d85801 100644 --- a/pkgs/servers/http/tomcat/default.nix +++ b/pkgs/servers/http/tomcat/default.nix @@ -1,4 +1,4 @@ -{ 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";