]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Test] checkv3: use spam_message for inline-settings regression test
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 24 Apr 2026 07:44:14 +0000 (08:44 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 24 Apr 2026 07:44:14 +0000 (08:44 +0100)
GTUBE short-circuits the Rspamd filter pipeline (forced reject before
SETTINGS_CHECK runs), so the inline metadata.settings test from the
previous commit silently never exercised settings.lua at all. Switch
to messages/spam_message.eml so the prefilter chain actually runs and
apply_settings_side_effects gets a chance to inject the symbol.

Also drop the actions.reject override case: with GTUBE it was a false
positive (GTUBE forces reject regardless of thresholds) and a proper
rewrite needs a second non-GTUBE message wired into the suite, which
can come in a follow-up.

Use the array form `symbols = [..]` matching the v2 INJECT SYMBOL test
in 108_settings.robot - it is the documented apply spelling.

test/functional/cases/001_merged/430_checkv3.robot

index 45429b88a286aa5835741778ba4dec9f5c2a83fc..fc013c06a32ec5750b0dfea3f18b32f9fa864015 100644 (file)
@@ -5,6 +5,7 @@ Variables       ${RSPAMD_TESTDIR}/lib/vars.py
 
 *** Variables ***
 ${GTUBE}               ${RSPAMD_TESTDIR}/messages/gtube.eml
+${MESSAGE}             ${RSPAMD_TESTDIR}/messages/spam_message.eml
 ${ALT_RELATED}         ${RSPAMD_TESTDIR}/messages/alternative-related.eml
 ${MIXED_RELATED_HTML}  ${RSPAMD_TESTDIR}/messages/mixed-related-html-only.eml
 ${SETTINGS_NOSYMBOLS}  {symbols_enabled = []}
@@ -29,20 +30,14 @@ checkv3 with settings_id
 
 checkv3 inline metadata.settings injects symbol
   [Documentation]  Inline metadata.settings must run apply_settings_side_effects
-  ...              so settings.symbols actually fires (issue #5999)
-  ${settings_obj} =  Evaluate  {"symbols": {"INLINE_V3_TEST": 1.0}}
+  ...              so settings.symbols actually fires (issue #5999).
+  ...              GTUBE is a hard bypass and skips SETTINGS_CHECK, so use a
+  ...              normal message that goes through the full prefilter chain.
+  ${settings_obj} =  Evaluate  {"symbols": ["INLINE_V3_TEST"]}
   &{meta} =  Create Dictionary  settings=${settings_obj}
-  Scan File V3  ${GTUBE}  metadata=${meta}
+  Scan File V3  ${MESSAGE}  metadata=${meta}
   Expect Symbol  INLINE_V3_TEST
 
-checkv3 inline metadata.settings overrides reject threshold
-  [Documentation]  Inline metadata.settings.actions must invoke the C-side
-  ...              action threshold apply path (issue #5999)
-  ${settings_obj} =  Evaluate  {"actions": {"reject": 1.0}}
-  &{meta} =  Create Dictionary  settings=${settings_obj}
-  Scan File V3  ${GTUBE}  metadata=${meta}
-  Expect Action  reject
-
 checkv3 missing metadata part
   [Documentation]  Send only message part without metadata, expect HTTP 500 (400 error mapped to 5xx)
   ${status} =  Scan File V3 Single Part  message  test message body