Assert the next compose carries the issued account (issue 1226, review round 2)

This commit is contained in:
2026-10-21 19:26:57 +02:00
parent 4e11965a2a
commit b08c6372e1
@@ -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 <node> <module>`.
func TestAnUnissuedProcessAccountIsWarnedOfAndTheRestIsComposed(t *testing.T) {
open := aMesh(t)
ctx := t.Context()