]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Add some classifiers to settings tests
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 10 Jun 2019 12:41:56 +0000 (13:41 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 10 Jun 2019 12:41:56 +0000 (13:41 +0100)
conf/statistic.conf
test/functional/cases/108_settings.robot
test/functional/configs/settings.conf

index d2b5b147ad552afc691307a38dfb8abebc43d9e2..8d45e760838520bf78fb10a032556e5d69744005 100644 (file)
@@ -24,7 +24,6 @@ classifier "bayes" {
     name = "osb";
   }
   cache {
-    path = "${DBDIR}/learn_cache.sqlite";
   }
   new_schema = true; # Always use new schema
   store_tokens = false; # Redefine if storing of tokens is desired
index 44d9b8b4d63eb1af35b61c4a3180d201f5a508bd..9011ad7b35db2ced1fa00c64eb6b74295cbf65a7 100644 (file)
@@ -9,15 +9,25 @@ Variables       ${TESTDIR}/lib/vars.py
 ${CONFIG}       ${TESTDIR}/configs/plugins.conf
 ${LUA_SCRIPT}   ${TESTDIR}/lua/settings.lua
 ${MESSAGE}      ${TESTDIR}/messages/spam_message.eml
+${SPAM_MESSAGE}      ${TESTDIR}/messages/spam.eml
+${HAM_MESSAGE}      ${TESTDIR}/messages/ham.eml
 ${RSPAMD_SCOPE}  Suite
 ${URL_TLD}      ${TESTDIR}/../lua/unit/test_tld.dat
 
 *** Test Cases ***
-NO SETTINGS
-  ${result} =  Scan Message With Rspamc  ${MESSAGE}
+NO SETTINGS SPAM
+  ${result} =  Scan Message With Rspamc  ${SPAM_MESSAGE}
   Check Rspamc  ${result}  SIMPLE_TEST
   Should Contain  ${result.stdout}  SIMPLE_PRE
   Should Contain  ${result.stdout}  SIMPLE_POST
+  Should Contain  ${result.stdout}  BAYES_SPAM
+
+NO SETTINGS HAM
+  ${result} =  Scan Message With Rspamc  ${HAM_MESSAGE}
+  Check Rspamc  ${result}  SIMPLE_TEST
+  Should Contain  ${result.stdout}  SIMPLE_PRE
+  Should Contain  ${result.stdout}  SIMPLE_POST
+  Should Contain  ${result.stdout}  BAYES_HAM
 
 ENABLE SYMBOL - NORMAL
   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings={symbols_enabled = ["SIMPLE_TEST"]}
index c2b4ba6cc5dd26bb12486d326561c61669f0ee08..091eb5f2c27bea0af799cfd68bce364a9bad3cd1 100644 (file)
@@ -14,3 +14,18 @@ settings {
     }
   }
 }
+classifier {
+  backend = "sqlite3";
+  statfile {
+    spam = true;
+    symbol = BAYES_SPAM;
+    path = "${TESTDIR}/data/bayes.spam.sqlite3";
+  }
+  statfile {
+    spam = false;
+    symbol = BAYES_HAM;
+    path = "${TESTDIR}/data/bayes.ham.sqlite3";
+  }
+  min_learns = 1;
+  min_token_hits = 1;
+}
\ No newline at end of file