networking required mesh-wireguard and nothing else; machines are assigned the network directly. module forget refuses a provided module, so a retired one is removed at start once no machine has it. Guard route-proxy's public account directory against a reissue.
30 lines
1.0 KiB
Go
30 lines
1.0 KiB
Go
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()} {
|
|
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)
|
|
}
|
|
}
|