e2e: the queues as tables - a deferred message on each, the empty one
- queue_readable_by_the_panel: the empty queue says "Nothing is waiting" (it
read postqueue -p's "Mail queue is empty").
- expired_message_is_closed: while defer_transports holds the message,
Outbound › Queue lists it with Postfix's reason ("deferred transport",
qmgr_message.c) and a Details link to its row.
- inbound_relay_delivers_and_refuses (testInboundUpstreamDown): the message
for an upstream that refuses is on Inbound › Queue with "connect to
10.77.0.11[10.77.0.11]:2526: Connection refused", and not on Outbound ›
Queue.
make e2e on the test server for 6db3704 plus this: 65 passed, 0 failed;
go vet + go test there: 26 packages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -136,6 +136,17 @@ print("" if r is None else r[0]+" "+r[1])`, token)
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Outbound › Queue lists the waiting recipient, with Postfix's reason and
|
||||
// the link to its row in the Outbound log (postqueue -j, as the panel).
|
||||
_, body, err := sc.panel.get("/outbound/queue")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !strings.Contains(body, `<td class="sp-mono">`+queueID+`</td>`) || !regexp.MustCompile(`<td class="sp-muted">[^<]*deferred transport</td>`).MatchString(body) ||
|
||||
!regexp.MustCompile(`<td class="sp-actions"><a href="/outbound/log/\d+">Details</a></td>`).MatchString(body) {
|
||||
t.Fatalf("Outbound › Queue does not list the deferred message %s with its reason and row:\n%.4000s", queueID, body)
|
||||
}
|
||||
|
||||
exec("postsuper", "-e", queueID)
|
||||
exec("postqueue", "-i", queueID)
|
||||
if err := waitFor("the expired message's row to be bounced", 30*time.Second, 500*time.Millisecond, func() (bool, error) {
|
||||
|
||||
@@ -93,6 +93,22 @@ print("" if r is None else "|".join(r))`, token)
|
||||
t.Fatalf("the Inbound log does not show the deferral:\n%.4000s", body)
|
||||
}
|
||||
|
||||
// The message waits on Inbound › Queue with the upstream's reason, and not
|
||||
// on Outbound › Queue: one Postfix queue, split by the recipient's domain.
|
||||
_, body, err = sc.panel.get("/inbound/queue")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !strings.Contains(body, `<td class="sp-mono">`+queueID+`</td>`) ||
|
||||
!strings.Contains(body, `<td class="sp-muted">connect to 10.77.0.11[10.77.0.11]:2526: Connection refused</td>`) {
|
||||
t.Fatalf("Inbound › Queue does not list the deferred message %s:\n%.4000s", queueID, body)
|
||||
}
|
||||
if _, body, err = sc.panel.get("/outbound/queue"); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if strings.Contains(body, queueID) {
|
||||
t.Fatalf("Outbound › Queue lists the inbound message %s", queueID)
|
||||
}
|
||||
|
||||
for _, args := range [][]string{{"postsuper", "-e", queueID}, {"postqueue", "-i", queueID}} {
|
||||
if out, err := h.execIn("selfpost", args...); err != nil {
|
||||
t.Fatalf("%s: %v\n%s", strings.Join(args, " "), err, out)
|
||||
|
||||
@@ -214,10 +214,10 @@ func TestE2E(t *testing.T) {
|
||||
t.Fatalf("GET /outbound/queue = %d", resp.StatusCode)
|
||||
}
|
||||
if strings.Contains(body, "Could not read the mail queue") {
|
||||
t.Fatal("the panel could not run postqueue -p (queue directory permissions)")
|
||||
t.Fatal("the panel could not run postqueue -j (queue directory permissions)")
|
||||
}
|
||||
if !strings.Contains(body, "Mail queue is empty") {
|
||||
t.Fatalf("the queue page does not show postqueue's listing of an empty queue:\n%s", body)
|
||||
if !strings.Contains(body, "Nothing is waiting. Every message has reached its receiving server.") {
|
||||
t.Fatalf("the queue page does not say the queue is empty:\n%s", body)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user