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

[dhcp_server] Add config_db monitor and customize options for dhcpservd #17051

Merged
merged 12 commits into from
Nov 16, 2023

Conversation

yaqiangz
Copy link
Contributor

@yaqiangz yaqiangz commented Oct 31, 2023

Why I did it

Add config_db monitor and customize options for dhcpservd. HLD: sonic-net/SONiC#1282

Work item tracking
  • Microsoft ADO (number only): 25600859

How I did it

  1. Add support to customize unassigned DHCP options. Current support type: binary, boolean, ipv4-address, string, uint8, uint16, uint32
  2. Add db config change monitor for dhcpservd

How to verify it

Unit tests in sonic-dhcp-server all passed

=============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.9.2, pytest-6.0.2, py-1.10.0, pluggy-0.13.0
rootdir: /sonic/src/sonic-dhcp-server, configfile: setup.cfg, testpaths: tests
plugins: pyfakefs-5.2.4, cov-2.10.1
collected 261 items                                                                                                                                                                                               

tests/test_dhcp_cfggen.py ..................                                                                                                                                                                [  6%]
tests/test_dhcp_db_monitor.py ............................................................................................................                                                                  [ 48%]
tests/test_dhcp_lease.py .....                                                                                                                                                                              [ 50%]
tests/test_dhcprelayd.py ........................................................................................                                                                                           [ 83%]
tests/test_dhcpservd.py .......                                                                                                                                                                             [ 86%]
tests/test_utils.py ...................................                                                                                                                                                     [100%]Clearing the cache


----------- coverage: platform linux, python 3.9.2-final-0 -----------
Name                                    Stmts   Miss Branch BrPart     Cover   Missing
--------------------------------------------------------------------------------------
dhcp_server/dhcpservd/dhcpservd.py         67      4     14      0    92.59%   89-96
dhcp_server/dhcprelayd/dhcprelayd.py      116      6     46      0    93.83%   76-82
dhcp_server/dhcpservd/dhcp_lease.py        95      3     30      4    94.40%   57->59, 59, 60->61, 61, 74->76, 112->134, 153
dhcp_server/dhcpservd/dhcp_cfggen.py      219      6     92      1    97.75%   202-206, 292->294, 294
dhcp_server/common/utils.py                69      1     38      1    98.13%   128->133, 133
dhcp_server/common/dhcp_db_monitor.py     221      0     74      1    99.66%   366->exit
--------------------------------------------------------------------------------------
TOTAL                                     787     20    294      7    96.95%

1 file skipped due to complete coverage.

Required test coverage of 80.0% reached. Total coverage: 96.95%

Signed-off-by: Yaqiang Zhu yaqiangzhu@microsoft.com

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@yaqiangz yaqiangz force-pushed the master_customize_options branch from 7ac2ed2 to 5a065ca Compare November 2, 2023 15:22
@yaqiangz yaqiangz marked this pull request as ready for review November 6, 2023 03:27
@yaqiangz yaqiangz force-pushed the master_customize_options branch from 49735de to 74aeffc Compare November 6, 2023 04:18
@yaqiangz yaqiangz force-pushed the master_customize_options branch from aeb5fe4 to 3ad4269 Compare November 6, 2023 09:15
@yaqiangz yaqiangz force-pushed the master_customize_options branch 4 times, most recently from 515dcb0 to 43f3838 Compare November 8, 2023 12:19
@yaqiangz yaqiangz force-pushed the master_customize_options branch 5 times, most recently from 43ecb5b to 1da1f3c Compare November 13, 2023 03:35
@yaqiangz yaqiangz force-pushed the master_customize_options branch 2 times, most recently from e6f1742 to 0cdd042 Compare November 13, 2023 07:03
@yaqiangz yaqiangz force-pushed the master_customize_options branch 2 times, most recently from 39715e2 to 46f6945 Compare November 15, 2023 08:40
@yaqiangz yaqiangz force-pushed the master_customize_options branch from 46f6945 to fc568f7 Compare November 16, 2023 02:01
@yxieca yxieca merged commit 3223ca0 into sonic-net:master Nov 16, 2023
@Xichen96 Xichen96 mentioned this pull request Nov 22, 2023
11 tasks
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