aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-06-01 21:19:34 +0100
committerGitHub <noreply@github.com>2021-06-01 21:19:34 +0100
commit8835cd6da922c7193193264f30f5827e9b4037de (patch)
tree0ac863007ae9356b28f11cc97afa9f098c0940e8
parentf4451616279bebfccedae7fe51200e0e38b97964 (diff)
parent89ecb1b26baa4a9d511d7fe6a50c8bc8414b5ed0 (diff)
downloadrspamd-8835cd6da922c7193193264f30f5827e9b4037de.tar.gz
rspamd-8835cd6da922c7193193264f30f5827e9b4037de.zip
Merge pull request #3768 from fatalbanana/test_debug_clean
[Test] Fix Lua coverage etc
-rw-r--r--test/functional/cases/220_http.robot (renamed from test/functional/cases/001_merged/220_http.robot)8
-rw-r--r--test/functional/cases/230_tcp.robot (renamed from test/functional/cases/001_merged/230_tcp.robot)9
-rw-r--r--test/functional/cases/231_tcp_down.robot (renamed from test/functional/cases/001_merged/231_tcp_down.robot)9
-rw-r--r--test/functional/configs/merged-local.conf17
-rw-r--r--test/functional/configs/merged.conf6
-rw-r--r--test/functional/lib/rspamd.robot2
6 files changed, 40 insertions, 11 deletions
diff --git a/test/functional/cases/001_merged/220_http.robot b/test/functional/cases/220_http.robot
index a6bf5ff65..2812b4efa 100644
--- a/test/functional/cases/001_merged/220_http.robot
+++ b/test/functional/cases/220_http.robot
@@ -7,7 +7,11 @@ Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/http.lua
+${RSPAMD_SCOPE} Suite
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
Simple HTTP request
@@ -61,12 +65,14 @@ SSL Large HTTP request
Http Setup
Run Dummy Http
Run Dummy Https
+ Rspamd Setup
Http Teardown
${http_pid} = Get File /tmp/dummy_http.pid
Shutdown Process With Children ${http_pid}
${https_pid} = Get File /tmp/dummy_https.pid
Shutdown Process With Children ${https_pid}
+ Rspamd Teardown
Run Dummy Http
${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_http.py
diff --git a/test/functional/cases/001_merged/230_tcp.robot b/test/functional/cases/230_tcp.robot
index 89ec7ea5a..6c0c0a9c8 100644
--- a/test/functional/cases/001_merged/230_tcp.robot
+++ b/test/functional/cases/230_tcp.robot
@@ -7,8 +7,11 @@ Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
-
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/tcp.lua
+${RSPAMD_SCOPE} Suite
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
Simple TCP request
@@ -48,12 +51,14 @@ Sync API TCP post request
Servers Setup
Run Dummy Http
Run Dummy Ssl
+ Rspamd Setup
Servers Teardown
${http_pid} = Get File /tmp/dummy_http.pid
Shutdown Process With Children ${http_pid}
${ssl_pid} = Get File /tmp/dummy_ssl.pid
Shutdown Process With Children ${ssl_pid}
+ Rspamd Teardown
Run Dummy Http
[Arguments]
diff --git a/test/functional/cases/001_merged/231_tcp_down.robot b/test/functional/cases/231_tcp_down.robot
index 088a60553..5d6c791bb 100644
--- a/test/functional/cases/001_merged/231_tcp_down.robot
+++ b/test/functional/cases/231_tcp_down.robot
@@ -1,10 +1,17 @@
*** Settings ***
+Suite Setup Rspamd Setup
+Suite Teardown Rspamd Teardown
Library ${RSPAMD_TESTDIR}/lib/rspamd.py
Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/tcp.lua
+${RSPAMD_SCOPE} Suite
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+
*** Test Cases ***
Sync API TCP get request when server is down
diff --git a/test/functional/configs/merged-local.conf b/test/functional/configs/merged-local.conf
index 1329a6eee..84bffe8dd 100644
--- a/test/functional/configs/merged-local.conf
+++ b/test/functional/configs/merged-local.conf
@@ -1,3 +1,19 @@
+history_redis {
+ enabled = false;
+}
+
+neural {
+ enabled = false;
+}
+
+bayes_expiry {
+ enabled = false;
+}
+
+metric_exporter {
+ enabled = false;
+}
+
emails {
"whitelist" = [
"rspamd-test.com"
@@ -897,6 +913,7 @@ worker "controller" {
}
worker "normal" {
+ count = 1;
bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}";
keypair {
pubkey = "{= env.KEY_PUB1 =}";
diff --git a/test/functional/configs/merged.conf b/test/functional/configs/merged.conf
index 132461d90..8bec67a41 100644
--- a/test/functional/configs/merged.conf
+++ b/test/functional/configs/merged.conf
@@ -13,12 +13,6 @@ lua = "{= env.TESTDIR =}/lua/tlds.lua"
# 104_get_from
lua = "{= env.TESTDIR =}/lua/get_from.lua"
-# 220_http
-lua = "{= env.TESTDIR =}/lua/http.lua"
-
-# 230_tcp / 231_tcp_down
-lua = "{= env.TESTDIR =}/lua/tcp.lua"
-
# 240_redis
lua = "{= env.TESTDIR =}/lua/redis.lua"
diff --git a/test/functional/lib/rspamd.robot b/test/functional/lib/rspamd.robot
index e5132e3a7..725ab6e5f 100644
--- a/test/functional/lib/rspamd.robot
+++ b/test/functional/lib/rspamd.robot
@@ -154,7 +154,7 @@ Export Scoped Variables
Log does not contain segfault record
${log} = Get File ${RSPAMD_TMPDIR}/rspamd.log encoding_errors=ignore
- Should not contain ${log} Segmentation fault: msg=Segmentation fault detected
+ Should not contain ${log} (Segmentation fault) msg=Segmentation fault detected
Redis HSET
[Arguments] ${hash} ${key} ${value}