diff options
Diffstat (limited to 'scripts/automation/regression/stateful_tests/trex_rx_test.py')
-rwxr-xr-x | scripts/automation/regression/stateful_tests/trex_rx_test.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/automation/regression/stateful_tests/trex_rx_test.py b/scripts/automation/regression/stateful_tests/trex_rx_test.py index 2f0a24f4..c097b180 100755 --- a/scripts/automation/regression/stateful_tests/trex_rx_test.py +++ b/scripts/automation/regression/stateful_tests/trex_rx_test.py @@ -52,9 +52,10 @@ class CTRexRx_Test(CTRexGeneral_Test): path = 'rx-check.data.stats.m_total_rx' total_rx = trex_res.get_last_value(path) - if not total_rx: + if total_rx is None: raise AbnormalResultError('No TRex results by path: %s' % path) - + elif not total_rx: + raise AbnormalResultError('Total rx_check (%s) packets is zero.' % path) print('Total packets checked: %s' % total_rx) print('Latency counters: %s' % latency_counters_display) @@ -69,7 +70,7 @@ class CTRexRx_Test(CTRexGeneral_Test): error_tolerance = self.get_benchmark_param('error_tolerance') if not error_tolerance or not allow_error_tolerance: error_tolerance = 0 - error_percentage = float(total_errors) * 100 / total_rx + error_percentage = total_errors * 100.0 / total_rx if total_errors > 0: if self.is_loopback or error_percentage > error_tolerance: @@ -255,7 +256,8 @@ class CTRexRx_Test(CTRexGeneral_Test): self.router.config_zbf() trex_res = self.trex.sample_to_run_finish() self.router.config_no_zbf() - self.router.clear_nat_translations() + self.router.config_no_nat(nat_obj) + #self.router.clear_nat_translations() print("\nLATEST RESULT OBJECT:") print(trex_res) self.check_rx_errors(trex_res, allow_error_tolerance = False) |