From 2d6a526ac3885605f34df4037fc79ad330565b23 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 11 Aug 2016 15:58:13 +0300 Subject: [PATCH] tests: Make ap_wps_er_http_proto more robust It looks like connect() for a TCP socket can time out at least with a recent kernel. Handle that case more gracefully by ignoring that socket while allowing the test to continue. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_wps.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index 32d2e63..6d9989a 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -4418,7 +4418,11 @@ RGV2aWNlIEEQSQAGADcqAAEg for i in range(20): socks[i] = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) - socks[i].connect(addr) + try: + socks[i].connect(addr) + except: + logger.info("connect %d failed" % i) + pass for i in range(20): socks[i].send("GET / HTTP/1.1\r\n\r\n") count = 0 -- 2.1.4