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 <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2016-08-11 15:58:13 +03:00 committed by Jouni Malinen
parent f27b9277d5
commit 2d6a526ac3

View file

@ -4418,7 +4418,11 @@ RGV2aWNlIEEQSQAGADcqAAEg
for i in range(20): for i in range(20):
socks[i] = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socks[i] = socket.socket(socket.AF_INET, socket.SOCK_STREAM,
socket.IPPROTO_TCP) socket.IPPROTO_TCP)
try:
socks[i].connect(addr) socks[i].connect(addr)
except:
logger.info("connect %d failed" % i)
pass
for i in range(20): for i in range(20):
socks[i].send("GET / HTTP/1.1\r\n\r\n") socks[i].send("GET / HTTP/1.1\r\n\r\n")
count = 0 count = 0