Skip to content

Commit

Permalink
[test_mux] add sleep in test_NH (#2648)
Browse files Browse the repository at this point in the history
* [test_mux] add sleep in test_NH

What I did: added sleep after adding/removing neighbors in test_NH

Why I did it: resolve PR failures due to timing issues between
adding/deleting neighbors and them being present in the asic_db

Signed-off-by: Nikola Dancejic <ndancejic@microsoft.com>
  • Loading branch information
Ndancejic committed Feb 6, 2023
1 parent 8de52bf commit 02c2267
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/test_mux.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,8 @@ def create_and_test_NH_routes(self, appdb, asicdb, dvs, dvs_route, mac):
" " + neigh_ipv6 + "\""
)
apdb.wait_for_entry("ROUTE_TABLE", nh_route)
apdb.wait_for_entry("ROUTE_TABLE", nh_route_ipv6)

rtkeys = dvs_route.check_asicdb_route_entries([nh_route])
rtkeys_ipv6 = dvs_route.check_asicdb_route_entries([nh_route_ipv6])
self.check_nexthop_in_asic_db(asicdb, rtkeys[0])
Expand All @@ -572,16 +574,22 @@ def create_and_test_NH_routes(self, appdb, asicdb, dvs, dvs_route, mac):

self.del_neighbor(dvs, neigh_ip)
self.del_neighbor(dvs, neigh_ipv6)
apdb.wait_for_deleted_entry(self.APP_NEIGH_TABLE, neigh_ip)
apdb.wait_for_deleted_entry(self.APP_NEIGH_TABLE, neigh_ipv6)
asicdb.wait_for_deleted_entry(self.ASIC_NEIGH_TABLE, neigh_ip)
asicdb.wait_for_deleted_entry(self.ASIC_NEIGH_TABLE, neigh_ip)

self.check_nexthop_in_asic_db(asicdb, rtkeys[0], True)
self.check_nexthop_in_asic_db(asicdb, rtkeys_ipv6[0], True)

# Set state to active, learn neighbor again
self.set_mux_state(appdb, "Ethernet0", "active")
self.check_nexthop_in_asic_db(asicdb, rtkeys[0], True)
self.check_nexthop_in_asic_db(asicdb, rtkeys_ipv6[0], True)

self.add_neighbor(dvs, neigh_ip, mac)
self.add_neighbor(dvs, neigh_ipv6, mac)
self.check_neigh_in_asic_db(asicdb, neigh_ip)
self.check_neigh_in_asic_db(asicdb, neigh_ipv6)

self.check_nexthop_in_asic_db(asicdb, rtkeys[0])
self.check_nexthop_in_asic_db(asicdb, rtkeys_ipv6[0])
dvs.runcmd(
Expand Down

0 comments on commit 02c2267

Please sign in to comment.