[core] network_open_file_chunk() temp file opt
[lighttpd.git] / tests / mod-ssi.t
blobf2f3bf4c37d6979572cfdc271baca9914c4ba712
1 #!/usr/bin/env perl
2 BEGIN {
3 # add current source dir to the include-path
4 # we need this for make distcheck
5 (my $srcdir = $0) =~ s,/[^/]+$,/,;
6 unshift @INC, $srcdir;
9 use strict;
10 use IO::Socket;
11 use Test::More tests => 5;
12 use LightyTest;
14 my $tf = LightyTest->new();
15 my $t;
17 ok($tf->start_proc == 0, "Starting lighttpd") or die();
19 $t->{REQUEST} = ( <<EOF
20 GET /ssi.shtml HTTP/1.0
21 EOF
23 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "/ssi.shtml\n" } ];
24 ok($tf->handle_http($t) == 0, 'ssi - echo ');
27 ## bug #280
28 $t->{REQUEST} = ( <<EOF
29 GET /exec-date.shtml HTTP/1.0
30 EOF
32 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "2\n\n" } ];
33 ok($tf->handle_http($t) == 0, 'ssi - echo ');
36 $t->{REQUEST} = ( <<EOF
37 GET /ssi-include.shtml HTTP/1.0
38 EOF
40 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "/ssi-include.shtml\n/ssi-include.shtml\n/ssi-include.shtml\nssi-include\n\nssi-include\n\n" } ];
41 ok($tf->handle_http($t) == 0, 'ssi - include');
44 ok($tf->stop_proc == 0, "Stopping lighttpd");