Skip to content

[202012][vlan] Remove add field of vlanid to DHCP_RELAY table while adding vlan#2681

Merged
yaqiangz merged 1 commit intosonic-net:202012from
yaqiangz:202012_fix_dhcp_relay
Feb 16, 2023
Merged

[202012][vlan] Remove add field of vlanid to DHCP_RELAY table while adding vlan#2681
yaqiangz merged 1 commit intosonic-net:202012from
yaqiangz:202012_fix_dhcp_relay

Conversation

@yaqiangz
Copy link
Contributor

@yaqiangz yaqiangz commented Feb 16, 2023

What I did

Remove add field of vlanid to DHCP_RELAY table while add vlan which would cause conflict with yang model.

How I did it

Remove add field of vlanid to DHCP_RELAY table while add vlan

How to verify it

2023-02-16T02:09:35.8928219Z ============================= test session starts ==============================
2023-02-16T02:09:35.8933715Z platform linux -- Python 3.7.3, pytest-3.10.1, py-1.7.0, pluggy-0.8.0
2023-02-16T02:09:35.8938378Z rootdir: /__w/1/s, inifile: pytest.ini
2023-02-16T02:09:35.8939079Z plugins: pyfakefs-5.1.0, cov-2.6.0
2023-02-16T02:09:40.5576217Z collected 961 items
2023-02-16T02:09:40.5615053Z 

2023-02-16T02:09:53.1351705Z tests/config_dhcp_relay_test.py ....................                     [ 10%]
2023-02-16T02:13:07.5436089Z tests/vlan_test.py ............................................          [ 97%]
2023-02-16T02:13:29.0043783Z 
2023-02-16T02:13:29.0045422Z ----------- coverage: platform linux, python 3.7.3-final-0 -----------
2023-02-16T02:13:29.0046195Z Name                                          Stmts   Miss  Cover
2023-02-16T02:13:29.0047090Z -----------------------------------------------------------------
2023-02-16T02:13:29.0055037Z config/dhcp_relay.py                            102      8    92%
2023-02-16T02:13:29.0060232Z config/vlan.py                                  180     14    92%
2023-02-16T02:13:29.0125331Z -----------------------------------------------------------------
2023-02-16T02:13:29.0125743Z TOTAL                                         23301   9713    58%
2023-02-16T02:13:29.0126195Z Coverage HTML written to dir htmlcov
2023-02-16T02:13:29.0126538Z Coverage XML written to file coverage.xml
2023-02-16T02:13:29.0126826Z 
2023-02-16T02:13:29.0126910Z 
2023-02-16T02:13:29.0127254Z ========================= 961 passed in 233.11 seconds =========================
admin@:~$ sudo sonic-db-cli CONFIG_DB hgetall "DHCP_RELAY|Vlan2000"
{}
admin@:~$ sudo config vlan add 2000
Restarting DHCP relay service...
admin@:~$ sudo sonic-db-cli CONFIG_DB hgetall "DHCP_RELAY|Vlan2000"
{}
admin@:~$ sudo config dhcp_relay ipv6 destination add 2000 fc02:2000::5
Added DHCP relay address [fc02:2000::5] to Vlan2000
Restarting DHCP relay service...
admin@:~$ sudo sonic-db-cli CONFIG_DB hgetall "DHCP_RELAY|Vlan2000"
{'dhcpv6_servers@': 'fc02:2000::5'}
admin@:~$ sudo config dhcp_relay ipv6 destination add 2000 fc02:2000::5
fc02:2000::5 is already a DHCP relay for Vlan2000
admin@:~$ sudo config dhcp_relay ipv6 destination add 2000 fc02:2000::6
Added DHCP relay address [fc02:2000::6] to Vlan2000
Restarting DHCP relay service...
admin@:~$ sudo sonic-db-cli CONFIG_DB hgetall "DHCP_RELAY|Vlan2000"
{'dhcpv6_servers@': 'fc02:2000::5,fc02:2000::6'}
admin@:~$ sudo config dhcp_relay ipv6 destination add 2000 fc02:2000::7 fc02:2000::8
Added DHCP relay address [fc02:2000::7,fc02:2000::8] to Vlan2000
Restarting DHCP relay service...
admin@:~$ sudo sonic-db-cli CONFIG_DB hgetall "DHCP_RELAY|Vlan2000"
{'dhcpv6_servers@': 'fc02:2000::5,fc02:2000::6,fc02:2000::7,fc02:2000::8'}

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@yaqiangz yaqiangz requested a review from jcaiMR February 16, 2023 03:06
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.

2 participants