Skip to content

Commit 92ca5c6

Browse files
augusdnselldinesh
authored andcommitted
Enhance test_pktgen to be more robust (#20855)
Signed-off-by: selldinesh <[email protected]>
1 parent b38c8b1 commit 92ca5c6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/test_pktgen.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ def test_pktgen(duthosts, enum_dut_hostname, enum_frontend_asic_index, tbinfo, l
8686

8787
# Select a random port to run traffic
8888
port_list = get_port_list(duthost, tbinfo)
89+
90+
# Skip test if no data ports are available (e.g., on supervisor cards)
91+
if not port_list:
92+
pytest.skip("No data ports available for packet generation test")
93+
8994
port = random.choice(port_list)
9095
asichost = duthost.get_port_asic_instance(port)
9196

0 commit comments

Comments
 (0)