Skip to content

feat(device-discovery): vrf discovery for aruba_aoscx, nokia_sros_ssh, cisco_viptela_ssh, paloalto_panos, paloalto_panos_ssh#455

Merged
leoparente merged 1 commit into
developfrom
feat/device-discovery-vrf-drivers-batch3
Jun 11, 2026
Merged

feat(device-discovery): vrf discovery for aruba_aoscx, nokia_sros_ssh, cisco_viptela_ssh, paloalto_panos, paloalto_panos_ssh#455
leoparente merged 1 commit into
developfrom
feat/device-discovery-vrf-drivers-batch3

Conversation

@leoparente

Copy link
Copy Markdown
Contributor

Summary

Third custom-driver batch implementing get_network_instances() for VRF discovery (follows #452 / #453 / #454). Five drivers across four transports, all returning the NAPALM OpenConfig shape consumed by options.discover_vrfs.

Per driver

Driver Data source Notes
aruba_aoscx REST system/vrfs + interface vrf refs in system/interfaces Same resource the IP getter reads, so member names join exactly. EVPN route distinguisher carried when the firmware exposes it. Factory default VRF = global table.
nokia_sros_ssh show service service-using vprn + per-service show service id <id> interface Service enumeration parsed driver-locally — SR OS service names are optional and the ntc-template error-exits on the unnamed form (one unnamed VPRN would silently drop every VPRN). Unnamed services fall back to the numeric id. Members keyed <service>/<interface> like the NETCONF sibling — SR OS interface names are per-instance scoped, so plain names could false-join onto same-named Base interfaces. RD not collected in this pass (classic CLI keeps it in per-service BGP config).
cisco_viptela_ssh VPN column of the existing show interface rows Transport VPN 0 = DEFAULT_INSTANCE; service VPNs and management VPN 512 map to VRFs named by VPN number.
paloalto_panos fwd field of the existing show interface all op-command vr:<name> and logical-router:<name> (Advanced Routing, 10.2+) both handled. VSYS never mapped. Factory default VR = global table.
paloalto_panos_ssh FORWARDING column of show interface logical (ntc-template) Identical envelope to the XML driver for the same topology.

Both PAN-OS drivers share a documented limitation: enumeration is membership-derived, so a virtual router with no interfaces assigned does not appear.

Tests

  • 11 fixture scenarios incl. the unnamed-VPRN form, multi-word service names, Advanced-Routing logical-routers, and zone-less PAN-OS rows
  • Driver ownership pin matrix extended to 18 drivers
  • Full suite: 1774 passed, 165 skipped; ruff clean

Review trail

Two adversarial Claude rounds: round 1 found two majors in nokia_sros_ssh (ntc-template error-exit on unnamed VPRNs wiping the whole VPRN list; plain-name member keying able to false-join VPRN membership onto same-named Base-router interfaces) plus minors — all fixed with pinning fixtures; round 2 probed the fixes against 21 adversarial line forms and full realistic captures: APPROVED.

🤖 Generated with Claude Code

…, cisco_viptela_ssh, paloalto_panos, paloalto_panos_ssh

Third custom-driver batch implementing get_network_instances():

- aruba_aoscx: VRFs from the system/vrfs REST resource (with the EVPN
  route distinguisher when the firmware exposes it); member interfaces
  from each interface's vrf reference in system/interfaces — the same
  resource the IP getter reads. The factory "default" VRF is the
  global routing table.
- nokia_sros_ssh: VPRNs from "show service service-using vprn"
  (ntc-template) plus one "show service id <id> interface" per
  service. Members keyed by plain interface name to match this
  driver's flat get_interfaces_ip() naming (the NETCONF sibling keys
  them "<service>/<interface>" because its IP getter does). RD not
  collected in this first pass — on the classic CLI it lives in
  per-service BGP config, not the templated service views.
- cisco_viptela_ssh: SD-WAN VPN segments from the VPN column of the
  same "show interface" rows the interface getters parse. Transport
  VPN 0 is the underlay and maps to the DEFAULT_INSTANCE; service VPNs
  and the management VPN 512 map to VRFs named by VPN number.
