]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Add config test stage to run_rspamd function.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 20 Jul 2015 12:22:43 +0000 (13:22 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 20 Jul 2015 12:22:43 +0000 (13:22 +0100)
test/functional/functions.sh

index 457ea2f2c9a328d86d8873bc755700f470592161..84393d32595938ecb29d4ae0d64b4075109d3887 100644 (file)
@@ -24,7 +24,7 @@ run_rspamd() {
        STATS_HASH=${STATS_HASH:-"compat"}
        STATS_KEY=${STATS_KEY:-"osipg87ms5gzsis33fdrhaqn5wocp6qfofzxjbw8k1wh9yb6adty"}
        
-       ${RSPAMD} -c ${RSPAMD_CONFIG} -u ${RSPAMD_USER} -g ${RSPAMD_GROUP} \
+       ${RSPAMD} -c ${RSPAMD_CONFIG} -u ${RSPAMD_USER} -g ${RSPAMD_GROUP} -t \
                TMPDIR=${TMPDIR} \
                STATSDIR=${STATSDIR} \
                LUADIR=${LUADIR} \
@@ -33,6 +33,19 @@ run_rspamd() {
                TESTDIR=${TEST_DIRNAME} \
                STATS_KEY=${STATS_KEY} > ${TMPDIR}/rspamd.out 2>&1
 
+       if [ $? -ne 0 ] ; then
+               save_error 'rspamd' 'cannot lint rspamd configuration'
+       fi
+
+       ${RSPAMD} -c ${RSPAMD_CONFIG} -u ${RSPAMD_USER} -g ${RSPAMD_GROUP} \
+               TMPDIR=${TMPDIR} \
+               STATSDIR=${STATSDIR} \
+               LUADIR=${LUADIR} \
+               STATS_BACKEND=${STATS_BACKEND} \
+               STATS_HASH=${STATS_HASH} \
+               TESTDIR=${TEST_DIRNAME} \
+               STATS_KEY=${STATS_KEY} >> ${TMPDIR}/rspamd.out 2>&1
+
        if [ $? -eq 0 ] ; then
                export RSPAMD_PID=`cat ${TMPDIR}/rspamd.pid`
        else