Changeset 81
- Timestamp:
- 03/03/2005 11:35:27 AM (4 years ago)
- Location:
- trunk/tests
- Files:
-
- 2 modified
-
mod-fastcgi.t (modified) (4 diffs)
-
mod-userdir.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/mod-fastcgi.t
r74 r81 26 26 close F; 27 27 28 return $pid; 28 if (defined $pid) { return $pid; } 29 30 return -1; 29 31 } 30 32 … … 34 36 close F; 35 37 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 } 38 42 39 43 return 0; … … 196 200 } 197 201 198 ok(start_proc == 0, "Starting lighttpd") or die();199 202 200 203 SKIP: { 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(); 202 207 203 208 @request = ( <<EOF … … 302 307 ok(handle_http == 0, 'PHP_SELF + Indexfile, Bug #3'); 303 308 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 310 316 GET /phphost.php HTTP/1.0 311 317 Host: zzz.example.org 312 318 EOF 313 319 ); 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 328 GET /indexfile/ HTTP/1.0 329 Host: www.example.org 330 EOF 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 340 POST /indexfile/abc HTTP/1.0 341 Host: www.example.org 342 Content-Length: 0 343 EOF 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 351 SKIP: { 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 322 357 GET /index.html?ok HTTP/1.0 323 358 Host: www.example.org 324 359 EOF 325 360 ); 326 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } );327 ok(handle_http == 0, 'FastCGI - Auth');328 329 @request = ( <<EOF361 @response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ); 362 ok(handle_http == 0, 'FastCGI - Auth'); 363 364 @request = ( <<EOF 330 365 GET /index.html?fail HTTP/1.0 331 366 Host: www.example.org 332 367 EOF 333 368 ); 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 375 SKIP: { 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 342 380 GET /indexfile/index.php HTTP/1.0 343 381 Host: www.example.org 344 382 EOF 345 383 ); 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 391 SKIP: { 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 379 397 GET /index.fcgi?lf HTTP/1.0 380 398 Host: www.example.org 381 399 EOF 382 400 ); 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 = ( <<EOF401 @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 387 405 GET /index.fcgi?crlf HTTP/1.0 388 406 Host: www.example.org 389 407 EOF 390 408 ); 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 = ( <<EOF409 @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 395 413 GET /index.fcgi?slow-lf HTTP/1.0 396 414 Host: www.example.org 397 415 EOF 398 416 ); 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 = ( <<EOF417 @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 403 421 GET /index.fcgi?slow-crlf HTTP/1.0 404 422 Host: www.example.org 405 423 EOF 406 424 ); 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 = ( <<EOF425 @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 411 429 GET /index.fcgi?die-at-end HTTP/1.0 412 430 Host: www.example.org 413 431 EOF 414 432 ); 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 = ( <<EOF433 @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 419 437 GET /index.fcgi?die-at-end HTTP/1.0 420 438 Host: www.example.org 421 439 EOF 422 440 ); 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 = ( <<EOF441 @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 428 446 GET /index.fcgi?crlf HTTP/1.0 429 447 Host: www.example.org 430 448 EOF 431 449 ); 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 192 192 193 193 @request = ( <<EOF 194 GET /~ jan/ HTTP/1.0194 GET /~foobar/ HTTP/1.0 195 195 EOF 196 196 );

