changeset 131:21a428b31f37

Tests: add test for fastcgi regression introduced in 0.8.34. Besides marking as TODO use todo_skip unless TEST_NGINX_UNSAFE defined as it causes coredump.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 11 Mar 2010 02:30:44 +0300
parents df9a573fde22
children 79ae5c30e6b4
files fastcgi.t
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/fastcgi.t
+++ b/fastcgi.t
@@ -24,7 +24,7 @@ select STDOUT; $| = 1;
 eval { require FCGI; };
 plan(skip_all => 'FCGI not installed') if $@;
 
-my $t = Test::Nginx->new()->has(qw/http fastcgi/)->plan(4)
+my $t = Test::Nginx->new()->has(qw/http fastcgi/)->plan(5)
 	->write_file_expand('nginx.conf', <<'EOF');
 
 %%TEST_GLOBALS%%
@@ -44,6 +44,7 @@ http {
 
         location / {
             fastcgi_pass 127.0.0.1:8081;
+            fastcgi_param REQUEST_URI $request_uri;
         }
     }
 }
@@ -61,6 +62,14 @@ like(http_get('/'), qr/^3$/m, 'fastcgi t
 
 unlike(http_head('/'), qr/SEE-THIS/, 'no data in HEAD');
 
+TODO: {
+local $TODO = 'coredumps in 0.8.34';
+todo_skip $TODO, 1 unless $ENV{TEST_NGINX_UNSAFE};
+
+like(http_get('/stderr'), qr/SEE-THIS/, 'large stderr handled');
+
+}
+
 ###############################################################################
 
 sub fastcgi_daemon {
@@ -71,6 +80,11 @@ sub fastcgi_daemon {
 	my $count;
 	while( $request->Accept() >= 0 ) {
 		$count++;
+
+		if ($ENV{REQUEST_URI} eq '/stderr') {
+			warn "sample stderr text" x 512;
+		}
+		
 		print <<EOF;
 Location: http://127.0.0.1:8080/redirect
 Content-Type: text/html