How sonic-net/sonic-mgmt works
sonic-mgmt is SONiC’s testbed deployment, test automation, and reporting repository. A typical test run starts in SpyTest, uses testbed definitions to target switches, exercises SONiC through its API and connection layers, and produces results for reporting. Ansible provides a separate operational path for testbed setup, topology, device facts, and upgrades. Traffic generation and the Go-based PINS infrastructure are additional testing capabilities. The README establishes the product scope; the sampled sources provide concrete detail for SpyTest startup, one device API, route announcement, and report storage, so other connections are shown only where supported by the repository structure or documentation.
Main entry points: ansible Ansible automation · framework.py Test framework · main.py SpyTest CLI · test_reporting Report collection
Components 22
Testbed operations
- Ansible automation
ansible - Testbed inventory
ansible/devutil - Topology generation
ansible/generate_topo.py - Device facts
ansible/library - SONiC upgrades
ansible/upgrade_sonic.py
SpyTest runtime
- SpyTest CLI
spytest/spytest/main.py - Test framework
spytest/spytest/framework.py - Testbed model
spytest/spytest/testbed.py - Test suites
spytest/spytest/suite.py - Test results
spytest/spytest/result.py
Device and traffic
- SONiC APIs
spytest/apis - Device connections
spytest/spytest/access - Traffic generation
spytest/spytest/tgen - Route announcement
ansible/library/announce_routes.py - PINS infrastructure
sdn_tests/pins_ondatra/infrastructure
Results and reporting
- Report collection
test_reporting - Report storage
test_reporting/report_data_storage.py - Report upload
test_reporting/report_uploader.py
Other components
- Test engineer
- Azure Kusto
- Pytest
- SONiC devices
Connections 21
- Test engineer → SpyTest CLI: starts tests
- SpyTest CLI → Pytest: invokes
- SpyTest CLI → Test framework: initializes
- Test framework → Testbed model: loads
- Test framework → Test suites: runs
- Test framework → Test results: records
- SONiC APIs → Device connections: uses
- Device connections → SONiC devices: connects
- SONiC APIs → SONiC devices: configures and queries
- Traffic generation → SONiC devices: generates traffic for
- Ansible automation → Testbed inventory: uses
- Ansible automation → Topology generation: generates
- Ansible automation → Device facts: collects
- Ansible automation → SONiC upgrades: runs
- Ansible automation → SONiC devices: manages
- Route announcement → SONiC devices: announces routes to
- PINS infrastructure → SONiC devices: tests
- Test results → Report collection: feeds
- Report collection → Report storage: stores reports
- Report storage → Azure Kusto: ingests into
- Report collection → Report upload: uploads