Changeset 64

Show
Ignore:
Timestamp:
03/01/2005 04:57:24 PM (4 years ago)
Author:
jan
Message:

added tests for restarting fcgi-procs after they died

Location:
trunk/tests
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/fastcgi-responder.conf

    r62 r64  
    22server.pid-file              = "/tmp/lighttpd/lighttpd.pid" 
    33 
    4 debug.log-request-header   = "enable" 
    5 debug.log-response-header  = "enable" 
    6 debug.log-request-handling = "enable" 
     4#debug.log-request-header   = "enable" 
     5#debug.log-response-header  = "enable" 
     6#debug.log-request-handling = "enable" 
     7#debug.log-state-handling = "enable" 
     8 
     9#fastcgi.debug = 1 
    710 
    811## bind to port (default: 80) 
     
    8992                                    "port" => 1028, 
    9093                                    "bin-path" => "./fcgi-responder", 
    91                                     "check-local" => "disable" 
     94                                    "check-local" => "disable", 
     95                                    "max-procs" => 1, 
     96                                    "min-procs" => 1 
    9297                                  ) 
    9398                                ) 
  • trunk/tests/fcgi-responder.c

    r62 r64  
    55 
    66int main () { 
    7         char* p; 
     7        int num_requests = 2; 
    88         
    9         while (FCGI_Accept() >= 0) {    
     9        while (num_requests > 0 && 
     10               FCGI_Accept() >= 0) { 
     11                char* p; 
     12                 
    1013                if (NULL != (p = getenv("QUERY_STRING"))) { 
    1114                        if (0 == strcmp(p, "lf")) { 
     
    2124                                fflush(stdout); 
    2225                                printf("\r\n"); 
     26                        } else if (0 == strcmp(p, "die-at-end")) { 
     27                                printf("Status: 200 OK\r\n\r\n"); 
     28                                num_requests--; 
    2329                        } else { 
    2430                                printf("Status: 200 OK\r\n\r\n"); 
     
    2834                } 
    2935                  
    30                 printf("test123");   
     36                printf("test123"); 
    3137        } 
    32  
     38         
    3339        return 0; 
    3440} 
  • trunk/tests/run-tests.pl

    r62 r64  
    33use strict; 
    44use IO::Socket; 
    5 use Test::More tests => 124; 
     5use Test::More tests => 126; 
    66 
    77 
     
    12211221ok(handle_http == 0, 'line-ending \n + \n'); 
    12221222 
    1223  
    1224  
    12251223@request  = ( <<EOF 
    12261224GET /index.fcgi?slow-crlf HTTP/1.0 
     
    12311229ok(handle_http == 0, 'line-ending \r\n + \r\n'); 
    12321230 
     1231@request  = ( <<EOF 
     1232GET /index.fcgi?die-at-end HTTP/1.0 
     1233Host: www.example.org 
     1234EOF 
     1235 ); 
     1236@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
     1237ok(handle_http == 0, 'killing fastcgi and wait for restart'); 
     1238 
     1239@request  = ( <<EOF 
     1240GET /index.fcgi?crlf HTTP/1.0 
     1241Host: www.example.org 
     1242EOF 
     1243 ); 
     1244@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
     1245ok(handle_http == 0, 'regular response of after restart'); 
     1246 
     1247 
    12331248 
    12341249ok(stop_proc == 0, "Stopping lighttpd");