From fc6155ae6b86ac4a7ec8dfa752e6b7f195f2d976 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Fri, 30 Jun 2017 13:55:18 +0200 Subject: [PATCH] [Minor] Tests: don't try bind ports --- circle.yml | 2 +- test/functional/cases/102_multimap.robot | 1 - test/functional/cases/106_url_tags.robot | 1 - .../functional/cases/110_statistics/lib.robot | 1 - .../cases/120_fuzzy/redis-general.robot | 1 - .../cases/120_fuzzy/replication.robot | 9 --------- .../cases/131_dkim_signing/002_redis.robot | 1 - test/functional/cases/140_proxy.robot | 5 ----- test/functional/cases/160_antivirus.robot | 3 --- test/functional/lib/rspamd.py | 20 ------------------- test/functional/lib/rspamd.robot | 2 -- 11 files changed, 1 insertion(+), 45 deletions(-) diff --git a/circle.yml b/circle.yml index d9fe138aa..cc1d20479 100644 --- a/circle.yml +++ b/circle.yml @@ -3,7 +3,7 @@ dependencies: - sudo apt-get update -qq || true - sudo apt-get install -qq cmake gcc lcov libevent-dev libglib2.0-dev libgmime-2.6-dev libluajit-5.1-dev liblua5.1-0-dev libmagic-dev libpcre3-dev libsqlite3-dev libssl-dev luarocks make python-dev ragel redis-server libgd-dev libfann-dev - gem install coveralls-lcov - - sudo pip install demjson ipaddress psutil robotframework + - sudo pip install demjson psutil robotframework - cd .. && wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make -j`nproc` && sudo cp src/redis-cli /usr/bin/ - sudo luarocks install luacheck diff --git a/test/functional/cases/102_multimap.robot b/test/functional/cases/102_multimap.robot index 7b45bdcac..977a84991 100644 --- a/test/functional/cases/102_multimap.robot +++ b/test/functional/cases/102_multimap.robot @@ -281,4 +281,3 @@ Multimap Setup Multimap Teardown Normal Teardown Shutdown Process With Children ${REDIS_PID} - Wait For Port ${SOCK_STREAM} ${LOCAL_ADDR} ${REDIS_PORT} diff --git a/test/functional/cases/106_url_tags.robot b/test/functional/cases/106_url_tags.robot index 960376ab7..7954d0aac 100644 --- a/test/functional/cases/106_url_tags.robot +++ b/test/functional/cases/106_url_tags.robot @@ -39,4 +39,3 @@ URL Tags Teardown Normal Teardown Remove File ${LUA} Shutdown Process With Children ${REDIS_PID} - Wait For Port ${SOCK_STREAM} ${LOCAL_ADDR} ${REDIS_PORT} diff --git a/test/functional/cases/110_statistics/lib.robot b/test/functional/cases/110_statistics/lib.robot index 7aba131d9..268433d04 100644 --- a/test/functional/cases/110_statistics/lib.robot +++ b/test/functional/cases/110_statistics/lib.robot @@ -51,7 +51,6 @@ Redis Statistics Setup Redis Statistics Teardown Normal Teardown Shutdown Process With Children ${REDIS_PID} - Wait For Port ${SOCK_STREAM} ${LOCAL_ADDR} ${REDIS_PORT} Statistics Setup Generic Setup STATS_PATH_CACHE STATS_PATH_HAM STATS_PATH_SPAM diff --git a/test/functional/cases/120_fuzzy/redis-general.robot b/test/functional/cases/120_fuzzy/redis-general.robot index d79ab30e7..056b177c8 100644 --- a/test/functional/cases/120_fuzzy/redis-general.robot +++ b/test/functional/cases/120_fuzzy/redis-general.robot @@ -29,4 +29,3 @@ Fuzzy Redis General Setup Fuzzy Redis General Teardown Normal Teardown Shutdown Process With Children ${REDIS_PID} - Wait For Port ${SOCK_STREAM} ${LOCAL_ADDR} ${REDIS_PORT} diff --git a/test/functional/cases/120_fuzzy/replication.robot b/test/functional/cases/120_fuzzy/replication.robot index 8a3b875ed..cb7d42533 100644 --- a/test/functional/cases/120_fuzzy/replication.robot +++ b/test/functional/cases/120_fuzzy/replication.robot @@ -82,12 +82,3 @@ Replication Teardown Cleanup Temporary Directory ${SLAVE_TMPDIR} Remove File ${TMP_INCLUDE1} Remove File ${TMP_INCLUDE2} - ${port_normal} = Create List ${SOCK_STREAM} ${LOCAL_ADDR} ${PORT_NORMAL} - ${port_fuzzy} = Create List ${SOCK_DGRAM} ${LOCAL_ADDR} ${PORT_FUZZY} - ${port_controller} = Create List ${SOCK_STREAM} ${LOCAL_ADDR} ${PORT_CONTROLLER} - ${port_normal_slave} = Create List ${SOCK_STREAM} ${LOCAL_ADDR} ${PORT_NORMAL_SLAVE} - ${port_fuzzy_slave} = Create List ${SOCK_DGRAM} ${LOCAL_ADDR} ${PORT_FUZZY_SLAVE} - ${port_controller_slave} = Create List ${SOCK_STREAM} ${LOCAL_ADDR} ${PORT_CONTROLLER_SLAVE} - ${ports} = Create List ${port_normal} ${port_fuzzy} ${port_controller} ${port_normal_slave} ${port_fuzzy_slave} ${port_controller_slave} - : FOR ${i} IN @{ports} - \ Wait For Port @{i}[0] @{i}[1] @{i}[2] diff --git a/test/functional/cases/131_dkim_signing/002_redis.robot b/test/functional/cases/131_dkim_signing/002_redis.robot index f46bfbc33..f7d590c1c 100644 --- a/test/functional/cases/131_dkim_signing/002_redis.robot +++ b/test/functional/cases/131_dkim_signing/002_redis.robot @@ -36,4 +36,3 @@ DKIM Signing Setup DKIM Signing Teardown Normal Teardown Shutdown Process With Children ${REDIS_PID} - Wait For Port ${SOCK_STREAM} ${LOCAL_ADDR} ${REDIS_PORT} diff --git a/test/functional/cases/140_proxy.robot b/test/functional/cases/140_proxy.robot index 42297ea62..7b29f188a 100644 --- a/test/functional/cases/140_proxy.robot +++ b/test/functional/cases/140_proxy.robot @@ -47,8 +47,3 @@ Proxy Teardown Shutdown Process With Children ${SLAVE_PID} Cleanup Temporary Directory ${PROXY_TMPDIR} Cleanup Temporary Directory ${SLAVE_TMPDIR} - ${port_normal} = Create List ${SOCK_STREAM} ${LOCAL_ADDR} ${PORT_NORMAL} - ${port_proxy} = Create List ${SOCK_STREAM} ${LOCAL_ADDR} ${PORT_PROXY} - ${ports} = Create List ${port_normal} ${port_proxy} - : FOR ${i} IN @{ports} - \ Wait For Port @{i}[0] @{i}[1] @{i}[2] diff --git a/test/functional/cases/160_antivirus.robot b/test/functional/cases/160_antivirus.robot index 98c7a4a2a..ec43329e3 100644 --- a/test/functional/cases/160_antivirus.robot +++ b/test/functional/cases/160_antivirus.robot @@ -67,16 +67,13 @@ Antivirus Setup Antivirus Teardown Normal Teardown Shutdown Process With Children ${REDIS_PID} - Wait For Port ${SOCK_STREAM} ${LOCAL_ADDR} ${REDIS_PORT} Run Dummy Clam [Arguments] ${port} ${found}= - Wait For Port ${SOCK_STREAM} ${LOCAL_ADDR} ${port} ${result} = Start Process ${TESTDIR}/util/dummy_clam.py ${port} ${found} Wait Until Created /tmp/dummy_clamav.pid Run Dummy Fprot [Arguments] ${port} ${found}= - Wait For Port ${SOCK_STREAM} ${LOCAL_ADDR} ${port} ${result} = Start Process ${TESTDIR}/util/dummy_fprot.py ${port} ${found} Wait Until Created /tmp/dummy_fprot.pid diff --git a/test/functional/lib/rspamd.py b/test/functional/lib/rspamd.py index fd1907384..76af7864d 100644 --- a/test/functional/lib/rspamd.py +++ b/test/functional/lib/rspamd.py @@ -1,6 +1,5 @@ import demjson import grp -import ipaddress import os import os.path import psutil @@ -200,22 +199,3 @@ def shutdown_process_with_children(pid): shutdown_process(child.pid) except: pass - -def wait_for_port(proto, addr, num): - i = ipaddress.ip_address(addr) - if (i.version == 6): - af = socket.AF_INET6 - else: - af = socket.AF_INET - while True: - try: - s = socket.socket(af, proto) - s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - s.bind((addr, num)) - if (proto == socket.SOCK_STREAM): - s.listen(0) - break - except: - pass - time.sleep(0.01) - s.close() diff --git a/test/functional/lib/rspamd.robot b/test/functional/lib/rspamd.robot index 3044b8292..e90ed9ee0 100644 --- a/test/functional/lib/rspamd.robot +++ b/test/functional/lib/rspamd.robot @@ -71,8 +71,6 @@ Generic Teardown Run Keyword If '${CONTROLLER_ERRORS}' == 'True' Check Controller Errors Shutdown Process With Children ${RSPAMD_PID} Cleanup Temporary Directory ${TMPDIR} - : FOR ${i} IN @{ports} - \ Wait For Port @{i}[0] @{i}[1] @{i}[2] Log Logs [Arguments] ${logfile} ${position} -- 2.39.5