async def verify_ecmp_distribution(stats, tx_port, rx_ports):
"""
Verify Ecmp packet distribution between ports
Args:
stats: Ixia statistics
tx_port (object): Tg Port object
rx_ports (list): List with Tg Ports objects
"""
p_err_msg = 'Port {} received pkts {} expected => {}'
rx_sum_msg = 'Tx pkts sent {} isnt equal to sum of all rx ports received {}'
tx_pkts_sent = [int(row['Frames Tx.']) for row in stats.Rows if row['Port Name'] == tx_port][0]
rx_pkts_sum = []
# We cant expected that amount of pkts traversed through each nexthop will be equal
# Check that at least 1/10 of traffic went through port and verify sum of all rx packets is equal to tx packets
expected = tx_pkts_sent // 10
for row in stats.Rows:
if row['Port Name'] in rx_ports:
Build: 2023-09-27-0724
Test results: http://10.36.118.11/TestResults/09-29-2023-17-52-01-616779_fullRegression/report_suite_group_functional.html?sort=result
Test results will be automatically removed in 14 days
tx_port = '10.36.118.199:1:11' rx_ports = ['10.36.118.199:1:9', '10.36.118.199:1:10']
AssertionError: Port 10.36.118.199:1:9 received pkts 2005 expected => 842154assert 2005 >= 842154 + ...