Test route-proxy without composing: its manifest's own facts and a plan entry's port, since the composition left mesh-sdk

The composer's proof that the manifest composes, and that a port is the placement's, is the node-engine's now (ADR 0593 §7).

Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
This commit is contained in:
2026-11-02 19:06:37 +01:00
parent 9c9d03691b
commit a74f9db508
2 changed files with 24 additions and 86 deletions
@@ -54,40 +54,16 @@ func TestRouteProxyKeepsItsPublicAccountDirectory(t *testing.T) {
if slices.Contains(m.Requires, "acme-ca") {
t.Fatal("route-proxy still asks for acme-ca; the public issuer is its own fact (ADR 0226)")
}
// As a build would leave it: each artifact a container names resolved to an image. Which image does not matter to
// the file checked here. An archive resource carries no image: it unpacks a bundle.
for _, res := range m.Resources {
if res["type"] == "archive" {
continue
}
if artifact, ok := res["artifact"].(string); ok {
delete(res, "artifact")
res["image"] = "registry.invalid/route-proxy/" + artifact +
"@sha256:1111111111111111111111111111111111111111111111111111111111111111"
}
}
r := catalogue.Resolution{
Node: "anchor",
Modules: []catalogue.Manifest{m},
Needs: []catalogue.Needed{{
Name: "internal-acme-ca", From: "home", At: "home.internal", For: "route-proxy",
Serves: map[string]any{"port": float64(9000), "path": "/acme/acme/directory", "roots": "/roots.pem"},
}},
}
// Its own broker credential, sealed as the mesh would; what it is does not matter here.
out, err := r.Declaration(catalogue.Rendering{Needed: map[string]map[string]string{"route-proxy": {"broker": "sealed"}}})
if err != nil {
t.Fatalf("route-proxy could not be composed for a machine: %v", err)
}
env := resourceNamed(out, "route-proxy.acme-env")
// The tree read inlines the template the manifest names, a literal with nothing to fill, so this is what it writes.
env := resourceNamed(m.Resources, "acme-env")
if env == nil {
t.Fatalf("nothing writes the public issuer's environment: %v", out)
t.Fatalf("nothing writes the public issuer's environment: %v", m.Resources)
}
if got, _ := env["content"].(string); got != renderedBeforeTheFold {
t.Fatalf("acme.env changed, which moves the proxy's account and reorders every certificate:\ngot %q\nwant %q",
got, renderedBeforeTheFold)
}
if resourceNamed(out, "route-proxy.bound-acme-ca") != nil {
if resourceNamed(m.Resources, "bound-acme-ca") != nil {
t.Error("a binding to acme-ca is still written")
}
var trust string