*** Settings ***
+Suite Setup SSL Server Suite Setup
Library ${RSPAMD_TESTDIR}/lib/rspamd.py
Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Test Cases ***
Controller SSL - stat
[Documentation] Fetch /stat over HTTPS from the controller SSL port.
- ... rspamd registers workers with main slightly before
- ... the controller's SSL listener finishes its OpenSSL
- ... init and starts accepting connections; when this
- ... test is the first one against a fresh rspamd the
- ... SSL port may briefly refuse. Retry until it serves.
- Wait Until Keyword Succeeds 15x 0.4s
- ... Fetch HTTPS And Expect 200 ${RSPAMD_PORT_CONTROLLER_SSL} /stat
+ Fetch HTTPS And Expect 200 ${RSPAMD_PORT_CONTROLLER_SSL} /stat
Controller SSL - errors
[Documentation] Fetch /errors over HTTPS from the controller SSL port
- Wait Until Keyword Succeeds 15x 0.4s
- ... Fetch HTTPS And Expect 200 ${RSPAMD_PORT_CONTROLLER_SSL} /errors
+ Fetch HTTPS And Expect 200 ${RSPAMD_PORT_CONTROLLER_SSL} /errors
Controller plain still works alongside SSL
[Documentation] Plain HTTP controller port must still work when SSL port is also configured
Expect Symbol GTUBE
*** Keywords ***
+SSL Server Suite Setup
+ [Documentation] Run Rspamd's startup readiness check pings the plain
+ ... normal worker and (for configs with a control socket)
+ ... waits for the controller to register its workers with
+ ... main. Neither of those guarantees the controller's
+ ... SSL listener on PORT_CONTROLLER_SSL is already
+ ... accepting -- OpenSSL context init for that listener
+ ... can lag worker registration by hundreds of ms, and
+ ... under parallel pabot load (4 workers + concurrent
+ ... serial robot on the same box) we have observed lags
+ ... past 6s, exhausting the per-test retry budget that
+ ... previously sat in each SSL test.
+ ...
+ ... Pay that wait once here, with a generous 30s budget,
+ ... so individual tests can issue a single direct HTTPS
+ ... request. If the listener never comes up the suite
+ ... setup fails loudly instead of every test retrying
+ ... independently.
+ Wait Until Keyword Succeeds 60x 0.5s
+ ... Fetch HTTPS And Expect 200 ${RSPAMD_PORT_CONTROLLER_SSL} /ping
+
Fetch HTTPS And Expect 200
[Arguments] ${port} ${path}
@{result} = HTTPS GET ${RSPAMD_LOCAL_ADDR} ${port} ${path}