Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions tests/portstat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@

intf_fec_counters_period = """\
The rates are calculated within 3 seconds period
IFACE STATE FEC_CORR FEC_UNCORR FEC_SYMBOL_ERR
--------- ------- ---------- ------------ ----------------
Ethernet0 D 0 0 0
Ethernet4 N/A 0 0 0
Ethernet8 N/A 0 0 0
"""
IFACE STATE FEC_CORR FEC_UNCORR FEC_SYMBOL_ERR FEC_PRE_BER FEC_POST_BER FEC_PRE_BER_MAX FLR(O) FLR(P) (Accuracy)
--------- ------- ---------- ------------ ---------------- ------------- -------------- ----------------- -------- -------------------
Ethernet0 D 0 0 0 N/A N/A N/A 0 0
Ethernet4 N/A 0 0 0 N/A N/A N/A 4.21e-10 7.81e-10 (89%)
Ethernet8 N/A 0 0 0 N/A N/A N/A N/A N/A
""" # noqa: E501

intf_counters_period = """\
The rates are calculated within 3 seconds period
Expand Down Expand Up @@ -454,8 +454,6 @@ def test_show_intf_fec_counters_period(self):
assert return_code == 0
assert result == intf_fec_counters_period



def test_show_intf_counters_period(self):
runner = CliRunner()
result = runner.invoke(show.cli.commands["interfaces"].commands["counters"], [
Expand Down
14 changes: 12 additions & 2 deletions utilities_common/portstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,12 +760,22 @@ def cnstat_diff_print(self, cnstat_new_dict, cnstat_old_dict,
table.append((key, self.get_port_state(key),
ns_diff(cntr['fec_corr'], old_cntr['fec_corr']),
ns_diff(cntr['fec_uncorr'], old_cntr['fec_uncorr']),
ns_diff(cntr['fec_symbol_err'], old_cntr['fec_symbol_err'])))
ns_diff(cntr['fec_symbol_err'], old_cntr['fec_symbol_err']),
format_fec_ber(rates.fec_pre_ber),
format_fec_ber(rates.fec_post_ber),
format_fec_ber(rates.fec_pre_ber_max),
format_fec_flr(rates.fec_flr),
format_fec_flr_predicted(rates.fec_flr_predicted, rates.fec_flr_r_squared)))
else:
table.append((key, self.get_port_state(key),
format_number_with_comma(cntr['fec_corr']),
format_number_with_comma(cntr['fec_uncorr']),
format_number_with_comma(cntr['fec_symbol_err'])))
format_number_with_comma(cntr['fec_symbol_err']),
format_fec_ber(rates.fec_pre_ber),
format_fec_ber(rates.fec_post_ber),
format_fec_ber(rates.fec_pre_ber_max),
format_fec_flr(rates.fec_flr),
format_fec_flr_predicted(rates.fec_flr_predicted, rates.fec_flr_r_squared)))
elif fec_hist_only:
header = header_fec_hist_only

Expand Down
Loading