You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by do...@apache.org on 2002/04/01 21:41:06 UTC
cvs commit: httpd-test/perl-framework/t/ssl proxy.t
dougm 02/04/01 11:41:06
Modified: perl-framework/t/ssl proxy.t
Log:
run tests through both proxyssl vhosts so we are testing both
http <-> https and https <-> https
Revision Changes Path
1.4 +38 -28 httpd-test/perl-framework/t/ssl/proxy.t
Index: proxy.t
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/t/ssl/proxy.t,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- proxy.t 30 Mar 2002 05:41:07 -0000 1.3
+++ proxy.t 1 Apr 2002 19:41:06 -0000 1.4
@@ -5,41 +5,51 @@
use Apache::TestRequest;
use Apache::TestUtil;
-plan tests => 6, ['mod_proxy'];
+my %modules = (
+ proxyssl => 'http',
+ proxyssl_ssl => 'https',
+);
-Apache::TestRequest::module('proxyssl');
+plan tests => 6 * keys %modules, ['mod_proxy'];
-my $hostport = Apache::TestRequest::hostport();
+for my $module (sort keys %modules) {
-ok t_cmp(200,
- GET('/')->code,
- "/ with proxyssl");
+ my $scheme = $modules{$module};
+ Apache::TestRequest::module($module);
+ Apache::TestRequest::scheme($scheme);
-ok t_cmp(200,
- GET('/verify')->code,
- "using valid proxyssl client cert");
+ my $hostport = Apache::TestRequest::hostport();
-ok t_cmp(403,
- GET('/require/snakeoil')->code,
- "using invalid proxyssl client cert");
+ ok t_cmp(200,
+ GET('/')->code,
+ "/ with $module ($scheme)");
-my $res = GET('/require-ssl-cgi/env.pl');
+ ok t_cmp(200,
+ GET('/verify')->code,
+ "using valid proxyssl client cert");
-ok t_cmp(200, $res->code, "protected cgi script");
+ ok t_cmp(403,
+ GET('/require/snakeoil')->code,
+ "using invalid proxyssl client cert");
-my $body = $res->content || "";
+ my $res = GET('/require-ssl-cgi/env.pl');
-my %vars;
-for my $line (split /\s*\r?\n/, $body) {
- my($key, $val) = split /\s*=\s*/, $line, 2;
- next unless $key;
- $vars{$key} = $val || "";
-}
+ ok t_cmp(200, $res->code, "protected cgi script");
+
+ my $body = $res->content || "";
+
+ my %vars;
+ for my $line (split /\s*\r?\n/, $body) {
+ my($key, $val) = split /\s*=\s*/, $line, 2;
+ next unless $key;
+ $vars{$key} = $val || "";
+ }
-ok t_cmp($hostport,
- $vars{HTTP_X_FORWARDED_HOST},
- "X-Forwarded-Host header");
-
-ok t_cmp('client_ok',
- $vars{SSL_CLIENT_S_DN_CN},
- "client subject common name");
+ ok t_cmp($hostport,
+ $vars{HTTP_X_FORWARDED_HOST},
+ "X-Forwarded-Host header");
+
+ ok t_cmp('client_ok',
+ $vars{SSL_CLIENT_S_DN_CN},
+ "client subject common name");
+}