Changeset 56

Show
Ignore:
Timestamp:
02/28/2005 05:08:05 PM (4 years ago)
Author:
jan
Message:

converted all tests to run-tests.pl

Location:
trunk/tests
Files:
4 added
30 removed
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/Makefile.am

    r44 r56  
    1212prepare.sh \ 
    1313run-tests.pl \ 
    14 bug-03.sh \ 
    15 bug-06.sh \ 
    16 bug-12.sh \ 
    17 large-header-01.sh \ 
    18 compress-01.sh \ 
    19 compress-02.sh \ 
    20 compress-03.sh \ 
    21 compress-04.sh \ 
    22 fastcgi-10.sh \ 
    23 fastcgi-11.sh \ 
    24 fastcgi-12.sh \ 
    25 fastcgi-13.sh \ 
    2614cleanup.sh 
    2715 
  • trunk/tests/docroot/www/Makefile.am

    r18 r56  
    22           phpself.php redirect.php cgi-pathinfo.pl phphost.php  \ 
    33           nph-status.pl 
    4 SUBDIRS=go indexfile 
     4SUBDIRS=go indexfile expire 
  • trunk/tests/lighttpd.conf

    r25 r56  
    44## bind to port (default: 80) 
    55server.port                 = 2048 
    6  
    7 # server.license              = "00000001000000013feccb804014587f000000010000000105911c976a3d462c8eaa2d7ca850432c" 
    86 
    97## bind to localhost (default: all interfaces) 
     
    1412 
    1513fastcgi.debug = 1 
    16  
    17 ##  
    18 ## Format: <errorfile-prefix><status>.html 
    19 ## -> ..../status-404.html for 'File not found' 
    20 #server.errorfile-prefix    = "/home/weigon/projects/lighttpd/doc/status-" 
    2114 
    2215server.dir-listing          = "enable" 
     
    4639server.indexfiles           = ( "index.php", "index.html",  
    4740                                "index.htm", "default.htm" ) 
    48  
    49 #,-- only root can use these options 
    50 #| 
    51 #|# chroot() to directory (default: no chroot() ) 
    52 #| server.chroot  / 
    53 #|# change uid to <uid> (default: don't care) 
    54 #| server.userid wwwrun 
    55 #|# change uid to <uid> (default: don't care) 
    56 #| server.groupid wwwrun 
    57 #| 
    58 #`--  
    5941 
    6042 
     
    10385                                ".py"  => "/usr/bin/python" ) 
    10486                         
    105 userdir.include-user = ( "weigon" ) 
     87userdir.include-user = ( "jan" ) 
    10688userdir.path = "/" 
    10789 
     
    144126url.redirect                = ( "^/redirect/$" => "http://localhost:2048/" ) 
    145127 
    146 expire.url                  = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes") 
     128expire.url                  = ( "/expire/access" => "access 2 hours",  
     129                                "/expire/modification" => "access plus 1 seconds 2 minutes") 
    147130 
    148131#cache.cache-dir             = "/home/weigon/wwwroot/cache/" 
  • trunk/tests/prepare.sh

    r10 r56  
    1212mkdir -p $tmpdir/servers/www.example.org/pages/dummydir/ 
    1313mkdir -p $tmpdir/servers/www.example.org/pages/go/ 
     14mkdir -p $tmpdir/servers/www.example.org/pages/expire/ 
    1415mkdir -p $tmpdir/servers/www.example.org/pages/indexfile/ 
    1516mkdir -p $tmpdir/servers/123.example.org/pages/ 
     
    2425   $srcdir/docroot/www/*.txt $tmpdir/servers/www.example.org/pages/ 
    2526cp $srcdir/docroot/www/go/*.php $tmpdir/servers/www.example.org/pages/go/ 
     27cp $srcdir/docroot/www/expire/*.txt $tmpdir/servers/www.example.org/pages/expire/ 
    2628cp $srcdir/docroot/www/indexfile/*.php $tmpdir/servers/www.example.org/pages/indexfile/ 
    2729cp $srcdir/docroot/123/*.txt \ 
  • trunk/tests/run-tests.pl

    r51 r56  
    33use strict; 
    44use IO::Socket; 
    5 use Test::More tests => 89; 
     5use Test::More tests => 114; 
    66 
    77 
     
    3333 
    3434        kill('TERM',$pid) or return -1; 
     35        select(undef, undef, undef, 0.25); 
    3536 
    3637        return 0; 
     
    166167 
    167168                        if (!defined $resp_hdr{$k}) { 
    168                                 diag(sprintf("required header '%s' is missing\n", $_)); 
     169                                diag(sprintf("required header '%s' is missing\n", $k)); 
    169170                                return -1; 
    170171                        } 
     
    747748 
    748749 
     750@request  = ( <<EOF 
     751GET / HTTP/1.0 
     752Hsgfsdjf: asdfhdf 
     753hdhd: shdfhfdasd 
     754hfhr: jfghsdfg 
     755jfuuehdmn: sfdgjfdg 
     756jvcbzufdg: sgfdfg 
     757hrnvcnd: jfjdfg 
     758jfusfdngmd: gfjgfdusdfg 
     759nfj: jgfdjdfg 
     760jfue: jfdfdg 
     761EOF 
     762 ); 
     763@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ); 
     764ok(handle_http == 0, 'larger headers'); 
     765 
    749766 
    750767 
     
    942959 
    943960 
     961 
     962print "\nmodules - mod_compress\n"; 
     963@request  = ( <<EOF 
     964GET /index.html HTTP/1.0 
     965Accept-Encoding: deflate 
     966EOF 
     967 ); 
     968@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '' } ); 
     969ok(handle_http == 0, 'Vary is set'); 
     970 
     971@request  = ( <<EOF 
     972GET /index.html HTTP/1.0 
     973Accept-Encoding: deflate 
     974EOF 
     975 ); 
     976@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Length' => '1288', '+Content-Encoding' => '' } ); 
     977ok(handle_http == 0, 'deflate - Content-Length and Content-Encoding is set'); 
     978 
     979@request  = ( <<EOF 
     980GET /index.html HTTP/1.0 
     981Accept-Encoding: gzip 
     982EOF 
     983 ); 
     984@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', '+Content-Encoding' => '' } ); 
     985ok(handle_http == 0, 'gzip - Content-Length and Content-Encoding is set'); 
     986 
     987@request  = ( <<EOF 
     988GET /index.txt HTTP/1.0 
     989Accept-Encoding: gzip, deflate 
     990EOF 
     991 ); 
     992@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', '+Content-Encoding' => '' } ); 
     993ok(handle_http == 0, 'gzip, deflate - Content-Length and Content-Encoding is set'); 
     994 
     995 
     996print "\nmodules - mod_expire\n"; 
     997@request  = ( <<EOF 
     998GET /expire/access.txt HTTP/1.0 
     999EOF 
     1000 ); 
     1001@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Expires' => '' } ); 
     1002ok(handle_http == 0, 'access'); 
     1003 
     1004@request  = ( <<EOF 
     1005GET /expire/modification.txt HTTP/1.0 
     1006EOF 
     1007 ); 
     1008@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Expires' => '' } ); 
     1009ok(handle_http == 0, 'modification'); 
     1010 
     1011 
     1012 
     1013 
     1014 
     1015 
    9441016print "\nmodules - mod_userdir\n"; 
    9451017 
     
    9681040ok(handle_http == 0, 'valid user + redirect'); 
    9691041 
    970  
    971  
    972  
    973  
    974  
    9751042print "\nclean up\n"; 
    9761043 
    9771044ok(stop_proc == 0, "Stopping lighttpd"); 
    9781045 
    979  
     1046print "\nspecial config\n"; 
     1047 
     1048$configfile = 'fastcgi-10.conf'; 
     1049ok(start_proc == 0, "Starting lighttpd with fastcgi-10.conf") or die(); 
     1050@request  = ( <<EOF 
     1051GET /phphost.php HTTP/1.0 
     1052Host: zzz.example.org 
     1053EOF 
     1054 ); 
     1055@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'zzz.example.org' } ); 
     1056ok(handle_http == 0, 'FastCGI + Host'); 
     1057 
     1058ok(stop_proc == 0, "Stopping lighttpd"); 
     1059 
     1060$configfile = 'fastcgi-11.conf'; 
     1061ok(start_proc == 0, "Starting lighttpd with fastcgi-11.conf") or die(); 
     1062@request  = ( <<EOF 
     1063GET /index.html?ok HTTP/1.0 
     1064Host: www.example.org 
     1065EOF 
     1066 ); 
     1067@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ); 
     1068ok(handle_http == 0, 'FastCGI - Auth'); 
     1069 
     1070ok(stop_proc == 0, "Stopping lighttpd"); 
     1071 
     1072$configfile = 'fastcgi-12.conf'; 
     1073ok(start_proc == 0, "Starting lighttpd with fastcgi-12.conf") or die(); 
     1074@request  = ( <<EOF 
     1075GET /index.html?fail HTTP/1.0 
     1076Host: www.example.org 
     1077EOF 
     1078 ); 
     1079@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ); 
     1080ok(handle_http == 0, 'FastCGI - Auth'); 
     1081 
     1082ok(stop_proc == 0, "Stopping lighttpd"); 
     1083 
     1084$configfile = 'fastcgi-13.conf'; 
     1085ok(start_proc == 0, "Starting lighttpd with fastcgi-13.conf") or die(); 
     1086@request  = ( <<EOF 
     1087GET /indexfile/index.php HTTP/1.0 
     1088Host: www.example.org 
     1089EOF 
     1090 ); 
     1091@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ); 
     1092ok(handle_http == 0, 'FastCGI + local spawning'); 
     1093 
     1094ok(stop_proc == 0, "Stopping lighttpd"); 
     1095 
     1096$configfile = 'bug-06.conf'; 
     1097ok(start_proc == 0, "Starting lighttpd with bug-06.conf") or die(); 
     1098@request  = ( <<EOF 
     1099GET /indexfile/ HTTP/1.0 
     1100Host: www.example.org 
     1101EOF 
     1102 ); 
     1103@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/indexfile/index.php' } ); 
     1104ok(handle_http == 0, 'Bug #6'); 
     1105 
     1106ok(stop_proc == 0, "Stopping lighttpd"); 
     1107 
     1108$configfile = 'bug-12.conf'; 
     1109ok(start_proc == 0, "Starting lighttpd with bug-12.conf") or die(); 
     1110@request  = ( <<EOF 
     1111POST /indexfile/abc HTTP/1.0 
     1112Host: www.example.org 
     1113Content-Length: 0 
     1114EOF 
     1115 ); 
     1116@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => '/indexfile/return-404.php' } ); 
     1117ok(handle_http == 0, 'Bug #12'); 
     1118 
     1119ok(stop_proc == 0, "Stopping lighttpd"); 
     1120 
     1121