summaryrefslogtreecommitdiffstats
path: root/test/functional/cases/151_rspamadm_async.robot
diff options
context:
space:
mode:
authorheraklit256 <37872459+heraklit256@users.noreply.github.com>2018-09-27 14:39:13 +0000
committerGitHub <noreply@github.com>2018-09-27 14:39:13 +0000
commit957c6d61e50cdd85243f25f27ded088c54f5e2f4 (patch)
treeba322de0ea223a79a56744177845584646e5e1ad /test/functional/cases/151_rspamadm_async.robot
parentfa4ffc69b738b0495467626621622fe4c433605f (diff)
parent30365705c8a07abb207d5d867f00ca697a7e6e37 (diff)
downloadrspamd-957c6d61e50cdd85243f25f27ded088c54f5e2f4.tar.gz
rspamd-957c6d61e50cdd85243f25f27ded088c54f5e2f4.zip
Merge pull request #5 from rspamd/master
merge upstream into local master
Diffstat (limited to 'test/functional/cases/151_rspamadm_async.robot')
-rw-r--r--test/functional/cases/151_rspamadm_async.robot42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/functional/cases/151_rspamadm_async.robot b/test/functional/cases/151_rspamadm_async.robot
new file mode 100644
index 000000000..31fa84245
--- /dev/null
+++ b/test/functional/cases/151_rspamadm_async.robot
@@ -0,0 +1,42 @@
+*** Settings ***
+Test Setup Rspamadm test Setup
+Test Teardown Rspamadm test Teardown
+Library Process
+Library ${TESTDIR}/lib/rspamd.py
+Resource ${TESTDIR}/lib/rspamd.robot
+Variables ${TESTDIR}/lib/vars.py
+Suite Teardown Terminate All Processes kill=True
+
+*** Variables ***
+${REDIS_SCOPE} Test
+
+
+*** Test Cases ***
+Tcp client
+ ${result} = Run Process ${RSPAMADM} lua -b ${TESTDIR}/lua/rspamadm/test_tcp_client.lua
+ Should Match Regexp ${result.stderr} ^$
+ Should Be Equal As Integers ${result.rc} 0
+ Should Be Equal ${result.stdout} hello post
+
+Redis client
+ ${result} = Run Process ${RSPAMADM} lua -b ${TESTDIR}/lua/rspamadm/test_redis_client.lua
+ Should Match Regexp ${result.stderr} ^$
+ Should Be Equal As Integers ${result.rc} 0
+ Should Be Equal ${result.stdout} true\thello from lua on redis
+
+*** Keywords ***
+
+Rspamadm test Setup
+ Run Dummy Http
+ Run Redis
+
+Rspamadm test Teardown
+ ${http_pid} = Get File /tmp/dummy_http.pid
+ Shutdown Process With Children ${http_pid}
+ Remove file /tmp/dummy_http.pid
+ Shutdown Process With Children ${REDIS_PID}
+
+Run Dummy Http
+ [Arguments]
+ ${result} = Start Process ${TESTDIR}/util/dummy_http.py
+ Wait Until Created /tmp/dummy_http.pid