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

[202405] Fix intermittent issue on reboot in test_lldp_syncd #15331

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
13 changes: 13 additions & 0 deletions tests/lldp/test_lldp_syncd.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ def get_show_lldp_table_output(duthost):
return interface_list


def check_lldp_table_keys(duthost, db_instance):
# Check if LLDP_ENTRY_TABLE keys match show lldp table output
lldp_entry_keys = get_lldp_entry_keys(db_instance)
show_lldp_table_int_list = get_show_lldp_table_output(duthost)
return sorted(lldp_entry_keys) == sorted(show_lldp_table_int_list)


def assert_lldp_interfaces(
lldp_entry_keys, show_lldp_table_int_list, lldpctl_interface
):
Expand Down Expand Up @@ -322,6 +329,12 @@ def test_lldp_entry_table_after_reboot(
localhost, duthosts, enum_rand_one_per_hwsku_frontend_hostname, db_instance
):
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]

# Verify LLDP_ENTRY_TABLE keys match show lldp table output at the start of test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There will be a reboot afterwards. All lldp_entry_keys and show_lldp_table_int_list will be checked after reboot. Will this check here still useful or it is not necessary anymore with another fix got in already?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wumiaont Ye, you are right, that's why I move the collection and verification after reboot, please check this PR https://github.com/sonic-net/sonic-mgmt/pull/15337/files

keys_match = wait_until(30, 5, 0, check_lldp_table_keys, duthost, db_instance)
if not keys_match:
assert keys_match, "LLDP_ENTRY_TABLE keys do not match 'show lldp table' output"

# reboot
logging.info("Run cold reboot on DUT")
reboot(
Expand Down
Loading