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

[show] Fix command "show nat translations count" #1680

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ezio-chen
Copy link

What I did

Add the optin parameter "verbose" for "show nat translations count".

How I did it

This command cannot be executed because the necessary variable "verbose" is missing.

How to verify it

Verify the command could be executed successfully.

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

admin@sonic:~$ show nat translations count

Static NAT Entries         ..................... 0
Static NAPT Entries        ..................... 0
Dynamic NAT Entries        ..................... 0
Dynamic NAPT Entries       ..................... 0
Static Twice NAT Entries   ..................... 0
Static Twice NAPT Entries  ..................... 0
Dynamic Twice NAT Entries  ..................... 0
Dynamic Twice NAPT Entries ..................... 0
Total SNAT/SNAPT Entries   ..................... 0
Total DNAT/DNAPT Entries   ..................... 0
Total Entries              ..................... 0
admin@sonic:~$ show nat translations count --verbose
Running command: sudo natshow -c

Static NAT Entries         ..................... 0
Static NAPT Entries        ..................... 0
Dynamic NAT Entries        ..................... 0
Dynamic NAPT Entries       ..................... 0
Static Twice NAT Entries   ..................... 0
Static Twice NAPT Entries  ..................... 0
Dynamic Twice NAT Entries  ..................... 0
Dynamic Twice NAPT Entries ..................... 0
Total SNAT/SNAPT Entries   ..................... 0
Total DNAT/DNAPT Entries   ..................... 0
Total Entries              ..................... 0

- What I did
Add the optin parameter "verbose" for "show nat translations count".

- Why I did it
This command cannot be executed because the necessary variable "verbose" is missing.

- How I verified it
Verify the command could be executed successfully

```
admin@sonic:~$ show nat translations count

Static NAT Entries         ..................... 0
Static NAPT Entries        ..................... 0
Dynamic NAT Entries        ..................... 0
Dynamic NAPT Entries       ..................... 0
Static Twice NAT Entries   ..................... 0
Static Twice NAPT Entries  ..................... 0
Dynamic Twice NAT Entries  ..................... 0
Dynamic Twice NAPT Entries ..................... 0
Total SNAT/SNAPT Entries   ..................... 0
Total DNAT/DNAPT Entries   ..................... 0
Total Entries              ..................... 0
admin@sonic:~$ show nat translations count --verbose
Running command: sudo natshow -c

Static NAT Entries         ..................... 0
Static NAPT Entries        ..................... 0
Dynamic NAT Entries        ..................... 0
Dynamic NAPT Entries       ..................... 0
Static Twice NAT Entries   ..................... 0
Static Twice NAPT Entries  ..................... 0
Dynamic Twice NAT Entries  ..................... 0
Dynamic Twice NAPT Entries ..................... 0
Total SNAT/SNAPT Entries   ..................... 0
Total DNAT/DNAPT Entries   ..................... 0
Total Entries              ..................... 0
admin@sonic:~$
```
@lguohan
Copy link
Contributor

lguohan commented Jun 17, 2021

can you add unit test?

@ezio-chen
Copy link
Author

Add the unit test for show nat

@ezio-chen
Copy link
Author

Hi @lguohan, could you help to review the change ?

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