|
42 | 42 | Ethernet8 N/A 100,317 0 0
|
43 | 43 | """
|
44 | 44 |
|
| 45 | +intf_fec_counters_period = """\ |
| 46 | +The rates are calculated within 3 seconds period |
| 47 | + IFACE STATE FEC_CORR FEC_UNCORR FEC_SYMBOL_ERR |
| 48 | +--------- ------- ---------- ------------ ---------------- |
| 49 | +Ethernet0 D 0 0 0 |
| 50 | +Ethernet4 N/A 0 0 0 |
| 51 | +Ethernet8 N/A 0 0 0 |
| 52 | +""" |
| 53 | + |
45 | 54 | intf_counters_period = """\
|
46 | 55 | The rates are calculated within 3 seconds period
|
47 | 56 | IFACE STATE RX_OK RX_BPS RX_UTIL RX_ERR RX_DRP RX_OVR TX_OK TX_BPS TX_UTIL TX_ERR TX_DRP TX_OVR
|
@@ -281,6 +290,24 @@ def test_show_intf_fec_counters(self):
|
281 | 290 | assert return_code == 0
|
282 | 291 | assert result == intf_fec_counters
|
283 | 292 |
|
| 293 | + def test_show_intf_fec_counters_period(self): |
| 294 | + runner = CliRunner() |
| 295 | + result = runner.invoke(show.cli.commands["interfaces"].commands["counters"].commands["fec-stats"], |
| 296 | + ["-p {}".format(TEST_PERIOD)]) |
| 297 | + print(result.exit_code) |
| 298 | + print(result.output) |
| 299 | + assert result.exit_code == 0 |
| 300 | + assert result.output == intf_fec_counters_period |
| 301 | + |
| 302 | + return_code, result = get_result_and_return_code( |
| 303 | + 'portstat -f -p {}'.format(TEST_PERIOD)) |
| 304 | + print("return_code: {}".format(return_code)) |
| 305 | + print("result = {}".format(result)) |
| 306 | + assert return_code == 0 |
| 307 | + assert result == intf_fec_counters_period |
| 308 | + |
| 309 | + |
| 310 | + |
284 | 311 | def test_show_intf_counters_period(self):
|
285 | 312 | runner = CliRunner()
|
286 | 313 | result = runner.invoke(show.cli.commands["interfaces"].commands["counters"], [
|
|
0 commit comments