- 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
Multimap Teardown
Normal Teardown
Shutdown Process With Children ${REDIS_PID}
- Wait For Port ${SOCK_STREAM} ${LOCAL_ADDR} ${REDIS_PORT}
Normal Teardown
Remove File ${LUA}
Shutdown Process With Children ${REDIS_PID}
- Wait For Port ${SOCK_STREAM} ${LOCAL_ADDR} ${REDIS_PORT}
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
Fuzzy Redis General Teardown
Normal Teardown
Shutdown Process With Children ${REDIS_PID}
- Wait For Port ${SOCK_STREAM} ${LOCAL_ADDR} ${REDIS_PORT}
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]
DKIM Signing Teardown
Normal Teardown
Shutdown Process With Children ${REDIS_PID}
- Wait For Port ${SOCK_STREAM} ${LOCAL_ADDR} ${REDIS_PORT}
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]
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
import demjson
import grp
-import ipaddress
import os
import os.path
import psutil
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()
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}