package overlay import ( "encoding/json" "testing" ) func TestTheMeshProvidesThePrivateNetworkAloneAndItsManifestIsTheModules(t *testing.T) { useTheSeat(t) if got := ProvidedModules(); len(got) != 1 || got[0] != Name { t.Fatalf("ProvidedModules = %v", got) } if !ProvidedByMesh(Name) || ProvidedByMesh("web") { t.Error("the mesh provides mesh-wireguard and nothing else") } m, raw, err := ProvidedManifest(Name) if err != nil { t.Fatal(err) } if want, _ := json.Marshal(Manifest()); string(raw) != string(want) { t.Errorf("provides\n%s\nthe manifest says\n%s", raw, want) } if m.Module != Name { t.Errorf("the manifest is of %q", m.Module) } if _, _, err := ProvidedManifest("web"); err == nil { t.Error("a module the mesh does not provide has a manifest") } }