comparison lib/Test/Nginx.pm @ 237:90af19544dd2

Tests: https sni tests.
author Valentin Bartenev <ne@vbart.ru>
date Mon, 01 Oct 2012 02:54:57 +0400
parents 4c43b3a0117c
children 8f280348d76f
comparison
equal deleted inserted replaced
236:5ac875a3088e 237:90af19544dd2
66 66
67 sub has_module($) { 67 sub has_module($) {
68 my ($self, $feature) = @_; 68 my ($self, $feature) = @_;
69 69
70 my %regex = ( 70 my %regex = (
71 sni => 'TLS SNI support enabled',
71 mail => '--with-mail(?!\S)', 72 mail => '--with-mail(?!\S)',
72 flv => '--with-http_flv_module', 73 flv => '--with-http_flv_module',
73 perl => '--with-http_perl_module', 74 perl => '--with-http_perl_module',
74 charset => '(?s)^(?!.*--without-http_charset_module)', 75 charset => '(?s)^(?!.*--without-http_charset_module)',
75 gzip => '(?s)^(?!.*--without-http_gzip_module)', 76 gzip => '(?s)^(?!.*--without-http_gzip_module)',
385 my $reply; 386 my $reply;
386 eval { 387 eval {
387 local $SIG{ALRM} = sub { die "timeout\n" }; 388 local $SIG{ALRM} = sub { die "timeout\n" };
388 local $SIG{PIPE} = sub { die "sigpipe\n" }; 389 local $SIG{PIPE} = sub { die "sigpipe\n" };
389 alarm(2); 390 alarm(2);
390 my $s = IO::Socket::INET->new( 391 my $s = $extra{socket} || IO::Socket::INET->new(
391 Proto => 'tcp', 392 Proto => 'tcp',
392 PeerAddr => '127.0.0.1:8080' 393 PeerAddr => '127.0.0.1:8080'
393 ); 394 );
394 log_out($request); 395 log_out($request);
395 $s->print($request); 396 $s->print($request);