]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[TESTS] refine non-regression tests and add 4 new tests
authorWilly Tarreau <w@1wt.eu>
Mon, 7 Jun 2010 11:50:26 +0000 (13:50 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 7 Jun 2010 20:43:55 +0000 (22:43 +0200)
These were required to be updated for 1.4.

tests/test-fsm.cfg

index 3b6dbdf0b3e1c62e1dddba9483ab0c6aac62af2a..8fcf2655bda1f3a6a1783b4022f0406a740bc870 100644 (file)
 #   server = nc6 --half-close -lp4000
 #   client = (printf "GET / HTTP/1.0\r\n\r\n"; sleep 1) | nc 127.1 8001
 # action : wait 9 seconds and check response
-# result : client exits with 504, log is emitted immediately, server must be
-#          terminated by hand. Logs indicate "sH--" with correct timers, which
-#          is 9s total (sleep 1 + 8 for server response).
-# example: 0/0/0/-1/9002 504 194 - - sH--
+# result : client exits with 504, log is emitted immediately, server exits
+#          immediately. Logs indicate "sH--" with correct timers, which
+#          is 8s regardless of the "sleep 1".
+# 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 :
 #   server = nc6 -lp4000
 #   client = (printf "GET / HTTP/1.0\r\n\r\n"; sleep 1) | nc 127.1 8001
-# action : wait 1 second and check response
-# result : client exits with 502, log is emitted immediately, server closes.
-#          Logs indicate "SH--" with correct timers.
-# example: 0/0/0/-1/1002 502 204 - - SH--
+# action : wait 9 second and check response
+# result : client exits with 504, log is emitted immediately, server exits
+#          immediately. Logs indicate "sH--" with correct timers, which
+#          is 8s regardless of the "sleep 1".
+# example: 0/0/0/-1/8002 504 194 - - sH--
 
 ########### test16: process_srv(), read timeout on server headers
 # setup :
 # action : wait at least 12 seconds and check the logs
 # result : client returns 503 and must be terminated by hand. Log is emitted
 #          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
 # setup :
 # action : wait at least 12 seconds and check the logs
 # result : client returns 503 and automatically closes. Log is emitted
 #          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
 # setup :
 # 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 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.
-#          Log is emitted immediately. Logs indicate "----" with correct timers.
-# example: 5002/0/0/0/5002 200 31 - - ----
+#          Log is emitted after the timeout occurs. Logs indicate "cD--" with correct timers.
+# 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 queue   9s
 
-       balance         url_param foo check_post
+       balance         roundrobin
        server          srv4000 127.0.0.1:4000
 
 # connect port 8002 to nowhere
@@ -264,6 +301,23 @@ listen  frt8002
        balance         url_param foo check_post
        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
 #      log             global