[TESTS] refine non-regression tests and add 4 new tests

These were required to be updated for 1.4.
This commit is contained in:
Willy Tarreau 2010-06-07 13:50:26 +02:00
parent 79ebac602d
commit 4098aabbb1
1 changed files with 69 additions and 15 deletions

View File

@ -135,19 +135,20 @@
# server = nc6 --half-close -lp4000 # server = nc6 --half-close -lp4000
# client = (printf "GET / HTTP/1.0\r\n\r\n"; sleep 1) | nc 127.1 8001 # client = (printf "GET / HTTP/1.0\r\n\r\n"; sleep 1) | nc 127.1 8001
# action : wait 9 seconds and check response # action : wait 9 seconds and check response
# result : client exits with 504, log is emitted immediately, server must be # result : client exits with 504, log is emitted immediately, server exits
# terminated by hand. Logs indicate "sH--" with correct timers, which # immediately. Logs indicate "sH--" with correct timers, which
# is 9s total (sleep 1 + 8 for server response). # is 8s regardless of the "sleep 1".
# example: 0/0/0/-1/9002 504 194 - - sH-- # example: 0/0/0/-1/8002 504 194 - - sH--
########### test15: process_srv(), client close causing server close ########### test15: process_srv(), client close not causing server close
# setup : # setup :
# server = nc6 -lp4000 # server = nc6 -lp4000
# client = (printf "GET / HTTP/1.0\r\n\r\n"; sleep 1) | nc 127.1 8001 # client = (printf "GET / HTTP/1.0\r\n\r\n"; sleep 1) | nc 127.1 8001
# action : wait 1 second and check response # action : wait 9 second and check response
# result : client exits with 502, log is emitted immediately, server closes. # result : client exits with 504, log is emitted immediately, server exits
# Logs indicate "SH--" with correct timers. # immediately. Logs indicate "sH--" with correct timers, which
# example: 0/0/0/-1/1002 502 204 - - SH-- # is 8s regardless of the "sleep 1".
# example: 0/0/0/-1/8002 504 194 - - sH--
########### test16: process_srv(), read timeout on server headers ########### test16: process_srv(), read timeout on server headers
# setup : # setup :
@ -166,7 +167,7 @@
# action : wait at least 12 seconds and check the logs # action : wait at least 12 seconds and check the logs
# result : client returns 503 and must be terminated by hand. Log is emitted # result : client returns 503 and must be terminated by hand. Log is emitted
# immediately. Logs indicate "sC--" with correct timers. # immediately. Logs indicate "sC--" with correct timers.
# example: 0/6001/-1/-1/12001 503 212 - - sC-- # example: 0/0/-1/-1/12001 503 212 - - sC--
########### test18: process_srv(), client close during connection time-out ########### test18: process_srv(), client close during connection time-out
# setup : # setup :
@ -176,7 +177,7 @@
# action : wait at least 12 seconds and check the logs # action : wait at least 12 seconds and check the logs
# result : client returns 503 and automatically closes. Log is emitted # result : client returns 503 and automatically closes. Log is emitted
# immediately. Logs indicate "sC--" with correct timers. # immediately. Logs indicate "sC--" with correct timers.
# example: 0/6001/-1/-1/12001 503 212 - - sC-- # example: 0/0/-1/-1/12001 503 212 - - sC--
########### test19: process_srv(), immediate server close after empty response ########### test19: process_srv(), immediate server close after empty response
# setup : # setup :
@ -209,10 +210,46 @@
# setup : # setup :
# server = (printf "HTTP/1.0 200 OK\r\nTest: test\r\n\r\n") | nc -lp4000 # server = (printf "HTTP/1.0 200 OK\r\nTest: test\r\n\r\n") | nc -lp4000
# client = (printf "POST / HTTP/1.0\r\nContent-length: 20\r\n\r\n";cat) | nc 127.1 8001 # client = (printf "POST / HTTP/1.0\r\nContent-length: 20\r\n\r\n";cat) | nc 127.1 8001
# action : wait 5s for the request body to timeout. # action : wait 7s for the request body to timeout.
# result : The server receives the request and responds immediately with 200. # result : The server receives the request and responds immediately with 200.
# Log is emitted immediately. Logs indicate "----" with correct timers. # Log is emitted after the timeout occurs. Logs indicate "cD--" with correct timers.
# example: 5002/0/0/0/5002 200 31 - - ---- # example: 1/0/0/0/7004 200 31 - - cD--
########### test23: process_srv(), client close on request body
# setup :
# server = (printf "HTTP/1.0 200 OK\r\nTest: test\r\n\r\n") | nc -lp4000
# client = (printf "POST / HTTP/1.0\r\nContent-length: 20\r\n\r\n";cat) | nc 127.1 8001
# action : wait 2s then press Ctrl-C on the client
# result : The server immediately aborts and the logs are emitted immediately with a 400.
# Logs indicate "CD--" with correct timers.
# example: 1/0/0/0/1696 400 31 - - CD--
########### test24 process_srv(), server close on request body
# setup :
# server = (printf "HTTP/1.0 200 OK\r\nTest: test\r\n\r\n") | nc -lp4000
# client = (printf "POST / HTTP/1.0\r\nContent-length: 20\r\n\r\n";cat) | nc 127.1 8001
# action : wait 2s then press Ctrl-C on the server and press enter a few times on the client
# result : The logs are emitted immediately with a 200 (server's incomplete response).
# Logs indicate "SD--" with correct timers. Client must be terminated by hand.
# example: 1/0/0/0/2186 200 31 - - SD--
########### test25: process_srv(), client timeout on request body when url_param is used
# setup :
# server = none
# client = (printf "POST / HTTP/1.0\r\nContent-length: 20\r\n\r\n";cat) | nc 127.1 8003
# action : wait 5s for the request body to timeout.
# result : The client receives a 408 and closes. The log is emitted immediately.
# Logs indicate "cD--" with correct timers.
# example: 0/-1/-1/-1/5003 408 212 - - cD--
########### test26: process_srv(), client abort on request body when url_param is used
# setup :
# server = none
# client = (printf "POST / HTTP/1.0\r\nContent-length: 20\r\n\r\n";cat) | nc 127.1 8003
# action : wait 2s then press Ctrl-C on the client
# result : The logs are emitted immediately with a 400.
# Logs indicate "CD--" with correct timers.
# example: 594/-1/-1/-1/594 400 187 - - CD--
@ -243,7 +280,7 @@ listen frt8001
timeout server 8s timeout server 8s
timeout queue 9s timeout queue 9s
balance url_param foo check_post balance roundrobin
server srv4000 127.0.0.1:4000 server srv4000 127.0.0.1:4000
# connect port 8002 to nowhere # connect port 8002 to nowhere
@ -264,6 +301,23 @@ listen frt8002
balance url_param foo check_post balance url_param foo check_post
server srv4000 192.168.255.255:4000 server srv4000 192.168.255.255:4000
# connect port 8003 to localhost:4000 with url_param
listen frt8003
log global
bind :8003
mode http
option httplog
maxconn 100
timeout http-request 5s
timeout connect 6s
timeout client 7s
timeout server 8s
timeout queue 9s
balance url_param foo check_post
server srv4000 127.0.0.1:4000
# listen frt8002 # listen frt8002
# log global # log global