Commit Graph

46 Commits

Author SHA1 Message Date
xumia
ccfb13aa2a [Build] Support j2 template for debian sources for docker ptf (#13198)
Change to use the sources.list from the file generated from the j2 template
2023-02-22 04:33:49 +08:00
Zhaohui Sun
21b2361027 Enable system-site-packages for ptf docker and install thrift for test_qos_sai (#12094)
Why I did it
test_sai_qos failed because of the following error:

"stderr_lines": [
        "Traceback (most recent call last):", 
        "  File \"/usr/bin/ptf\", line 522, in <module>", 
        "    test_modules = load_test_modules(config)", 
        "  File \"/usr/bin/ptf\", line 413, in load_test_modules", 
        "    mod = imp.load_module(modname, *imp.find_module(modname, [root]))", 
        "  File \"saitests/switch.py\", line 19, in <module>", 
        "    import switch_sai_thrift", 
        "ImportError: No module named switch_sai_thrift"
    ], 

It's because test_sai_qos runs ptf script which imports switch_sai_thrift, switch_sai_thrift is installed from python-saithrift_0.9.4_amd64.deb.
For master image, the deb file is for python3, but ptf only has virtual python3 environment, that's why we add --system-site-packages to allow virtual env to access system site-packeges.

Add thrift package in docker ptf virtual python3 env, because currently env-python3 doesn't have thrift module which is needed in switch_sai_thrift.

How I did it
Enable --system-site-packages for virtual py3 env in ptf docker and install thrift for test_qos_sai

How to verify it
load and login ptf conatiner
dpkg - i python-saithrift_0.9.4_amd64.deb
source /root/env-python3/bin/activate
python
import switch_sai_thrift.switch_sai_rpc
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
2022-10-03 19:00:22 +00:00
Zhaohui Sun
cc30771f6b
Add python3 virtual environment for docker-ptf (#10599)
Why I did it
Migrate ptftests script to python3, in order to do an incremental migration, add python virtual environment firstly, install all required python packages in virtual env as well.
Then migrate ptftests scripts from python2 to python3 one by one avoid impacting non-changed scripts.

Signed-off-by: Zhaohui Sun zhaohuisun@microsoft.com

How I did it
Add python3 virtual environment for docker-ptf.
Add submodule ptf-py3 and install patched ptf 0.9.3 into virtual environment as well, two ptf issues were reported here:
p4lang/ptf#173
p4lang/ptf#174

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
2022-04-26 09:13:26 +08:00
Zhaohui Sun
44cf773a96
Revert "[docker-ptf]: Upgrade scapy to 2.4.5 in docker-ptf (#10507)" (#10537)
It upgraded scapy to 2.4.5 in docker-ptf container, after this upgrade, all scripts under ansible/roles/test/files/ptftests will import scapy 2.4.5, some test cases will fail because they are not upgraded accordingly.

Reverts #10507 to avoid breaking regression test.

This reverts commit 92efc01270.
2022-04-13 08:57:10 +08:00
Ze Gan
92efc01270
[docker-ptf]: Upgrade scapy to 2.4.5 in docker-ptf (#10507)
Why I did it
Existing dataplane tests cannot be tested under MACsec environment due to the traffic under MACsec link is encrypted. So, I will override the dp_poll of ptf to MACsec dp_poll to decrypt the MACsec packets on injected ports (PR: Azure/sonic-mgmt#5490). MACsec decryption library depends on scapy 2.4.5.

How I did it
Upgrade scapy library to 2.4.5 by pip.

How to verify it
Check the scapy version in docker-ptf by

python -c "import scapy; print(scapy.__version__)"
2.4.5

Signed-off-by: Ze Gan <ganze718@gmail.com>
2022-04-08 22:26:40 -07:00
Shilong Liu
3fa627f290
Add a config variable to override default container registry instead of dockerhub. (#10166)
* Add variable to reset default docker registry
* fix bug in docker version control
2022-03-14 18:09:20 +08:00
Shi Su
f2774b635d
Add openbfdd to ptf docker (#9488)
Why I did it
To enable test support for BFD-related features, the PTF docker needs to have the proper support for BFD. This PR aims to add BFD support in ptf docker.

How I did it
Clone and build OpenBFDD for PTF docker.

How to verify it
Build locally and verify BFD is supported.
2021-12-14 11:46:48 -08:00
Ye Jianquan
38500fa92e
Add gdb and pyrasite to ptf image (#8816) 2021-09-24 17:10:48 +08:00
Myron Sosyak
4d03526311
[docker-ptf] Upgrade to buster (#8254)
Co-authored-by: Your Name <you@example.com>
2021-08-18 10:42:03 -07:00
richardyu
9417fe9303
PTF adds unittest-xml-reporting (#8417)
Co-authored-by: richardyu-ms <richard.yu@microsoft.com>
2021-08-11 20:55:21 -07:00
guxianghong
6fe6d7394d
[arm] support compile sonic arm image on arm server (#7285)
- Support compile sonic arm image on arm server. If arm image compiling is executed on arm server instead of using qemu mode on x86 server, compile time can be saved significantly.
- Add kernel argument systemd.unified_cgroup_hierarchy=0 for upgrade systemd to version 247, according to #7228
- rename multiarch docker to sonic-slave-${distro}-march-${arch}

Co-authored-by: Xianghong Gu <xgu@centecnetworks.com>
Co-authored-by: Shi Lei <shil@centecnetworks.com>
2021-04-18 08:17:57 -07:00
Ze Gan
5221e68b99
[docker-ptf]: Add teamd dependency to ptf (#6994)
Signed-off-by: Ze Gan <ganze718@gmail.com>
2021-03-10 09:11:23 -08:00
Qi Luo
38d973b834
[build]: Fix get-pip 2.7 url according to upstream announcement (#6999)
ref: https://bootstrap.pypa.io/2.7/get-pip.py

The URL you are using to fetch this script has changed, and this one will no
longer work. Please use get-pip.py from the following URL instead:

    https://bootstrap.pypa.io/pip/2.7/get-pip.py
2021-03-09 18:15:16 -08:00
Guohan Lu
ca0e8cbe0e [docker-ptf]: build docker ptf
- combine docker-ptf-saithrift into docker-ptf docker
- build docker-ptf under platform vs
- remove docker-ptf for other platforms

Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-27 08:28:21 -08:00
macikgozwa
169b2fb188
[docker-ptf]: Updating Python-based GNMI client (#6216)
Upgrading the reference for the Python GNMI tool repository. The commit for the new payload

Co-authored-by: Murat Acikgoz <muacikgo@microsoft.com>
2020-12-17 22:12:04 -08:00
pra-moh
24f684da68 [docker-ptf] add gnmi python client (#4928)
For telemetry regression test we need gnmi client to be present on ptfdocker. Gnmi-server will be present on SONiC DuT. Further, we can access gnmi_get from ptfdocker inside pytest to verify gnmi server streaming data successfully or not.
2020-07-12 18:08:52 +00:00
Danny Allen
2872d80231
[docker-ptf] Add support for spytest to ptf container (#4410)
- Install apt and pip dependencies
- Define traffic generator service

Signed-off-by: Danny Allen <daall@microsoft.com>
2020-04-13 16:56:19 -07:00
lguohan
9b48c22449
[docker-ptf]: install ntp related package (#4275)
setup ntp server to do the test

Signed-off-by: Guohan Lu <lguohan@gmail.com>
2020-03-18 11:01:36 -07:00
lguohan
09c0563692
[docker-ptf]: install tacacs+ server to test tacacs (#4224)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2020-03-05 01:37:23 -08:00
chitra-raghavan
c6fee49e76 [docker-ptf]: Adding sflowtool to ptf docker to for sflow tests (#4045)
Adding sflowtool to ptf docker for running sflow tests in sonic-mgmt repository
2020-01-23 09:28:39 -08:00
lguohan
57728c5c8b
[docker-ptf]: add ethtool and telnet package in ptf (#3815) 2019-11-25 09:00:47 -08:00
pavel-shirshov
420278f286 [docker-base/ptf]: Make a link to vim. Add tmux to docker-ptf (#3758) 2019-11-20 07:39:49 -08:00
Sudharsan D.G
be3421c352 [docker-ptf]: Added python-libpcap for the updated arp responder (#3731)
Added python-libpcap to be used by arp_responder.py utility. This is needed to set conf.use_pcap which will make sure that L2pcapListenSocket uses libpcap instead of Linux PF_PACKET sockets. By using libpcap the vlan field will not be removed when the application receives the packet.
2019-11-08 22:57:05 -08:00
arheneus@marvell.com
50fe458592 [build]: SONiC buildimage ARM arch support (#2980)
ARM Architecture support in SONIC

make configure platform=[ASIC_VENDOR_ARCH] PLATFORM_ARCH=[ARM_ARCH]
SONIC_ARCH: default amd64
armhf - arm32bit
arm64 - arm64bit

Signed-off-by: Antony Rheneus <arheneus@marvell.com>
2019-07-25 22:06:41 -07:00
Nazarii Hnydyn
77b3a18dd0 [ptf] Fixed root ssh authentication issue (#3192)
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
2019-07-23 07:02:31 -07:00
lguohan
6ca35b55d6
[docker-ptf]: move docker-ptf to stretch (#2954) 2019-05-29 18:26:52 -07:00
Ying Xie
9af7d21e2e
[jessie based docker] remove dependency on some retired jessie repos (#2707)
* [jessie repo] remove one dependency on jessie-backport repo

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* [build] remove dependency on retried jessie-backports repo

The downloaded Jessie docker image still reference jessie-updates.
Removing it from the list.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* fix typo

* move chunk

* [docker-ptf] avoid using retired Jessie repos

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
2019-03-26 23:46:39 -07:00
Stepan Blyshchak
8b7fc8db65 [dockers] Upgrade Mellanox syncd docker to stretch (#2640)
* [dockers] Upgrade Mellanox syncd docker to stretch

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
2019-03-12 21:38:25 -07:00
pavel-shirshov
d39dd396b5
Move tcpdump into /usr/bin Otherwise it's impossible to run tcpdump due to a docker bug (#1195) 2017-11-29 16:36:26 -08:00
pavel-shirshov
bdbede51e0 [docker ptf]: Install tcpdump (#1059)
* Always start with Forwarding State flag set for bgpd

* Install tcpdump into ptf container
2017-10-20 05:09:37 -07:00
pavel-shirshov
d898011b2e [docker-ptf]: Update entrypoint entry for docker-ptf (#836)
* Updated entrypoint for docker-ptf container

* Add main supervisord.conf file under /etc/supervisor. Run supervisord with option -c
2017-07-24 13:36:40 -07:00
pavel-shirshov
2201bf3496 [docker-ptf]: Install yaml module for python (#821)
* Install yaml python module in docker-ptf container
2017-07-19 23:21:03 -07:00
pavel-shirshov
7792f09437 [docker-ptf]: Install python modules from pypi (#788) 2017-07-06 02:27:05 -07:00
sihuihan88
6867458058 [docker-ptf]: Install exabgp in docker ptf (#709) 2017-06-16 07:25:40 -07:00
lguohan
26f98559b0 [docker-ptf]: add hping3 into docker-ptf (#651) 2017-05-31 10:49:31 -07:00
pavel-shirshov
122c03caee [docker-ptf]: Overwrite ubuntu scapy with version from p4lang (#639)
* Install scapy from p4lang

* Overwrite standard scapy version
2017-05-26 18:32:52 -07:00
pavel-shirshov
edab38e321 Install ipython from packages (#637) 2017-05-26 13:31:33 -07:00
pavel-shirshov
867670665f [docker-ptf]: Add less, ipython, and python ssh libraries (#625) 2017-05-24 01:34:37 -07:00
Joe LeVeque
8f348399f5 [Dockers]: Manage all Docker containers with Supervisord (#573)
- Consolidate config.sh and start.sh scripts into one script (start.sh)
 - Solve issue #435 - All dockers now run supervisord as their ENTRYPOINT
 - All stdout/stderr output from processes managed by supervisord is now sent to syslog instead of their own files
 - Supervisord log messages are now also sent to syslog
 - Removed unused smartmontools package from docker-platform-monitor
2017-05-08 15:43:31 -07:00
maggiemsft
4dfe2a26f3 [docker-ptf]replace ping utility from inetutils-ping to iputils-ping (#523)
* replace ping utility from inetutil-ping to iputils-ping

* fix dup typo

* change from package installing to using apt install

* remove unnecessary package handling line
2017-05-01 18:47:29 -07:00
Shuotian Cheng
c7d540cb2f [ptf]: Add pip install pysubnettree (#554)
>> import SubnetTree

This module is used for PTF FIB test to build LPM
2017-04-29 00:15:12 -07:00
Andriy Moroz
ddbda4ce2e docker: Add ipaddress python module to the PTF docker (#231)
Needed for the FIB test
2017-02-01 12:49:43 -08:00
Joe LeVeque
608980524f [docker]: Install dpkt Python package in PTF docker (#216) 2017-01-25 18:19:15 -08:00
Oleksandr Ivantsiv
80d0d2d43b Reduce docker images size. (#196)
* Reduce docker images size.

Install only required dependencies.

* Update Dockerfile.j2
2017-01-19 12:19:21 -08:00
Pavel Shirshov
86f5c19643 [docker]: docker-ptf doesn't wait until eth3 is up
This is done inside ptf agent now
2017-01-17 14:40:35 -08:00
marian-pritsak
43b0e502de Add recipe for ptf docker 2017-01-05 14:39:07 -08:00