Skip to content

Commit

Permalink
Ensure second route group OID is correct (sonic-net#3380)
Browse files Browse the repository at this point in the history
What I did
When grabbing the second route group OID, ensure that it is distinct from the first route group OID

Why I did it
The order in which DB keys are returned is not deterministic, so blindly taking the last key returned will sometimes lead to selecting the wrong OID
  • Loading branch information
theasianpianist authored Nov 20, 2024
1 parent c86efa1 commit 1843de4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/dash/test_dash_route_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ def test_rebind_eni_route_group(dash_db: DashDB):

dash_db.set_app_db_entry(APP_DASH_ROUTE_GROUP_TABLE_NAME, ROUTE_GROUP2, ROUTE_GROUP2_CONFIG)
dash_db.set_app_db_entry(APP_DASH_ROUTE_TABLE_NAME, ROUTE_GROUP2, OUTBOUND_ROUTE_PREFIX1, ROUTE_VNET_CONFIG_UNDERLAY_SIP)
rg2_oid = dash_db.wait_for_asic_db_keys("ASIC_STATE:SAI_OBJECT_TYPE_OUTBOUND_ROUTING_GROUP", min_keys=2)[1]
oids = dash_db.wait_for_asic_db_keys("ASIC_STATE:SAI_OBJECT_TYPE_OUTBOUND_ROUTING_GROUP", min_keys=2)
for oid in oids:
if oid != rg1_oid:
rg2_oid = oid
break

dash_db.set_app_db_entry(APP_DASH_ENI_ROUTE_TABLE_NAME, ENI_ID, ENI_ROUTE_GROUP1_CONFIG)

Expand Down

0 comments on commit 1843de4

Please sign in to comment.