openconfig/featureprofiles: The End of Network CLI Scraping

How hyperscalers use a massive Go test suite to force the world's largest hardware vendors to speak exactly the same language.

9 min read • View on GitHub • More from Openconfig

A massive blueprint of a network router being assembled from mismatched puzzle pieces into a uniform frame, representing multi-vendor hardware compliance.
Network hardware from different vendors is forced into a strict, unified mathematical model before it ever touches a data center floor.
Key Takeaways

The Death of the CLI Regex

For decades, network automation was a brittle exercise in text parsing. Engineers wrote complex Expect scripts in Python to log into routers, issue commands like show ip bgp summary, and scrape the unstructured terminal output with regular expressions. A single vendor software update could change a whitespace character and break a multi-million dollar deployment pipeline.

The OpenConfig project changed the data model, but featureprofiles changed the enforcement mechanism. It treats network hardware exactly like programmable microservices. Instead of scraping text, engineers use fluent Go APIs to query structured gRPC telemetry. The network is no longer managed by human-readable terminal output. It is managed by strictly typed Go structs.

Feature Profiles are groups of OpenConfig paths and tests which verify their behavior

A visual contrast showing a tangled knot of thick ropes on the left and perfectly machined interlocking metal gears on the right, representing CLI scraping versus structured gNMI models.
The transition from legacy CLI text scraping to strictly typed, model-driven gNMI configuration.

Compiling the Network

The architecture of the repository relies on a rigorous validation pipeline. A Makefile ensures that the Go tests never drift from the official OpenConfig YANG specifications. It clones the public models and runs a dedicated path validator before a single test is compiled.

To run these tests without requiring a physical lab full of multi-million dollar routers, the project integrates with Kubernetes Network Emulation (KNE). KNE spins up containerized versions of vendor operating systems, such as Arista cEOS or Nokia SR Linux. The Go tests, orchestrated by the Ondatra framework, connect to these virtual nodes and execute the exact same validation logic that would run on physical hardware.

A four-step validation pipeline showing data flow. Step 1: A Go Test (Ondatra) uses ygot to generate a config struct. Step 2: The test pushes the config to a Device Under Test (DUT) via gNMI. Step 3: An Open Traffic Generator (OTG) injects simulated data packets into the DUT data plane. Step 4: gNMI streams telemetry from the DUT back to the Go test to verify packet drops and hardware behavior.

The code looks less like traditional networking and more like standard cloud-native Go:

func TestBGP(t *testing.T) {
    dut := ondatra.DUT(t, "dut")
    
    // Generate config using ygot
    d := &oc.Root{}
    ni := d.GetOrCreateNetworkInstance(*deviations.DefaultNetworkInstance)
    
    // Push config via gNMI
    gnmi.Replace(t, dut, gnmi.OC().NetworkInstance(*deviations.DefaultNetworkInstance).Config(), ni)
}

Blasting the Data Plane

Configuring a device is only half the battle. A router might accept a command to block specific traffic, but the only way to prove it works is to send the traffic and watch it drop. This is where the Open Traffic Generator (OTG) integration becomes critical.

A feature profile may contain configuration, telemetry, operational or any other paths that a device exposes.

The suite uses OTG APIs to inject actual line-rate packets into the data plane. The test blasts the router with traffic and simultaneously monitors the gNMI telemetry counters. If the hardware silicon fails to drop the packets at the exact rate specified by the OpenConfig model, the test fails. It is an executable contract for physical silicon performance.

A heavy-duty server rack in a high-speed wind tunnel, blasted by sharp geometric arrows representing data packets, with an analog dial measuring the impact.
Data plane testing verifies that the router's physical silicon actually drops the packets the control plane tells it to drop.

The Pragmatism of Deviations

The smartest architectural decision in the repository is the internal deviations package. Hardware vendors move at different speeds, and their silicon has physical limitations. A strict binary pass or fail would result in an unusable test suite.

Instead, the suite allows fine-grained, explicitly tracked exceptions. A test might acknowledge that a specific vendor requires a BGP session reset after an MD5 key change, or that another vendor does not support a specific QoS timer. The core logic remains identical for everyone, but the deviations package allows the tests to run successfully across diverse hardware while documenting exactly where each vendor falls short of the ideal standard.

Certification, Not Just Automation

It is important to understand what featureprofiles is not. It is not a daily operational tool like PyATS or NAPALM. Those tools exist to help engineers manage existing networks, push ad-hoc changes, and audit current states.

Feature profiles exist to certify the hardware before you buy it. It is the compliance barrier that vendors must pass to sell equipment to hyperscalers.

Project Primary Goal Architecture Data Plane Testing
OpenConfig Feature Profiles Hardware Certification & Compliance Model-first gNMI (Go) Native OTG packet injection
PyATS Network Operations & Testing Parser-based CLI scraping (Python) External scripts required
NAPALM Multi-vendor Abstraction Unified API wrapping CLI/Netconf (Python) None built-in

By forcing competing vendors to pass the exact same Go tests, the repository acts as an executable peace treaty. It proves that the networking industry can finally move past brittle text parsing and embrace the rigors of modern software engineering.


Sources: openconfig/featureprofiles on GitHub, open-source documentation, and the Ondatra testing framework.