summaryrefslogtreecommitdiffstats
path: root/scripts/automation/regression/stateful_tests
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/regression/stateful_tests')
-rwxr-xr-xscripts/automation/regression/stateful_tests/trex_general_test.py9
-rwxr-xr-xscripts/automation/regression/stateful_tests/trex_rx_test.py8
2 files changed, 8 insertions, 9 deletions
diff --git a/scripts/automation/regression/stateful_tests/trex_general_test.py b/scripts/automation/regression/stateful_tests/trex_general_test.py
index 1a44970a..2e5adc40 100755
--- a/scripts/automation/regression/stateful_tests/trex_general_test.py
+++ b/scripts/automation/regression/stateful_tests/trex_general_test.py
@@ -135,15 +135,12 @@ class CTRexGeneral_Test(unittest.TestCase):
if res[name] != float(val):
self.fail('TRex results[%s]==%f and not as expected %f ' % (name, res[name], val))
- def check_CPU_benchmark (self, trex_res, err = 10, minimal_cpu = None, maximal_cpu = 85):
+ def check_CPU_benchmark (self, trex_res, err = 10, minimal_cpu = 30, maximal_cpu = 85):
#cpu_util = float(trex_res.get_last_value("trex-global.data.m_cpu_util"))
cpu_util = sum([float(x) for x in trex_res.get_value_list("trex-global.data.m_cpu_util")[-4:-1]]) / 3 # mean of 3 values before last
- if minimal_cpu is None:
- if '1G' in self.modes:
- minimal_cpu = 1
- else:
- minimal_cpu = 30
+ if '1G' in self.modes:
+ minimal_cpu /= 10
if not self.is_virt_nics:
if cpu_util > maximal_cpu:
diff --git a/scripts/automation/regression/stateful_tests/trex_rx_test.py b/scripts/automation/regression/stateful_tests/trex_rx_test.py
index 2f0a24f4..a6cc4bc6 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)
@@ -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)