changeset 431:05c46688b54b

Tests: ssl_password_file.t fixes. Make sure to always specify listen socket in all servers as the default vary (under root, nginx will try to listen on 80). Make sure to detect if an https request was processed by http.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 09 Jul 2014 05:19:51 +0400
parents a82b02635614
children c1269426585d
files ssl_password_file.t
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ssl_password_file.t
+++ b/ssl_password_file.t
@@ -32,7 +32,8 @@ plan(skip_all => 'IO::Socket::SSL too ol
 
 plan(skip_all => 'win32') if $^O eq 'MSWin32';
 
-my $t = Test::Nginx->new()->has(qw/http http_ssl/)->has_daemon('openssl');
+my $t = Test::Nginx->new()->has(qw/http http_ssl rewrite/)
+	->has_daemon('openssl');
 
 plan(skip_all => 'no ssl_password_file') unless $t->has_version('1.7.2');
 
@@ -62,22 +63,26 @@ http {
         ssl_password_file password;
 
         location / {
+		return 200 "$scheme";
         }
     }
 
     server {
+        listen       127.0.0.1:8080;
         server_name  two_entries;
 
         ssl_password_file password_many;
     }
 
     server {
+        listen       127.0.0.1:8080;
         server_name  file_is_fifo;
 
         ssl_password_file password_fifo;
     }
 
     server {
+        listen       127.0.0.1:8080;
         server_name  inherits;
 
         ssl_certificate_key inherits.key;
@@ -131,8 +136,8 @@ is($@, '', 'ssl_password_file works');
 
 # simple tests to ensure that nothing broke with ssl_password_file directive
 
-like(http_get('/password'), qr/200 OK/, 'http');
-like(http_get('/password', socket => get_ssl_socket()), qr/200 OK/, 'https');
+like(http_get('/'), qr/200 OK.*http/ms, 'http');
+like(http_get('/', socket => get_ssl_socket()), qr/200 OK.*https/ms, 'https');
 
 ###############################################################################