Skip to content

Commit f543717

Browse files
committed
inclusing loss check
1 parent c0026b8 commit f543717

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

tests/snappi_tests/dataplane/test_fec_error_injection.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
'minConsecutiveUncorrectableWithLossOfLink',
1111
'laneMarkers'
1212
]
13-
# ErrorTypes = [
14-
# 'minConsecutiveUncorrectableWithLossOfLink'
15-
# ]
1613

1714
@pytest.mark.parametrize('error_type', ErrorTypes)
1815
def test_fec_error_injection(snappi_api, # noqa F811
@@ -77,20 +74,19 @@ def test_fec_error_injection(snappi_api, # noqa F811
7774
wait(15, "For error insertion to start")
7875
# TODO For maxConsecutiveUncorrectableWithoutLossOfLink check link state on DUT
7976
flow_metrics = fetch_snappi_flow_metrics(api, ['IPv4 Traffic'])[0]
80-
pytest_assert(flow_metrics.frames_tx > 0 and int(flow_metrics.frames_rx_rate) == 0,
77+
pytest_assert(flow_metrics.frames_tx > 0 and int(flow_metrics.loss) > 0,
8178
"FAIL: Rx Port did not stop receiving packets after starting FEC Error Insertion")
8279
logger.info(' .. PASSED : Rx Port stopped receiving packets after starting FEC Error Insertion')
8380
logger.info('Stopping FEC Error Insertion')
8481
port1.StopFecErrorInsertion()
8582
wait(15, "For error insertion to stop")
86-
83+
ixnet.ClearStats()
8784
flow_metrics = fetch_snappi_flow_metrics(api, ['IPv4 Traffic'])[0]
88-
pytest_assert(int(flow_metrics.frames_rx_rate) > 0,
85+
pytest_assert(int(flow_metrics.frames_rx_rate) > 0 and int(flow_metrics.loss) == 0,
8986
"FAIL: Rx Port did not resume receiving packets after stopping FEC Error Insertion")
9087
logger.info(' .. PASSED : Rx Port resumed receiving packets after stopping FEC Error Insertion')
9188
logger.info('Stopping Traffic ...')
9289
ts = api.control_state()
9390
ts.traffic.flow_transmit.state = ts.traffic.flow_transmit.STOP
9491
api.set_control_state(ts)
9592
wait(10, "For traffic to stop")
96-

0 commit comments

Comments
 (0)