aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-08-09 14:12:46 +0100
committerAndrew Lewis <nerf@judo.za.org>2016-08-09 14:12:46 +0100
commit67ee0d9274e0d27d6c0e118de11862c8258597b9 (patch)
treefdddace1298dabeae0835e22f532eded66b4ef5d /test
parentbd01177c1364399ef29ca6671669a271af967998 (diff)
downloadrspamd-67ee0d9274e0d27d6c0e118de11862c8258597b9.tar.gz
rspamd-67ee0d9274e0d27d6c0e118de11862c8258597b9.zip
[Test] Add custom rspamd log follower for non-standard tests
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/140_proxy.robot6
-rw-r--r--test/functional/lib/rspamd.robot7
2 files changed, 9 insertions, 4 deletions
diff --git a/test/functional/cases/140_proxy.robot b/test/functional/cases/140_proxy.robot
index 6ad308692..a82c687e4 100644
--- a/test/functional/cases/140_proxy.robot
+++ b/test/functional/cases/140_proxy.robot
@@ -12,10 +12,8 @@ ${MESSAGE} ${TESTDIR}/messages/spam_message.eml
*** Test Cases ***
Scan Message
${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_PROXY} -p ${MESSAGE}
- ${PROXY_LOGPOS} = Log Logs ${PROXY_TMPDIR}/rspamd.log ${PROXY_LOGPOS}
- Set Suite Variable ${PROXY_LOGPOS}
- ${SLAVE_LOGPOS} = Log Logs ${SLAVE_TMPDIR}/rspamd.log ${SLAVE_LOGPOS}
- Set Suite Variable ${SLAVE_LOGPOS}
+ Custom Follow Rspamd Log ${PROXY_TMPDIR}/rspamd.log ${PROXY_LOGPOS} PROXY_LOGPOS Suite
+ Custom Follow Rspamd Log ${SLAVE_TMPDIR}/rspamd.log ${SLAVE_LOGPOS} SLAVE_LOGPOS Suite
Run Keyword If ${result.rc} != 0 Log ${result.stderr}
Should Contain ${result.stdout} SIMPLE_TEST
Should Be Equal As Integers ${result.rc} 0
diff --git a/test/functional/lib/rspamd.robot b/test/functional/lib/rspamd.robot
index 02df036f3..a4769f4a5 100644
--- a/test/functional/lib/rspamd.robot
+++ b/test/functional/lib/rspamd.robot
@@ -38,6 +38,13 @@ Check Rspamc Match String
Run Keyword If ${inverse} == False Should Contain ${subject} ${str}
... ELSE Should Not Contain ${subject} ${str}
+Custom Follow Rspamd Log
+ [Arguments] ${logfile} ${logpos} ${logpos_var} ${scope}
+ ${logpos} = Log Logs ${logfile} ${logpos}
+ Run Keyword If '${scope}' == 'Test' Set Test Variable ${${logpos_var}} ${logpos}
+ ... ELSE IF '${scope}' == 'Suite' Set Suite Variable ${${logpos_var}} ${logpos}
+ ... ELSE Fail 'scope must be Test or Suite'
+
Follow Rspamd Log
${RSPAMD_LOGPOS} = Log Logs ${TMPDIR}/rspamd.log ${RSPAMD_LOGPOS}
Run Keyword If '${RSPAMD_SCOPE}' == 'Test' Set Test Variable ${RSPAMD_LOGPOS}