package overlay import ( "encoding/json" "testing" "github.com/novox/mesh-controller/internal/catalogue" ) // The private network's claim is a seat the mesh defines (novox/hq ADR 0110). // // Checked here because this is where the manifest is composed: it ships with the control plane and // has no module.json for a test reading the catalogue to find. Parsed with the real parser, so a // set that forgot this seat refuses the control plane's own module here rather than on a machine. func TestThePrivateNetworksClaimIsASeatTheMeshDefines(t *testing.T) { for _, composed := range []map[string]any{Manifest(), DomainManifest()} { raw, err := json.Marshal(composed) if err != nil { t.Fatal(err) } if _, err := catalogue.ParseManifest(raw); err != nil { t.Errorf("%s, composed by the control plane, is refused: %v", composed["module"], err) } } seat, defined := catalogue.SeatNamed(TheNetwork) if !defined || seat.Scope != catalogue.ScopeNode { t.Fatalf("%s is not a node seat the mesh defines: %+v", TheNetwork, seat) } }