aboutsummaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorAnton Yuzhaninov <citrin+git@citrin.ru>2018-10-24 21:08:31 -0400
committerAnton Yuzhaninov <citrin+git@citrin.ru>2018-10-24 21:28:47 -0400
commit43ceedc68fe92ffaeb2f5f3bb41087744018e110 (patch)
tree29b0f04f4290be1097c80ca70bbdbc574efb3aba /test/functional
parent58e4d05f07e988b9a02e88c279b30f05602da8a0 (diff)
downloadrspamd-43ceedc68fe92ffaeb2f5f3bb41087744018e110.tar.gz
rspamd-43ceedc68fe92ffaeb2f5f3bb41087744018e110.zip
TCP Connect robot keyword
* reduce timeout to a reasonable value * explicitly close socket, don't wait for GC
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/lib/rspamd.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/lib/rspamd.py b/test/functional/lib/rspamd.py
index e4462c18c..6fc1c0e67 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)