diff --git a/release.nix b/release.nix
index 143d698e045..957e65b681d 100644
--- a/release.nix
+++ b/release.nix
@@ -128,6 +128,7 @@ let
installer.separateBoot = t.installer.separateBoot.test;
installer.simple = t.installer.simple.test;
kde4 = t.kde4.test;
+ proxy = t.proxy.test;
quake3 = t.quake3.test;
subversion = t.subversion.report;
trac = t.trac.test;
diff --git a/tests/default.nix b/tests/default.nix
index 5045375e10d..2efe151ab79 100644
--- a/tests/default.nix
+++ b/tests/default.nix
@@ -31,6 +31,7 @@ in
firefox = apply (import ./firefox.nix);
installer = pkgs.lib.mapAttrs (name: complete) (call (import ./installer.nix));
kde4 = apply (import ./kde4.nix);
+ proxy = apply (import ./proxy.nix);
quake3 = apply (import ./quake3.nix);
subversion = apply (import ./subversion.nix);
trac = apply (import ./trac.nix);
diff --git a/tests/proxy.nix b/tests/proxy.nix
new file mode 100644
index 00000000000..81833060d43
--- /dev/null
+++ b/tests/proxy.nix
@@ -0,0 +1,94 @@
+{ pkgs, ... }:
+
+let
+
+ backend =
+ { config, pkgs, ... }:
+
+ {
+ services.sshd.enable = true;
+
+ services.httpd.enable = true;
+ services.httpd.adminAddr = "foo@example.org";
+ services.httpd.documentRoot = "${pkgs.valgrind}/share/doc/valgrind/html";
+ };
+
+in
+
+{
+
+ nodes =
+ { proxy =
+ { config, pkgs, nodes, ... }:
+
+ {
+ services.httpd.enable = true;
+ services.httpd.adminAddr = "bar@example.org";
+ services.httpd.extraModules = ["proxy_balancer"];
+
+ services.httpd.extraConfig =
+ ''
+ ExtendedStatus on
+
+
+ Order deny,allow
+ Allow from all
+ SetHandler server-status
+
+
+
+ Allow from all
+ BalancerMember http://${nodes.backend1.config.networking.hostName} retry=0
+ BalancerMember http://${nodes.backend2.config.networking.hostName} retry=0
+
+
+ ProxyStatus full
+ ProxyPass /server-status !
+ ProxyPass / balancer://cluster/
+ ProxyPassReverse / balancer://cluster/
+
+ # For testing; don't want to wait forever for dead backend servers.
+ ProxyTimeout 5
+ '';
+ };
+
+ backend1 = backend;
+ backend2 = backend;
+
+ client = { config, pkgs, ... }: { };
+ };
+
+ testScript =
+ ''
+ startAll;
+
+ $proxy->waitForJob("httpd");
+ $backend1->waitForJob("httpd");
+ $backend2->waitForJob("httpd");
+
+ # With the back-ends up, the proxy should work.
+ $client->mustSucceed("curl --fail http://proxy/");
+
+ $client->mustSucceed("curl --fail http://proxy/server-status");
+
+ # Block the first back-end.
+ $backend1->block;
+
+ # The proxy should still work.
+ $client->mustSucceed("curl --fail http://proxy/");
+
+ $client->mustSucceed("curl --fail http://proxy/");
+
+ # Block the second back-end.
+ $backend2->block;
+
+ # Now the proxy should fail as well.
+ $client->mustFail("curl --fail http://proxy/");
+
+ # But if the second back-end comes back, the proxy should start
+ # working again.
+ $backend2->unblock;
+ $client->mustSucceed("curl --fail http://proxy/");
+ '';
+
+}