aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-16 17:10:50 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-16 17:10:50 +0000
commit3f83c2f80c545daeb858801cbef6ad7c5a9c5198 (patch)
tree2e1afd9053a786536b528e005af6251bf352b95f /test
parent5dcf4d6ebd8e87de3e58876daed89c90303d25fc (diff)
downloadrspamd-3f83c2f80c545daeb858801cbef6ad7c5a9c5198.tar.gz
rspamd-3f83c2f80c545daeb858801cbef6ad7c5a9c5198.zip
[Test] Rbl: Add received and whitelists tests
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/300_rbl.robot8
-rw-r--r--test/functional/configs/plugins.conf10
-rw-r--r--test/functional/configs/rbl.conf27
3 files changed, 45 insertions, 0 deletions
diff --git a/test/functional/cases/300_rbl.robot b/test/functional/cases/300_rbl.robot
index 36d13c045..8ac96915e 100644
--- a/test/functional/cases/300_rbl.robot
+++ b/test/functional/cases/300_rbl.robot
@@ -28,6 +28,14 @@ RBL FROM UNKNOWN HIT
${result} = Scan Message With Rspamc ${MESSAGE} -i 4.3.2.2
Check Rspamc ${result} FAKE_RBL_UNKNOWN
+RBL RECEIVED HIT
+ ${result} = Scan Message With Rspamc ${MESSAGE} -i 8.8.8.8
+ Check Rspamc ${result} FAKE_RECEIVED_RBL_CODE_3
+
+RBL FROM HIT WL
+ ${result} = Scan Message With Rspamc ${MESSAGE} -i 4.3.2.4
+ Check Rspamc ${result} FAKE_RBL_CODE_2 inverse=True
+
*** Keywords ***
Rbl Setup
${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/rbl.conf
diff --git a/test/functional/configs/plugins.conf b/test/functional/configs/plugins.conf
index c881e972e..d7a5b009c 100644
--- a/test/functional/configs/plugins.conf
+++ b/test/functional/configs/plugins.conf
@@ -498,6 +498,16 @@ options = {
replies = ["127.0.0.2", "127.0.0.3"];
},
{
+ name = "4.2.3.4.fake.rbl";
+ type = "a";
+ replies = ["127.0.0.2"];
+ },
+ {
+ name = "4.2.3.4.fake.wl";
+ type = "a";
+ replies = ["127.0.0.2"];
+ },
+ {
name = "4.3.2.1.fake.rbl";
type = "a";
rcode = 'nxdomain';
diff --git a/test/functional/configs/rbl.conf b/test/functional/configs/rbl.conf
index 15106548b..a66deea6a 100644
--- a/test/functional/configs/rbl.conf
+++ b/test/functional/configs/rbl.conf
@@ -12,5 +12,32 @@ rbl {
"FAKE_RBL_CODE_3" = "127.0.0.3";
}
}
+ fake_received {
+ from = false;
+ ipv4 = true;
+ ipv6 = true;
+ received = true;
+ rbl = "fake.rbl";
+ symbol = "FAKE_RECEIVED_RBL_UNKNOWN";
+ unknown = true;
+ returncodes = {
+ "FAKE_RECEIVED_RBL_CODE_2" = "127.0.0.2";
+ "FAKE_RECEIVED_RBL_CODE_3" = "127.0.0.3";
+ }
+ }
+ fake_whitelist {
+ from = true;
+ ipv4 = true;
+ ipv6 = true;
+ received = true;
+ is_whitelist = true;
+ rbl = "fake.wl";
+ symbol = "FAKE_WL_RBL_UNKNOWN";
+ unknown = true;
+ returncodes = {
+ "FAKE_WL_RBL_CODE_2" = "127.0.0.2";
+ "FAKE_WL_RBL_CODE_3" = "127.0.0.3";
+ }
+ }
}
} \ No newline at end of file