Issue the provisioner client its own account when its module declares no broker
mesh/merge-gate error: builds mesh-controller → novox; no bus step; the check could not run: killed by hand
mesh/repo-check error: the check could not run: killed by hand
mesh/delivery superseded: a newer head of the same pull request

The catalogue's mesh-provisioner-client declares only provisioner-broker:
the client speaks on the bus as itself. module issue refused it for
lacking a broker, assign minted nothing, and push refused it for lacking
an account, so no machine could run the client (issue 917).
This commit is contained in:
2026-10-16 13:01:03 +00:00
parent a20680dfe7
commit b5da0b2161
3 changed files with 52 additions and 15 deletions
@@ -2,6 +2,7 @@ package main
import (
"slices"
"strings"
"testing"
"github.com/novox/mesh-controller/internal/broker"
@@ -60,3 +61,32 @@ func TestTheProvisionerClientsAccountIsIssuedForItsServiceAndNeverInvented(t *te
t.Fatal("a module with nowhere to read the client's account is read as running it")
}
}
// A module that runs the client and declares no broker of its own, as the catalogue's mesh-provisioner-client does,
// may be issued: the client's account alone (issue 917). Before, `module issue` refused it for having no broker,
// while a push refused it for having no account, so no machine could run the client.
func TestAClientWithoutABrokerOfItsOwnMayBeIssued(t *testing.T) {
if err := mayIssue(aClientModule()); err != nil {
t.Fatalf("the client alone is refused an account: %v", err)
}
neither := aBot("bot", false)
if err := mayIssue(neither); err == nil {
t.Fatal("a module with nowhere to read any account may be issued one")
}
}
// Assigning the client tries to issue the client's account, as assigning any module issues its broker (issue 917):
// without a bus to issue on, the line says so and names the verb, never nothing.
func TestAssigningTheClientIssuesItsAccount(t *testing.T) {
open := aMesh(t)
ctx := t.Context()
client := aClientModule()
register(t, open, client)
out, err := assign(ctx, open, "laptop", client.Module)
if err != nil {
t.Fatal(err)
}
if !strings.Contains(out, "bus credential") {
t.Fatalf("assigning the client said nothing of its account:\n%s", out)
}
}