Changeset 513

Show
Ignore:
Timestamp:
08/08/2005 10:30:02 AM (3 years ago)
Author:
moo
Message:

pathinfo test

Location:
trunk/tests
Files:
1 added
1 modified

Legend:

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

    r168 r513  
    33use strict; 
    44use IO::Socket; 
    5 use Test::More tests => 40; 
     5use Test::More tests => 41; 
    66 
    77my $basedir = (defined $ENV{'top_builddir'} ? $ENV{'top_builddir'} : '..'); 
     
    1818sub pidof { 
    1919        my $prog = $_[0]; 
    20  
    21         open F, "ps ax  | grep $prog | grep -v grep | awk '{ print \$1 }'|" or 
    22         open F, "ps -ef | grep $prog | grep -v grep | awk '{ print \$2 }'|" or 
     20        my $pid; 
     21 
     22        open F, "ps ax  | grep $prog | grep -v grep | awk '{ print \$1 }'|" and $pid = <F> or 
     23        close F and 
     24        open F, "ps -ef | grep $prog | grep -v grep | awk '{ print \$2 }'|" and $pid = <F> or 
    2325          return -1; 
    2426 
    25         my $pid = <F>; 
    2627        close F; 
    2728 
     
    202203 
    203204SKIP: { 
    204         skip "no PHP running on port 1026", 24 if pidof("php") == -1;  
     205        skip "no PHP running on port 1026", 25 if pidof("php") == -1;  
    205206 
    206207        ok(start_proc == 0, "Starting lighttpd") or die(); 
     
    253254        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/phpself.php' } ); 
    254255        ok(handle_http == 0, '$_SERVER["PHP_SELF"]'); 
     256 
     257        @request  = ( <<EOF 
     258GET /pathinfo.php/foo HTTP/1.0 
     259Host: www.example.org 
     260EOF 
     261 ); 
     262        @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/foo' } ); 
     263        ok(handle_http == 0, '$_SERVER["PATH_INFO"]'); 
    255264 
    256265        @request  = ( <<EOF