- paloalto_panos / paloalto_panos_ssh: virtual routers from the
  forwarding field of each driver's existing interface command
  ("vr:<name>", or "logical-router:<name>" with Advanced Routing on
  PAN-OS 10.2+). VSYS are never mapped. The factory "default" VR maps
  to the DEFAULT_INSTANCE. Both transports emit identical envelopes
  for the same topology. Limitation: enumeration is membership-derived,
  so an interface-less VR does not appear.

Nine fixture scenarios; driver-pin matrix extended to eighteen drivers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
device_discovery
   client.py661085%169–188
   discovery.py76593%102–104, 174–177
   entity_metadata.py13285%24, 27
   interface.py217598%141–145, 491–492
   main.py49296%182, 188
   metrics.py53198%133
   server.py881089%44–46, 72–87, 184, 187
   stubs.py1601094%31, 64, 84, 146, 256, 301, 324–329, 341–346
   translate.py283798%141, 143, 256, 478, 556, 567, 608
   translate_chassis.py175697%42, 45, 54–55, 149, 405
   translate_modules.py107199%217
   version.py7186%14
   vrf.py72396%67–68, 99
device_discovery/policy
   manager.py61395%37–38, 161
   portscan.py841187%34–35, 59–60, 64, 72–76, 117
   run.py88298%158, 193
   runner.py2532391%276–280, 285–286, 303–304, 397, 631, 650–682
TOTAL198810295% 

Tests Skipped Failures Errors Time
1939 165 💤 0 ❌ 0 🔥 26.538s ⏱️

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements NAPALM get_network_instances() for VRF discovery across five additional custom drivers (Aruba AOS-CX, Nokia SR OS SSH, Cisco Viptela SSH, PAN-OS XML, PAN-OS SSH), emitting the OpenConfig-shaped payload consumed by options.discover_vrfs and extending fixtures/tests to pin behavior.

Changes:

  • Added get_network_instances() implementations for aruba_aoscx, nokia_sros_ssh, cisco_viptela_ssh, paloalto_panos, and paloalto_panos_ssh.
  • Added/extended mock-data fixtures for the new VRF discovery behaviors (including edge cases like unnamed VPRNs and Advanced Routing logical routers).
  • Updated the runner dispatch test matrix to assert these drivers now own a real get_network_instances() implementation.

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated no comments.

Show a summary per file
File Description
device-discovery/custom_napalm/aruba_aoscx.py Adds VRF enumeration via REST (system/vrfs) and membership via interface VRF references.
device-discovery/custom_napalm/nokia_sros_ssh.py Adds driver-local parsing of VPRN services + per-service interface membership, avoiding ntc-template failure modes.
device-discovery/custom_napalm/cisco_viptela_ssh.py Adds VPN-segment → VRF mapping based on parsed show interface rows.
device-discovery/custom_napalm/paloalto_panos.py Adds VRF discovery from XML API show interface all fwd field (vr/logical-router).
device-discovery/custom_napalm/paloalto_panos_ssh.py Adds VRF discovery from show interface logical FORWARDING column (ntc-templates).
device-discovery/tests/test_runner_vrf_dispatch.py Extends the “driver implements get_network_instances” pin set to include the five new drivers.
device-discovery/tests/custom_drivers/aruba_aoscx/mock_data/... Adds AOS-CX VRF/interface REST fixtures + expected OC payloads.
device-discovery/tests/custom_drivers/nokia_sros_ssh/mock_data/... Adds SR OS SSH fixtures for normal/unnamed/no-VPRN scenarios + expected payloads.
device-discovery/tests/custom_drivers/cisco_viptela_ssh/mock_data/... Adds Viptela show interface fixtures + expected payloads.
device-discovery/tests/custom_drivers/paloalto_panos/mock_data/... Adds PAN-OS XML show interface all fixtures + expected payloads.
device-discovery/tests/custom_drivers/paloalto_panos_ssh/mock_data/... Adds PAN-OS SSH show interface logical fixtures + expected payloads.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@leoparente leoparente self-assigned this Jun 11, 2026
@leoparente leoparente merged commit 93e2416 into develop Jun 11, 2026
10 checks passed
@leoparente leoparente deleted the feat/device-discovery-vrf-drivers-batch3 branch June 11, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants