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

[dns] Implement config and show commands for static DNS. #2737

Merged
merged 3 commits into from
Jun 25, 2023

Conversation

oleksandrivantsiv
Copy link
Collaborator

What I did

Implement config and show commands for static DNS feature. According to sonic-net/SONiC#1262 HLD.

How I did it

Static DNS config commands are implemented in the new config/dns.py file. DNS config commands are available under config dns ... sub-command.
Show commands are implemented in the new show/dns.py file. DNS show commands are available under show dns ... sub-command.

How to verify it

Compile sonic-utilities package. The unit tests will run automatically during the compilation.
Coverage for config/dns.py : 94%
Coverage for show/dns.py : 86%

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)

# config dns nameserver add 1.1.1.1
# config dns nameserver add 8.8.8.8
# show dns nameserver
  Nameserver
------------
     1.1.1.1
     8.8.8.8

Yakiv-Huryk
Yakiv-Huryk previously approved these changes Mar 14, 2023
Copy link
Contributor

@isabelmsft isabelmsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @oleksandrivantsiv , thanks for your work on this PR and the DNS yang model.

Since we are in the process of replacing adhoc validation checks (like your function def is_valid_ip_address) with yang validation, could you please update your PR to reflect this?

Here is the design doc for how we are phasing in yang validation: sonic-net/SONiC#1072

Here is a sample PR to demonstrate changes that would be necessary to your PR: #2604

On a high level, the main steps are:

  1. add if ADHOC_VALIDATION: where you currently have adhoc validation
  2. use the ValidatedConfigDBConnector decorator

ganglyu
ganglyu previously approved these changes Apr 15, 2023
Implement unit tests for all added commands.
Coverage for config/dns.py : 94%
Coverage for show/dns.py : 86%
@oleksandrivantsiv
Copy link
Collaborator Author

Hi @oleksandrivantsiv , thanks for your work on this PR and the DNS yang model.

Since we are in the process of replacing adhoc validation checks (like your function def is_valid_ip_address) with yang validation, could you please update your PR to reflect this?

Here is the design doc for how we are phasing in yang validation: sonic-net/SONiC#1072

Here is a sample PR to demonstrate changes that would be necessary to your PR: #2604

On a high level, the main steps are:

  1. add if ADHOC_VALIDATION: where you currently have adhoc validation
  2. use the ValidatedConfigDBConnector decorator

@isabelmsft done

@liat-grozovik
Copy link
Collaborator

@isabelmsft could you please help to review following comments handled?

@oleksandrivantsiv
Copy link
Collaborator Author

@isabelmsft kindly reminder to review

@liat-grozovik
Copy link
Collaborator

@zhangyanzhao as this should be part of 202305 can you please create a label for sonic-utilities?

isabelmsft
isabelmsft previously approved these changes Jun 21, 2023
Copy link
Collaborator

@liat-grozovik liat-grozovik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oleksandrivantsiv you are missing the command line reference update with the new commands. can you please update it and add the changes to this PR

@oleksandrivantsiv
Copy link
Collaborator Author

@oleksandrivantsiv you are missing the command line reference update with the new commands. can you please update it and add the changes to this PR

done

