@cryptotaxi247 / netdata-1 / commits / ecb54e818

chore(go.d): rename topology engine package to l2topology (#22611)

Ilya Mashchenko committed Jun 3, 2026 at 11:44 UTC ecb54e818c2377823be6204e75817cf061a840e2
128 files changed +276 -274
.github/workflows/snmp-topology-tests.yml
+3 -1
@@ -10,6 +10,7 @@ on:
10 - 'src/go/plugin/go.d/collector/snmp_topology/**'
11 - 'src/go/plugin/go.d/config/go.d/snmp.profiles/**'
12 - 'src/go/pkg/topology/**'
13 + - 'src/go/pkg/l2topology/**'
14 pull_request:
15 paths:
16 - '.github/workflows/snmp-topology-tests.yml'
@@ -17,6 +18,7 @@ on:
18 - 'src/go/plugin/go.d/collector/snmp_topology/**'
19 - 'src/go/plugin/go.d/config/go.d/snmp.profiles/**'
20 - 'src/go/pkg/topology/**'
21 + - 'src/go/pkg/l2topology/**'
22
23 jobs:
24 fixture-tests:
@@ -95,7 +97,7 @@ jobs:
97 cd src/go
98 go test -tags=snmp_topology_fixtures \
99 ./plugin/go.d/collector/snmp_topology/... \
98 - ./pkg/topology/engine/parity/...
100 + ./pkg/l2topology/parity/...
101
102 - name: Stop snmpsim
103 if: always()
src/go/pkg/l2topology/bridge_domain_model.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/bridge_domain_model_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "testing"
src/go/pkg/l2topology/doc.go new
+5
@@ -0,0 +1,5 @@
1 +// SPDX-License-Identifier: GPL-3.0-or-later
2 +
3 +// Package l2topology provides a reusable topology discovery interface that can be
4 +// shared by multiple collectors and services.
5 +package l2topology
src/go/pkg/l2topology/engine.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "context"
src/go/pkg/l2topology/engine_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "context"
src/go/pkg/l2topology/l2_pipeline.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import "fmt"
6
src/go/pkg/l2topology/l2_pipeline_address_normalization.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "encoding/hex"
src/go/pkg/l2topology/l2_pipeline_adjacencies.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import "strings"
6
src/go/pkg/l2topology/l2_pipeline_builder.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "strings"
src/go/pkg/l2topology/l2_pipeline_collections.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "net/netip"
src/go/pkg/l2topology/l2_pipeline_endpoints.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "strconv"
src/go/pkg/l2topology/l2_pipeline_enrichment.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "maps"
src/go/pkg/l2topology/l2_pipeline_fdb.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/l2_pipeline_fdb_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "testing"
src/go/pkg/l2topology/l2_pipeline_keys.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "fmt"
src/go/pkg/l2topology/l2_pipeline_keys_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "testing"
src/go/pkg/l2topology/l2_pipeline_lldp_normalization.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "encoding/hex"
src/go/pkg/l2topology/l2_pipeline_match_cdp.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "strconv"
src/go/pkg/l2topology/l2_pipeline_match_lldp.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import "strings"
6
src/go/pkg/l2topology/l2_pipeline_normalization.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import "strings"
6
src/go/pkg/l2topology/l2_pipeline_normalization_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "testing"
src/go/pkg/l2topology/l2_pipeline_pairing.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import "strings"
6
src/go/pkg/l2topology/l2_pipeline_registration.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "fmt"
src/go/pkg/l2topology/l2_pipeline_remote_resolution.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "net/netip"
src/go/pkg/l2topology/l2_pipeline_remote_resolution_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "testing"
src/go/pkg/l2topology/l2_pipeline_sorting.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/l2_pipeline_stats.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 func newL2ResultStats() map[string]any {
6 return map[string]any{
src/go/pkg/l2topology/l2_pipeline_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "testing"
src/go/pkg/l2topology/mac_oui_lookup.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 _ "embed"
src/go/pkg/l2topology/mac_oui_lookup_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "strings"
src/go/pkg/l2topology/mac_oui_vendors.tsv renamed
src/go/pkg/l2topology/node_topology.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import "net/netip"
6
src/go/pkg/l2topology/node_topology_router.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/node_topology_service.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import "sort"
6
src/go/pkg/l2topology/node_topology_subnet.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "fmt"
src/go/pkg/l2topology/node_topology_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "net/netip"
src/go/pkg/l2topology/noop.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import "context"
6
src/go/pkg/l2topology/parity/README.md renamed
src/go/pkg/l2topology/parity/doc.go renamed
src/go/pkg/l2topology/parity/golden.go renamed
src/go/pkg/l2topology/parity/golden_fixture_test.go renamed
+18 -18
@@ -11,20 +11,20 @@ import (
11 )
12
13 func TestValidateGoldenCache(t *testing.T) {
14 - manifest, err := LoadManifest("../../../../testdata/snmp/enlinkd/nms8003/manifest.yaml")
14 + manifest, err := LoadManifest("../../../testdata/snmp/enlinkd/nms8003/manifest.yaml")
15 require.NoError(t, err)
16
17 scenario, ok := manifest.FindScenario("nms8003_lldp")
18 require.True(t, ok)
19
20 - resolved, err := ResolveScenario("../../../../testdata/snmp/enlinkd/nms8003/manifest.yaml", scenario)
20 + resolved, err := ResolveScenario("../../../testdata/snmp/enlinkd/nms8003/manifest.yaml", scenario)
21 require.NoError(t, err)
22
23 require.NoError(t, ValidateCache(resolved.GoldenYAML, resolved.GoldenJSON))
24 }
25
26 func TestValidateGoldenCache_NMS8000(t *testing.T) {
27 - manifestPath := "../../../../testdata/snmp/enlinkd/nms8000/manifest.yaml"
27 + manifestPath := "../../../testdata/snmp/enlinkd/nms8000/manifest.yaml"
28 manifest, err := LoadManifest(manifestPath)
29 require.NoError(t, err)
30
@@ -40,7 +40,7 @@ func TestValidateGoldenCache_NMS8000(t *testing.T) {
40 }
41
42 func TestValidateGoldenCache_NMS13637(t *testing.T) {
43 - manifestPath := "../../../../testdata/snmp/enlinkd/nms13637/manifest.yaml"
43 + manifestPath := "../../../testdata/snmp/enlinkd/nms13637/manifest.yaml"
44 manifest, err := LoadManifest(manifestPath)
45 require.NoError(t, err)
46
@@ -53,7 +53,7 @@ func TestValidateGoldenCache_NMS13637(t *testing.T) {
53 }
54
55 func TestValidateGoldenCache_NMS10205B(t *testing.T) {
56 - manifestPath := "../../../../testdata/snmp/enlinkd/nms10205b/manifest.yaml"
56 + manifestPath := "../../../testdata/snmp/enlinkd/nms10205b/manifest.yaml"
57 manifest, err := LoadManifest(manifestPath)
58 require.NoError(t, err)
59
@@ -66,7 +66,7 @@ func TestValidateGoldenCache_NMS10205B(t *testing.T) {
66 }
67
68 func TestValidateGoldenCache_NMS17216(t *testing.T) {
69 - manifestPath := "../../../../testdata/snmp/enlinkd/nms17216/manifest.yaml"
69 + manifestPath := "../../../testdata/snmp/enlinkd/nms17216/manifest.yaml"
70 manifest, err := LoadManifest(manifestPath)
71 require.NoError(t, err)
72
@@ -82,7 +82,7 @@ func TestValidateGoldenCache_NMS17216(t *testing.T) {
82 }
83
84 func TestValidateGoldenCache_NMS0123(t *testing.T) {
85 - manifestPath := "../../../../testdata/snmp/enlinkd/nms0123/manifest.yaml"
85 + manifestPath := "../../../testdata/snmp/enlinkd/nms0123/manifest.yaml"
86 manifest, err := LoadManifest(manifestPath)
87 require.NoError(t, err)
88
@@ -95,7 +95,7 @@ func TestValidateGoldenCache_NMS0123(t *testing.T) {
95 }
96
97 func TestValidateGoldenCache_NMS0002(t *testing.T) {
98 - manifestPath := "../../../../testdata/snmp/enlinkd/nms0002/manifest.yaml"
98 + manifestPath := "../../../testdata/snmp/enlinkd/nms0002/manifest.yaml"
99 manifest, err := LoadManifest(manifestPath)
100 require.NoError(t, err)
101
@@ -111,7 +111,7 @@ func TestValidateGoldenCache_NMS0002(t *testing.T) {
111 }
112
113 func TestValidateGoldenCache_NMS0000(t *testing.T) {
114 - manifestPath := "../../../../testdata/snmp/enlinkd/nms0000/manifest.yaml"
114 + manifestPath := "../../../testdata/snmp/enlinkd/nms0000/manifest.yaml"
115 manifest, err := LoadManifest(manifestPath)
116 require.NoError(t, err)
117
@@ -135,7 +135,7 @@ func TestValidateGoldenCache_NMS0000(t *testing.T) {
135 }
136
137 func TestValidateGoldenCache_NMS7467(t *testing.T) {
138 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7467/manifest.yaml"
138 + manifestPath := "../../../testdata/snmp/enlinkd/nms7467/manifest.yaml"
139 manifest, err := LoadManifest(manifestPath)
140 require.NoError(t, err)
141
@@ -148,7 +148,7 @@ func TestValidateGoldenCache_NMS7467(t *testing.T) {
148 }
149
150 func TestValidateGoldenCache_NMS7563(t *testing.T) {
151 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7563/manifest.yaml"
151 + manifestPath := "../../../testdata/snmp/enlinkd/nms7563/manifest.yaml"
152 manifest, err := LoadManifest(manifestPath)
153 require.NoError(t, err)
154
@@ -164,7 +164,7 @@ func TestValidateGoldenCache_NMS7563(t *testing.T) {
164 }
165
166 func TestValidateGoldenCache_NMS4930(t *testing.T) {
167 - manifestPath := "../../../../testdata/snmp/enlinkd/nms4930/manifest.yaml"
167 + manifestPath := "../../../testdata/snmp/enlinkd/nms4930/manifest.yaml"
168 manifest, err := LoadManifest(manifestPath)
169 require.NoError(t, err)
170
@@ -184,7 +184,7 @@ func TestValidateGoldenCache_NMS4930(t *testing.T) {
184 }
185
186 func TestValidateGoldenCache_NMS7777DW(t *testing.T) {
187 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7777dw/manifest.yaml"
187 + manifestPath := "../../../testdata/snmp/enlinkd/nms7777dw/manifest.yaml"
188 manifest, err := LoadManifest(manifestPath)
189 require.NoError(t, err)
190
@@ -197,7 +197,7 @@ func TestValidateGoldenCache_NMS7777DW(t *testing.T) {
197 }
198
199 func TestValidateGoldenCache_NMS13923(t *testing.T) {
200 - manifestPath := "../../../../testdata/snmp/enlinkd/nms13923/manifest.yaml"
200 + manifestPath := "../../../testdata/snmp/enlinkd/nms13923/manifest.yaml"
201 manifest, err := LoadManifest(manifestPath)
202 require.NoError(t, err)
203
@@ -210,7 +210,7 @@ func TestValidateGoldenCache_NMS13923(t *testing.T) {
210 }
211
212 func TestValidateGoldenCache_NMS13593(t *testing.T) {
213 - manifestPath := "../../../../testdata/snmp/enlinkd/nms13593/manifest.yaml"
213 + manifestPath := "../../../testdata/snmp/enlinkd/nms13593/manifest.yaml"
214 manifest, err := LoadManifest(manifestPath)
215 require.NoError(t, err)
216
@@ -223,7 +223,7 @@ func TestValidateGoldenCache_NMS13593(t *testing.T) {
223 }
224
225 func TestValidateGoldenCache_NMS7918(t *testing.T) {
226 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7918/manifest.yaml"
226 + manifestPath := "../../../testdata/snmp/enlinkd/nms7918/manifest.yaml"
227 manifest, err := LoadManifest(manifestPath)
228 require.NoError(t, err)
229
@@ -247,7 +247,7 @@ func TestValidateGoldenCache_NMS7918(t *testing.T) {
247 }
248
249 func TestValidateGoldenCache_NMS18541(t *testing.T) {
250 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
250 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
251 manifest, err := LoadManifest(manifestPath)
252 require.NoError(t, err)
253
@@ -280,7 +280,7 @@ func TestValidateGoldenCache_NMS18541(t *testing.T) {
280 }
281
282 func TestGoldenYAMLValidation(t *testing.T) {
283 - doc, err := LoadGoldenYAML("../../../../testdata/snmp/enlinkd/nms8003/golden/nms8003_lldp.yaml")
283 + doc, err := LoadGoldenYAML("../../../testdata/snmp/enlinkd/nms8003/golden/nms8003_lldp.yaml")
284 require.NoError(t, err)
285
286 require.Equal(t, GoldenVersion, doc.Version)
src/go/pkg/l2topology/parity/golden_test.go renamed
src/go/pkg/l2topology/parity/l2_builder.go renamed
+27 -27
@@ -10,7 +10,7 @@ import (
10 "strconv"
11 "strings"
12
13 - "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
13 + "github.com/netdata/netdata/go/plugins/pkg/l2topology"
14 )
15
16 // BuildOptions configures protocol extraction when converting walk fixtures
@@ -48,22 +48,22 @@ func LoadScenarioWalks(scenario ResolvedScenario) ([]FixtureWalk, error) {
48 return walks, nil
49 }
50
51 -// BuildL2ResultFromWalks builds a deterministic layer-2 engine.Result from
51 +// BuildL2ResultFromWalks builds a deterministic layer-2 l2topology.Result from
52 // LLDP/CDP/FDB/ARP observations in walk fixtures.
53 -func BuildL2ResultFromWalks(fixtures []FixtureWalk, opts BuildOptions) (engine.Result, error) {
53 +func BuildL2ResultFromWalks(fixtures []FixtureWalk, opts BuildOptions) (l2topology.Result, error) {
54 if len(fixtures) == 0 {
55 - return engine.Result{}, fmt.Errorf("at least one fixture is required")
55 + return l2topology.Result{}, fmt.Errorf("at least one fixture is required")
56 }
57
58 - observations := make([]engine.L2Observation, 0, len(fixtures))
58 + observations := make([]l2topology.L2Observation, 0, len(fixtures))
59 for _, fx := range fixtures {
60 if strings.TrimSpace(fx.DeviceID) == "" {
61 - return engine.Result{}, fmt.Errorf("fixture with empty device id")
61 + return l2topology.Result{}, fmt.Errorf("fixture with empty device id")
62 }
63 observations = append(observations, parseFixture(fx).toObservation())
64 }
65
66 - return engine.BuildL2ResultFromObservations(observations, engine.DiscoverOptions{
66 + return l2topology.BuildL2ResultFromObservations(observations, l2topology.DiscoverOptions{
67 EnableLLDP: opts.EnableLLDP,
68 EnableCDP: opts.EnableCDP,
69 EnableBridge: opts.EnableBridge,
@@ -332,8 +332,8 @@ func parseFixture(f FixtureWalk) parsedFixture {
332 return p
333 }
334
335 -func (p parsedFixture) toObservation() engine.L2Observation {
336 - obs := engine.L2Observation{
335 +func (p parsedFixture) toObservation() l2topology.L2Observation {
336 + obs := l2topology.L2Observation{
337 DeviceID: p.deviceID,
338 Hostname: p.hostname,
339 ManagementIP: p.mgmtIP,
@@ -349,11 +349,11 @@ func (p parsedFixture) toObservation() engine.L2Observation {
349 return obs
350 }
351
352 -func (p parsedFixture) toInterfaces() []engine.ObservedInterface {
352 +func (p parsedFixture) toInterfaces() []l2topology.ObservedInterface {
353 if len(p.ifNameByIndex) == 0 {
354 return nil
355 }
356 - out := make([]engine.ObservedInterface, 0, len(p.ifNameByIndex))
356 + out := make([]l2topology.ObservedInterface, 0, len(p.ifNameByIndex))
357 for idx, name := range p.ifNameByIndex {
358 n, err := strconv.Atoi(idx)
359 if err != nil {
@@ -363,7 +363,7 @@ func (p parsedFixture) toInterfaces() []engine.ObservedInterface {
363 if ifName == "" {
364 continue
365 }
366 - out = append(out, engine.ObservedInterface{IfIndex: n, IfName: ifName, IfDescr: ifName})
366 + out = append(out, l2topology.ObservedInterface{IfIndex: n, IfName: ifName, IfDescr: ifName})
367 }
368 sort.Slice(out, func(i, j int) bool {
369 if out[i].IfIndex != out[j].IfIndex {
@@ -374,11 +374,11 @@ func (p parsedFixture) toInterfaces() []engine.ObservedInterface {
374 return out
375 }
376
377 -func (p parsedFixture) toBridgePorts() []engine.BridgePortObservation {
377 +func (p parsedFixture) toBridgePorts() []l2topology.BridgePortObservation {
378 if len(p.bridgePortToIfIndex) == 0 {
379 return nil
380 }
381 - out := make([]engine.BridgePortObservation, 0, len(p.bridgePortToIfIndex))
381 + out := make([]l2topology.BridgePortObservation, 0, len(p.bridgePortToIfIndex))
382 for basePort, ifIndexRaw := range p.bridgePortToIfIndex {
383 ifIndex, err := strconv.Atoi(strings.TrimSpace(ifIndexRaw))
384 if err != nil || ifIndex <= 0 {
@@ -388,7 +388,7 @@ func (p parsedFixture) toBridgePorts() []engine.BridgePortObservation {
388 if basePort == "" {
389 continue
390 }
391 - out = append(out, engine.BridgePortObservation{
391 + out = append(out, l2topology.BridgePortObservation{
392 BasePort: basePort,
393 IfIndex: ifIndex,
394 })
@@ -403,17 +403,17 @@ func (p parsedFixture) toBridgePorts() []engine.BridgePortObservation {
403 return out
404 }
405
406 -func (p parsedFixture) toFDBEntries() []engine.FDBObservation {
406 +func (p parsedFixture) toFDBEntries() []l2topology.FDBObservation {
407 if len(p.fdbEntries) == 0 {
408 return nil
409 }
410 - out := make([]engine.FDBObservation, 0, len(p.fdbEntries))
410 + out := make([]l2topology.FDBObservation, 0, len(p.fdbEntries))
411 for _, entry := range p.fdbEntries {
412 mac := normalizeHexToken(entry.mac)
413 if mac == "" {
414 continue
415 }
416 - out = append(out, engine.FDBObservation{
416 + out = append(out, l2topology.FDBObservation{
417 MAC: mac,
418 BridgePort: strings.TrimSpace(entry.bridgePort),
419 Status: strings.TrimSpace(entry.status),
@@ -432,17 +432,17 @@ func (p parsedFixture) toFDBEntries() []engine.FDBObservation {
432 return out
433 }
434
435 -func (p parsedFixture) toARPNDEntries() []engine.ARPNDObservation {
435 +func (p parsedFixture) toARPNDEntries() []l2topology.ARPNDObservation {
436 if len(p.arpEntries) == 0 {
437 return nil
438 }
439 - out := make([]engine.ARPNDObservation, 0, len(p.arpEntries))
439 + out := make([]l2topology.ARPNDObservation, 0, len(p.arpEntries))
440 for _, entry := range p.sortedARPEntries() {
441 ifIndex, err := strconv.Atoi(strings.TrimSpace(entry.ifIndex))
442 if err != nil {
443 ifIndex = 0
444 }
445 - out = append(out, engine.ARPNDObservation{
445 + out = append(out, l2topology.ARPNDObservation{
446 Protocol: "arp",
447 IfIndex: ifIndex,
448 IfName: p.ifNameByIndex[entry.ifIndex],
@@ -455,13 +455,13 @@ func (p parsedFixture) toARPNDEntries() []engine.ARPNDObservation {
455 return out
456 }
457
458 -func (p parsedFixture) toLLDPRemotes() []engine.LLDPRemoteObservation {
458 +func (p parsedFixture) toLLDPRemotes() []l2topology.LLDPRemoteObservation {
459 if len(p.lldpRemotes) == 0 {
460 return nil
461 }
462 - obs := make([]engine.LLDPRemoteObservation, 0, len(p.lldpRemotes))
462 + obs := make([]l2topology.LLDPRemoteObservation, 0, len(p.lldpRemotes))
463 for _, remote := range p.sortedLLDPRemotes() {
464 - obs = append(obs, engine.LLDPRemoteObservation{
464 + obs = append(obs, l2topology.LLDPRemoteObservation{
465 LocalPortNum: remote.localPortNum,
466 RemoteIndex: remote.remIndex,
467 LocalPortID: p.portIDByNum[remote.localPortNum],
@@ -478,18 +478,18 @@ func (p parsedFixture) toLLDPRemotes() []engine.LLDPRemoteObservation {
478 return obs
479 }
480
481 -func (p parsedFixture) toCDPRemotes() []engine.CDPRemoteObservation {
481 +func (p parsedFixture) toCDPRemotes() []l2topology.CDPRemoteObservation {
482 if len(p.cdpRemotes) == 0 {
483 return nil
484 }
485 - obs := make([]engine.CDPRemoteObservation, 0, len(p.cdpRemotes))
485 + obs := make([]l2topology.CDPRemoteObservation, 0, len(p.cdpRemotes))
486 for _, remote := range p.sortedCDPRemotes() {
487 ifIndex, err := strconv.Atoi(remote.ifIndex)
488 if err != nil {
489 ifIndex = 0
490 }
491 localName := p.ifNameByIndex[remote.ifIndex]
492 - obs = append(obs, engine.CDPRemoteObservation{
492 + obs = append(obs, l2topology.CDPRemoteObservation{
493 LocalIfIndex: ifIndex,
494 LocalIfName: localName,
495 DeviceIndex: remote.deviceIndex,
src/go/pkg/l2topology/parity/l2_builder_test.go renamed
+96 -96
@@ -12,12 +12,12 @@ import (
12 "strings"
13 "testing"
14
15 - "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
15 + "github.com/netdata/netdata/go/plugins/pkg/l2topology"
16 "github.com/stretchr/testify/require"
17 )
18
19 func TestBuildL2ResultFromWalks_LLDP_NMS8003(t *testing.T) {
20 - manifestPath := "../../../../testdata/snmp/enlinkd/nms8003/manifest.yaml"
20 + manifestPath := "../../../testdata/snmp/enlinkd/nms8003/manifest.yaml"
21 manifest, err := LoadManifest(manifestPath)
22 require.NoError(t, err)
23
@@ -54,7 +54,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS8003(t *testing.T) {
54 }
55
56 func TestBuildL2ResultFromWalks_CDP_NMS8000(t *testing.T) {
57 - manifestPath := "../../../../testdata/snmp/enlinkd/nms8000/manifest.yaml"
57 + manifestPath := "../../../testdata/snmp/enlinkd/nms8000/manifest.yaml"
58 manifest, err := LoadManifest(manifestPath)
59 require.NoError(t, err)
60
@@ -125,7 +125,7 @@ func TestBuildL2ResultFromWalks_CDP_NMS8000(t *testing.T) {
125 }
126
127 func TestBuildL2ResultFromWalks_LLDP_NMS8000(t *testing.T) {
128 - manifestPath := "../../../../testdata/snmp/enlinkd/nms8000/manifest.yaml"
128 + manifestPath := "../../../testdata/snmp/enlinkd/nms8000/manifest.yaml"
129 manifest, err := LoadManifest(manifestPath)
130 require.NoError(t, err)
131
@@ -186,7 +186,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS8000(t *testing.T) {
186 }
187
188 func TestBuildL2ResultFromWalks_LLDP_NMS13637(t *testing.T) {
189 - manifestPath := "../../../../testdata/snmp/enlinkd/nms13637/manifest.yaml"
189 + manifestPath := "../../../testdata/snmp/enlinkd/nms13637/manifest.yaml"
190 manifest, err := LoadManifest(manifestPath)
191 require.NoError(t, err)
192
@@ -239,7 +239,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS13637(t *testing.T) {
239 }
240
241 func TestBuildL2ResultFromWalks_LLDP_NMS10205B(t *testing.T) {
242 - manifestPath := "../../../../testdata/snmp/enlinkd/nms10205b/manifest.yaml"
242 + manifestPath := "../../../testdata/snmp/enlinkd/nms10205b/manifest.yaml"
243 manifest, err := LoadManifest(manifestPath)
244 require.NoError(t, err)
245
@@ -275,7 +275,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS10205B(t *testing.T) {
275 {fixtureID: "SRX-100", totalLinks: 10, sourceLinks: 0, lldpElementCnt: 6},
276 }
277
278 - var final engine.Result
278 + var final l2topology.Result
279 for i, expected := range expectations {
280 walks, walkErr := loadScenarioWalkPrefix(resolved, i+1)
281 require.NoError(t, walkErr)
@@ -312,7 +312,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS10205B(t *testing.T) {
312 require.Contains(t, finalKeys, "lldp|Delhi|28520|Space-EX-SW1|528")
313 require.Contains(t, finalKeys, "lldp|Space-EX-SW1|1361|Space-EX-SW2|531")
314
315 - topologyEdges := make(map[string]engine.Adjacency, len(final.Adjacencies))
315 + topologyEdges := make(map[string]l2topology.Adjacency, len(final.Adjacencies))
316 for _, adj := range final.Adjacencies {
317 if adj.Protocol != "lldp" {
318 continue
@@ -337,7 +337,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS10205B(t *testing.T) {
337 }
338
339 func TestBuildL2ResultFromWalks_LLDP_NMS17216(t *testing.T) {
340 - manifestPath := "../../../../testdata/snmp/enlinkd/nms17216/manifest.yaml"
340 + manifestPath := "../../../testdata/snmp/enlinkd/nms17216/manifest.yaml"
341 manifest, err := LoadManifest(manifestPath)
342 require.NoError(t, err)
343
@@ -369,7 +369,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS17216(t *testing.T) {
369 {fixtureID: "Switch5", totalLinks: 12, sourceLinks: 0, lldpElementCnt: 5},
370 }
371
372 - var final engine.Result
372 + var final l2topology.Result
373 for i, expected := range expectations {
374 walks, walkErr := loadScenarioWalkPrefix(resolved, i+1)
375 require.NoError(t, walkErr)
@@ -401,7 +401,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS17216(t *testing.T) {
401 }
402
403 func TestBuildL2ResultFromWalks_CDP_NMS17216(t *testing.T) {
404 - manifestPath := "../../../../testdata/snmp/enlinkd/nms17216/manifest.yaml"
404 + manifestPath := "../../../testdata/snmp/enlinkd/nms17216/manifest.yaml"
405 manifest, err := LoadManifest(manifestPath)
406 require.NoError(t, err)
407
@@ -436,7 +436,7 @@ func TestBuildL2ResultFromWalks_CDP_NMS17216(t *testing.T) {
436 {fixtureID: "Router4", totalLinks: 26, sourceLinks: 1},
437 }
438
439 - var final engine.Result
439 + var final l2topology.Result
440 for i, expected := range expectations {
441 walks, walkErr := loadScenarioWalkPrefix(resolved, i+1)
442 require.NoError(t, walkErr)
@@ -478,7 +478,7 @@ func TestBuildL2ResultFromWalks_CDP_NMS17216(t *testing.T) {
478 }
479
480 func TestBuildL2ResultFromWalks_CDP_NMS17216_TopologyProjection(t *testing.T) {
481 - manifestPath := "../../../../testdata/snmp/enlinkd/nms17216/manifest.yaml"
481 + manifestPath := "../../../testdata/snmp/enlinkd/nms17216/manifest.yaml"
482 manifest, err := LoadManifest(manifestPath)
483 require.NoError(t, err)
484
@@ -519,7 +519,7 @@ func TestBuildL2ResultFromWalks_CDP_NMS17216_TopologyProjection(t *testing.T) {
519 }
520
521 func TestBuildL2ResultFromWalks_LLDP_NMS17216_TopologyProjection(t *testing.T) {
522 - manifestPath := "../../../../testdata/snmp/enlinkd/nms17216/manifest.yaml"
522 + manifestPath := "../../../testdata/snmp/enlinkd/nms17216/manifest.yaml"
523 manifest, err := LoadManifest(manifestPath)
524 require.NoError(t, err)
525
@@ -574,7 +574,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS17216_TopologyProjection(t *testing.T) {
574 }
575
576 func TestBuildL2ResultFromWalks_LLDP_NMS0123(t *testing.T) {
577 - manifestPath := "../../../../testdata/snmp/enlinkd/nms0123/manifest.yaml"
577 + manifestPath := "../../../testdata/snmp/enlinkd/nms0123/manifest.yaml"
578 manifest, err := LoadManifest(manifestPath)
579 require.NoError(t, err)
580
@@ -607,7 +607,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0123(t *testing.T) {
607 {fixtureID: "ITPN0202", totalLinks: 23},
608 }
609
610 - var final engine.Result
610 + var final l2topology.Result
611 for i, expected := range expectations {
612 walks, walkErr := loadScenarioWalkPrefix(resolved, i+1)
613 require.NoError(t, walkErr)
@@ -651,7 +651,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0123(t *testing.T) {
651 }
652
653 func TestBuildL2ResultFromWalks_LLDP_NMS0002_CISCO_JUNIPER(t *testing.T) {
654 - manifestPath := "../../../../testdata/snmp/enlinkd/nms0002/manifest.yaml"
654 + manifestPath := "../../../testdata/snmp/enlinkd/nms0002/manifest.yaml"
655 manifest, err := LoadManifest(manifestPath)
656 require.NoError(t, err)
657
@@ -706,7 +706,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0002_CISCO_JUNIPER(t *testing.T) {
706 }
707
708 func TestBuildL2ResultFromWalks_LLDP_NMS0002_CISCO_ALCATEL(t *testing.T) {
709 - manifestPath := "../../../../testdata/snmp/enlinkd/nms0002/manifest.yaml"
709 + manifestPath := "../../../testdata/snmp/enlinkd/nms0002/manifest.yaml"
710 manifest, err := LoadManifest(manifestPath)
711 require.NoError(t, err)
712
@@ -764,7 +764,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0002_CISCO_ALCATEL(t *testing.T) {
764 }
765
766 func TestBuildL2ResultFromWalks_LLDP_NMS0000_NETWORK_ALL(t *testing.T) {
767 - manifestPath := "../../../../testdata/snmp/enlinkd/nms0000/manifest.yaml"
767 + manifestPath := "../../../testdata/snmp/enlinkd/nms0000/manifest.yaml"
768 manifest, err := LoadManifest(manifestPath)
769 require.NoError(t, err)
770
@@ -845,7 +845,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0000_NETWORK_ALL(t *testing.T) {
845 {fixtureID: "ms19", totalLinks: 73, sourceLinks: 3, lldpElementCnt: 18},
846 }
847
848 - var final engine.Result
848 + var final l2topology.Result
849 for i, expected := range expectations {
850 walks, walkErr := loadScenarioWalkPrefix(resolved, i+1)
851 require.NoError(t, walkErr)
@@ -894,7 +894,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0000_NETWORK_ALL(t *testing.T) {
894 }
895
896 func TestBuildL2ResultFromWalks_LLDP_NMS0000_NETWORK_TWO_CONNECTED(t *testing.T) {
897 - manifestPath := "../../../../testdata/snmp/enlinkd/nms0000/manifest.yaml"
897 + manifestPath := "../../../testdata/snmp/enlinkd/nms0000/manifest.yaml"
898 manifest, err := LoadManifest(manifestPath)
899 require.NoError(t, err)
900
@@ -955,7 +955,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0000_NETWORK_TWO_CONNECTED(t *testing.T)
955 }
956
957 func TestBuildL2ResultFromWalks_LLDP_NMS0000_NETWORK_THREE_CONNECTED(t *testing.T) {
958 - manifestPath := "../../../../testdata/snmp/enlinkd/nms0000/manifest.yaml"
958 + manifestPath := "../../../testdata/snmp/enlinkd/nms0000/manifest.yaml"
959 manifest, err := LoadManifest(manifestPath)
960 require.NoError(t, err)
961
@@ -1018,7 +1018,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0000_NETWORK_THREE_CONNECTED(t *testing.
1018 }
1019
1020 func TestBuildL2ResultFromWalks_LLDP_NMS0000_MICROSENSE(t *testing.T) {
1021 - manifestPath := "../../../../testdata/snmp/enlinkd/nms0000/manifest.yaml"
1021 + manifestPath := "../../../testdata/snmp/enlinkd/nms0000/manifest.yaml"
1022 manifest, err := LoadManifest(manifestPath)
1023 require.NoError(t, err)
1024
@@ -1055,7 +1055,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0000_MICROSENSE(t *testing.T) {
1055 require.Equal(t, 1, countFixturesWithLLDPLocalElements(allWalks))
1056 require.Equal(t, map[string]int{"ms08": 5}, countAdjacenciesBySource(step1.Adjacencies, "lldp"))
1057
1058 - deviceByID := make(map[string]engine.Device, len(step1.Devices))
1058 + deviceByID := make(map[string]l2topology.Device, len(step1.Devices))
1059 for _, dev := range step1.Devices {
1060 deviceByID[dev.ID] = dev
1061 }
@@ -1078,7 +1078,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0000_MICROSENSE(t *testing.T) {
1078 }
1079
1080 func TestBuildL2ResultFromWalks_LLDP_NMS0000_MS16(t *testing.T) {
1081 - manifestPath := "../../../../testdata/snmp/enlinkd/nms0000/manifest.yaml"
1081 + manifestPath := "../../../testdata/snmp/enlinkd/nms0000/manifest.yaml"
1082 manifest, err := LoadManifest(manifestPath)
1083 require.NoError(t, err)
1084
@@ -1115,7 +1115,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0000_MS16(t *testing.T) {
1115 require.Equal(t, 1, countFixturesWithLLDPLocalElements(allWalks))
1116 require.Equal(t, map[string]int{"ms16": 5}, countAdjacenciesBySource(step1.Adjacencies, "lldp"))
1117
1118 - deviceByID := make(map[string]engine.Device, len(step1.Devices))
1118 + deviceByID := make(map[string]l2topology.Device, len(step1.Devices))
1119 for _, dev := range step1.Devices {
1120 deviceByID[dev.ID] = dev
1121 }
@@ -1138,7 +1138,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0000_MS16(t *testing.T) {
1138 }
1139
1140 func TestBuildL2ResultFromWalks_LLDP_NMS0000_PLANET(t *testing.T) {
1141 - manifestPath := "../../../../testdata/snmp/enlinkd/nms0000/manifest.yaml"
1141 + manifestPath := "../../../testdata/snmp/enlinkd/nms0000/manifest.yaml"
1142 manifest, err := LoadManifest(manifestPath)
1143 require.NoError(t, err)
1144
@@ -1175,7 +1175,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0000_PLANET(t *testing.T) {
1175 require.Equal(t, 1, countFixturesWithLLDPLocalElements(allWalks))
1176 require.Equal(t, map[string]int{"planet": 3}, countAdjacenciesBySource(step1.Adjacencies, "lldp"))
1177
1178 - deviceByID := make(map[string]engine.Device, len(step1.Devices))
1178 + deviceByID := make(map[string]l2topology.Device, len(step1.Devices))
1179 for _, dev := range step1.Devices {
1180 deviceByID[dev.ID] = dev
1181 }
@@ -1183,7 +1183,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0000_PLANET(t *testing.T) {
1183 require.Equal(t, "V177", deviceByID["planet"].Hostname)
1184 require.Equal(t, "a8:f7:e0:6c:3b:d8", deviceByID["planet"].ChassisID)
1185
1186 - adjByLocalPort := make(map[string]engine.Adjacency, len(step1.Adjacencies))
1186 + adjByLocalPort := make(map[string]l2topology.Adjacency, len(step1.Adjacencies))
1187 for _, adj := range step1.Adjacencies {
1188 if adj.SourceID != "planet" {
1189 continue
@@ -1219,7 +1219,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS0000_PLANET(t *testing.T) {
1219 }
1220
1221 func TestBuildL2ResultFromWalks_LLDP_NMS18541_NETWORK_ALL(t *testing.T) {
1222 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1222 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1223 manifest, err := LoadManifest(manifestPath)
1224 require.NoError(t, err)
1225
@@ -1328,7 +1328,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_NETWORK_ALL(t *testing.T) {
1328 }
1329
1330 func TestBuildL2ResultFromWalks_LLDP_NMS18541_TOPO_QFX_SW01_SW02_SW03(t *testing.T) {
1331 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1331 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1332 manifest, err := LoadManifest(manifestPath)
1333 require.NoError(t, err)
1334
@@ -1390,7 +1390,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_TOPO_QFX_SW01_SW02_SW03(t *testing
1390 }
1391
1392 func TestBuildL2ResultFromWalks_LLDP_NMS18541_TOPO_QFX_SW01(t *testing.T) {
1393 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1393 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1394 manifest, err := LoadManifest(manifestPath)
1395 require.NoError(t, err)
1396
@@ -1440,7 +1440,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_TOPO_QFX_SW01(t *testing.T) {
1440 }
1441
1442 func TestBuildL2ResultFromWalks_LLDP_NMS18541_TOPO_QFX_SW02(t *testing.T) {
1443 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1443 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1444 manifest, err := LoadManifest(manifestPath)
1445 require.NoError(t, err)
1446
@@ -1490,7 +1490,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_TOPO_QFX_SW02(t *testing.T) {
1490 }
1491
1492 func TestBuildL2ResultFromWalks_LLDP_NMS18541_TOPO_QFX_SW03(t *testing.T) {
1493 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1493 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1494 manifest, err := LoadManifest(manifestPath)
1495 require.NoError(t, err)
1496
@@ -1540,7 +1540,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_TOPO_QFX_SW03(t *testing.T) {
1540 }
1541
1542 func TestBuildL2ResultFromWalks_LLDP_NMS18541_TOPO_QFX_SW04(t *testing.T) {
1543 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1543 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1544 manifest, err := LoadManifest(manifestPath)
1545 require.NoError(t, err)
1546
@@ -1590,7 +1590,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_TOPO_QFX_SW04(t *testing.T) {
1590 }
1591
1592 func TestBuildL2ResultFromWalks_LLDP_NMS18541_TOPO_QFX_SW08(t *testing.T) {
1593 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1593 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1594 manifest, err := LoadManifest(manifestPath)
1595 require.NoError(t, err)
1596
@@ -1640,7 +1640,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_TOPO_QFX_SW08(t *testing.T) {
1640 }
1641
1642 func TestBuildL2ResultFromWalks_LLDP_NMS18541_TOPO_QFX_SW09(t *testing.T) {
1643 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1643 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1644 manifest, err := LoadManifest(manifestPath)
1645 require.NoError(t, err)
1646
@@ -1688,7 +1688,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_TOPO_QFX_SW09(t *testing.T) {
1688 }
1689
1690 func TestBuildL2ResultFromWalks_LLDP_NMS18541_QFX(t *testing.T) {
1691 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1691 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1692 manifest, err := LoadManifest(manifestPath)
1693 require.NoError(t, err)
1694
@@ -1747,7 +1747,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_QFX(t *testing.T) {
1747 }
1748
1749 func TestBuildL2ResultFromWalks_LLDP_NMS18541_MICROSENS_SW01(t *testing.T) {
1750 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1750 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1751 manifest, err := LoadManifest(manifestPath)
1752 require.NoError(t, err)
1753
@@ -1788,7 +1788,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_MICROSENS_SW01(t *testing.T) {
1788 }
1789
1790 func TestBuildL2ResultFromWalks_LLDP_NMS18541_MICROSENS_SW02(t *testing.T) {
1791 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1791 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1792 manifest, err := LoadManifest(manifestPath)
1793 require.NoError(t, err)
1794
@@ -1829,7 +1829,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_MICROSENS_SW02(t *testing.T) {
1829 }
1830
1831 func TestBuildL2ResultFromWalks_LLDP_NMS18541_MICROSENS_SW03(t *testing.T) {
1832 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1832 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1833 manifest, err := LoadManifest(manifestPath)
1834 require.NoError(t, err)
1835
@@ -1869,7 +1869,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_MICROSENS_SW03(t *testing.T) {
1869 }
1870
1871 func TestBuildL2ResultFromWalks_LLDP_NMS18541_MICROSENS_SW04(t *testing.T) {
1872 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1872 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1873 manifest, err := LoadManifest(manifestPath)
1874 require.NoError(t, err)
1875
@@ -1912,7 +1912,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_MICROSENS_SW04(t *testing.T) {
1912 }
1913
1914 func TestBuildL2ResultFromWalks_LLDP_NMS18541_MICROSENS_SW08(t *testing.T) {
1915 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1915 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1916 manifest, err := LoadManifest(manifestPath)
1917 require.NoError(t, err)
1918
@@ -1954,7 +1954,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_MICROSENS_SW08(t *testing.T) {
1954 }
1955
1956 func TestBuildL2ResultFromWalks_LLDP_NMS18541_MICROSENS_SW09(t *testing.T) {
1957 - manifestPath := "../../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1957 + manifestPath := "../../../testdata/snmp/enlinkd/nms18541/manifest.yaml"
1958 manifest, err := LoadManifest(manifestPath)
1959 require.NoError(t, err)
1960
@@ -2000,7 +2000,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS18541_MICROSENS_SW09(t *testing.T) {
2000 }
2001
2002 func TestBuildL2ResultFromWalks_CDP_NMS7467(t *testing.T) {
2003 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7467/manifest.yaml"
2003 + manifestPath := "../../../testdata/snmp/enlinkd/nms7467/manifest.yaml"
2004 manifest, err := LoadManifest(manifestPath)
2005 require.NoError(t, err)
2006
@@ -2058,7 +2058,7 @@ func TestBuildL2ResultFromWalks_CDP_NMS7467(t *testing.T) {
2058 }
2059
2060 func TestBuildL2ResultFromWalks_MIXED_NMS7563_CISCO01(t *testing.T) {
2061 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7563/manifest.yaml"
2061 + manifestPath := "../../../testdata/snmp/enlinkd/nms7563/manifest.yaml"
2062 manifest, err := LoadManifest(manifestPath)
2063 require.NoError(t, err)
2064
@@ -2092,7 +2092,7 @@ func TestBuildL2ResultFromWalks_MIXED_NMS7563_CISCO01(t *testing.T) {
2092 require.Equal(t, 1, countFixturesWithLLDPLocalElements(walks))
2093 require.Equal(t, 0, countBidirectionalPairs(final.Adjacencies, "lldp"))
2094
2095 - deviceByID := make(map[string]engine.Device, len(final.Devices))
2095 + deviceByID := make(map[string]l2topology.Device, len(final.Devices))
2096 for _, dev := range final.Devices {
2097 deviceByID[dev.ID] = dev
2098 }
@@ -2118,7 +2118,7 @@ func TestBuildL2ResultFromWalks_MIXED_NMS7563_CISCO01(t *testing.T) {
2118 }
2119
2120 func TestBuildL2ResultFromWalks_LLDP_NMS7563_HOMESERVER(t *testing.T) {
2121 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7563/manifest.yaml"
2121 + manifestPath := "../../../testdata/snmp/enlinkd/nms7563/manifest.yaml"
2122 manifest, err := LoadManifest(manifestPath)
2123 require.NoError(t, err)
2124
@@ -2146,7 +2146,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS7563_HOMESERVER(t *testing.T) {
2146 require.Equal(t, 0, final.Stats["links_cdp"])
2147 require.Equal(t, 1, countFixturesWithLLDPLocalElements(walks))
2148
2149 - deviceByID := make(map[string]engine.Device, len(final.Devices))
2149 + deviceByID := make(map[string]l2topology.Device, len(final.Devices))
2150 for _, dev := range final.Devices {
2151 deviceByID[dev.ID] = dev
2152 }
@@ -2173,7 +2173,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS7563_HOMESERVER(t *testing.T) {
2173 }
2174
2175 func TestBuildL2ResultFromWalks_CDP_NMS7563_SWITCH02(t *testing.T) {
2176 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7563/manifest.yaml"
2176 + manifestPath := "../../../testdata/snmp/enlinkd/nms7563/manifest.yaml"
2177 manifest, err := LoadManifest(manifestPath)
2178 require.NoError(t, err)
2179
@@ -2206,7 +2206,7 @@ func TestBuildL2ResultFromWalks_CDP_NMS7563_SWITCH02(t *testing.T) {
2206 require.Equal(t, 0, final.Stats["links_lldp"])
2207 require.Equal(t, map[string]int{"switch02": 3}, countAdjacenciesBySource(final.Adjacencies, "cdp"))
2208
2209 - deviceByID := make(map[string]engine.Device, len(final.Devices))
2209 + deviceByID := make(map[string]l2topology.Device, len(final.Devices))
2210 for _, dev := range final.Devices {
2211 deviceByID[dev.ID] = dev
2212 }
@@ -2253,7 +2253,7 @@ func TestBuildL2ResultFromWalks_CDP_NMS7563_SWITCH02(t *testing.T) {
2253 }
2254
2255 func TestBuildL2ResultFromWalks_LLDP_NMS7777DW_NO_LINKS(t *testing.T) {
2256 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7777dw/manifest.yaml"
2256 + manifestPath := "../../../testdata/snmp/enlinkd/nms7777dw/manifest.yaml"
2257 manifest, err := LoadManifest(manifestPath)
2258 require.NoError(t, err)
2259
@@ -2304,7 +2304,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS7777DW_NO_LINKS(t *testing.T) {
2304 }
2305
2306 func TestBuildL2ResultFromWalks_LLDP_NMS13923(t *testing.T) {
2307 - manifestPath := "../../../../testdata/snmp/enlinkd/nms13923/manifest.yaml"
2307 + manifestPath := "../../../testdata/snmp/enlinkd/nms13923/manifest.yaml"
2308 manifest, err := LoadManifest(manifestPath)
2309 require.NoError(t, err)
2310
@@ -2367,7 +2367,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS13923(t *testing.T) {
2367 }
2368
2369 func TestBuildL2ResultFromWalks_LLDP_NMS13593(t *testing.T) {
2370 - manifestPath := "../../../../testdata/snmp/enlinkd/nms13593/manifest.yaml"
2370 + manifestPath := "../../../testdata/snmp/enlinkd/nms13593/manifest.yaml"
2371 manifest, err := LoadManifest(manifestPath)
2372 require.NoError(t, err)
2373
@@ -2400,7 +2400,7 @@ func TestBuildL2ResultFromWalks_LLDP_NMS13593(t *testing.T) {
2400 require.Len(t, step2.Adjacencies, 7)
2401 require.Equal(t, 0, countBidirectionalPairs(step2.Adjacencies, "lldp"))
2402
2403 - localByID := make(map[string]engine.Device)
2403 + localByID := make(map[string]l2topology.Device)
2404 for _, dev := range step2.Devices {
2405 if dev.ID != "ZHBGO1Zsr001" && dev.ID != "ZHBGO1Zsr002" {
2406 continue
@@ -2611,7 +2611,7 @@ func TestBuildL2ResultFromWalks_ARPEnrichment(t *testing.T) {
2611 }
2612
2613 func TestParseCDPInterfaceGetter_NMS0002_RPICT001(t *testing.T) {
2614 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms0002UkRoFakeLink/r-ro-suce-pict-001.txt")
2614 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms0002UkRoFakeLink/r-ro-suce-pict-001.txt")
2615 require.NoError(t, err)
2616
2617 require.Equal(t, "FastEthernet0", mustLookupWalkValue(t, ds, "1.3.6.1.4.1.9.9.23.1.1.1.1.6.1"))
@@ -2632,7 +2632,7 @@ func TestParseCDPInterfaceGetter_NMS0002_RPICT001(t *testing.T) {
2632 }
2633
2634 func TestParseCDPGlobalGroup_NMS0002_RPICT001(t *testing.T) {
2635 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms0002UkRoFakeLink/r-ro-suce-pict-001.txt")
2635 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms0002UkRoFakeLink/r-ro-suce-pict-001.txt")
2636 require.NoError(t, err)
2637
2638 require.Equal(t, "r-ro-suce-pict-001.infra.u-ssi.net", mustLookupWalkValue(t, ds, "1.3.6.1.4.1.9.9.23.1.3.4.0"))
@@ -2642,7 +2642,7 @@ func TestParseCDPGlobalGroup_NMS0002_RPICT001(t *testing.T) {
2642 }
2643
2644 func TestParseCDPGlobalGroupWithDeviceFormat_NMS7467_CISCO_SWITCH(t *testing.T) {
2645 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms7467/192.0.2.7-walk.txt")
2645 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms7467/192.0.2.7-walk.txt")
2646 require.NoError(t, err)
2647
2648 require.Equal(t, "JAB043408B7", mustLookupWalkValue(t, ds, "1.3.6.1.4.1.9.9.23.1.3.4.0"))
@@ -2651,14 +2651,14 @@ func TestParseCDPGlobalGroupWithDeviceFormat_NMS7467_CISCO_SWITCH(t *testing.T)
2651 }
2652
2653 func TestParseCDPCacheTable_NMS0002_RPICT001(t *testing.T) {
2654 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms0002UkRoFakeLink/r-ro-suce-pict-001.txt")
2654 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms0002UkRoFakeLink/r-ro-suce-pict-001.txt")
2655 require.NoError(t, err)
2656
2657 require.Equal(t, 14, countCDPCacheRows(ds))
2658 }
2659
2660 func TestParseLLDPLocalGroup_NMS17216_SWITCH1(t *testing.T) {
2661 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms17216/switch1-walk.txt")
2661 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms17216/switch1-walk.txt")
2662 require.NoError(t, err)
2663
2664 require.Equal(t, "0016c8bd4d80", compactHexToken(mustLookupWalkValue(t, ds, "1.0.8802.1.1.2.1.3.2.0")))
@@ -2667,7 +2667,7 @@ func TestParseLLDPLocalGroup_NMS17216_SWITCH1(t *testing.T) {
2667 }
2668
2669 func TestParseLLDPLocGetter_NMS17216_SWITCH1(t *testing.T) {
2670 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms17216/switch1-walk.txt")
2670 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms17216/switch1-walk.txt")
2671 require.NoError(t, err)
2672
2673 val9 := lldpLocPortTriplet(t, ds, "9")
@@ -2684,7 +2684,7 @@ func TestParseLLDPLocGetter_NMS17216_SWITCH1(t *testing.T) {
2684 }
2685
2686 func TestParseLLDPLocGetter_NMS17216_SWITCH2(t *testing.T) {
2687 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms17216/switch2-walk.txt")
2687 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms17216/switch2-walk.txt")
2688 require.NoError(t, err)
2689
2690 val1 := lldpLocPortTriplet(t, ds, "1")
@@ -2701,7 +2701,7 @@ func TestParseLLDPLocGetter_NMS17216_SWITCH2(t *testing.T) {
2701 }
2702
2703 func TestParseLLDPRemTable_NMS17216_SWITCH1(t *testing.T) {
2704 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms17216/switch1-walk.txt")
2704 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms17216/switch1-walk.txt")
2705 require.NoError(t, err)
2706
2707 rows := collectLLDPRemoteRows(ds)
@@ -2715,7 +2715,7 @@ func TestParseLLDPRemTable_NMS17216_SWITCH1(t *testing.T) {
2715 }
2716
2717 func TestParseLLDPRemoteTableWithLocLookup_NMS17216_SWITCH2(t *testing.T) {
2718 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms17216/switch2-walk.txt")
2718 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms17216/switch2-walk.txt")
2719 require.NoError(t, err)
2720
2721 rows := collectLLDPRemoteRows(ds)
@@ -2747,10 +2747,10 @@ func TestParseLLDPRemoteTableWithLocLookup_NMS17216_SWITCH2(t *testing.T) {
2747 }
2748
2749 func TestParseTimeTetraLLDPVendorRows_NMS13593(t *testing.T) {
2750 - ds1, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms13593/srv001-walk.txt")
2750 + ds1, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms13593/srv001-walk.txt")
2751 require.NoError(t, err)
2752
2753 - ds2, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms13593/srv002-walk.txt")
2753 + ds2, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms13593/srv002-walk.txt")
2754 require.NoError(t, err)
2755
2756 require.Equal(t, "24:21:24:ec:e2:3f", normalizeHexToken(mustLookupWalkValue(t, ds1, "1.0.8802.1.1.2.1.3.2.0")))
@@ -2795,7 +2795,7 @@ func TestParseTimeTetraLLDPVendorRows_NMS13593(t *testing.T) {
2795 }
2796
2797 func TestParseTimeTetraLLDPVendorRows_NMS13923_SRV005(t *testing.T) {
2798 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms13923/srv005.txt")
2798 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms13923/srv005.txt")
2799 require.NoError(t, err)
2800
2801 require.Equal(t, "00:16:4d:dd:d5:5b", normalizeHexToken(mustLookupWalkValue(t, ds, "1.0.8802.1.1.2.1.3.2.0")))
@@ -2825,7 +2825,7 @@ func TestParseTimeTetraLLDPVendorRows_NMS13923_SRV005(t *testing.T) {
2825 }
2826
2827 func TestBuildL2ResultFromWalks_ARP_NMS102(t *testing.T) {
2828 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms102/mikrotik-192.168.0.1-walk.txt")
2828 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms102/mikrotik-192.168.0.1-walk.txt")
2829 require.NoError(t, err)
2830
2831 result, err := BuildL2ResultFromWalks([]FixtureWalk{
@@ -2886,7 +2886,7 @@ func TestBuildL2ResultFromWalks_ARP_NMS102(t *testing.T) {
2886 },
2887 }
2888
2889 - actualByIP := make(map[string]engine.Enrichment, len(result.Enrichments))
2889 + actualByIP := make(map[string]l2topology.Enrichment, len(result.Enrichments))
2890 for _, enrichment := range result.Enrichments {
2891 require.Len(t, enrichment.IPs, 1)
2892 actualByIP[enrichment.IPs[0].String()] = enrichment
@@ -2908,7 +2908,7 @@ func TestBuildL2ResultFromWalks_ARP_NMS102(t *testing.T) {
2908 }
2909
2910 func TestParseBridgeBaseWalk_NMS4930(t *testing.T) {
2911 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms4930/dlink_DES-3026.properties")
2911 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms4930/dlink_DES-3026.properties")
2912 require.NoError(t, err)
2913
2914 require.Equal(t, "00:1e:58:a3:2f:cd", normalizeHexToken(mustLookupWalkValue(t, ds, "1.3.6.1.2.1.17.1.1.0")))
@@ -2922,7 +2922,7 @@ func TestParseBridgeBaseWalk_NMS4930(t *testing.T) {
2922 }
2923
2924 func TestParseBridgeBasePortTable_NMS4930(t *testing.T) {
2925 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms4930/dlink_DES-3026.properties")
2925 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms4930/dlink_DES-3026.properties")
2926 require.NoError(t, err)
2927
2928 rows := ds.Prefix("1.3.6.1.2.1.17.1.4.1.2.")
@@ -2939,7 +2939,7 @@ func TestParseBridgeBasePortTable_NMS4930(t *testing.T) {
2939 }
2940
2941 func TestParseBridgeStpPortTable_NMS4930(t *testing.T) {
2942 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms4930/dlink_DES-3026.properties")
2942 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms4930/dlink_DES-3026.properties")
2943 require.NoError(t, err)
2944 require.Len(t, ds.Prefix("1.3.6.1.2.1.17.2.15.1.3."), 26)
2945
@@ -2963,7 +2963,7 @@ func TestParseBridgeStpPortTable_NMS4930(t *testing.T) {
2963 }
2964
2965 func TestBuildL2ResultFromWalks_FDB_NMS4930(t *testing.T) {
2966 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms4930/dlink_DES-3026.properties")
2966 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms4930/dlink_DES-3026.properties")
2967 require.NoError(t, err)
2968
2969 result, err := BuildL2ResultFromWalks([]FixtureWalk{
@@ -3013,7 +3013,7 @@ func TestBuildL2ResultFromWalks_FDB_NMS4930(t *testing.T) {
3013 }
3014
3015 func TestBuildL2ResultFromWalks_BRIDGE_NMS4930_DLINK1(t *testing.T) {
3016 - manifestPath := "../../../../testdata/snmp/enlinkd/nms4930/manifest.yaml"
3016 + manifestPath := "../../../testdata/snmp/enlinkd/nms4930/manifest.yaml"
3017 manifest, err := LoadManifest(manifestPath)
3018 require.NoError(t, err)
3019
@@ -3047,7 +3047,7 @@ func TestBuildL2ResultFromWalks_BRIDGE_NMS4930_DLINK1(t *testing.T) {
3047 }
3048
3049 func TestBuildL2ResultFromWalks_BRIDGE_NMS4930_DLINK2(t *testing.T) {
3050 - manifestPath := "../../../../testdata/snmp/enlinkd/nms4930/manifest.yaml"
3050 + manifestPath := "../../../testdata/snmp/enlinkd/nms4930/manifest.yaml"
3051 manifest, err := LoadManifest(manifestPath)
3052 require.NoError(t, err)
3053
@@ -3081,10 +3081,10 @@ func TestBuildL2ResultFromWalks_BRIDGE_NMS4930_DLINK2(t *testing.T) {
3081 }
3082
3083 func TestParseBridgeDot1qTpFdbTable_NMS4930(t *testing.T) {
3084 - ds1, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms4930/dlink_DES-3026.properties")
3084 + ds1, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms4930/dlink_DES-3026.properties")
3085 require.NoError(t, err)
3086
3087 - ds2, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/upstream/linkd/nms4930/dlink_DGS-3612G.properties")
3087 + ds2, err := LoadWalkFile("../../../testdata/snmp/enlinkd/upstream/linkd/nms4930/dlink_DGS-3612G.properties")
3088 require.NoError(t, err)
3089
3090 macs1 := buildDot1qMacPortMap(ds1)
@@ -3097,7 +3097,7 @@ func TestParseBridgeDot1qTpFdbTable_NMS4930(t *testing.T) {
3097 }
3098
3099 func TestBuildL2ResultFromWalks_BRIDGE_NMS7918_ASW01(t *testing.T) {
3100 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7918/manifest.yaml"
3100 + manifestPath := "../../../testdata/snmp/enlinkd/nms7918/manifest.yaml"
3101 manifest, err := LoadManifest(manifestPath)
3102 require.NoError(t, err)
3103
@@ -3153,7 +3153,7 @@ func TestBuildL2ResultFromWalks_BRIDGE_NMS7918_ASW01(t *testing.T) {
3153 }
3154
3155 func TestBuildL2ResultFromWalks_BRIDGE_NMS7918_SAMASW01(t *testing.T) {
3156 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7918/manifest.yaml"
3156 + manifestPath := "../../../testdata/snmp/enlinkd/nms7918/manifest.yaml"
3157 manifest, err := LoadManifest(manifestPath)
3158 require.NoError(t, err)
3159
@@ -3209,7 +3209,7 @@ func TestBuildL2ResultFromWalks_BRIDGE_NMS7918_SAMASW01(t *testing.T) {
3209 }
3210
3211 func TestBuildL2ResultFromWalks_BRIDGE_NMS7918_STCASW01(t *testing.T) {
3212 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7918/manifest.yaml"
3212 + manifestPath := "../../../testdata/snmp/enlinkd/nms7918/manifest.yaml"
3213 manifest, err := LoadManifest(manifestPath)
3214 require.NoError(t, err)
3215
@@ -3265,7 +3265,7 @@ func TestBuildL2ResultFromWalks_BRIDGE_NMS7918_STCASW01(t *testing.T) {
3265 }
3266
3267 func TestBuildL2ResultFromWalks_ARP_NMS7918_OSPWL01(t *testing.T) {
3268 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7918/manifest.yaml"
3268 + manifestPath := "../../../testdata/snmp/enlinkd/nms7918/manifest.yaml"
3269 manifest, err := LoadManifest(manifestPath)
3270 require.NoError(t, err)
3271
@@ -3316,7 +3316,7 @@ func TestBuildL2ResultFromWalks_ARP_NMS7918_OSPWL01(t *testing.T) {
3316 }
3317
3318 func TestBuildL2ResultFromWalks_ARP_NMS7918_OSPESS01(t *testing.T) {
3319 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7918/manifest.yaml"
3319 + manifestPath := "../../../testdata/snmp/enlinkd/nms7918/manifest.yaml"
3320 manifest, err := LoadManifest(manifestPath)
3321 require.NoError(t, err)
3322
@@ -3381,7 +3381,7 @@ func TestBuildL2ResultFromWalks_ARP_NMS7918_OSPESS01(t *testing.T) {
3381 }
3382
3383 func TestBuildL2ResultFromWalks_ARP_NMS7918_PE01(t *testing.T) {
3384 - manifestPath := "../../../../testdata/snmp/enlinkd/nms7918/manifest.yaml"
3384 + manifestPath := "../../../testdata/snmp/enlinkd/nms7918/manifest.yaml"
3385 manifest, err := LoadManifest(manifestPath)
3386 require.NoError(t, err)
3387
@@ -3653,10 +3653,10 @@ func timeTetraLocalPortRowsByIfIndex(t *testing.T, ds WalkDataset, ifIndex int)
3653 return rows
3654 }
3655
3656 -func buildResultFromScenarioPrefix(scenario ResolvedScenario, prefixLen int, opts BuildOptions) (engine.Result, error) {
3656 +func buildResultFromScenarioPrefix(scenario ResolvedScenario, prefixLen int, opts BuildOptions) (l2topology.Result, error) {
3657 walks, err := loadScenarioWalkPrefix(scenario, prefixLen)
3658 if err != nil {
3659 - return engine.Result{}, err
3659 + return l2topology.Result{}, err
3660 }
3661
3662 return BuildL2ResultFromWalks(walks, opts)
@@ -3685,7 +3685,7 @@ func loadScenarioWalkPrefix(scenario ResolvedScenario, prefixLen int) ([]Fixture
3685 return walks, nil
3686 }
3687
3688 -func countAdjacenciesBySource(adjacencies []engine.Adjacency, protocol string) map[string]int {
3688 +func countAdjacenciesBySource(adjacencies []l2topology.Adjacency, protocol string) map[string]int {
3689 out := make(map[string]int)
3690 for _, adj := range adjacencies {
3691 if adj.Protocol != protocol {
@@ -3806,7 +3806,7 @@ func collectLLDPRemoteRows(ds WalkDataset) map[string]map[int]string {
3806 return rows
3807 }
3808
3809 -func adjacencyKeySet(adjacencies []engine.Adjacency) map[string]struct{} {
3809 +func adjacencyKeySet(adjacencies []l2topology.Adjacency) map[string]struct{} {
3810 out := make(map[string]struct{}, len(adjacencies))
3811 for _, adj := range adjacencies {
3812 key := fmt.Sprintf("%s|%s|%s|%s|%s", adj.Protocol, adj.SourceID, adj.SourcePort, adj.TargetID, adj.TargetPort)
@@ -3815,7 +3815,7 @@ func adjacencyKeySet(adjacencies []engine.Adjacency) map[string]struct{} {
3815 return out
3816 }
3817
3818 -func countBidirectionalPairs(adjacencies []engine.Adjacency, protocol string) int {
3818 +func countBidirectionalPairs(adjacencies []l2topology.Adjacency, protocol string) int {
3819 directed := make(map[string]struct{}, len(adjacencies))
3820 for _, adj := range adjacencies {
3821 if adj.Protocol != protocol {
@@ -3852,7 +3852,7 @@ func countBidirectionalPairs(adjacencies []engine.Adjacency, protocol string) in
3852 return pairs
3853 }
3854
3855 -func countMutualLocalAdjacencyEdges(adjacencies []engine.Adjacency, protocol string, localDevices map[string]struct{}) int {
3855 +func countMutualLocalAdjacencyEdges(adjacencies []l2topology.Adjacency, protocol string, localDevices map[string]struct{}) int {
3856 directedCounts := make(map[string]int)
3857 for _, adj := range adjacencies {
3858 if adj.Protocol != protocol || adj.SourceID == adj.TargetID {
@@ -3897,8 +3897,8 @@ func countMutualLocalAdjacencyEdges(adjacencies []engine.Adjacency, protocol str
3897 return edges
3898 }
3899
3900 -func enrichmentByMAC(enrichments []engine.Enrichment) map[string]engine.Enrichment {
3901 - byMAC := make(map[string]engine.Enrichment, len(enrichments))
3900 +func enrichmentByMAC(enrichments []l2topology.Enrichment) map[string]l2topology.Enrichment {
3901 + byMAC := make(map[string]l2topology.Enrichment, len(enrichments))
3902 for _, enrichment := range enrichments {
3903 if enrichment.MAC == "" {
3904 continue
@@ -3908,14 +3908,14 @@ func enrichmentByMAC(enrichments []engine.Enrichment) map[string]engine.Enrichme
3908 return byMAC
3909 }
3910
3911 -func mustEnrichmentByMAC(t *testing.T, byMAC map[string]engine.Enrichment, mac string) engine.Enrichment {
3911 +func mustEnrichmentByMAC(t *testing.T, byMAC map[string]l2topology.Enrichment, mac string) l2topology.Enrichment {
3912 t.Helper()
3913 enrichment, ok := byMAC[mac]
3914 require.True(t, ok, "missing enrichment for mac=%s", mac)
3915 return enrichment
3916 }
3917
3918 -func enrichmentContainsIP(enrichment engine.Enrichment, ip string) bool {
3918 +func enrichmentContainsIP(enrichment l2topology.Enrichment, ip string) bool {
3919 for _, addr := range enrichment.IPs {
3920 if addr.String() == ip {
3921 return true
@@ -3924,7 +3924,7 @@ func enrichmentContainsIP(enrichment engine.Enrichment, ip string) bool {
3924 return false
3925 }
3926
3927 -func countEnrichmentIPs(enrichments []engine.Enrichment) int {
3927 +func countEnrichmentIPs(enrichments []l2topology.Enrichment) int {
3928 total := 0
3929 for _, enrichment := range enrichments {
3930 total += len(enrichment.IPs)
@@ -3932,7 +3932,7 @@ func countEnrichmentIPs(enrichments []engine.Enrichment) int {
3932 return total
3933 }
3934
3935 -func countUndirectedLocalDevicePairs(adjacencies []engine.Adjacency, protocol string, localDevices map[string]struct{}) int {
3935 +func countUndirectedLocalDevicePairs(adjacencies []l2topology.Adjacency, protocol string, localDevices map[string]struct{}) int {
3936 pairs := make(map[string]struct{})
3937 for _, adj := range adjacencies {
3938 if adj.Protocol != protocol || adj.SourceID == adj.TargetID {
@@ -3953,7 +3953,7 @@ func countUndirectedLocalDevicePairs(adjacencies []engine.Adjacency, protocol st
3953 return len(pairs)
3954 }
3955
3956 -func countLocalTopologyVertices(adjacencies []engine.Adjacency, protocol string, localDevices map[string]struct{}) int {
3956 +func countLocalTopologyVertices(adjacencies []l2topology.Adjacency, protocol string, localDevices map[string]struct{}) int {
3957 vertices := make(map[string]struct{})
3958 for _, adj := range adjacencies {
3959 if adj.Protocol != protocol || adj.SourceID == adj.TargetID {
src/go/pkg/l2topology/parity/manifest.go renamed
src/go/pkg/l2topology/parity/manifest_fixture_test.go renamed
+1 -1
@@ -12,7 +12,7 @@ import (
12 )
13
14 func TestLoadAndResolveManifest(t *testing.T) {
15 - manifestPath := "../../../../testdata/snmp/enlinkd/nms8003/manifest.yaml"
15 + manifestPath := "../../../testdata/snmp/enlinkd/nms8003/manifest.yaml"
16
17 manifest, err := LoadManifest(manifestPath)
18 require.NoError(t, err)
src/go/pkg/l2topology/parity/manifest_test.go renamed
src/go/pkg/l2topology/parity/node_topology_parity_test.go renamed
+12 -12
@@ -13,7 +13,7 @@ import (
13 "strings"
14 "testing"
15
16 - "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
16 + "github.com/netdata/netdata/go/plugins/pkg/l2topology"
17 "github.com/stretchr/testify/require"
18 )
19
@@ -88,7 +88,7 @@ type nodeTopologyCIDRExpectation struct {
88
89 func loadNodeTopologyFixtureDocument(t *testing.T) nodeTopologyFixtureDocument {
90 t.Helper()
91 - path := filepath.Join("../../../../testdata/snmp/enlinkd", "node_topology", "scenarios.json")
91 + path := filepath.Join("../../../testdata/snmp/enlinkd", "node_topology", "scenarios.json")
92 data, err := os.ReadFile(path)
93 require.NoError(t, err)
94
@@ -99,12 +99,12 @@ func loadNodeTopologyFixtureDocument(t *testing.T) nodeTopologyFixtureDocument {
99 return doc
100 }
101
102 -func scenarioToService(t *testing.T, scenario nodeTopologyScenario) *engine.NodeTopologyService {
102 +func scenarioToService(t *testing.T, scenario nodeTopologyScenario) *l2topology.NodeTopologyService {
103 t.Helper()
104
105 - nodes := make([]engine.NodeTopologyEntity, 0, len(scenario.Nodes))
105 + nodes := make([]l2topology.NodeTopologyEntity, 0, len(scenario.Nodes))
106 for _, node := range scenario.Nodes {
107 - entry := engine.NodeTopologyEntity{
107 + entry := l2topology.NodeTopologyEntity{
108 ID: node.ID,
109 Label: node.Label,
110 SysObject: node.SysObject,
@@ -116,9 +116,9 @@ func scenarioToService(t *testing.T, scenario nodeTopologyScenario) *engine.Node
116 nodes = append(nodes, entry)
117 }
118
119 - ips := make([]engine.IPInterfaceTopologyEntity, 0, len(scenario.IPs))
119 + ips := make([]l2topology.IPInterfaceTopologyEntity, 0, len(scenario.IPs))
120 for _, ip := range scenario.IPs {
121 - entry := engine.IPInterfaceTopologyEntity{
121 + entry := l2topology.IPInterfaceTopologyEntity{
122 ID: ip.ID,
123 NodeID: ip.NodeID,
124 IsManaged: ip.IsManaged,
@@ -135,9 +135,9 @@ func scenarioToService(t *testing.T, scenario nodeTopologyScenario) *engine.Node
135 ips = append(ips, entry)
136 }
137
138 - snmp := make([]engine.SnmpInterfaceTopologyEntity, 0, len(scenario.SNMP))
138 + snmp := make([]l2topology.SnmpInterfaceTopologyEntity, 0, len(scenario.SNMP))
139 for _, iface := range scenario.SNMP {
140 - snmp = append(snmp, engine.SnmpInterfaceTopologyEntity{
140 + snmp = append(snmp, l2topology.SnmpInterfaceTopologyEntity{
141 ID: iface.ID,
142 NodeID: iface.NodeID,
143 IfIndex: iface.IfIndex,
@@ -146,7 +146,7 @@ func scenarioToService(t *testing.T, scenario nodeTopologyScenario) *engine.Node
146 })
147 }
148
149 - return engine.NewNodeTopologyService(nodes, ips, snmp)
149 + return l2topology.NewNodeTopologyService(nodes, ips, snmp)
150 }
151
152 func parseOptionalAddr(value string) (netip.Addr, bool) {
@@ -236,7 +236,7 @@ func runNodeTopologyScenarioParity(t *testing.T, scenarioName string) {
236 }
237 }
238
239 - topology := engine.BuildNetworkRouterTopology(service, 30, 126)
239 + topology := l2topology.BuildNetworkRouterTopology(service, 30, 126)
240 if expect.TopologyVertices != nil {
241 require.Len(t, topology.Vertices, *expect.TopologyVertices)
242 } else if expect.MultiBet != nil {
@@ -323,7 +323,7 @@ func TestNms0001EnIT_testLinkdNetworkTopologyUpdater(t *testing.T) {
323 require.True(t, ok)
324
325 service := scenarioToService(t, scenario)
326 - topology := engine.BuildNetworkRouterTopology(service, 30, 126)
326 + topology := l2topology.BuildNetworkRouterTopology(service, 30, 126)
327 require.NotEmpty(t, topology.Vertices)
328 require.Len(t, topology.Vertices, *scenario.Expect.TopologyVertices)
329 require.Len(t, topology.Edges, *scenario.Expect.TopologyEdges)
src/go/pkg/l2topology/parity/walk.go renamed
src/go/pkg/l2topology/parity/walk_fixture_test.go renamed
+1 -1
@@ -11,7 +11,7 @@ import (
11 )
12
13 func TestLoadWalkFile_NMS8003Fixture(t *testing.T) {
14 - ds, err := LoadWalkFile("../../../../testdata/snmp/enlinkd/nms8003/fixtures/NMM-R1.snmpwalk.txt")
14 + ds, err := LoadWalkFile("../../../testdata/snmp/enlinkd/nms8003/fixtures/NMM-R1.snmpwalk.txt")
15 require.NoError(t, err)
16 require.NotEmpty(t, ds.Records)
17
src/go/pkg/l2topology/parity/walk_test.go renamed
src/go/pkg/l2topology/runtime.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "context"
src/go/pkg/l2topology/runtime_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "context"
src/go/pkg/l2topology/topology_adapter.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "net/netip"
src/go/pkg/l2topology/topology_adapter_actor_collapse.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_bridge_links.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_bridge_links_deterministic.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import "strings"
6
src/go/pkg/l2topology/topology_adapter_bridge_links_observation.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "strconv"
src/go/pkg/l2topology/topology_adapter_bridge_ports.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "strconv"
src/go/pkg/l2topology/topology_adapter_bridge_ports_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "testing"
src/go/pkg/l2topology/topology_adapter_builder.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "strings"
src/go/pkg/l2topology/topology_adapter_collections.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "maps"
src/go/pkg/l2topology/topology_adapter_collections_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "net/netip"
src/go/pkg/l2topology/topology_adapter_device_actor.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "strings"
src/go/pkg/l2topology/topology_adapter_device_endpoint.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "strconv"
src/go/pkg/l2topology/topology_adapter_device_summary.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "math"
src/go/pkg/l2topology/topology_adapter_device_summary_builder.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 type deviceInterfaceCollector struct {
6 ifIndexes map[string]struct{}
src/go/pkg/l2topology/topology_adapter_device_summary_collect.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "strconv"
src/go/pkg/l2topology/topology_adapter_device_summary_neighbors.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_device_summary_port_evidence.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_device_summary_render.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import "strings"
6
src/go/pkg/l2topology/topology_adapter_device_summary_summaries.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_device_summary_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "testing"
src/go/pkg/l2topology/topology_adapter_device_types.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import "strings"
6
src/go/pkg/l2topology/topology_adapter_devices.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import "github.com/netdata/netdata/go/plugins/pkg/topology"
6
src/go/pkg/l2topology/topology_adapter_devices_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "net/netip"
src/go/pkg/l2topology/topology_adapter_display.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "strings"
src/go/pkg/l2topology/topology_adapter_display_attrs.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "math"
src/go/pkg/l2topology/topology_adapter_display_segment.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "strings"
src/go/pkg/l2topology/topology_adapter_endpoint_device_hints.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_endpoint_device_hints_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "testing"
src/go/pkg/l2topology/topology_adapter_endpoints.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "net/netip"
src/go/pkg/l2topology/topology_adapter_fdb.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_fdb_inference.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_fdb_owners.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_identity.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_identity_assignment.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "fmt"
src/go/pkg/l2topology/topology_adapter_identity_assignment_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "testing"
src/go/pkg/l2topology/topology_adapter_projection.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import "github.com/netdata/netdata/go/plugins/pkg/topology"
6
src/go/pkg/l2topology/topology_adapter_projection_pairs.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "strings"
src/go/pkg/l2topology/topology_adapter_pruning.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_regression_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "testing"
src/go/pkg/l2topology/topology_adapter_reporter_hints.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_segment_actor.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_segment_hints.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_segments.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_segments_builder.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "time"
src/go/pkg/l2topology/topology_adapter_segments_builder_assignment.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "strconv"
src/go/pkg/l2topology/topology_adapter_segments_builder_emit.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_segments_builder_init.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "sort"
src/go/pkg/l2topology/topology_adapter_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "net/netip"
src/go/pkg/l2topology/topology_updater.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import "sync"
6
src/go/pkg/l2topology/topology_updater_test.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "errors"
src/go/pkg/l2topology/types.go renamed
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -package engine
3 +package l2topology
4
5 import (
6 "net/netip"
src/go/pkg/topology/engine/doc.go deleted
-5
@@ -1,5 +0,0 @@
1 -// SPDX-License-Identifier: GPL-3.0-or-later
2 -
3 -// Package engine provides a reusable topology discovery interface that can be
4 -// shared by multiple collectors and services.
5 -package engine
src/go/plugin/go.d/collector/snmp_topology/collector.go
+1 -1
@@ -10,7 +10,7 @@ import (
10
11 "github.com/gosnmp/gosnmp"
12
13 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
13 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
14
15 "github.com/netdata/netdata/go/plugins/pkg/funcapi"
16 "github.com/netdata/netdata/go/plugins/plugin/framework/collectorapi"
src/go/plugin/go.d/collector/snmp_topology/func_topology_v1.go
+1 -1
@@ -12,7 +12,7 @@ import (
12 "strings"
13 "time"
14
15 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
15 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
16 topologyv1 "github.com/netdata/netdata/go/plugins/pkg/topology/v1"
17 )
18
src/go/plugin/go.d/collector/snmp_topology/topology_cache_test.go
+1 -1
@@ -9,7 +9,7 @@ import (
9 "testing"
10 "time"
11
12 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
12 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
13 "github.com/netdata/netdata/go/plugins/plugin/go.d/collector/snmp/ddsnmp"
14 "github.com/stretchr/testify/assert"
15 "github.com/stretchr/testify/require"
src/go/plugin/go.d/collector/snmp_topology/topology_local_actor.go
+1 -1
@@ -2,7 +2,7 @@
2
3 package snmptopology
4
5 -import topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
5 +import topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
6
7 func augmentLocalActorFromCache(data *topologyData, local topologyDevice) {
8 if data == nil || len(data.Actors) == 0 {
src/go/plugin/go.d/collector/snmp_topology/topology_observation_identity.go
+1 -1
@@ -6,7 +6,7 @@ import (
6 "fmt"
7 "strings"
8
9 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
9 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
10 )
11
12 type topologyObservationIdentityResolver struct {
src/go/plugin/go.d/collector/snmp_topology/topology_observation_identity_test.go
+1 -1
@@ -5,7 +5,7 @@ package snmptopology
5 import (
6 "testing"
7
8 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
8 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
9 "github.com/stretchr/testify/require"
10 )
11
src/go/plugin/go.d/collector/snmp_topology/topology_observation_local.go
+1 -1
@@ -5,7 +5,7 @@ package snmptopology
5 import (
6 "strings"
7
8 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
8 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
9 )
10
11 func (c *topologyCache) buildEngineObservation(local topologyDevice) topologyengine.L2Observation {
src/go/plugin/go.d/collector/snmp_topology/topology_observation_local_forwarding.go
+1 -1
@@ -7,7 +7,7 @@ import (
7 "strconv"
8 "strings"
9
10 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
10 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
11 )
12
13 func (c *topologyCache) appendObservedFDBEntries(observation *topologyengine.L2Observation) {
src/go/plugin/go.d/collector/snmp_topology/topology_observation_local_interfaces.go
+1 -1
@@ -6,7 +6,7 @@ import (
6 "sort"
7 "strings"
8
9 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
9 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
10 )
11
12 func (c *topologyCache) appendObservedInterfaces(observation *topologyengine.L2Observation) {
src/go/plugin/go.d/collector/snmp_topology/topology_observation_local_neighbors.go
+1 -1
@@ -6,7 +6,7 @@ import (
6 "sort"
7 "strings"
8
9 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
9 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
10 )
11
12 func (c *topologyCache) appendObservedLLDPRemotes(observation *topologyengine.L2Observation) {
src/go/plugin/go.d/collector/snmp_topology/topology_observation_remote.go
+1 -1
@@ -6,7 +6,7 @@ import (
6 "sort"
7 "strings"
8
9 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
9 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
10 )
11
12 type topologyRemoteObservationBuilder struct {
src/go/plugin/go.d/collector/snmp_topology/topology_observation_remote_cdp.go
+1 -1
@@ -6,7 +6,7 @@ import (
6 "sort"
7 "strings"
8
9 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
9 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
10 )
11
12 func (b *topologyRemoteObservationBuilder) collectCDPRemoteObservations() {
src/go/plugin/go.d/collector/snmp_topology/topology_observation_remote_identity.go
+1 -1
@@ -5,7 +5,7 @@ package snmptopology
5 import (
6 "strings"
7
8 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
8 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
9 )
10
11 func (b *topologyRemoteObservationBuilder) updateRemoteIdentity(deviceID, managementIP, chassisID string) {
src/go/plugin/go.d/collector/snmp_topology/topology_observation_remote_lldp.go
+1 -1
@@ -6,7 +6,7 @@ import (
6 "sort"
7 "strings"
8
9 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
9 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
10 )
11
12 func (b *topologyRemoteObservationBuilder) collectLLDPRemoteObservations() {
src/go/plugin/go.d/collector/snmp_topology/topology_output_collapse_priority.go
+1 -1
@@ -5,7 +5,7 @@ package snmptopology
5 import (
6 "strings"
7
8 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
8 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
9 )
10
11 func compareCollapseActorPriority(left, right topologyActor) int {
src/go/plugin/go.d/collector/snmp_topology/topology_output_map_type.go
+1 -1
@@ -5,7 +5,7 @@ package snmptopology
5 import (
6 "strings"
7
8 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
8 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
9 )
10
11 func applyMapTypePolicy(data *topologyData, mapType string) int {
src/go/plugin/go.d/collector/snmp_topology/topology_registry_build.go
+1 -1
@@ -5,7 +5,7 @@ package snmptopology
5 import (
6 "time"
7
8 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
8 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
9 )
10
11 func buildSNMPTopologySnapshot(aggregate topologyObservationAggregate, options topologyQueryOptions) (topologyData, bool) {
src/go/plugin/go.d/collector/snmp_topology/topology_registry_observations.go
+1 -1
@@ -5,7 +5,7 @@ package snmptopology
5 import (
6 "sort"
7
8 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
8 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
9 )
10
11 func (r *topologyRegistry) activeCaches() []*topologyCache {
src/go/plugin/go.d/collector/snmp_topology/topology_registry_snapshot.go
+1 -1
@@ -6,7 +6,7 @@ import (
6 "strings"
7 "time"
8
9 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
9 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
10 )
11
12 type topologyObservationSnapshot struct {
src/go/plugin/go.d/collector/snmp_topology/topology_snapshot_builder.go
+1 -1
@@ -5,7 +5,7 @@ package snmptopology
5 import (
6 "time"
7
8 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
8 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
9 "github.com/netdata/netdata/go/plugins/plugin/go.d/collector/snmp/ddsnmp"
10 )
11
src/go/plugin/go.d/collector/snmp_topology/topology_snmprec_forwarding_test.go
+1 -1
@@ -13,7 +13,7 @@ import (
13 "strings"
14 "testing"
15
16 - topologyengine "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
16 + topologyengine "github.com/netdata/netdata/go/plugins/pkg/l2topology"
17 "github.com/netdata/netdata/go/plugins/plugin/go.d/collector/snmp/ddsnmp"
18 "github.com/stretchr/testify/require"
19 )
src/go/tools/topology-parity-evidence/main.go
+4 -4
@@ -24,8 +24,8 @@ import (
24 "strings"
25 "time"
26
27 - "github.com/netdata/netdata/go/plugins/pkg/topology/engine"
28 - "github.com/netdata/netdata/go/plugins/pkg/topology/engine/parity"
27 + "github.com/netdata/netdata/go/plugins/pkg/l2topology"
28 + "github.com/netdata/netdata/go/plugins/pkg/l2topology/parity"
29 )
30
31 const (
@@ -723,7 +723,7 @@ func expectedBehaviorSnapshot(golden parity.GoldenDocument) behaviorOracleSnapsh
723 }
724 }
725
726 -func actualBehaviorSnapshot(result engine.Result) behaviorOracleSnapshot {
726 +func actualBehaviorSnapshot(result l2topology.Result) behaviorOracleSnapshot {
727 devices := make([]parity.GoldenDevice, 0, len(result.Devices))
728 for _, dev := range result.Devices {
729 devices = append(devices, parity.GoldenDevice{
@@ -1713,7 +1713,7 @@ func enabledProtocols(protocols parity.ManifestProtocols) []string {
1713 return out
1714 }
1715
1716 -func resultAdjacencyKeySet(adjacencies []engine.Adjacency) map[string]struct{} {
1716 +func resultAdjacencyKeySet(adjacencies []l2topology.Adjacency) map[string]struct{} {
1717 out := make(map[string]struct{}, len(adjacencies))
1718 for _, adj := range adjacencies {
1719 out[fmt.Sprintf("%s|%s|%s|%s|%s", adj.Protocol, adj.SourceID, adj.SourcePort, adj.TargetID, adj.TargetPort)] = struct{}{}