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.
- The repository replaces brittle CLI text scraping with a suite of strictly typed Go tests that treat network hardware like programmable microservices.
- Hyperscalers use these tests as an executable compliance contract to certify that multi-vendor hardware adheres to the OpenConfig data model.
- The integration of Open Traffic Generators allows engineers to verify that physical silicon actually drops or routes packets according to the software configuration.
- An internal deviations package tracks vendor-specific hardware limitations without compromising the core logic of the unified test suite.
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
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.
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.
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.