From abfdab0d3e23f15c0a875cf6fb5bfbd2246722d4 Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Fri, 26 Aug 2011 10:17:24 +0000 Subject: [PATCH] Added testcase for Tomcat, with HTTP proxy svn path=/nixos/trunk/; revision=28824 --- release.nix | 1 + tests/default.nix | 1 + tests/tomcat.nix | 31 +++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 tests/tomcat.nix diff --git a/release.nix b/release.nix index 6f2807652ca8..d3c6308197fc 100644 --- a/release.nix +++ b/release.nix @@ -181,6 +181,7 @@ let quake3 = t.quake3.report; remote_builds = t.remote_builds.test; #subversion = t.subversion.report; + tomcat = t.tomcat.test; trac = t.trac.test; xfce = t.xfce.test; }; diff --git a/tests/default.nix b/tests/default.nix index 767732b53b4f..e8c2e348b2ba 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -25,6 +25,7 @@ with import ../lib/testing.nix { inherit nixpkgs system; }; remote_builds = makeTest (import ./remote-builds.nix); simple = makeTest (import ./simple.nix); #subversion = makeTest (import ./subversion.nix); + tomcat = makeTest (import ./tomcat.nix); trac = makeTest (import ./trac.nix); xfce = makeTest (import ./xfce.nix); } diff --git a/tests/tomcat.nix b/tests/tomcat.nix new file mode 100644 index 000000000000..a6a60ba72fc3 --- /dev/null +++ b/tests/tomcat.nix @@ -0,0 +1,31 @@ +{ pkgs, ... }: + +{ + nodes = { + server = + { pkgs, config, ... }: + + { + services.tomcat.enable = true; + services.httpd.enable = true; + services.httpd.adminAddr = "foo@bar.com"; + services.httpd.extraSubservices = [ + { serviceType = "tomcat-connector"; + stateDir = "/var/run/httpd"; + logDir = "/var/log/httpd"; + } + ]; + }; + + client = { }; + }; + + testScript = '' + startAll; + + $server->waitForJob("tomcat"); + $server->sleep(30); # Dirty, but it takes a while before Tomcat handles to requests properly + $client->mustSucceed("curl --fail http://server/examples/servlets/servlet/HelloWorldExample"); + $client->mustSucceed("curl --fail http://server/examples/jsp/jsp2/simpletag/hello.jsp"); + ''; +}