Debian Codegraph @

test/functional/cases/335_neural_llm/003_llm_train.robot

raw
1 *** Settings ***
2 Suite Setup Rspamd Redis Setup
3 Suite Teardown Rspamd Redis Teardown
4 Library Process
5 Library ${RSPAMD_TESTDIR}/lib/rspamd.py
6 Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
7 Variables ${RSPAMD_TESTDIR}/lib/vars.py
8
9 *** Variables ***
10 ${CONFIG} ${RSPAMD_TESTDIR}/configs/neural_llm.conf
11 ${SPAM_MSG} ${RSPAMD_TESTDIR}/messages/spam_message.eml
12 ${HAM_MSG} ${RSPAMD_TESTDIR}/messages/ham.eml
13 ${REDIS_SCOPE} Suite
14 ${RSPAMD_SCOPE} Suite
15 ${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
16
17 *** Test Cases ***
18 Train LLM-backed neural and verify
19 Run Dummy Llm
20
21 # Learn spam
22 ${result} = Run Rspamc -P secret -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} neural_learn:spam ${SPAM_MSG}
23 Check Rspamc ${result}
24
25 # Learn ham
26 ${result} = Run Rspamc -P secret -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} neural_learn:ham ${HAM_MSG}
27 Check Rspamc ${result}
28
29 Sleep 5s
30
31 # Check spam inference (dummy_llm returns ones vector for "spam" content)
32 Scan File ${SPAM_MSG} Settings={groups_enabled=["neural"]}
33 Expect Symbol NEURAL_SPAM
34
35 # Check ham inference (zeros vector)
36 Scan File ${HAM_MSG} Settings={groups_enabled=["neural"]}
37 Expect Symbol NEURAL_HAM
38
39 Dummy Llm Teardown