Use it around every change, and as a regular health check.
Network Testing
Network testing runs checks with clear expected results — can A reach B, is the OSPF neighbour up, does this route exist, is this port open — before and after a change, and fails the change when a check fails.
1. Network testing: unit tests for templates, Batfish for configs, pyATS for live state, ping/traceroute matrices.
2. Run in CI and post-change.
3. Clear pass/fail.
4. Labs (containerlab) for testing.
5. Track results.
change → tests (lab/static/live) → pass/fail
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
requirement → assertion definition → vantage/context → test execution → raw result → interpretation → target/path correlation → repeated acceptance → regression
Healthy evidence: assertions are explicit, reproducible from known vantage points and correlated to the exact change plus appropriate regression coverage.
Step 2 Failure modes and next checks Narrow the fault
Step 3 Common mistakes Narrow the fault
- No pre/post tests.
Step 4 Where it fails Narrow the fault
Where Network Testing usually goes wrong: device identity, transport/API model, configuration versus operational state and forwarding-plane verification; test-case identity, fixture/environment, assertion scope, isolation, failure diagnostics and cleanup.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
A test needs an expected result written down in advance. Test from the places users are, not only from the router. Run the same tests before and after: a test that already failed before the change is not caused by it.
pyats run job <job>.py --testbed-file tb.yaml— network tests- Reachability tests (ping matrix) — connectivity
- Test results in CI — gating
ReferenceWhat it is1 section · depth on demand
Core model
Define the exact assertion, vantage point, inputs, expected result, timeout/tolerance and evidence capture so a passing test has a precise meaning.
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
A passing network test shows only its defined path, context and assertion at that time; it does not establish universal service health.
In depth
Network testing verifies that the network behaves as intended — reachability, routing, failover, policy — using automated tests rather than manual pings after a change.
| Test type | Example |
|---|---|
| State assertions | All BGP sessions Established |
| Reachability | Ping/traceroute matrix between sites |
| Policy | ACL blocks guest → server VLAN |
| Failover | Shut a link, check convergence |
| Synthetic traffic | IP SLA, ThousandEyes |
# pyATS-style assertion
assert all(n["state"] == "Established" for n in bgp_neighbors), "BGP neighbor down"
Run the same test suite before and after changes so differences are obvious.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network Automation > Network Testing. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://developer.cisco.com/site/networking/ · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Network Testing Network Automation proof-boundary map
Fast intent/scope, management-operation, device-state and network-acceptance boundaries for Network Testing.
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Intent / scope | Source revision and exact targets are explicit | Stale inventory, hidden selector or wrong variables change scope |
| Management operation | Transport/model/payload and per-device response are traceable | Auth/capability/parser differences hide partial or wrong execution |
| Device state | Effective and persistent state are read back | Accepted config/API result is mistaken for convergence |
| Network proof | Original control/data-plane or service test passes | Automation summary substitutes for actual network acceptance |
Deep reference
Healthy vs suspicious evidence
Output interpretation
For Network Testing, rely on structured fields and stable IDs (device identity, transport/API model, configuration versus operational state and forwarding-plane verification; test-case identity, fixture/environment, assertion scope, isolation, failure diagnostics and cleanup) rather than text formatted for display.