]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Rbl: Add received and whitelists tests
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 16 Dec 2018 17:10:50 +0000 (17:10 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 16 Dec 2018 17:10:50 +0000 (17:10 +0000)
test/functional/cases/300_rbl.robot
test/functional/configs/plugins.conf
test/functional/configs/rbl.conf

index 36d13c0458312f227b731664bd7515c8be9ebec9..8ac96915e34698b5d7dee356d8caa1950c2e4ba3 100644 (file)
@@ -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
index c881e972e874a0a020e7871330d499d7aca4f956..d7a5b009c58e4b1a768da5440324fe801212b41a 100644 (file)
@@ -497,6 +497,16 @@ options = {
           type = "a";
           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";
index 15106548b96a12f11ef68451c101c176b155775f..a66deea6a558ddf80e1cbe8d8a570c58438c4cae 100644 (file)
@@ -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