Changeset 81

Show
Ignore:
Timestamp:
03/03/2005 11:35:27 AM (4 years ago)
Author:
jan
Message:

skip fastcgi checks if fastcgi-proc is not available

Location:
trunk/tests
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/mod-fastcgi.t

    r74 r81  
    2626        close F; 
    2727 
    28         return $pid; 
     28        if (defined $pid) { return $pid; } 
     29 
     30        return -1; 
    2931} 
    3032 
     
    3436        close F; 
    3537 
    36         kill('TERM',$pid) or return -1; 
    37         select(undef, undef, undef, 0.01); 
     38        if (defined $pid) { 
     39                kill('TERM',$pid) or return -1; 
     40                select(undef, undef, undef, 0.01); 
     41        } 
    3842 
    3943        return 0; 
     
    196200} 
    197201     
    198 ok(start_proc == 0, "Starting lighttpd") or die(); 
    199202 
    200203SKIP: { 
    201         skip "no PHP running on port 1026", 13 if pidof("php") == -1;  
     204        skip "no PHP running on port 1026", 23 if pidof("php") == -1;  
     205 
     206        ok(start_proc == 0, "Starting lighttpd") or die(); 
    202207 
    203208        @request  = ( <<EOF 
     
    302307        ok(handle_http == 0, 'PHP_SELF + Indexfile, Bug #3'); 
    303308 
    304  
    305 } 
    306  
    307 $configfile = 'fastcgi-10.conf'; 
    308 ok(start_proc == 0, "Starting lighttpd with $configfile") or die(); 
    309 @request  = ( <<EOF 
     309         
     310        ok(stop_proc == 0, "Stopping lighttpd"); 
     311 
     312 
     313        $configfile = 'fastcgi-10.conf'; 
     314        ok(start_proc == 0, "Starting lighttpd with $configfile") or die(); 
     315        @request  = ( <<EOF 
    310316GET /phphost.php HTTP/1.0 
    311317Host: zzz.example.org 
    312318EOF 
    313319 ); 
    314 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'zzz.example.org' } ); 
    315 ok(handle_http == 0, 'FastCGI + Host'); 
    316  
    317 ok(stop_proc == 0, "Stopping lighttpd"); 
    318  
    319 $configfile = 'fastcgi-auth.conf'; 
    320 ok(start_proc == 0, "Starting lighttpd with $configfile") or die(); 
    321 @request  = ( <<EOF 
     320        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'zzz.example.org' } ); 
     321        ok(handle_http == 0, 'FastCGI + Host'); 
     322 
     323        ok(stop_proc == 0, "Stopping lighttpd"); 
     324         
     325        $configfile = 'bug-06.conf'; 
     326        ok(start_proc == 0, "Starting lighttpd with $configfile") or die(); 
     327        @request  = ( <<EOF 
     328GET /indexfile/ HTTP/1.0 
     329Host: www.example.org 
     330EOF 
     331 ); 
     332        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/indexfile/index.php' } ); 
     333        ok(handle_http == 0, 'Bug #6'); 
     334 
     335        ok(stop_proc == 0, "Stopping lighttpd"); 
     336 
     337        $configfile = 'bug-12.conf'; 
     338        ok(start_proc == 0, "Starting lighttpd with bug-12.conf") or die(); 
     339        @request  = ( <<EOF 
     340POST /indexfile/abc HTTP/1.0 
     341Host: www.example.org 
     342Content-Length: 0 
     343EOF 
     344 ); 
     345        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => '/indexfile/return-404.php' } ); 
     346        ok(handle_http == 0, 'Bug #12'); 
     347 
     348        ok(stop_proc == 0, "Stopping lighttpd"); 
     349} 
     350 
     351SKIP: { 
     352        skip "no fcgi-auth found", 4 unless -x $basedir."/tests/fcgi-auth";  
     353 
     354        $configfile = 'fastcgi-auth.conf'; 
     355        ok(start_proc == 0, "Starting lighttpd with $configfile") or die(); 
     356        @request  = ( <<EOF 
    322357GET /index.html?ok HTTP/1.0 
    323358Host: www.example.org 
    324359EOF 
    325360 ); 
    326 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ); 
    327 ok(handle_http == 0, 'FastCGI - Auth'); 
    328  
    329 @request  = ( <<EOF 
     361        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ); 
     362        ok(handle_http == 0, 'FastCGI - Auth'); 
     363 
     364        @request  = ( <<EOF 
    330365GET /index.html?fail HTTP/1.0 
    331366Host: www.example.org 
    332367EOF 
    333368 ); 
    334 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ); 
    335 ok(handle_http == 0, 'FastCGI - Auth'); 
    336  
    337 ok(stop_proc == 0, "Stopping lighttpd"); 
    338  
    339 $configfile = 'fastcgi-13.conf'; 
    340 ok(start_proc == 0, "Starting lighttpd with $configfile") or die(); 
    341 @request  = ( <<EOF 
     369        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ); 
     370        ok(handle_http == 0, 'FastCGI - Auth'); 
     371 
     372        ok(stop_proc == 0, "Stopping lighttpd"); 
     373} 
     374 
     375SKIP: { 
     376        skip "no fcgi-auth found", 3 unless -x "/home/weigon/Documents/php-4.3.10/sapi/cgi/php";  
     377        $configfile = 'fastcgi-13.conf'; 
     378        ok(start_proc == 0, "Starting lighttpd with $configfile") or die(); 
     379        @request  = ( <<EOF 
    342380GET /indexfile/index.php HTTP/1.0 
    343381Host: www.example.org 
    344382EOF 
    345383 ); 
    346 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ); 
    347 ok(handle_http == 0, 'FastCGI + local spawning'); 
    348  
    349 ok(stop_proc == 0, "Stopping lighttpd"); 
    350  
    351 $configfile = 'bug-06.conf'; 
    352 ok(start_proc == 0, "Starting lighttpd with $configfile") or die(); 
    353 @request  = ( <<EOF 
    354 GET /indexfile/ HTTP/1.0 
    355 Host: www.example.org 
    356 EOF 
    357  ); 
    358 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/indexfile/index.php' } ); 
    359 ok(handle_http == 0, 'Bug #6'); 
    360  
    361 ok(stop_proc == 0, "Stopping lighttpd"); 
    362  
    363 $configfile = 'bug-12.conf'; 
    364 ok(start_proc == 0, "Starting lighttpd with bug-12.conf") or die(); 
    365 @request  = ( <<EOF 
    366 POST /indexfile/abc HTTP/1.0 
    367 Host: www.example.org 
    368 Content-Length: 0 
    369 EOF 
    370  ); 
    371 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => '/indexfile/return-404.php' } ); 
    372 ok(handle_http == 0, 'Bug #12'); 
    373  
    374 ok(stop_proc == 0, "Stopping lighttpd"); 
    375  
    376 $configfile = 'fastcgi-responder.conf'; 
    377 ok(start_proc == 0, "Starting lighttpd with $configfile") or die(); 
    378 @request  = ( <<EOF 
     384        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ); 
     385        ok(handle_http == 0, 'FastCGI + local spawning'); 
     386 
     387        ok(stop_proc == 0, "Stopping lighttpd"); 
     388} 
     389 
     390 
     391SKIP: { 
     392        skip "no fcgi-auth found", 9 unless -x $basedir."/tests/fcgi-responder";  
     393         
     394        $configfile = 'fastcgi-responder.conf'; 
     395        ok(start_proc == 0, "Starting lighttpd with $configfile") or die(); 
     396        @request  = ( <<EOF 
    379397GET /index.fcgi?lf HTTP/1.0 
    380398Host: www.example.org 
    381399EOF 
    382400 ); 
    383 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
    384 ok(handle_http == 0, 'line-ending \n\n'); 
    385  
    386 @request  = ( <<EOF 
     401        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
     402        ok(handle_http == 0, 'line-ending \n\n'); 
     403 
     404        @request  = ( <<EOF 
    387405GET /index.fcgi?crlf HTTP/1.0 
    388406Host: www.example.org 
    389407EOF 
    390408 ); 
    391 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
    392 ok(handle_http == 0, 'line-ending \r\n\r\n'); 
    393  
    394 @request  = ( <<EOF 
     409        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
     410        ok(handle_http == 0, 'line-ending \r\n\r\n'); 
     411 
     412        @request  = ( <<EOF 
    395413GET /index.fcgi?slow-lf HTTP/1.0 
    396414Host: www.example.org 
    397415EOF 
    398416 ); 
    399 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
    400 ok(handle_http == 0, 'line-ending \n + \n'); 
    401  
    402 @request  = ( <<EOF 
     417        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
     418        ok(handle_http == 0, 'line-ending \n + \n'); 
     419 
     420        @request  = ( <<EOF 
    403421GET /index.fcgi?slow-crlf HTTP/1.0 
    404422Host: www.example.org 
    405423EOF 
    406424 ); 
    407 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
    408 ok(handle_http == 0, 'line-ending \r\n + \r\n'); 
    409  
    410 @request  = ( <<EOF 
     425        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
     426        ok(handle_http == 0, 'line-ending \r\n + \r\n'); 
     427 
     428        @request  = ( <<EOF 
    411429GET /index.fcgi?die-at-end HTTP/1.0 
    412430Host: www.example.org 
    413431EOF 
    414432 ); 
    415 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
    416 ok(handle_http == 0, 'killing fastcgi and wait for restart'); 
    417  
    418 @request  = ( <<EOF 
     433        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
     434        ok(handle_http == 0, 'killing fastcgi and wait for restart'); 
     435 
     436        @request  = ( <<EOF 
    419437GET /index.fcgi?die-at-end HTTP/1.0 
    420438Host: www.example.org 
    421439EOF 
    422440 ); 
    423 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
    424 ok(handle_http == 0, 'killing fastcgi and wait for restart'); 
    425  
    426  
    427 @request  = ( <<EOF 
     441        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
     442        ok(handle_http == 0, 'killing fastcgi and wait for restart'); 
     443 
     444 
     445        @request  = ( <<EOF 
    428446GET /index.fcgi?crlf HTTP/1.0 
    429447Host: www.example.org 
    430448EOF 
    431449 ); 
    432 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
    433 ok(handle_http == 0, 'regular response of after restart'); 
    434  
    435  
    436  
    437 ok(stop_proc == 0, "Stopping lighttpd"); 
    438  
     450        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
     451        ok(handle_http == 0, 'regular response of after restart'); 
     452 
     453 
     454        ok(stop_proc == 0, "Stopping lighttpd"); 
     455} 
     456 
  • trunk/tests/mod-userdir.t

    r72 r81  
    192192 
    193193@request  = ( <<EOF 
    194 GET /~jan/ HTTP/1.0 
     194GET /~foobar/ HTTP/1.0 
    195195EOF 
    196196 );