Skip to content

Update test_po_cleanup.py #5453

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

Merged
merged 3 commits into from
Apr 4, 2022
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
24 changes: 12 additions & 12 deletions tests/pc/test_po_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,24 @@ def check_topo_and_restore(duthosts, enum_rand_one_per_hwsku_frontend_hostname,

if len(mg_facts['minigraph_portchannels'].keys()) == 0 and not duthost.is_multi_asic:
pytest.skip("Skip test due to there is no portchannel exists in current topology.")

def test_po_cleanup(duthosts, enum_rand_one_per_hwsku_frontend_hostname, enum_asic_index, tbinfo):
def test_po_cleanup(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo):
"""
test port channel are cleaned up correctly and teammgrd and teamsyncd process
handle SIGTERM gracefully
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
logging.info("Disable swss/teamd Feature")
duthost.asic_instance(enum_asic_index).stop_service("swss")
logging.info("Disable swss/teamd Feature in all asics")
# Following will call "sudo systemctl stop swss@0", same for swss@1 ..
duthost.stop_service("swss")
# Check if Linux Kernel Portchannel Interface teamdev are clean up
if not wait_until(10, 1, 0, check_kernel_po_interface_cleaned, duthost, enum_asic_index):
fail_msg = "PortChannel interface still exists in kernel"
pytest.fail(fail_msg)
# Restore swss service.
duthost.asic_instance(enum_asic_index).start_service("swss")
assert wait_until(300, 20, 0, duthost.critical_services_fully_started),\
"Not all critical services are fully started"

for asic_id in duthost.get_asic_ids():
if not wait_until(10, 1, 0, check_kernel_po_interface_cleaned, duthost, asic_id):
fail_msg = "PortChannel interface still exists in kernel"
pytest.fail(fail_msg)
# Restore config services
config_reload(duthost)

def test_po_cleanup_after_reload(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo):
"""
test port channel are cleaned up correctly after config reload, with system under stress.
Expand Down