summaryrefslogtreecommitdiffstats
path: root/scripts/automation/regression/unit_tests/trex_general_test.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-01-08 14:40:31 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-01-08 14:40:31 +0200
commit148fd251911869db33df03f7fd3287c1f76f2fa4 (patch)
treedf3f8b848c57d701dd71255f9949927eaff32b6e /scripts/automation/regression/unit_tests/trex_general_test.py
parent8db09096b9dcf030b7dc744fbd7ee463d8e6fd1b (diff)
building: add pkg option with --pkg-dir and --pkg-file arguments (./b pkg --pkg-dir ...) for building TRex package
regression: add jumbo packets test high latency fails test and not only print add maximal and minimal expected CPU utilization aggregate results: remove tracebacks at usual errors in tests move TRex info from setups info to top (its now common to all setups) save last good commit hash
Diffstat (limited to 'scripts/automation/regression/unit_tests/trex_general_test.py')
-rwxr-xr-xscripts/automation/regression/unit_tests/trex_general_test.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/scripts/automation/regression/unit_tests/trex_general_test.py b/scripts/automation/regression/unit_tests/trex_general_test.py
index 6a6ad79c..fb84a3e1 100755
--- a/scripts/automation/regression/unit_tests/trex_general_test.py
+++ b/scripts/automation/regression/unit_tests/trex_general_test.py
@@ -165,12 +165,15 @@ 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):
+ 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 cpu_util < 30 and not self.is_virt_nics:
- self.fail("CPU is too low (%s%%), can't verify performance in such low CPU%%." % cpu_util )
+ if not self.is_virt_nics:
+ if cpu_util > maximal_cpu:
+ self.fail("CPU is too high (%s%%), probably queue full." % cpu_util )
+ if cpu_util < minimal_cpu:
+ self.fail("CPU is too low (%s%%), can't verify performance in such low CPU%%." % cpu_util )
cores = self.get_benchmark_param('cores')
trex_tx_bps = trex_res.get_last_value("trex-global.data.m_total_tx_bytes")
@@ -236,16 +239,14 @@ class CTRexGeneral_Test(unittest.TestCase):
if check_latency:
# check that max latency does not exceed 1 msec in regular setup or 20ms in VM
- allowed_latency = 20000 if self.is_VM else 1000
+ allowed_latency = 50000 if self.is_VM else 1000
if max(trex_res.get_max_latency().values()) > allowed_latency:
- print 'LatencyError: Maximal latency exceeds %s (usec)' % allowed_latency
- #raise AbnormalResultError('Maximal latency above 1ms')
+ self.fail('LatencyError: Maximal latency exceeds %s (usec)' % allowed_latency)
# check that avg latency does not exceed 1 msec in regular setup or 3ms in VM
allowed_latency = 3000 if self.is_VM else 1000
if max(trex_res.get_avg_latency().values()) > allowed_latency:
- print 'LatencyError: Average latency exceeds %s (usec)' % allowed_latency
- #raise AbnormalResultError('Maximal latency above 1ms')
+ self.fail('LatencyError: Average latency exceeds %s (usec)' % allowed_latency)
if not self.is_loopback:
# check router number of drops --> deliberately masked- need to be figured out!!!!!