Skip to content

Commit 2fe99e0

Browse files
authored
[dvs] Update README with new flags, options, and known issues (sonic-net#1380)
- Document --keeptb flag - Add dynamic port option to ./create_vnet.sh - Add libswsscommon installation issue Signed-off-by: Danny Allen <[email protected]>
1 parent ea30f2f commit 2fe99e0

File tree

1 file changed

+53
-4
lines changed

1 file changed

+53
-4
lines changed

tests/README.md

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ For those developing new features for SWSS or the DVS framework, you might find
5454
5555
```
5656
docker run --privileged -id --name sw debian bash
57-
sudo ./create_vnet.sh sw
57+
sudo ./create_vnet.sh -n 32 sw
5858
```
5959
3. Start the DVS container:
6060
@@ -97,16 +97,65 @@ For those developing new features for SWSS or the DVS framework, you might find
9797
sudo pytest --imgname=docker-sonic-vs:my-changes.333
9898
```
9999
100+
- You can also preserve a non-persistent DVS container for debugging purposes:
101+
102+
```
103+
sudo pytest --keeptb
104+
```
105+
106+
Which should give you something like this in `docker ps`:
107+
108+
```
109+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
110+
10bb406e7475 docker-sonic-vs:sonic-swss-build.1529 "/usr/bin/supervisord" 3 hours ago Up 3 hours ecstatic_swartz
111+
edb35e9aa10b debian:jessie "bash" 3 hours ago Up 3 hours elegant_edison
112+
```
113+
100114
- You can automatically retry failed test cases **once**:
101115
102116
```
103117
sudo pytest --force-flaky
104118
```
105119
106120
## Known Issues
107-
- ```
108-
ERROR: Error response from daemon: client is newer than server (client API version: x.xx, server API version: x.xx)
121+
- You may encounter the test run being aborted before any cases are run:
109122
```
123+
daall@baker:~/sonic-swss/tests$ sudo pytest test_acl.py
124+
============================= test session starts ==============================
125+
platform linux -- Python 3.6.9, pytest-4.6.9, py-1.9.0, pluggy-0.13.1
126+
rootdir: /home/daall/sonic-swss/tests
127+
plugins: flaky-3.7.0
128+
collected 25 items
110129
111-
You can mitigate this by editing the `DEFAULT_DOCKER_API_VERSION` in `/usr/local/lib/python2.7/dist-packages/docker/constants.py`, or by upgrading to a newer version of Docker CE. See [relevant GitHub discussion](https://github.com/drone/drone/issues/2048).
130+
test_acl.py Aborted
131+
```
112132
133+
When run with the `-sv` flags we get some more information:
134+
```
135+
daall@baker:~/sonic-swss/tests$ sudo pytest -sv test_acl.py
136+
============================= test session starts ==============================
137+
platform linux -- Python 3.6.9, pytest-4.6.9, py-1.9.0, pluggy-0.13.1 -- /usr/bin/python3
138+
cachedir: .pytest_cache
139+
rootdir: /home/daall/sonic-swss/tests
140+
plugins: flaky-3.7.0
141+
collected 25 items
142+
143+
test_acl.py::TestAcl::test_AclTableCreation terminate called after throwing an instance of 'std::runtime_error'
144+
what(): Sonic database config file doesn't exist at /var/run/redis/sonic-db/database_config.json
145+
Aborted
146+
```
147+
148+
This indicates that something went wrong with the `libswsscommon` installation. The following should mitigate the issue:
149+
```
150+
dpkg -r libswsscommon python3-swsscommon
151+
dpkg --purge libswsscommon python3-swsscommon
152+
rm -rf /usr/lib/python3/dist-packages/swsscommon/
153+
dpkg -i libswsscommon.deb python3-swsscommon.deb
154+
```
155+
156+
- You may encounter the following error message:
157+
```
158+
ERROR: Error response from daemon: client is newer than server (client API version: x.xx, server API version: x.xx)
159+
```
160+
161+
You can mitigate this by upgrading to a newer version of Docker CE or editing the `DEFAULT_DOCKER_API_VERSION` in `/usr/local/lib/python3/dist-packages/docker/constants.py`, or by upgrading to a newer version of Docker CE. See [relevant GitHub discussion](https://github.com/drone/drone/issues/2048).

0 commit comments

Comments
 (0)