Skip to content

Testing Guide

Xin Wang edited this page Dec 12, 2020 · 50 revisions

Most testing resources live in the sonic-mgmt repo.

Different repos/packages/submodules may also have unit tests of their own that live in that repo (e.g. the Docker Virtual Switch tests in the sonic-swss repo).

SONiC Testbed

Instructions for setting up the physical SONiC testbed can be found here.

SONiC Virtual Testbed

We also support a virtualized SONiC testbed that can simulate a running SONiC device and accompanying network topology using KVM and Docker. This test setup does not require any physical switching hardware or any vendor SAI. This testbed should be used to validate the control plane behavior of SONiC features during development and to prevent regressions in the master SONiC image.

Instructions for setting up this testbed can be found here.

Minigraph

The minigraph file (i.e. minigraph.xml) is the starting point for configuring a SONiC device.

The minigraph is an XML format file that describes the device configuration in a version-neutral and platform-neutral way. Each SONiC device must have a matching minigraph file for device configuration and test.

SONiC minigraph files can be saved locally or in a centralized remote location.

All local minigraph files are saved under ansible/minigraph folder. The file name must match your SONiC device name specified in 'lab' inventory file under the ansible folder in sonic-mgmt.

Further configuration info:

How to run tests

All tests (physical or virtual) are run from inside the sonic-mgmt docker container. Detailed instruction for setting up the sonic-mgmt container can be found here with the other testbed setup instructions.

Pytest (for testing SONiC master branch, 201911< qualification)

Ansible Tests (<201811 qualification)

SONiC Test Plans

Here are some test design docs:

Clone this wiki locally