diff --git a/tests/pc/test_po_cleanup.py b/tests/pc/test_po_cleanup.py index 797ca1c8517..40e7deb466e 100644 --- a/tests/pc/test_po_cleanup.py +++ b/tests/pc/test_po_cleanup.py @@ -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.