delivery-log-storage: e2e holds the page to its lines after a rotation

New step delivery_log_survives_rotation: the page of the first delivered
message must list the line that opened its queue id and its delivery line,
then mail.log is rotated with logrotate -f, the current file is checked to
hold no delivery line, and the page must list both lines still. Before this
feature the page searched the current file and would show none.

The step runs after negative_level1_ratelimit: placed right after the first
delivery it rotated away the "connect from" line the level-2 step reads from
the current log, and that step failed.

On the test server, for this tree: go vet clean, go test ./... 22 packages
ok, make e2e ok (126 s).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mix
2026-10-12 10:25:21 +03:00
co-authored by Claude Opus 5.5
parent a6845ae948
commit 815236a607
4 changed files with 85 additions and 2 deletions
+15
View File
@@ -92,6 +92,8 @@ type scenario struct {
l2AppPassword string
clientIP string
zoneRecords []txtRecord
// deliveryPage is the panel page of the first delivered message.
deliveryPage string
}
func TestE2E(t *testing.T) {
@@ -251,6 +253,14 @@ func TestE2E(t *testing.T) {
}); err != nil {
t.Fatal(err)
}
// The only row so far; its page is looked at again once the log has
// been rotated (delivery_log_survives_rotation).
page, err := firstDeliveryPage(sc)
if err != nil {
t.Fatal(err)
}
sc.deliveryPage = page
})
run("negative_level2_ratelimit_via_panel", func(t *testing.T) {
@@ -274,6 +284,11 @@ func TestE2E(t *testing.T) {
run("negative_level1_ratelimit", func(t *testing.T) {
testLevel1RateLimit(t, sc)
})
// Rotates mail.log, so it comes after the steps that read what they need
// from the current file.
run("delivery_log_survives_rotation", func(t *testing.T) {
testDeliveryLogSurvivesRotation(t, sc)
})
// From here on the installation is no longer the one the run started: it
// is restored from its own backup, then switched to accept mail on port 25.