TESTS: add a test configuration to stress handshake combinations
authorWilly Tarreau <w@1wt.eu>
Sun, 19 Mar 2017 05:59:29 +0000 (06:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 19 Mar 2017 10:59:47 +0000 (11:59 +0100)
commitd78c0fa0fb32b27c49279c8fdb6e76bb6a01602f
tree03171c6fcff5c1c3781d9e20b9aed8e55b4cfc01
parente6006245de214fa6689bbddb5463867452575b35
TESTS: add a test configuration to stress handshake combinations

This config tries to involve the various possible combinations of connection
handshakes, on the accept side and on the connect side. It also produces logs
indicating the handshake time.

May be tested with tcploop as the server, both for TCP and HTTP mode :
   - accept new connection
   - pause 100ms
   - send what looks like an HTTP response
   - wait 500ms and close

Starting log server (mainly to check timers) :
   $ socat udp-recvfrom:5514,fork -

Starting server :
   $ tcploop 8000 L N A W P100 S:"HTTP/1.0 200 OK\r\nConnection: close\r\n\r\n" P500

Testing all combinations with server-speaks-first (tcp) :
   $ nc 0 8007

Testing all combinations with client-speaks-first (tcp) :
   $ (printf "GET / HTTP/1.0\r\n\r\n";sleep 1) | nc 0 8007

Testing all combinations with client-speaks-first after pause (tcp) :
   $ (usleep 0.05 ; printf "GET / HTTP/1.0\r\n\r\n";sleep 1) | nc 0 8007

Testing all combinations with client-speaks-first (http) :
   $ (printf "GET / HTTP/1.0\r\n\r\n";sleep 1) | nc 0 8017

Testing all combinations with client-speaks-first after pause (http) :
   $ (usleep 0.05 ; printf "GET / HTTP/1.0\r\n\r\n";sleep 1) | nc 0 8017

Same tests must be redone after surrounding connect() in tcp_connect_server()
with fcntl(fd, F_SETFL, 0) and fcntl(fd, F_SETFL, O_NONBLOCK) for sycnhronous
connect().
tests/test-handshakes-chk.cfg [new file with mode: 0644]
tests/test-handshakes.cfg [new file with mode: 0644]