httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r109339 - /httpd/test/trunk/perl-framework/t/modules/proxy.t
Date Wed, 01 Dec 2004 13:26:17 GMT
Author: jorton
Date: Wed Dec  1 05:26:15 2004
New Revision: 109339

URL: http://svn.apache.org/viewcvs?view=rev&rev=109339
Log:
Test that ProxyPassReverse does rewrite Location headers.

Modified:
   httpd/test/trunk/perl-framework/t/modules/proxy.t

Modified: httpd/test/trunk/perl-framework/t/modules/proxy.t
Url: http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/t/modules/proxy.t?view=diff&rev=109339&p1=httpd/test/trunk/perl-framework/t/modules/proxy.t&r1=109338&p2=httpd/test/trunk/perl-framework/t/modules/proxy.t&r2=109339
==============================================================================
--- httpd/test/trunk/perl-framework/t/modules/proxy.t	(original)
+++ httpd/test/trunk/perl-framework/t/modules/proxy.t	Wed Dec  1 05:26:15 2004
@@ -6,19 +6,31 @@
 use Apache::TestUtil;
 use Apache::TestConfig ();
 
-plan tests => 6, need_module 'proxy';
+plan tests => 8, need_module 'proxy';
 
 Apache::TestRequest::module("proxy_http_reverse");
+Apache::TestRequest::user_agent(requests_redirectable => 0);
 
 my $r = GET("/reverse/");
 ok t_cmp($r->code, 200, "reverse proxy to index.html");
 ok t_cmp($r->content, qr/^welcome to /, "reverse proxied body");
 
-$r = GET("/reverse/modules/cgi/env.pl");
-ok t_cmp($r->code, 200, "reverse proxy to env.pl");
-ok t_cmp($r->content, qr/^APACHE_TEST_HOSTNAME = /, "reverse proxied env.pl response");
-
-$r = GET("/reverse/modules/cgi/env.pl?reverse-proxy");
-ok t_cmp($r->code, 200, "reverse proxy with query string");
-ok t_cmp($r->content, qr/QUERY_STRING = reverse-proxy\n/s, "reverse proxied query string
OK");
+if (have_module('cgi')) {
+    $r = GET("/reverse/modules/cgi/env.pl");
+    ok t_cmp($r->code, 200, "reverse proxy to env.pl");
+    ok t_cmp($r->content, qr/^APACHE_TEST_HOSTNAME = /, "reverse proxied env.pl response");
+    
+    $r = GET("/reverse/modules/cgi/env.pl?reverse-proxy");
+    ok t_cmp($r->code, 200, "reverse proxy with query string");
+    ok t_cmp($r->content, qr/QUERY_STRING = reverse-proxy\n/s, "reverse proxied query
string OK");
+} else {
+    skip "skipping tests without mod_cgi" foreach(1..4);
+}
 
+if (have_module('alias')) {
+    $r = GET("/reverse/perm");
+    ok t_cmp($r->code, 301, "reverse proxy of redirect");
+    ok t_cmp($r->header("Location"), qr{http://[^/]*/reverse/alias}, "reverse proxy rewrote
redirect");
+} else {
+    skip "skipping tests without mod_alias" foreach (1..2);
+}

Mime
View raw message