]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Skip miltertest tests if it is not installed 4709/head
authorAndrew Lewis <nerf@judo.za.org>
Sat, 18 Nov 2023 01:38:06 +0000 (03:38 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Sat, 18 Nov 2023 01:38:06 +0000 (03:38 +0200)
test/functional/cases/131_dkim_signing/006_milter.robot
test/functional/cases/180_milter.robot
test/functional/lib/vars.py

index cfa1bafce5b8b3e1f2a45947b806cae16788f5f0..2b63d07c7b992da781dac0b94e4b3717d659c528 100644 (file)
@@ -1,6 +1,7 @@
 *** Settings ***
 Suite Setup     Rspamd Setup
 Suite Teardown  Rspamd Teardown
+Test Tags       miltertest
 Library         Process
 Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
 Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
@@ -21,6 +22,7 @@ MULTIPLE SIGNATURES
 *** Keywords ***
 Milter Test
   [Arguments]  ${mtlua}
+  Skip If  not ${HAVE_MILTERTEST}  msg=miltertest not installed
   ${result} =  Run Process  miltertest  -Dport\=${RSPAMD_PORT_PROXY}  -Dhost\=${RSPAMD_LOCAL_ADDR}  -s  ${RSPAMD_TESTDIR}/lua/miltertest/${mtlua}
   ...  cwd=${RSPAMD_TESTDIR}/lua/miltertest
   Should Match Regexp  ${result.stderr}  ^$
index be9a06466c3b8a866cd647e2574a814fe6788b9b..d41751c7a18b56479728bf10239ace51d8d41b59 100644 (file)
@@ -1,6 +1,7 @@
 *** Settings ***
 Suite Setup     Rspamd Setup
 Suite Teardown  Rspamd Teardown
+Test Tags       miltertest
 Library         Process
 Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
 Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
@@ -30,6 +31,7 @@ COMBINED TEST
 *** Keywords ***
 Milter Test
   [Arguments]  ${mtlua}
+  Skip If  not ${HAVE_MILTERTEST}  msg=miltertest not installed
   ${result} =  Run Process  miltertest  -Dport\=${RSPAMD_PORT_PROXY}  -Dhost\=${RSPAMD_LOCAL_ADDR}  -s  ${RSPAMD_TESTDIR}/lua/miltertest/${mtlua}
   ...  cwd=${RSPAMD_TESTDIR}/lua/miltertest
   Should Match Regexp  ${result.stderr}  ^$
index 898d21286ff556abdb2f2c6e2efd25bdebab1ea3..0a12a8191fff1905588a1c2b6462dcedc8b0ebfa 100644 (file)
@@ -1,6 +1,8 @@
+import shutil
 import socket
 
 CONTROLLER_ERRORS = True
+HAVE_MILTERTEST = shutil.which('miltertest') and True or False
 RSPAMD_EXTERNAL_RELAY_ENABLED = False
 RSPAMD_KEY_PVT1 = 'ekd3x36tfa5gd76t6pa8hqif3ott7n1siuux68exbkk7ukscte9y'
 RSPAMD_KEY_PUB1 = 'm8kneubpcjsb8sbsoj7jy7azj9fdd3xmj63txni86a8ye9ncomny'