Vnet_route_check Vxlan tunnel route update.#2281
Vnet_route_check Vxlan tunnel route update.#2281siqbal1986 merged 3 commits intosonic-net:masterfrom siqbal1986:Vnet_route_check_Vxlan_tunnel_update
Conversation
|
We should not ignore vnet routes in the script. Scrip must handle the vnet routes in default scope and proceed with the check |
|
can you please add some tests and also fix the test failure? |
|
|
scripts/vnet_route_check.py
Outdated
| if vnet_name not in vnet_intfs: | ||
| # this route has no vnet_intf and may be part of default VRF. | ||
| vnet_table = swsscommon.Table(db, 'VNET_TABLE') | ||
| scope = vnet_table.get(vnet_name)[1][1][1] |
There was a problem hiding this comment.
what is this index [1][1][1] ? Can you provide an example?
There was a problem hiding this comment.
this looking up the scope=default but i think I can improve it.
| vnet_intfs = get_vnet_intfs() | ||
|
|
||
| vrf_oid_to_vnet_map = {} | ||
| vrf_oid_to_vnet_map[default_vrf_oid] = 'default_VRF' |
There was a problem hiding this comment.
I don't see this being used. Can you confirm?
There was a problem hiding this comment.
This is used as a placeholder, as the data structure keeps track of the routes by means of the vnet interface.
| virtual_router = swsscommon.Table(asic_db, 'ASIC_STATE:SAI_OBJECT_TYPE_VIRTUAL_ROUTER') | ||
| default_vrf_oid = "" | ||
| if virtual_router.getKeys() != []: | ||
| default_vrf_oid = virtual_router.getKeys()[0] |
There was a problem hiding this comment.
please make it as a global variable so you don't have to pass it in multiple places and use as "self.xxx"
commit 78e4fe7 Author: siqbal1486 <[email protected]> Date: Wed Aug 10 12:17:56 2022 -0700 Fixes suggested in review. Signed-off-by: siqbal1486 <[email protected]> commit 757a6b0 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Tue Aug 9 12:12:33 2022 -0700 added 2 tests and fixed a bug. commit fb4d138 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Mon Aug 1 18:59:55 2022 -0700 changed script to account for tunnel routes. commit c2db718 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Sun Jul 31 15:09:12 2022 -0700 removed accidently added spaces. commit 2b5658d Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Sun Jul 31 14:52:49 2022 -0700 Modified Vnet_route_check to ignore the Vxlan tunnel routes which use default VRF.
Fixed a bug found while testing for IpV6.
Update sonic-utilities submodule pointer to include the following: * 0a7557b [minigraph] add option to specify golden path in load_minigraph ([sonic-net#2350](sonic-net/sonic-utilities#2350)) * 322aefc [GCU]Remove GCU unique lane check for duplicate lanes platforms ([sonic-net#2343](sonic-net/sonic-utilities#2343)) * 7099fff [fastboot] fastboot enhancement: Use warm-boot infrastructure for fast-boot ([sonic-net#2286](sonic-net/sonic-utilities#2286)) * 09026ed [warm-reboot] fix warm-reboot when /tmp/cache is missing ([sonic-net#2367](sonic-net/sonic-utilities#2367)) * a3c404c Fix typo in platform_sfputil_helper.is_rj45_port ([sonic-net#2374](sonic-net/sonic-utilities#2374)) * 637d834 Vnet_route_check Vxlan tunnel route update. ([sonic-net#2281](sonic-net/sonic-utilities#2281)) * 29a3e51 Added support for tunnel route status in show vnet routes all. ([sonic-net#2341](sonic-net/sonic-utilities#2341)) * 1ac584b Use 'default' VRF when VRF name is not provided ([sonic-net#2368](sonic-net/sonic-utilities#2368)) * 4d377a6 [subinterface]Added additional checks in portchannel and subinterface commands ([sonic-net#2345](sonic-net/sonic-utilities#2345)) * bbcdf2e disk_check: Publish event for RO state ([sonic-net#2320](sonic-net/sonic-utilities#2320)) * 3fd537b Support the bandit check by GitHub Action ([sonic-net#2358](sonic-net/sonic-utilities#2358)) * 491d3d3 [generate dump]Added error message when saisdkdump fails ([sonic-net#2356](sonic-net/sonic-utilities#2356)) * 6830e01 [counterpoll]Fixing counterpoll show for tunnel and acl stats ([sonic-net#2355](sonic-net/sonic-utilities#2355)) * 3be2ad7 [fast-reboot]Avoid stopping masked services during fast-reboot ([sonic-net#2335](sonic-net/sonic-utilities#2335)) * 0e1b0cf [GCU] Fix missing backend in dry run ([sonic-net#2347](sonic-net/sonic-utilities#2347)) * 676c31b Add verification for override ([sonic-net#2305](sonic-net/sonic-utilities#2305)) * 48997c2 Add Password Hardening CLI support ([sonic-net#2338](sonic-net/sonic-utilities#2338)) * 414e239 update unit tests for swap ([#locato](https://github.com/sonic-net/sonic-utilities/pull/locato)) * a91a492 consider swap checking memory in ([#stalle](https://github.com/sonic-net/sonic-utilities/pull/stalle)) * f0ce586 [route_check]: Ignore standalone tunnel routes ([sonic-net#2325](sonic-net/sonic-utilities#2325)) Signed-off-by: dprital <[email protected]>
* Squashed commit of the following: commit 78e4fe7 Author: siqbal1486 <[email protected]> Date: Wed Aug 10 12:17:56 2022 -0700 Fixes suggested in review. Signed-off-by: siqbal1486 <[email protected]> commit 757a6b0 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Tue Aug 9 12:12:33 2022 -0700 added 2 tests and fixed a bug. commit fb4d138 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Mon Aug 1 18:59:55 2022 -0700 changed script to account for tunnel routes. commit c2db718 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Sun Jul 31 15:09:12 2022 -0700 removed accidently added spaces. commit 2b5658d Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Sun Jul 31 14:52:49 2022 -0700 Modified Vnet_route_check to ignore the Vxlan tunnel routes which use default VRF. * changes suggested in review. Fixed a bug found while testing for IpV6. * Updated a testcse to cover IPV6. Fixed a bug causing build failures.
* Squashed commit of the following: commit 78e4fe7 Author: siqbal1486 <[email protected]> Date: Wed Aug 10 12:17:56 2022 -0700 Fixes suggested in review. Signed-off-by: siqbal1486 <[email protected]> commit 757a6b0 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Tue Aug 9 12:12:33 2022 -0700 added 2 tests and fixed a bug. commit fb4d138 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Mon Aug 1 18:59:55 2022 -0700 changed script to account for tunnel routes. commit c2db718 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Sun Jul 31 15:09:12 2022 -0700 removed accidently added spaces. commit 2b5658d Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Sun Jul 31 14:52:49 2022 -0700 Modified Vnet_route_check to ignore the Vxlan tunnel routes which use default VRF. * changes suggested in review. Fixed a bug found while testing for IpV6. * Updated a testcse to cover IPV6. Fixed a bug causing build failures.
* Squashed commit of the following: commit 78e4fe7 Author: siqbal1486 <[email protected]> Date: Wed Aug 10 12:17:56 2022 -0700 Fixes suggested in review. Signed-off-by: siqbal1486 <[email protected]> commit 757a6b0 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Tue Aug 9 12:12:33 2022 -0700 added 2 tests and fixed a bug. commit fb4d138 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Mon Aug 1 18:59:55 2022 -0700 changed script to account for tunnel routes. commit c2db718 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Sun Jul 31 15:09:12 2022 -0700 removed accidently added spaces. commit 2b5658d Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Sun Jul 31 14:52:49 2022 -0700 Modified Vnet_route_check to ignore the Vxlan tunnel routes which use default VRF. * changes suggested in review. Fixed a bug found while testing for IpV6. * Updated a testcse to cover IPV6. Fixed a bug causing build failures.
* Squashed commit of the following: commit 78e4fe7 Author: siqbal1486 <[email protected]> Date: Wed Aug 10 12:17:56 2022 -0700 Fixes suggested in review. Signed-off-by: siqbal1486 <[email protected]> commit 757a6b0 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Tue Aug 9 12:12:33 2022 -0700 added 2 tests and fixed a bug. commit fb4d138 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Mon Aug 1 18:59:55 2022 -0700 changed script to account for tunnel routes. commit c2db718 Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Sun Jul 31 15:09:12 2022 -0700 removed accidently added spaces. commit 2b5658d Author: Shahzad Iqbal (SHAHZADIQBAL) <[email protected]> Date: Sun Jul 31 14:52:49 2022 -0700 Modified Vnet_route_check to ignore the Vxlan tunnel routes which use default VRF. * changes suggested in review. Fixed a bug found while testing for IpV6. * Updated a testcse to cover IPV6. Fixed a bug causing build failures.
Modified Vnet_route_check to ignore the Vxlan tunnel routes which uses default VRF.
What I did
Updated the vnet_route_check script to handle the vxlan tunnel routes.
How I did it
By checking the scope of the tunnel route, if it is default then it is treated in a different way. Tunnel routes coming from App_db are compared with ASIC_db default_VRF routes and their presence is verified.
For routes coming from ASIC_db with default_VRF, the comparison is not done with the routes form App_db as ASIC_DB carries all other the routes.
For normal vnet routes, the functionality of the script is unaffected.
How to verify it
run the script after adding a vxlan tunnel.
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)