From e5d3e13a5c2f3e053c48c1e2b0a310a50219e907 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 17 Aug 2016 12:24:59 +0300 Subject: [PATCH] tests: Fix ap_wps_er_http_proto max concurrent requests case Commit 2d6a526ac3885605f34df4037fc79ad330565b23 ('tests: Make ap_wps_er_http_proto more robust') tried to work around the timeouts here, but that was not really the best approach since the one second timeout that was used here for connect() ended up being very close to the limit even before the kernel change. The longer connect() time is caused by a sequence where the listen() backlog ignores the connection instead of accept() followed by close() within the wpa_supplicant ER HTTP connection handling. The time to retransmit the SYN changed a bit in the kernel from 1.0 sec to about 1.03 sec. This was enough to push that over the one second timeout. Fix this by using a sufficiently long timeout (10 sec) to allow SYN retransmission to occur to recover from the listen() backlog case. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_wps.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index 6d9989ad8..fcbbb8c47 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -4418,11 +4418,8 @@ RGV2aWNlIEEQSQAGADcqAAEg for i in range(20): socks[i] = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) - try: - socks[i].connect(addr) - except: - logger.info("connect %d failed" % i) - pass + socks[i].settimeout(10) + socks[i].connect(addr) for i in range(20): socks[i].send("GET / HTTP/1.1\r\n\r\n") count = 0