MCPcopy
hub / github.com/micro/go-micro / TestMDNS

Function TestMDNS

registry/mdns_test.go:9–150  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestMDNS(t *testing.T) {
10 // skip test in travis because of sendto: operation not permitted error
11 if travis := os.Getenv("TRAVIS"); travis == "true" {
12 t.Skip()
13 }
14
15 testData := []*Service{
16 {
17 Name: "test1",
18 Version: "1.0.1",
19 Nodes: []*Node{
20 {
21 Id: "test1-1",
22 Address: "10.0.0.1:10001",
23 Metadata: map[string]string{
24 "foo": "bar",
25 },
26 },
27 },
28 },
29 {
30 Name: "test2",
31 Version: "1.0.2",
32 Nodes: []*Node{
33 {
34 Id: "test2-1",
35 Address: "10.0.0.2:10002",
36 Metadata: map[string]string{
37 "foo2": "bar2",
38 },
39 },
40 },
41 },
42 {
43 Name: "test3",
44 Version: "1.0.3",
45 Nodes: []*Node{
46 {
47 Id: "test3-1",
48 Address: "10.0.0.3:10003",
49 Metadata: map[string]string{
50 "foo3": "bar3",
51 },
52 },
53 },
54 },
55 {
56 Name: "test4",
57 Version: "1.0.4",
58 Nodes: []*Node{
59 {
60 Id: "test4-1",
61 Address: "[::]:10004",
62 Metadata: map[string]string{
63 "foo4": "bar4",
64 },
65 },
66 },

Callers

nothing calls this directly

Calls 9

NewMDNSRegistryFunction · 0.85
FatalMethod · 0.80
TimeoutFunction · 0.70
RegisterMethod · 0.65
GetServiceMethod · 0.65
ListServicesMethod · 0.65
DeregisterMethod · 0.65
FatalfMethod · 0.45
SleepMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…