Fix bug with checking VRF's routes in route_check.py #2301
Fix bug with checking VRF's routes in route_check.py #2301prsunny merged 2 commits intosonic-net:masterfrom
Conversation
|
|
|
What is the fix? We already have the check without VRF. Can you explain a bit more? |
Previously, we skip routes with VRF prefix (ROUTE_TABLE from APP_DB): sonic-utilities/scripts/route_check.py Line 284 in be1866f But from ASIC_DB we read all routes (including routes from VRF) and have a problem with comparing. |
388b545 to
edd0e08
Compare
ok, in that case i suggest lets fix the proper way. For VRF routes, lets get the VRF ID from ASIC_DB and compare only routes from that VRF. |
We can't compare only routes from specific VRF separatelly because:
Mapping VRF names with OIDs is absent in REDIS (it's saved into swss code). In my implementation, I compare all routes from APP_DB (without VRF + VRF routes) with all routes from ASIC_DB. |
0a8149a to
7f326d0
Compare
Signed-off-by: Petro Bratash <petrox.bratash@intel.com>
7f326d0 to
88a8c96
Compare
|
@prsunny Could you please take a look? |
* Create route_check.py compatible with VRF Signed-off-by: Petro Bratash <petrox.bratash@intel.com>
Signed-off-by: Petro Bratash petrox.bratash@intel.com
What I did
Add capability to check routes with VRF
How I did it
All routes in VRF have a specific prefix in name.
Route table when we have VRF:
Route table without VRF:
Remove Vrf prefix from route. Without Vrf, we can compare routes from APP and ASIC DB.
How to verify it
Run next command on SONiC:
sudo config vrf add Vrf1sudo config interface vrf bind PortChannel101 Vrf1sudo config interface ip add PortChannel101 10.0.0.56/31/usr/local/bin/route_check.pyAlso can run SONiC TC
vrf/test_vrf.py::TestVrfDeletion::test_vrf1_neigh_after_restoreand check syslogPrevious 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)