From: Anton Yuzhaninov Date: Thu, 25 Oct 2018 01:08:31 +0000 (-0400) Subject: TCP Connect robot keyword X-Git-Tag: 1.8.2~142^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F2610%2Fhead;p=thirdparty%2Frspamd.git TCP Connect robot keyword * reduce timeout to a reasonable value * explicitly close socket, don't wait for GC --- diff --git a/test/functional/lib/rspamd.py b/test/functional/lib/rspamd.py index e4462c18cc..6fc1c0e670 100644 --- a/test/functional/lib/rspamd.py +++ b/test/functional/lib/rspamd.py @@ -160,8 +160,15 @@ def spamc(addr, port, filename): return r.decode('utf-8') def TCP_Connect(addr, port): + """Attempts to open a TCP connection to specified address:port + + Example: + | Wait Until Keyword Succeeds | 5s | 10ms | TCP Connect | localhost | 8080 | + """ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.settimeout(5) # seconds s.connect((addr, port)) + s.close() def update_dictionary(a, b): a.update(b)