From 181b579ac6ea3290e999cdef7d84a9617ab16213 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 21 Oct 2026 19:27:22 +0200 Subject: [PATCH] Assert the next compose carries the issued account, not a stand-in (issue 1226, review round 2) --- .../process_accounts_integration_test.go | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/cmd/mesh-controller/process_accounts_integration_test.go b/cmd/mesh-controller/process_accounts_integration_test.go index 1c2e3db5..b1a34582 100644 --- a/cmd/mesh-controller/process_accounts_integration_test.go +++ b/cmd/mesh-controller/process_accounts_integration_test.go @@ -10,8 +10,10 @@ import ( "testing" "git.novox.be/novox/mesh-sdk/go/catalogue" + "git.novox.be/novox/mesh-sdk/go/compose" "github.com/novox/mesh-controller/internal/broker" + "github.com/novox/mesh-controller/internal/inventory" "github.com/novox/mesh-controller/internal/link" "github.com/novox/mesh-controller/internal/testbus" ) @@ -75,8 +77,23 @@ func TestAGainedProcessIsIssuedWhenTheDeliveryRecordsIt(t *testing.T) { 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) + // The row the compose reads is the account issueProcess accepted (origin accepted), never a value the mesh + // made for it (a stand-in). + in, err := inputFor(ctx, open) + if err != nil { + t.Fatal(err) + } + var row *compose.OwnSecretRow + for i, r := range in.OwnSecrets { + if r.Node == "laptop" && r.Module == "mesh-mail" && r.Name == "broker-send" { + row = &in.OwnSecrets[i] + } + } + if row == nil { + t.Fatal("1226/AC2: the next compose carries no row for the process's account") + } + if row.Origin != inventory.OriginAccepted { + t.Fatalf("1226/AC2: the process's account is a stand-in the mesh made (origin %q), not the issued account", row.Origin) } build("b-2", "bbbbbbb2222") again, _, err := inv.BusUserHash(ctx, "laptop.mesh-mail.send")