[action] [PR:4448] Show vnet route cli update on 202511#313
Merged
Conversation
<!--
Please make sure you've read and understood our contributing guidelines:
https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md
** Make sure all your commits include a signature generated with `git commit -s` **
If this is a bug fix, make sure your description includes "closes #xxxx",
"fixes #xxxx" or "resolves #xxxx" so that GitHub automatically closes the related
issue when the PR is merged.
If you are adding/modifying/removing any command or utility script, please also
make sure to add/modify/remove any unit tests from the tests
directory as appropriate.
If you are modifying or removing an existing 'show', 'config' or 'sonic-clear'
subcommand, or you are adding a new subcommand, please make sure you also
update the Command Line Reference Guide (doc/Command-Reference.md) to reflect
your changes.
Please provide the following information:
-->
#### What I did
It is a manually cherry-pick from sonic-net/sonic-utilities#4332
Updating the show vnet cli:
1. showing new filed "metric" in show vnet route all/tunnel
2. added <vnet_name> for specific vnet name on vnet show route all/local/tunnel commands
#### How I did it
1. added metric field in show vnet route
2. changed show vnet show route all/tunnel, and added vnet show route local
3. updated command reference document
4. Added mock test cases and related unit tests
#### How to verify it
added unit tests and passed.
<img width="1716" height="422" alt="image" src="https://github.com/user-attachments/assets/a6a5352c-c1e7-4ed3-9081-197ec5412d04" />
#### Previous command output (if the output of a command-line utility has changed)
\>show vnet routes all
```
vnet name prefix nexthop interface
--------------- ---------------- ------------------------------------- -------------------------------
test_v4_in_v4-0 160.162.191.1/32 100.100.4.1 Ethernet1
test_v4_in_v4-0 160.163.191.1/32 100.101.4.1, 100.101.4.2 Ethernet1, Ethernet2
test_v4_in_v4-0 160.164.191.1/32 100.102.4.1, 100.102.4.2, 100.102.4.3 Ethernet1, Ethernet2, Ethernet3
test_v4_in_v4-1 160.165.191.1/32 100.103.4.1, 100.103.4.2, 100.103.4.3 Ethernet1, Ethernet2, Ethernet3
vnet name prefix endpoint mac address vni status
--------------- ------------------------ ------------------------------------------- ------------- ----- --------
Vnet_v6_in_v6-0 fddd:a156:a251::a6:1/128 fddd:a100:a251::a10:1,fddd:a101:a251::a10:1 active
fddd:a102:a251::a10:1,fddd:a103:a251::a10:1
test_v4_in_v4-0 160.162.191.1/32 100.251.7.1 active
test_v4_in_v4-0 160.163.191.1/32 100.251.7.1 active
test_v4_in_v4-0 160.164.191.1/32 100.251.7.1
```
\>show vnet routes tunnel
```
vnet name prefix endpoint mac address vni
--------------- ------------------------ --------------------------------------------------------------------------------------- ------------- -----
Vnet_v6_in_v6-0 fddd:a156:a251::a6:1/128 fddd:a100:a251::a10:1,fddd:a101:a251::a10:1,fddd:a102:a251::a10:1,fddd:a103:a251::a10:1
test_v4_in_v4-0 160.162.191.1/32 100.251.7.1
test_v4_in_v4-0 160.163.191.1/32 100.251.7.1
test_v4_in_v4-0 160.164.191.1/32 100.251.7.1
```
#### New command output (if the output of a command-line utility has changed)
\>show vnet routes all
```
vnet name prefix nexthop interface
--------------- ---------------- ------------------------------------- -------------------------------
test_v4_in_v4-0 160.162.191.1/32 100.100.4.1 Ethernet1
test_v4_in_v4-0 160.163.191.1/32 100.101.4.1, 100.101.4.2 Ethernet1, Ethernet2
test_v4_in_v4-0 160.164.191.1/32 100.102.4.1, 100.102.4.2, 100.102.4.3 Ethernet1, Ethernet2, Ethernet3
test_v4_in_v4-1 160.165.191.1/32 100.103.4.1, 100.103.4.2, 100.103.4.3 Ethernet1, Ethernet2, Ethernet3
vnet name prefix endpoint mac address vni metric status
--------------- ------------------------ ------------------------------------------- ------------- ----- -------- --------
Vnet_v6_in_v6-0 fddd:a156:a251::a6:1/128 fddd:a100:a251::a10:1,fddd:a101:a251::a10:1 active
fddd:a102:a251::a10:1,fddd:a103:a251::a10:1
test_v4_in_v4-0 160.162.191.1/32 100.251.7.1 active
test_v4_in_v4-0 160.163.191.1/32 100.251.7.1 0 active
test_v4_in_v4-0 160.164.191.1/32 100.251.7.1
```
\>show vnet routes all test_v4_in_v4-0
```
vnet name prefix nexthop interface
--------------- ---------------- ------------------------------------- -------------------------------
test_v4_in_v4-0 160.162.191.1/32 100.100.4.1 Ethernet1
test_v4_in_v4-0 160.163.191.1/32 100.101.4.1, 100.101.4.2 Ethernet1, Ethernet2
test_v4_in_v4-0 160.164.191.1/32 100.102.4.1, 100.102.4.2, 100.102.4.3 Ethernet1, Ethernet2, Ethernet3
vnet name prefix endpoint mac address vni metric status
--------------- ---------------- ----------- ------------- ----- -------- --------
test_v4_in_v4-0 160.162.191.1/32 100.251.7.1 active
test_v4_in_v4-0 160.163.191.1/32 100.251.7.1 0 active
test_v4_in_v4-0 160.164.191.1/32 100.251.7.1
```
\> show vnet routes tunnel
```
vnet name prefix endpoint mac address vni metric status
--------------- ------------------------ ------------------------------------------- ------------- ----- -------- --------
Vnet_v6_in_v6-0 fddd:a156:a251::a6:1/128 fddd:a100:a251::a10:1,fddd:a101:a251::a10:1 active
fddd:a102:a251::a10:1,fddd:a103:a251::a10:1
test_v4_in_v4-0 160.162.191.1/32 100.251.7.1 active
test_v4_in_v4-0 160.163.191.1/32 100.251.7.1 0 active
test_v4_in_v4-0 160.164.191.1/32 100.251.7.1
```
\>show vnet routes tunnel test_v4_in_v4-0
```
vnet name prefix endpoint mac address vni metric status
--------------- ---------------- ----------- ------------- ----- -------- --------
test_v4_in_v4-0 160.162.191.1/32 100.251.7.1 active
test_v4_in_v4-0 160.163.191.1/32 100.251.7.1 0 active
test_v4_in_v4-0 160.164.191.1/32 100.251.7.1
```
\>show vnet routes local
```
vnet name prefix nexthop interface
--------------- ---------------- ------------------------------------- -------------------------------
test_v4_in_v4-0 160.162.191.1/32 100.100.4.1 Ethernet1
test_v4_in_v4-0 160.163.191.1/32 100.101.4.1, 100.101.4.2 Ethernet1, Ethernet2
test_v4_in_v4-0 160.164.191.1/32 100.102.4.1, 100.102.4.2, 100.102.4.3 Ethernet1, Ethernet2, Ethernet3
test_v4_in_v4-1 160.165.191.1/32 100.103.4.1, 100.103.4.2, 100.103.4.3 Ethernet1, Ethernet2, Ethernet3
```
\>show vnet routes local test_v4_in_v4-0
```
vnet name prefix nexthop interface
--------------- ---------------- ------------------------------------- -------------------------------
test_v4_in_v4-0 160.162.191.1/32 100.100.4.1 Ethernet1
test_v4_in_v4-0 160.163.191.1/32 100.101.4.1, 100.101.4.2 Ethernet1, Ethernet2
test_v4_in_v4-0 160.164.191.1/32 100.102.4.1, 100.102.4.2, 100.102.4.3 Ethernet1, Ethernet2, Ethernet3
```
Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
Collaborator
Author
|
Original PR: sonic-net/sonic-utilities#4448 |
Collaborator
Author
|
/azp run |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
It is a manually cherry-pick from sonic-net/sonic-utilities#4332
Updating the show vnet cli:
1. showing new filed "metric" in show vnet route all/tunnel
2. added <vnet_name> for specific vnet name on vnet show route all/local/tunnel commands
How I did it
How to verify it
added unit tests and passed.

Previous command output (if the output of a command-line utility has changed)
>show vnet routes all
>show vnet routes tunnel
New command output (if the output of a command-line utility has changed)
>show vnet routes all
>show vnet routes all test_v4_in_v4-0
> show vnet routes tunnel
>show vnet routes tunnel test_v4_in_v4-0
>show vnet routes local
>show vnet routes local test_v4_in_v4-0
Signed-off-by: Sonic Build Admin sonicbld@microsoft.com