@cryptotaxi247 / netdata-1 / commits / c366ae6a6

ci: rework SNMP fixture workflow to cover topology engine tests (#22426)

Ilya Mashchenko committed May 6, 2026 at 13:07 UTC c366ae6a680f284efbaade84a48f7448e6ae863c
10 files changed +25 -143
.github/workflows/snmp-topology-tests.yml renamed
+17 -9
@@ -1,25 +1,25 @@
1 ---
2 -name: SNMP Simulator Tests
2 +name: SNMP & Topology Tests
3 on:
4 push:
5 branches:
6 - master
7 paths:
8 - - '.github/workflows/snmp-sim-tests.yml'
8 + - '.github/workflows/snmp-topology-tests.yml'
9 - 'src/go/plugin/go.d/collector/snmp/**'
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 pull_request:
14 paths:
15 - - '.github/workflows/snmp-sim-tests.yml'
15 + - '.github/workflows/snmp-topology-tests.yml'
16 - 'src/go/plugin/go.d/collector/snmp/**'
17 - 'src/go/plugin/go.d/collector/snmp_topology/**'
18 - 'src/go/plugin/go.d/config/go.d/snmp.profiles/**'
19 - 'src/go/pkg/topology/**'
20
21 jobs:
22 - simulator-tests:
22 + fixture-tests:
23 runs-on: ubuntu-latest
24 steps:
25 - name: Checkout
@@ -32,14 +32,20 @@ jobs:
32 with:
33 go-version-file: src/go/go.mod
34
35 + - name: Clone testdata
36 + shell: bash
37 + run: |
38 + set -euo pipefail
39 + git clone --depth=1 https://github.com/netdata/testdata.git src/go/testdata
40 +
41 - name: Prepare snmpsim data
42 shell: bash
43 run: |
44 set -euo pipefail
45 mkdir -p /tmp/snmpsim-data
40 - cp src/go/plugin/go.d/collector/snmp_topology/testdata/snmprec/arubaos-cx_10.10.snmprec /tmp/snmpsim-data/lldp1.snmprec
41 - cp src/go/plugin/go.d/collector/snmp_topology/testdata/snmprec/aos6.snmprec /tmp/snmpsim-data/lldp2.snmprec
42 - cp src/go/plugin/go.d/collector/snmp_topology/testdata/snmprec/ciscosb_sg350x-24p.snmprec /tmp/snmpsim-data/cdp1.snmprec
46 + cp src/go/testdata/snmp/snmprec/arubaos-cx_10.10.snmprec /tmp/snmpsim-data/lldp1.snmprec
47 + cp src/go/testdata/snmp/snmprec/aos6.snmprec /tmp/snmpsim-data/lldp2.snmprec
48 + cp src/go/testdata/snmp/snmprec/ciscosb_sg350x-24p.snmprec /tmp/snmpsim-data/cdp1.snmprec
49
50 - name: Start snmpsim
51 shell: bash
@@ -73,7 +79,7 @@ jobs:
79 wait_for_simulator snmpsim-v3 \
80 snmpget -v3 -l authPriv -u testuser -a MD5 -A authpass1 -x AES -X privpass1 -n lldp1 127.0.0.1:1162 1.3.6.1.2.1.1.1.0
81
76 - - name: Run integration tests
82 + - name: Run topology fixture tests
83 env:
84 NETDATA_SNMPSIM_ENDPOINT: 127.0.0.1:1161
85 NETDATA_SNMPSIM_COMMUNITIES: lldp1,lldp2,cdp1
@@ -87,7 +93,9 @@ jobs:
93 NETDATA_SNMPSIM_V3_PRIV_KEY: privpass1
94 run: |
95 cd src/go
90 - go test -tags=integration ./plugin/go.d/collector/snmp_topology
96 + go test -tags=snmp_topology_fixtures \
97 + ./plugin/go.d/collector/snmp_topology/... \
98 + ./pkg/topology/engine/parity/...
99
100 - name: Stop snmpsim
101 if: always()
src/go/pkg/topology/engine/parity/golden_fixture_test.go
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -//go:build topology_fixtures
3 +//go:build snmp_topology_fixtures
4
5 package parity
6
src/go/pkg/topology/engine/parity/l2_builder_test.go
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -//go:build topology_fixtures
3 +//go:build snmp_topology_fixtures
4
5 package parity
6
src/go/pkg/topology/engine/parity/manifest_fixture_test.go
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -//go:build topology_fixtures
3 +//go:build snmp_topology_fixtures
4
5 package parity
6
src/go/pkg/topology/engine/parity/node_topology_parity_test.go
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -//go:build topology_fixtures
3 +//go:build snmp_topology_fixtures
4
5 package parity
6
src/go/pkg/topology/engine/parity/walk_fixture_test.go
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -//go:build topology_fixtures
3 +//go:build snmp_topology_fixtures
4
5 package parity
6
src/go/plugin/go.d/collector/snmp_topology/testdata/ATTRIBUTION.md deleted
-126
@@ -1,126 +0,0 @@
1 -<!-- markdownlint-disable-file MD013 MD032 MD034 MD043 -->
2 -
3 -# SNMP topology test data attribution
4 -
5 -Source: https://github.com/librenms/librenms
6 -License: GPL-3.0
7 -
8 -Files (verbatim copies from LibreNMS snmpsim testdata with LLDP/CDP neighbors):
9 -- tests/snmpsim/aix.snmprec
10 -- tests/snmpsim/aos6.snmprec
11 -- tests/snmpsim/aos7.snmprec
12 -- tests/snmpsim/aos.snmprec
13 -- tests/snmpsim/arista_eos.snmprec
14 -- tests/snmpsim/arista_eos_vrf.snmprec
15 -- tests/snmpsim/arubaos-cx_10.06.snmprec
16 -- tests/snmpsim/arubaos-cx_10.07.snmprec
17 -- tests/snmpsim/arubaos-cx_10.10.snmprec
18 -- tests/snmpsim/arubaos-cx_8360.snmprec
19 -- tests/snmpsim/arubaos-cx.snmprec
20 -- tests/snmpsim/boss_ers3510.snmprec
21 -- tests/snmpsim/boss_ers4950.snmprec
22 -- tests/snmpsim/bti800.snmprec
23 -- tests/snmpsim/ciena-sds.snmprec
24 -- tests/snmpsim/ciena-waveserver.snmprec
25 -- tests/snmpsim/ciscome1200.snmprec
26 -- tests/snmpsim/ciscosb_cbs250-24p-4x-v3.snmprec
27 -- tests/snmpsim/ciscosb_cbs350-4x.snmprec
28 -- tests/snmpsim/ciscosb_sg350x-24p.snmprec
29 -- tests/snmpsim/ciscosb_sg550x-8f8t.snmprec
30 -- tests/snmpsim/ciscosb_sx550x-24f.snmprec
31 -- tests/snmpsim/ciscowlc_cbw240ac.snmprec
32 -- tests/snmpsim/dell-os10.snmprec
33 -- tests/snmpsim/dell-sonic.snmprec
34 -- tests/snmpsim/dlink_des-3526.snmprec
35 -- tests/snmpsim/dlink_des-3550.snmprec
36 -- tests/snmpsim/dlink_dgs-1510-28.snmprec
37 -- tests/snmpsim/dlink_dgs-1510-28x-me.snmprec
38 -- tests/snmpsim/dlink_dgs-1510-28xmp-me.snmprec
39 -- tests/snmpsim/dlink_dgs-3000-28xmp.snmprec
40 -- tests/snmpsim/dlink_dgs-3420-28tc.snmprec
41 -- tests/snmpsim/dlink_dgs-3620-28sc.snmprec
42 -- tests/snmpsim/dlink_dgs-3627g.snmprec
43 -- tests/snmpsim/dnos_s4048.snmprec
44 -- tests/snmpsim/dnos.snmprec
45 -- tests/snmpsim/dnos_z9100-on.snmprec
46 -- tests/snmpsim/edgecos_2100-28p.snmprec
47 -- tests/snmpsim/edgecos_dcs203.snmprec
48 -- tests/snmpsim/edgecos_ecs2100-10t.snmprec
49 -- tests/snmpsim/edgecos_ecs4100-28t.snmprec
50 -- tests/snmpsim/edgecos_ecs4610-24f.snmprec
51 -- tests/snmpsim/edgeswitch_es-24-250w.snmprec
52 -- tests/snmpsim/edgeswitch_us-8.snmprec
53 -- tests/snmpsim/edgeswitch_us-8-v2.snmprec
54 -- tests/snmpsim/edgeswitch_usw-flex-xg.snmprec
55 -- tests/snmpsim/eltex-mes21xx_mes2124m.snmprec
56 -- tests/snmpsim/eltex-mes21xx_mes3124.snmprec
57 -- tests/snmpsim/eltex-mes23xx_mes2324b.snmprec
58 -- tests/snmpsim/eltex-mes23xx_mes2324fbac.snmprec
59 -- tests/snmpsim/eltex-mes23xx_mes2324fb.snmprec
60 -- tests/snmpsim/eltex-mes23xx_mes2324p.snmprec
61 -- tests/snmpsim/eltex-mes23xx_mes2348p.snmprec
62 -- tests/snmpsim/eltex-mes23xx_mes3324f.snmprec
63 -- tests/snmpsim/eltex-mes23xx_mes3324.snmprec
64 -- tests/snmpsim/eltex-mes23xx_mes3348.snmprec
65 -- tests/snmpsim/eltex-mes23xx_mes5324.snmprec
66 -- tests/snmpsim/eltex-mes24xx_mes2424bac.snmprec
67 -- tests/snmpsim/fortigate_60f3g4g.snmprec
68 -- tests/snmpsim/fortigate_60fospfv3.snmprec
69 -- tests/snmpsim/fortiswitch_148f-fpoe.snmprec
70 -- tests/snmpsim/fs-centec_s5850-48s2q4c.snmprec
71 -- tests/snmpsim/fs-switch_s3900-24f4s.snmprec
72 -- tests/snmpsim/fs-switch_s3900-24t4s.snmprec
73 -- tests/snmpsim/fs-switch_s3900.snmprec
74 -- tests/snmpsim/gam.snmprec
75 -- tests/snmpsim/ios_2960x.snmprec
76 -- tests/snmpsim/iosxe_c9400-svl.snmprec
77 -- tests/snmpsim/iosxe_c9400x-svl.snmprec
78 -- tests/snmpsim/iosxe_c9500h-svl.snmprec
79 -- tests/snmpsim/iosxe_c9500x-svl.snmprec
80 -- tests/snmpsim/iosxe_c9600-svl.snmprec
81 -- tests/snmpsim/iosxe_c9600x-svl.snmprec
82 -- tests/snmpsim/iosxe_c9800.snmprec
83 -- tests/snmpsim/iosxe_ie32008t2s-ios17-12.snmprec
84 -- tests/snmpsim/iosxr_ncs55a2.snmprec
85 -- tests/snmpsim/jetstream_vlans.snmprec
86 -- tests/snmpsim/junos_ex4600mp.snmprec
87 -- tests/snmpsim/junos_mx5t-isis.snmprec
88 -- tests/snmpsim/junos_qfx5100.snmprec
89 -- tests/snmpsim/junos_rpm.snmprec
90 -- tests/snmpsim/linksys-ss_lgs318p.snmprec
91 -- tests/snmpsim/moxa-awk_4131a.snmprec
92 -- tests/snmpsim/moxa-eds-4000-series_eds-4012-4gc.snmprec
93 -- tests/snmpsim/moxa-etherdevice_edsg512e.snmprec
94 -- tests/snmpsim/moxa-etherdevice_edsg516e.snmprec
95 -- tests/snmpsim/moxa-etherdevice_edsp506e.snmprec
96 -- tests/snmpsim/mypoweros.snmprec
97 -- tests/snmpsim/nxos_n3k-3064pq.snmprec
98 -- tests/snmpsim/pmp_450i.snmprec
99 -- tests/snmpsim/pmp_450m.snmprec
100 -- tests/snmpsim/pmp_450.snmprec
101 -- tests/snmpsim/pmp.snmprec
102 -- tests/snmpsim/procurve_e2910.snmprec
103 -- tests/snmpsim/procurve.snmprec
104 -- tests/snmpsim/raisecom-ros.snmprec
105 -- tests/snmpsim/routeros_crs317.snmprec
106 -- tests/snmpsim/routeros_rb433gl.snmprec
107 -- tests/snmpsim/routeros_rb750gr3.snmprec
108 -- tests/snmpsim/routeros_rb760igs.snmprec
109 -- tests/snmpsim/routeros.snmprec
110 -- tests/snmpsim/routeros_wifi.snmprec
111 -- tests/snmpsim/ruijie.snmprec
112 -- tests/snmpsim/scalance_sc646.snmprec
113 -- tests/snmpsim/scalance_xc206-2sfp.snmprec
114 -- tests/snmpsim/slxos_slx9150.snmprec
115 -- tests/snmpsim/smartax.snmprec
116 -- tests/snmpsim/voss_7432cq.snmprec
117 -- tests/snmpsim/voss_8608.snmprec
118 -- tests/snmpsim/voss_xa1440.snmprec
119 -- tests/snmpsim/vrp_5720.snmprec
120 -- tests/snmpsim/vrp_ac6605-26.snmprec
121 -- tests/snmpsim/zynos_gs1900-fdb.snmprec
122 -- tests/snmpsim/zynos_mgs3712.snmprec
123 -- tests/snmpsim/zynos.snmprec
124 -- tests/snmpsim/zynos_xgs4600.snmprec
125 -
126 -These files are used by topology cache tests to validate LLDP/CDP parsing with real device data.
src/go/plugin/go.d/collector/snmp_topology/topology_integration_test.go
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -//go:build topology_fixtures
3 +//go:build snmp_topology_fixtures
4
5 package snmptopology
6
src/go/plugin/go.d/collector/snmp_topology/topology_snmprec_forwarding_test.go
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -//go:build topology_fixtures
3 +//go:build snmp_topology_fixtures
4
5 package snmptopology
6
src/go/plugin/go.d/collector/snmp_topology/topology_snmprec_test.go
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -//go:build topology_fixtures
3 +//go:build snmp_topology_fixtures
4
5 package snmptopology
6