Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python3]migrate dhcp relay ptftests scripts from python2 to python3 #5534

Merged
merged 2 commits into from
May 12, 2022

Conversation

ZhaohuiS
Copy link
Contributor

@ZhaohuiS ZhaohuiS commented Apr 19, 2022

Description of PR

Summary:
Migrate dhcp relay ptftests scripts from python2 to python3.

PR cannot be merged until merging of sonic-net/sonic-buildimage#10599 which includes necessary changes for the setup of the Python3 virtual environment in the docker-ptf docker container.

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

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911
  • 202012

Approach

What is the motivation for this PR?

Do an incremental migration, migrate ptftests scripts from python2 to python3 one by one.

How did you do it?

Avoid impact py2 script, add virtual env in docker-ptf container, then call virtual env ptf for migrated py3 scripts.
But ptf command will load all scripts under ptftests, it will throw error for py2 scripts when using new ptf.
So move migrated scripts to separated py3 folder avoid impacting py2 scripts.

How did you verify/test it?

run dhcp_relay/test_dhcp_relay.py and dhcp_relay/test_dhcpv6_relay.py

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

docker-ptf python3 migration doc:
https://github.com/Azure/sonic-mgmt/blob/master/ansible/roles/test/files/ptftests/py3/README.md

@ZhaohuiS ZhaohuiS requested a review from a team as a code owner April 19, 2022 09:58
@ZhaohuiS ZhaohuiS changed the title migrate dhcp relay ptftests scripts from python2 to python3 [python3]migrate dhcp relay ptftests scripts from python2 to python3 Apr 21, 2022
@ZhaohuiS
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Pull request contains merge conflicts.

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
@ZhaohuiS ZhaohuiS force-pushed the python3_migration_ptf branch from 318e383 to a15af7b Compare April 27, 2022 03:05
@ZhaohuiS ZhaohuiS requested a review from wangxin April 27, 2022 03:24
@ZhaohuiS
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ZhaohuiS
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ZhaohuiS ZhaohuiS requested a review from kellyyeh April 28, 2022 01:36
@ZhaohuiS ZhaohuiS merged commit 96b6289 into sonic-net:master May 12, 2022
ZhaohuiS added a commit that referenced this pull request May 18, 2022
Description of PR
Summary:
migrate the following scripts to python3, this PR can't be merged until #5534 is merged which has dependency of ptf_runner.py

ansible/roles/test/files/ptftests/dir_bcast_test.py
ansible/roles/test/files/ptftests/fdb.py
ansible/roles/test/files/ptftests/fdb_mac_expire_test.py
ansible/roles/test/files/ptftests/fdb_test.py


Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants