Skip to content

Commit

Permalink
Stop traffic before testing loss percentage
Browse files Browse the repository at this point in the history
Signed-off-by: fkwilken <fkwilken@gmail.com>
  • Loading branch information
fkwilken committed Aug 21, 2023
1 parent 27a9e21 commit 2258ed4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
tgen_utils_setup_streams,
tgen_utils_get_loss,
tgen_utils_start_traffic,
tgen_utils_stop_traffic,
tgen_utils_get_swp_info,
)
pytestmark = [pytest.mark.suite_functional_lacp,
Expand Down Expand Up @@ -142,6 +143,7 @@ async def test_lacp_routing_over_bridge(testbed):
raise # will re-raise the AssertionError
await tgen_utils_start_traffic(tgen_dev)
await asyncio.sleep(25)
await tgen_utils_stop_traffic(tgen_dev)

# 9. Verify traffic received on bridge
stats = await tgen_utils_get_traffic_stats(tgen_dev, 'Traffic Item Statistics')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ async def test_lacp_routing_over_lacp(testbed):
raise # will re-raise the AssertionError
await tgen_utils_start_traffic(tgen_dev)
await asyncio.sleep(25)
await tgen_utils_stop_traffic(tgen_dev)

# 9. Verify no traffic loss
stats = await tgen_utils_get_traffic_stats(tgen_dev, 'Traffic Item Statistics')
for row in stats.Rows:
err_msg = f"Expected 0.00 loss, actual {float(row['Loss %'])}"
assert isclose(tgen_utils_get_loss(row), 0.00, abs_tol=0.1), err_msg
await tgen_utils_stop_traffic(tgen_dev)
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
tgen_utils_get_traffic_stats,
tgen_utils_setup_streams,
tgen_utils_start_traffic,
tgen_utils_stop_traffic,
tgen_utils_get_swp_info,
tgen_utils_get_loss,
)
Expand Down Expand Up @@ -164,6 +165,7 @@ async def test_lacp_routing_over_vlan_device(testbed):
raise # will re-raise the AssertionError
await tgen_utils_start_traffic(tgen_dev)
await asyncio.sleep(25)
await tgen_utils_stop_traffic(tgen_dev)

# 9. Verify no traffic loss
stats = await tgen_utils_get_traffic_stats(tgen_dev, 'Traffic Item Statistics')
Expand Down

0 comments on commit 2258ed4

Please sign in to comment.