commit 57c2106: Merge pull request #2935 from citrin/clickhouse

GitHub noreply at github.com
Fri Jun 21 17:35:08 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-06-21 18:34:02 +0100
URL: https://github.com/rspamd/rspamd/commit/57c21062f261eb595f8e64cd32d7df9604b7e754 (HEAD -> master)

Merge pull request #2935 from citrin/clickhouse
[Minor] ClickHouse: Improve schema and tests

 src/plugins/lua/clickhouse.lua                     |  92 +++----
 .../cases/210_clickhouse/001_migration.robot       | 138 +++++-----
 test/functional/configs/clickhouse-config.xml      | 288 +--------------------
 test/functional/lib/rspamd.py                      |   9 +-
 test/functional/lib/rspamd.robot                   |   2 +-
 5 files changed, 126 insertions(+), 403 deletions(-)

diff --combined test/functional/lib/rspamd.robot
index f54f64b48,1e18a61a8..01e85a8b3
--- a/test/functional/lib/rspamd.robot
+++ b/test/functional/lib/rspamd.robot
@@@ -23,10 -23,9 +23,10 @@@ Check Rspam
    ${inverse} =  Evaluate  'inverse' in $kwargs
    ${re} =  Evaluate  're' in $kwargs
    ${rc} =  Set Variable If  ${has_rc} == True  &{kwargs}[rc]  0
 -  : FOR  ${i}  IN  @{args}
 -  \  Run Keyword If  ${re} == True  Check Rspamc Match Regexp  ${result.stdout}  ${i}  ${inverse}
 -  \  ...  ELSE  Check Rspamc Match String  ${result.stdout}  ${i}  ${inverse}
 +  FOR  ${i}  IN  @{args}
 +    Run Keyword If  ${re} == True  Check Rspamc Match Regexp  ${result.stdout}  ${i}  ${inverse}
 +    ...  ELSE  Check Rspamc Match String  ${result.stdout}  ${i}  ${inverse}
 +  END
    Run Keyword If  @{args} == @{EMPTY}  Check Rspamc Match Default  ${result.stdout}  ${inverse}
    Should Be Equal As Integers  ${result.rc}  ${rc}
  
@@@ -62,18 -61,17 +62,18 @@@ Generic Setu
    [Arguments]  @{vargs}  &{kwargs}
    &{d} =  Run Rspamd  @{vargs}  &{kwargs}
    ${keys} =  Get Dictionary Keys  ${d}
 -  : FOR  ${i}  IN  @{keys}
 -  \  Run Keyword If  '${RSPAMD_SCOPE}' == 'Suite'  Set Suite Variable  ${${i}}  &{d}[${i}]
 -  \  ...  ELSE IF  '${RSPAMD_SCOPE}' == 'Test'  Set Test Variable  ${${i}}  &{d}[${i}]
 -  \  ...  ELSE  Fail  'RSPAMD_SCOPE must be Test or Suite'
 +  FOR  ${i}  IN  @{keys}
 +    Run Keyword If  '${RSPAMD_SCOPE}' == 'Suite'  Set Suite Variable  ${${i}}  &{d}[${i}]
 +    ...  ELSE IF  '${RSPAMD_SCOPE}' == 'Test'  Set Test Variable  ${${i}}  &{d}[${i}]
 +    ...  ELSE  Fail  'RSPAMD_SCOPE must be Test or Suite'
 +  END
  
  Generic Teardown
    [Arguments]  @{ports}
    Run Keyword If  '${CONTROLLER_ERRORS}' == 'True'  Check Controller Errors
    Shutdown Process With Children  ${RSPAMD_PID}
    Log does not contain segfault record
-   Save Run Results  ${TMPDIR}  rspamd.log redis.log rspamd.conf clickhouse-server.log clickhouse-server.err.log clickhouse-config.xml
+   Save Run Results  ${TMPDIR}  rspamd.log redis.log rspamd.conf clickhouse-config.xml
    Collect Lua Coverage
    Cleanup Temporary Directory  ${TMPDIR}
  
@@@ -146,8 -144,7 +146,8 @@@ Run Ngin
  
  Run Rspamc
    [Arguments]  @{args}
 -  ${result} =  Run Process  ${RSPAMC}  -t  60  --header  Queue-ID\=${TEST NAME}  @{args}  env:LD_LIBRARY_PATH=${TESTDIR}/../../contrib/aho-corasick
 +  ${result} =  Run Process  ${RSPAMC}  -t  60  --header  Queue-ID\=${TEST NAME}
 +  ...  @{args}  env:LD_LIBRARY_PATH=${TESTDIR}/../../contrib/aho-corasick
    Log  ${result.stdout}
    [Return]  ${result}
  
@@@ -161,10 -158,9 +161,10 @@@ Run Rspam
    ...  ELSE  Make Temporary Directory
    Set Directory Ownership  ${tmpdir}  ${RSPAMD_USER}  ${RSPAMD_GROUP}
    ${template} =  Get File  ${CONFIG}
 -  : FOR  ${i}  IN  @{vargs}
 -  \  ${newvalue} =  Replace Variables  ${${i}}
 -  \  Set To Dictionary  ${d}  ${i}=${newvalue}
 +  FOR  ${i}  IN  @{vargs}
 +    ${newvalue} =  Replace Variables  ${${i}}
 +    Set To Dictionary  ${d}  ${i}=${newvalue}
 +  END
    ${config} =  Replace Variables  ${template}
    ${config} =  Replace Variables  ${config}
    Log  ${config}
@@@ -192,10 -188,8 +192,10 @@@ Simple Teardow
  Sync Fuzzy Storage
    [Arguments]  @{vargs}
    ${len} =  Get Length  ${vargs}
 -  ${result} =  Run Keyword If  $len == 0  Run Process  ${RSPAMADM}  control  -s  ${TMPDIR}/rspamd.sock  fuzzy_sync
 -  ...  ELSE  Run Process  ${RSPAMADM}  control  -s  @{vargs}[0]/rspamd.sock  fuzzy_sync
 +  ${result} =  Run Keyword If  $len == 0  Run Process  ${RSPAMADM}  control  -s
 +  ...  ${TMPDIR}/rspamd.sock  fuzzy_sync
 +  ...  ELSE  Run Process  ${RSPAMADM}  control  -s  @{vargs}[0]/rspamd.sock
 +  ...  fuzzy_sync
    Log  ${result.stdout}
    Run Keyword If  $len == 0  Follow Rspamd Log
    ...  ELSE  Custom Follow Rspamd Log  @{vargs}[0]/rspamd.log  @{vargs}[1]  @{vargs}[2]  @{vargs}[3]


More information about the Commits mailing list