2005-09-01 11:44:57 +00:00
|
|
|
#!/usr/bin/env perl
|
2005-08-23 07:55:19 +00:00
|
|
|
BEGIN {
|
2008-01-15 22:03:59 +00:00
|
|
|
# add current source dir to the include-path
|
|
|
|
# we need this for make distcheck
|
|
|
|
(my $srcdir = $0) =~ s,/[^/]+$,/,;
|
|
|
|
unshift @INC, $srcdir;
|
2005-08-23 07:55:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use IO::Socket;
|
2016-05-12 16:11:52 +00:00
|
|
|
use Test::More tests => 5;
|
2005-08-23 07:55:19 +00:00
|
|
|
use LightyTest;
|
|
|
|
|
|
|
|
my $tf = LightyTest->new();
|
|
|
|
my $t;
|
2006-10-05 00:09:51 +00:00
|
|
|
|
2005-08-23 07:55:19 +00:00
|
|
|
ok($tf->start_proc == 0, "Starting lighttpd") or die();
|
|
|
|
|
|
|
|
$t->{REQUEST} = ( <<EOF
|
|
|
|
GET /ssi.shtml HTTP/1.0
|
|
|
|
EOF
|
|
|
|
);
|
2005-08-31 12:55:44 +00:00
|
|
|
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "/ssi.shtml\n" } ];
|
2005-08-23 07:55:19 +00:00
|
|
|
ok($tf->handle_http($t) == 0, 'ssi - echo ');
|
|
|
|
|
2005-09-29 13:29:44 +00:00
|
|
|
|
|
|
|
## bug #280
|
|
|
|
$t->{REQUEST} = ( <<EOF
|
|
|
|
GET /exec-date.shtml HTTP/1.0
|
|
|
|
EOF
|
|
|
|
);
|
|
|
|
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "2\n\n" } ];
|
|
|
|
ok($tf->handle_http($t) == 0, 'ssi - echo ');
|
|
|
|
|
|
|
|
|
2016-05-12 16:11:52 +00:00
|
|
|
$t->{REQUEST} = ( <<EOF
|
|
|
|
GET /ssi-include.shtml HTTP/1.0
|
|
|
|
EOF
|
|
|
|
);
|
2016-05-14 02:35:19 +00:00
|
|
|
$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" } ];
|
2016-05-12 16:11:52 +00:00
|
|
|
ok($tf->handle_http($t) == 0, 'ssi - include');
|
|
|
|
|
|
|
|
|
2005-08-23 07:55:19 +00:00
|
|
|
ok($tf->stop_proc == 0, "Stopping lighttpd");
|
|
|
|
|