Documentation Multiclass Bayes Classification Tests with Redis Backend
Suite Setup Rspamd Redis Setup
Suite Teardown Rspamd Redis Teardown
+Test Setup Set Test Hash Documentation
Resource multiclass_lib.robot
*** Variables ***
# Extract filename from message path for queue-id
${path} ${filename} = Split Path ${message}
IF "${user}"
- ${result} = Run Rspamc -d ${user} --queue-id ${filename} -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} learn_class:${class} ${message}
+ ${result} = Run Rspamc -d ${user} -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} learn_class:${class} ${message}
ELSE
- ${result} = Run Rspamc --queue-id ${filename} -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} learn_class:${class} ${message}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} learn_class:${class} ${message}
END
Check Rspamc ${result}
# Extract filename from message path for queue-id
${path} ${filename} = Split Path ${message}
IF "${user}"
- ${result} = Run Rspamc -d ${user} --queue-id ${filename} -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} learn_${class} ${message}
+ ${result} = Run Rspamc -d ${user} -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} learn_${class} ${message}
ELSE
- ${result} = Run Rspamc --queue-id ${filename} -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} learn_${class} ${message}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} learn_${class} ${message}
END
Check Rspamc ${result}
${nginx_log} = Get File ${RSPAMD_TMPDIR}/nginx.log
Log ${nginx_log}
+Set Test Hash Documentation
+ ${log_tag} = Evaluate __import__('hashlib').md5('${TEST NAME}'.encode()).hexdigest()[:8]
+ Log TEST CONTEXT: [${log_tag}] ${TEST NAME} console=True
+
Run Rspamc
[Arguments] @{args}
- ${result} = Run Process ${RSPAMC} -t 60 --header Queue-ID\=${TEST NAME}
- ... @{args} env:LD_LIBRARY_PATH=${RSPAMD_TESTDIR}/../../contrib/aho-corasick
+ ${log_tag} = Evaluate __import__('hashlib').md5('${TEST NAME}'.encode()).hexdigest()[:8]
+ # Check if --queue-id is already provided in the arguments
+ ${args_str} = Evaluate ' '.join(@{args})
+ ${has_queue_id} = Evaluate '--queue-id' in '${args_str}'
+ IF ${has_queue_id}
+ ${result} = Run Process ${RSPAMC} -t 60 --log-tag ${log_tag}
+ ... @{args} env:LD_LIBRARY_PATH=${RSPAMD_TESTDIR}/../../contrib/aho-corasick
+ ELSE
+ ${result} = Run Process ${RSPAMC} -t 60 --queue-id ${TEST NAME} --log-tag ${log_tag}
+ ... @{args} env:LD_LIBRARY_PATH=${RSPAMD_TESTDIR}/../../contrib/aho-corasick
+ END
Log ${result.stdout}
[Return] ${result}