diff ssi-include-big.t @ 15:c6c36d7a4d90

Tests: support config embedded in test itself.
author Maxim Dounin <mdounin@mdounin.ru>
date Sat, 13 Sep 2008 02:57:01 +0400
parents d4b74207a627
children b331c3113ebb
line wrap: on
line diff
--- a/ssi-include-big.t
+++ b/ssi-include-big.t
@@ -21,7 +21,39 @@ use Test::Nginx;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->run('ssi-include-big.conf');
+my $t = Test::Nginx->new();
+
+$t->write_file_expand('nginx.conf', <<'EOF');
+
+master_process off;
+daemon         off;
+
+events {
+    worker_connections  1024;
+}
+
+http {
+    access_log    off;
+    root          %%TESTDIR%%;
+
+    output_buffers  2 512;
+    ssi on;
+    gzip on;
+
+    server {
+        listen       localhost:8080;
+        server_name  localhost;
+
+        location /proxy/ {
+            proxy_pass http://localhost:8080/local/;
+        }
+        location = /local/blah {
+            return 204;
+        }
+    }
+}
+
+EOF
 
 $t->write_file('c1.html', 'X' x 1023);
 $t->write_file('c2.html', 'X' x 1024);
@@ -33,6 +65,8 @@ my $t = Test::Nginx->new()->run('ssi-inc
 $t->write_file('test3.html', '<!--#include virtual="/proxy/blah" -->' . "\n"
 	. '<!--#include virtual="/c3.html" -->');
 
+$t->run();
+
 ###############################################################################
 
 my $t1 = http_gzip_request('/test1.html');
@@ -49,7 +83,7 @@ ok(defined $t3, 'big included file (more
 sub http_gzip_request {
 	my ($url) = @_;
 	my $r = http(<<EOF);
-GET $url HTTP/1.0
+GET $url HTTP/1.1
 Host: localhost
 Connection: close
 Accept-Encoding: gzip