Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test_virtual_chassis]: use wait_for to make test more robust #1640

Merged
merged 1 commit into from
Feb 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tests/test_virtual_chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def test_chassis_system_neigh(self, vct):
assert res == "", "Error configuring static neigh"

asic_db = dvs.get_asic_db()
asic_db.wait_for_n_keys("ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY", 1)
neighkeys = asic_db.get_keys("ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY")
assert len(neighkeys), "No neigh entries in ASIC_DB"

Expand All @@ -195,8 +196,12 @@ def test_chassis_system_neigh(self, vct):

# Check for presence of encap index, retrieve and store it for sync verification
test_neigh_entry = asic_db.wait_for_entry("ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY", test_neigh)
encap_index = test_neigh_entry.get("SAI_NEIGHBOR_ENTRY_ATTR_ENCAP_INDEX")
assert encap_index != "", "VOQ encap index is not programmed in ASIC_DB"
test_neigh_entry_attrs = asic_db.wait_for_fields("ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY", test_neigh, ["SAI_NEIGHBOR_ENTRY_ATTR_ENCAP_INDEX"])
print(test_neigh)
print(test_neigh_entry)
print(test_neigh_entry_attrs)
encap_index = test_neigh_entry_attrs["SAI_NEIGHBOR_ENTRY_ATTR_ENCAP_INDEX"]
assert encap_index != "" and encap_index != None, "VOQ encap index is not programmed in ASIC_DB"

break

Expand Down