@liat-grozovik liat-grozovik merged commit dc2945b into sonic-net:master Jun 25, 2023
4 checks passed
dgsudharsan added a commit to dgsudharsan/sonic-buildimage that referenced this pull request Jul 11, 2023
Update sonic-utilities submodule pointer to include the following:
* ff380e04 [hash]: Implement GH frontend ([sonic-net#2580](sonic-net/sonic-utilities#2580))
* 61bad064 [db_migrator] Set correct CURRENT_VERSION, extend UT ([sonic-net#2895](sonic-net/sonic-utilities#2895))
* 6b8ee47c [CLI][Show][BGP] Show BGP Change for no neighbor scenario ([sonic-net#2885](sonic-net/sonic-utilities#2885))
* 73d8d633 [doc] Update Command-Reference.md, change show bgp peer command to show bfd peer ([sonic-net#2750](sonic-net/sonic-utilities#2750))
* 7bc08c28 [db_migrator] Remove hardcoded config and migrate config from minigraph ([sonic-net#2887](sonic-net/sonic-utilities#2887))
* b1aa9426 [generate_dump]: Enhance show techsupport for Marvell platform ([sonic-net#2676](sonic-net/sonic-utilities#2676))
* 316b14c0 Add support for secure upgrade ([sonic-net#2698](sonic-net/sonic-utilities#2698))
* dc2945bc [dns] Implement config and show commands for static DNS. ([sonic-net#2737](sonic-net/sonic-utilities#2737))
* 8414a709 [chassis][multi asic] change acl_loader to use tcp socket for db communication ([sonic-net#2525](sonic-net/sonic-utilities#2525))
* 0b629ba1 Revert [chassis][voq] Clear fabric counters queue/port (2789) ([sonic-net#2882](sonic-net/sonic-utilities#2882))
* 3ba8241a [db_migtrator] Add migration of FLEX_COUNTER_DELAY_STATUS during 1911->master upgrade + fast-reboot. Add UT. ([sonic-net#2839](sonic-net/sonic-utilities#2839))
* fceef2ed [chassis][voq] Clear fabric counters queue/port ([sonic-net#2789](sonic-net/sonic-utilities#2789))

Signed-off-by: dgsudharsan <sudharsand@nvidia.com>
liat-grozovik pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Jul 11, 2023
Update sonic-utilities submodule pointer to include the following:
* ff380e04 [hash]: Implement GH frontend ([#2580](sonic-net/sonic-utilities#2580))
* 61bad064 [db_migrator] Set correct CURRENT_VERSION, extend UT ([#2895](sonic-net/sonic-utilities#2895))
* 6b8ee47c [CLI][Show][BGP] Show BGP Change for no neighbor scenario ([#2885](sonic-net/sonic-utilities#2885))
* 73d8d633 [doc] Update Command-Reference.md, change show bgp peer command to show bfd peer ([#2750](sonic-net/sonic-utilities#2750))
* 7bc08c28 [db_migrator] Remove hardcoded config and migrate config from minigraph ([#2887](sonic-net/sonic-utilities#2887))
* b1aa9426 [generate_dump]: Enhance show techsupport for Marvell platform ([#2676](sonic-net/sonic-utilities#2676))
* 316b14c0 Add support for secure upgrade ([#2698](sonic-net/sonic-utilities#2698))
* dc2945bc [dns] Implement config and show commands for static DNS. ([#2737](sonic-net/sonic-utilities#2737))
* 8414a709 [chassis][multi asic] change acl_loader to use tcp socket for db communication ([#2525](sonic-net/sonic-utilities#2525))
* 0b629ba1 Revert [chassis][voq] Clear fabric counters queue/port (2789) ([#2882](sonic-net/sonic-utilities#2882))
* 3ba8241a [db_migtrator] Add migration of FLEX_COUNTER_DELAY_STATUS during 1911->master upgrade + fast-reboot. Add UT. ([#2839](sonic-net/sonic-utilities#2839))
* fceef2ed [chassis][voq] Clear fabric counters queue/port ([#2789](sonic-net/sonic-utilities#2789))

Signed-off-by: dgsudharsan <sudharsand@nvidia.com>
pdhruv-marvell pushed a commit to pdhruv-marvell/sonic-utilities that referenced this pull request Aug 23, 2023
)

- What I did
Implement config and show commands for static DNS feature. According to sonic-net/SONiC#1262 HLD.

- How I did it
Static DNS config commands are implemented in the new config/dns.py file. DNS config commands are available under config dns ... sub-command.
Show commands are implemented in the new show/dns.py file. DNS show commands are available under show dns ... sub-command.

- How to verify it
Compile sonic-utilities package. The unit tests will run automatically during the compilation.
Coverage for config/dns.py : 94%
Coverage for show/dns.py : 86%

- 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)
# config dns nameserver add 1.1.1.1
# config dns nameserver add 8.8.8.8
# show dns nameserver
  Nameserver
------------
     1.1.1.1
     8.8.8.8
sonic-otn pushed a commit to sonic-otn/sonic-buildimage that referenced this pull request Sep 20, 2023
Update sonic-utilities submodule pointer to include the following:
* ff380e04 [hash]: Implement GH frontend ([sonic-net#2580](sonic-net/sonic-utilities#2580))
* 61bad064 [db_migrator] Set correct CURRENT_VERSION, extend UT ([sonic-net#2895](sonic-net/sonic-utilities#2895))
* 6b8ee47c [CLI][Show][BGP] Show BGP Change for no neighbor scenario ([sonic-net#2885](sonic-net/sonic-utilities#2885))
* 73d8d633 [doc] Update Command-Reference.md, change show bgp peer command to show bfd peer ([sonic-net#2750](sonic-net/sonic-utilities#2750))
* 7bc08c28 [db_migrator] Remove hardcoded config and migrate config from minigraph ([sonic-net#2887](sonic-net/sonic-utilities#2887))
* b1aa9426 [generate_dump]: Enhance show techsupport for Marvell platform ([sonic-net#2676](sonic-net/sonic-utilities#2676))
* 316b14c0 Add support for secure upgrade ([sonic-net#2698](sonic-net/sonic-utilities#2698))
* dc2945bc [dns] Implement config and show commands for static DNS. ([sonic-net#2737](sonic-net/sonic-utilities#2737))
* 8414a709 [chassis][multi asic] change acl_loader to use tcp socket for db communication ([sonic-net#2525](sonic-net/sonic-utilities#2525))
* 0b629ba1 Revert [chassis][voq] Clear fabric counters queue/port (2789) ([sonic-net#2882](sonic-net/sonic-utilities#2882))
* 3ba8241a [db_migtrator] Add migration of FLEX_COUNTER_DELAY_STATUS during 1911->master upgrade + fast-reboot. Add UT. ([sonic-net#2839](sonic-net/sonic-utilities#2839))
* fceef2ed [chassis][voq] Clear fabric counters queue/port ([sonic-net#2789](sonic-net/sonic-utilities#2789))

Signed-off-by: dgsudharsan <sudharsand@nvidia.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.

6 participants