diff options
author | Arno Töll <arno@debian.org> | 2012-11-21 23:04:06 +0100 |
---|---|---|
committer | Arno Töll <arno@debian.org> | 2012-11-21 23:04:06 +0100 |
commit | dae92c799e85ec3b65f46da6a776e4386bc99d6c (patch) | |
tree | 64ecec42b0551a11125ffde792f3f1f8ae28d85f /tests | |
parent | e787ca6640e45e5c28913d149b0ecd9810930b8a (diff) | |
download | lighttpd-dae92c799e85ec3b65f46da6a776e4386bc99d6c.tar.gz |
Imported Upstream version 1.4.9upstream/1.4.9
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/LightyTest.pm | 15 | ||||
-rw-r--r-- | tests/docroot/www/dummydir/.svn/README.txt | 2 | ||||
-rw-r--r-- | tests/docroot/www/dummydir/.svn/empty-file | 0 | ||||
-rw-r--r-- | tests/docroot/www/dummydir/.svn/entries | 13 | ||||
-rw-r--r-- | tests/docroot/www/dummydir/.svn/format | 1 | ||||
-rw-r--r-- | tests/fastcgi-13.conf | 4 | ||||
-rwxr-xr-x | tests/mod-fastcgi.t | 2 | ||||
-rwxr-xr-x | tests/request.t | 40 |
8 files changed, 49 insertions, 28 deletions
diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm index 37023d3..85a08ef 100755 --- a/tests/LightyTest.pm +++ b/tests/LightyTest.pm @@ -158,6 +158,8 @@ sub handle_http { close $remote; + my $full_response = $lines; + my $href; foreach $href ( @{ $t->{RESPONSE} }) { # first line is always response header @@ -181,13 +183,12 @@ sub handle_http { if ($line =~ /^([^:]+):\s*(.+)$/) { (my $h = $1) =~ tr/[A-Z]/[a-z]/; -# if (defined $resp_hdr{$h}) { -# diag(sprintf("header %s is duplicated: %s and %s\n", -# $h, $resp_hdr{$h}, $2)); -# return -1; -# } - - $resp_hdr{$h} = $2; + if (defined $resp_hdr{$h}) { + diag(sprintf("header %s is duplicated: %s and %s\n", + $h, $resp_hdr{$h}, $2)); + } else { + $resp_hdr{$h} = $2; + } } else { diag(sprintf("unexpected line '$line'\n")); return -1; diff --git a/tests/docroot/www/dummydir/.svn/README.txt b/tests/docroot/www/dummydir/.svn/README.txt deleted file mode 100644 index 271a8ce..0000000 --- a/tests/docroot/www/dummydir/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/tests/docroot/www/dummydir/.svn/empty-file b/tests/docroot/www/dummydir/.svn/empty-file deleted file mode 100644 index e69de29..0000000 --- a/tests/docroot/www/dummydir/.svn/empty-file +++ /dev/null diff --git a/tests/docroot/www/dummydir/.svn/entries b/tests/docroot/www/dummydir/.svn/entries deleted file mode 100644 index d0722cd..0000000 --- a/tests/docroot/www/dummydir/.svn/entries +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<wc-entries - xmlns="svn:"> -<entry - committed-rev="1" - name="" - committed-date="2005-02-12T17:08:04.106079Z" - url="svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x/tests/docroot/www/dummydir" - last-author="jan" - kind="dir" - uuid="152afb58-edef-0310-8abb-c4023f1b3aa9" - revision="803"/> -</wc-entries> diff --git a/tests/docroot/www/dummydir/.svn/format b/tests/docroot/www/dummydir/.svn/format deleted file mode 100644 index b8626c4..0000000 --- a/tests/docroot/www/dummydir/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/tests/fastcgi-13.conf b/tests/fastcgi-13.conf index 2d6a2bd..f351208 100644 --- a/tests/fastcgi-13.conf +++ b/tests/fastcgi-13.conf @@ -8,8 +8,6 @@ debug.log-request-handling = "enable" ## bind to port (default: 80) server.port = 2048 -# server.license = "00000001000000013feccb804014587f000000010000000105911c976a3d462c8eaa2d7ca850432c" - ## bind to localhost (default: all interfaces) server.bind = "localhost" server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" @@ -87,7 +85,7 @@ fastcgi.server = ( ".php" => ( "grisu" => ( "host" => "127.0.0.1", "port" => 1048, - "bin-path" => "/home/jan/Documents/php-5.1.0b3/sapi/cgi/php -c /usr/local/lib/php.ini", + "bin-path" => "/home/jan/Documents/php-5.1.0/sapi/cgi/php -c /usr/local/lib/php.ini", "bin-copy-environment" => ( "PATH", "SHELL", "USER" ), ) ) diff --git a/tests/mod-fastcgi.t b/tests/mod-fastcgi.t index c6acec7..d3ea4a8 100755 --- a/tests/mod-fastcgi.t +++ b/tests/mod-fastcgi.t @@ -216,7 +216,7 @@ EOF } SKIP: { - skip "no php found", 4 unless -x "/home/jan/Documents/php-5.1.0b3/sapi/cgi/php"; + skip "no php found", 4 unless -x "/home/jan/Documents/php-5.1.0/sapi/cgi/php"; $tf->{CONFIGFILE} = 'fastcgi-13.conf'; ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die(); $t->{REQUEST} = ( <<EOF diff --git a/tests/request.t b/tests/request.t index 4049013..be1f5d8 100755 --- a/tests/request.t +++ b/tests/request.t @@ -8,7 +8,7 @@ BEGIN { use strict; use IO::Socket; -use Test::More tests => 29; +use Test::More tests => 33; use LightyTest; my $tf = LightyTest->new(); @@ -300,7 +300,45 @@ EOF $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; ok($tf->handle_http($t) == 0, 'GET, Range with range-requests-disabled'); +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Content-Length: 4 + +1234 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'GET with Content-Length'); + +$t->{REQUEST} = ( <<EOF +OPTIONS / HTTP/1.0 +Content-Length: 4 + +1234 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'OPTIONS with Content-Length'); +$t->{REQUEST} = ( <<EOF +HEAD / HTTP/1.0 +Content-Length: 4 + +1234 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'HEAD with Content-Length'); + + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +If-Modified-Since: Sun, 1970 Jan 01 00:00:01 GMT +If-Modified-Since: Sun, 1970 Jan 01 00:00:01 GMT +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'Duplicate If-Mod-Since, with equal timestamps'); ok($tf->stop_proc == 0, "Stopping lighttpd"); |