Test wait for database + SMTP in forbid pipelining mode support - #86
Open
AndrewSav wants to merge 2 commits into
Open
Test wait for database + SMTP in forbid pipelining mode support#86AndrewSav wants to merge 2 commits into
AndrewSav wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two fixes to the integration test harness, in preparation to Debian 13 upgrade.
1. SMTP fixtures are sent fire-and-forget
Current behavior: the fixtures pipe a whole SMTP dialogue into
ncoropenssl s_client, which sends every command without reading the server's replies. Postfix treats that as unauthorised pipelining and rejects it with554 5.5.0 Error: SMTP protocol synchronization.smtpd_forbid_unauth_pipeliningdefaults toyesfrom postfix 3.9 on, so on Debian 13 (postfix 3.10) not one fixture mail is accepted and every suite fails wholesale. The dialogues also useHELO, so postfix never advertisesPIPELININGand no look-ahead is permitted at all.On Debian 12 (postfix 3.7) the submission fixtures pass only by timing luck —
opensslhappens to be slow enough that the server's replies have already arrived by the time the next command is written.New behavior: adds
test/share/tests/smtp-send.py, which replays a dialogue file one command at a time and reads each reply before sending the next. The port 25 and submission (587/465) fixtures and the SMTP-auth assertions are routed through it. Its exit status reports whether the dialogue completed, not whether the mail was accepted, because several fixtures test a rejection on purpose and postfix ends those dialogues by hanging up.The IMAP triggers on port 993 are left alone, as IMAP permits pipelining.
2. Container startup races its backing service
Current behavior: the suites start the mailserver container a fixed number of seconds after creating its backing service, which races against that service's startup. A service may need more time on a slow host, and the waits were inconsistent anyway -
init_ecdsawaited 10s whileinit_sieve,init_ldap,init_ldap2and the two traefik targets did not wait at all.When the race is lost, dovecot logs
Connect failed to databaseto/var/log/mail.errand the "mail.err does not exist" assertion fails. Early delivery failures also shift the message UIDs that the sieve assertions depend on, so the failure surfaces far from its cause.New behavior: every fixed sleep is replaced with a wait on the condition it stood in for.
init_target, so all dependent targets inherit the wait. The SQL probes query the seeded schema as the application user, which covers server startup, init-script import and user creation in one check; openldap is probed with an authenticated search of the bootstrapped tree.sleep 30infixtures_reverse/fixtures_ldap2becomes explicit waits for rspamd, imaps and submission to listen.sleep 2/sleep 10around mail delivery become waits for postfix to drain itsincoming,activeandmaildropqueues. Deferred mail is ignored, so a bounce to an unreachable external domain cannot hang the wait.Each wait is bounded by
WAIT_TIMEOUT(default 300s) and dumps the service's logs on timeout, so a genuine hang still fails the build with something to read.13 fixed sleeps are removed, totalling 196s of unconditional sleeping per full run. Every
sleepthat remains is a poll interval inside one of these bounded waits.Dependencies: none.
smtp-send.pyis stdlib-only (socket,ssl,argparse) and python3 is already present in the image.Type of change
Status
Todo List
smtp-send.pycarries a module docstring explaining why it exists, and the Makefile waits are commented at each siteHow has this been tested ?
Full suite run against the current Debian 12 base (
mailserver2/debian-mail-overlay:1.0.20, postfix 3.7) — the base master and CI use — to confirm the change is a no-op there:Counts are unchanged from master.