]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Tests: don't try bind ports
authorAndrew Lewis <nerf@judo.za.org>
Fri, 30 Jun 2017 11:55:18 +0000 (13:55 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 30 Jun 2017 12:02:40 +0000 (14:02 +0200)
circle.yml
test/functional/cases/102_multimap.robot
test/functional/cases/106_url_tags.robot
test/functional/cases/110_statistics/lib.robot
test/functional/cases/120_fuzzy/redis-general.robot
test/functional/cases/120_fuzzy/replication.robot
test/functional/cases/131_dkim_signing/002_redis.robot
test/functional/cases/140_proxy.robot
test/functional/cases/160_antivirus.robot
test/functional/lib/rspamd.py
test/functional/lib/rspamd.robot

index d9fe138aa67851950a9c14004150b31ce59478c4..cc1d20479b30e24a7133bcff79023d1a586f7491 100644 (file)
@@ -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
 
index 7b45bdcac56b9a39502dc642583b9890e7d6a3a4..977a849916e6d026095b8c27780e8002271a1bba 100644 (file)
@@ -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}
index 960376ab7be0f5ad804edce511825ac165b3b33b..7954d0aac61ed49c77d378f6114b93afbfe92b14 100644 (file)
@@ -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}
index 7aba131d90f16bf0807abba2ed6cfae712c18816..268433d048e40f8763b455d35f711d839e4eb345 100644 (file)
@@ -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
index d79ab30e78d6c76573c4a780651688446b6d86e5..056b177c8ec96e60ba230bce645806bba5dfe0e2 100644 (file)
@@ -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}
index 8a3b875ed7157d9ef34fd70edd5e77fc8eedbc6c..cb7d425334f109d6337940ecb51094b5a4dda838 100644 (file)
@@ -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]
index f46bfbc334b4f01bbcd5ba66387f59d2f48f3ad1..f7d590c1c309c258903f5d2ddef5627f3f4083c2 100644 (file)
@@ -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}
index 42297ea622e3dc8eda9adb0e54a1cddab76603b6..7b29f188a3a547324640b6169fc8af003a456ae5 100644 (file)
@@ -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]
index 98c7a4a2a208382ee0e1fd8179b2109cb2040054..ec43329e3d92333d03a72bf97c7b7d88d2853ae4 100644 (file)
@@ -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
index fd1907384621e964025c7872edfdba3944bb8b25..76af7864dc5e464a4663513ec91b4acc78bf619d 100644 (file)
@@ -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()
index 3044b829267a4033e4414426a8005401dbd725b7..e90ed9ee008a4c3b2f1b4f8974378b7a20ed38e7 100644 (file)
@@ -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}