forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests]: add README, vlan, acl tests (sonic-net#405)
* [test]: add --dvsname option to specify the dvs container * [test]: add test vlan member creation test * [test]: add acl test * [test]: add README.md
- Loading branch information
Showing
8 changed files
with
398 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
*.la | ||
*.lo | ||
*.o | ||
*.pyc | ||
|
||
# Packaging Files # | ||
################### | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
SWSS Integration Tests | ||
|
||
# Introduction | ||
|
||
SWSS Integration tests runs on docker-sonic-vs which runs on top of SAI virtual switch. The tests can be run on any Linux machine without real switch ASIC. It is used to test SwSS (Switch State Service) by setting AppDB or ConfigDB and checking corresponding AsicDB entries. | ||
|
||
# How to run the tests | ||
|
||
- Install docker and pytest on your dev machine | ||
``` | ||
sudo pip install --system docker==2.6.1 | ||
sudo pip install --system pytest==3.3.0 | ||
``` | ||
- Compile and install swss common library | ||
```` | ||
cd sonic-swss-common | ||
dpkg-buildpackage -us -uc -b | ||
dpkg -i ../libswsscommon_1.0.0_amd64.deb | ||
dpkg -i ../python-swsscommon_1.0.0_amd64.deb | ||
``` | ||
- Build and load docker-sonic-vs | ||
``` | ||
cd sonic-buildimage | ||
make configure PLATFORM=vs | ||
make all | ||
docker load < target/docker-sonic-vs.gz | ||
``` | ||
- Run tests | ||
``` | ||
cd sonic-swss/tests | ||
sudo pytest -v | ||
``` | ||
# How to setup test development env | ||
To develop new swss features or swss integration tests, you need to setup a virtual switch docker container which | ||
persists. | ||
- Create virtual switch container (name:vs). ```create_vnet.sh``` can be found at [here](https://github.com/Azure/sonic-buildimage/blob/master/platform/vs/create_vnet.sh). | ||
``` | ||
docker run -id --name sw debian bash | ||
sudo ./create_vnet.sh sw | ||
docker run --privileged -v /var/run/redis-vs:/var/run/redis --network container:sw -d --name vs docker-sonic-vs | ||
``` | ||
- Run test using the existing vs container | ||
``` | ||
sudo pytest -v --dvsname=vs | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.