From b08c6372e135d172640848071774fbf9463b4e2f Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 21 Oct 2026 19:26:57 +0200 Subject: [PATCH] Assert the next compose carries the issued account (issue 1226, review round 2) --- .../process_accounts_integration_test.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cmd/mesh-controller/process_accounts_integration_test.go b/cmd/mesh-controller/process_accounts_integration_test.go index 8c735ed6..1c2e3db5 100644 --- a/cmd/mesh-controller/process_accounts_integration_test.go +++ b/cmd/mesh-controller/process_accounts_integration_test.go @@ -67,6 +67,17 @@ func TestAGainedProcessIsIssuedWhenTheDeliveryRecordsIt(t *testing.T) { if err != nil || !held { t.Fatalf("1226/AC2: recording the gained definition did not mint the process's account: held %v, %v", held, err) } + // And the next compose carries the account, with no warning (1226/AC2). + var said bytes.Buffer + if _, err := prepareSend(leftOutSaidBy(ctx, &said), open, "laptop"); err != nil { + t.Fatalf("1226/AC2: the next compose failed: %v", err) + } + if strings.Contains(said.String(), "bus account is not issued") { + t.Fatalf("1226/AC2: the next compose warns of an account just minted: %q", said.String()) + } + if _, held, err := inv.ModuleSecretIfIssued(ctx, "laptop", "mesh-mail", "broker-send"); err != nil || !held { + t.Fatalf("1226/AC2: the next compose carries no account for the process: held %v, %v", held, err) + } build("b-2", "bbbbbbb2222") again, _, err := inv.BusUserHash(ctx, "laptop.mesh-mail.send") if err != nil || again != hash { @@ -74,8 +85,9 @@ func TestAGainedProcessIsIssuedWhenTheDeliveryRecordsIt(t *testing.T) { } } -// 1226/AC1 and AC4 against the store: a process account nobody issued is warned of in the push's answer, naming -// issue, and the send is not refused, so the machine's other modules are composed. +// 1226/AC1 and AC4 against the store: given two modules on a machine, one with an unissued process account, when +// the machine is composed, the rest of it is composed and sent, and only the warning in the push's answer names +// the first, with `mesh-controller.issue `. func TestAnUnissuedProcessAccountIsWarnedOfAndTheRestIsComposed(t *testing.T) { open := aMesh(t) ctx := t.Context()