Skip to content

[dhcp_server] test ip assignment with single and range ip configuration#12427

Merged
wangxin merged 8 commits intosonic-net:masterfrom
w1nda:pub_test_dhcp_server
May 9, 2024
Merged

[dhcp_server] test ip assignment with single and range ip configuration#12427
wangxin merged 8 commits intosonic-net:masterfrom
w1nda:pub_test_dhcp_server

Conversation

@w1nda
Copy link
Member

@w1nda w1nda commented Apr 12, 2024

Description of PR

Summary:
This PR is part of test plan #11348 implementation

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205
  • 202305
  • 202311

Approach

What is the motivation for this PR?

To make sure dhcp server has the capability for usage.

How did you do it?

In this PR,
first, we write common function to construct DHCP packet, parse VLAN configuration, parse port mapping and send packet and verify packet.
second, we add cases for ip assignment with single ip configuration.
last, we add case for ip assignment with range ip configuration.

How did you verify/test it?

Run tests on Arista-720DT-G48S4 and Nokia-7215 mx topo.

Any platform specific information?

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

Documentation

@w1nda w1nda requested review from Blueve and yaqiangz April 12, 2024 02:46
@w1nda w1nda force-pushed the pub_test_dhcp_server branch from ce26485 to b8c72ea Compare April 12, 2024 03:21
@w1nda w1nda force-pushed the pub_test_dhcp_server branch from b8c72ea to 594de42 Compare April 12, 2024 09:14
@w1nda w1nda force-pushed the pub_test_dhcp_server branch from 643835c to b447ab3 Compare April 16, 2024 04:21
@w1nda w1nda changed the title [dhcp_server] implement dhcp server test plan [dhcp_server] test ip assignment with single and range ip configuration Apr 16, 2024
@w1nda w1nda marked this pull request as ready for review April 16, 2024 06:26
@w1nda w1nda requested a review from yaqiangz April 16, 2024 06:27
@w1nda w1nda requested a review from yaqiangz April 16, 2024 12:10
@w1nda w1nda force-pushed the pub_test_dhcp_server branch from 1595367 to 9a2434f Compare April 26, 2024 09:05
@w1nda w1nda requested a review from yaqiangz April 26, 2024 09:49
@w1nda
Copy link
Member Author

w1nda commented May 6, 2024

Hi @wangxin, cloud you help merge this PR?

@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/dhcp_server/test_dhcp_server.py:134:30: F821 undefined name 'json'

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@wangxin wangxin merged commit a63bb0f into sonic-net:master May 9, 2024
w1nda added a commit to w1nda/sonic-mgmt that referenced this pull request Jun 26, 2024
…on (sonic-net#12427)

What is the motivation for this PR?
To make sure dhcp server has the capability for usage.

How did you do it?
In this PR,
first, we write common function to construct DHCP packet, parse VLAN configuration, parse port mapping and send packet and verify packet.
second, we add cases for ip assignment with single ip configuration.
last, we add case for ip assignment with range ip configuration.

How did you verify/test it?
Run tests on Arista-720DT-G48S4 and Nokia-7215 mx topo.
mrkcmo pushed a commit to Azarack/sonic-mgmt that referenced this pull request Jul 17, 2024
…on (sonic-net#12427)

What is the motivation for this PR?
To make sure dhcp server has the capability for usage.

How did you do it?
In this PR,
first, we write common function to construct DHCP packet, parse VLAN configuration, parse port mapping and send packet and verify packet.
second, we add cases for ip assignment with single ip configuration.
last, we add case for ip assignment with range ip configuration.

How did you verify/test it?
Run tests on Arista-720DT-G48S4 and Nokia-7215 mx topo.
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.

4 participants