Skip to content

Commit f0737b9

Browse files
authored
Update test_po_cleanup.py (#5453)
* Update test_po_cleanup.py [test_po_cleanup] Change timeout length to 800 instead of 300 to allow more time for multi-asic asics to come back. * Update test_po_cleanup.py 1. Execute an "config_reload" at the end of test_po_cleanup, to start up not only all critical services, but also wait for all port, interfaces, bgp neighbors to come up. 2. Call duthost.stop_service("swss") directly from duthost, instead of passing each asics inside the test_po_cleanup. to avoid execution sequence of test_po_cleanup[asic0], test_po_cleanup_after_reload[duthost], test_po_cleanup[asic1].
1 parent 69c5b0d commit f0737b9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tests/pc/test_po_cleanup.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,24 @@ def check_topo_and_restore(duthosts, enum_rand_one_per_hwsku_frontend_hostname,
4747

4848
if len(mg_facts['minigraph_portchannels'].keys()) == 0 and not duthost.is_multi_asic:
4949
pytest.skip("Skip test due to there is no portchannel exists in current topology.")
50-
51-
def test_po_cleanup(duthosts, enum_rand_one_per_hwsku_frontend_hostname, enum_asic_index, tbinfo):
50+
51+
def test_po_cleanup(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo):
5252
"""
5353
test port channel are cleaned up correctly and teammgrd and teamsyncd process
5454
handle SIGTERM gracefully
5555
"""
5656
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
57-
logging.info("Disable swss/teamd Feature")
58-
duthost.asic_instance(enum_asic_index).stop_service("swss")
57+
logging.info("Disable swss/teamd Feature in all asics")
58+
# Following will call "sudo systemctl stop swss@0", same for swss@1 ..
59+
duthost.stop_service("swss")
5960
# Check if Linux Kernel Portchannel Interface teamdev are clean up
60-
if not wait_until(10, 1, 0, check_kernel_po_interface_cleaned, duthost, enum_asic_index):
61-
fail_msg = "PortChannel interface still exists in kernel"
62-
pytest.fail(fail_msg)
63-
# Restore swss service.
64-
duthost.asic_instance(enum_asic_index).start_service("swss")
65-
assert wait_until(300, 20, 0, duthost.critical_services_fully_started),\
66-
"Not all critical services are fully started"
67-
61+
for asic_id in duthost.get_asic_ids():
62+
if not wait_until(10, 1, 0, check_kernel_po_interface_cleaned, duthost, asic_id):
63+
fail_msg = "PortChannel interface still exists in kernel"
64+
pytest.fail(fail_msg)
65+
# Restore config services
66+
config_reload(duthost)
67+
6868
def test_po_cleanup_after_reload(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo):
6969
"""
7070
test port channel are cleaned up correctly after config reload, with system under stress.

0 commit comments

Comments
 (0)