summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-04-28 02:20:34 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-04-28 02:20:34 +0300
commit0b83b5e12f9db7d5590434844767959c0154aa9c (patch)
treee11d259ddbcfd1acbd866571a27b38dbdf5ab02f /scripts
parent34587f930b4c8e5275341c69b178ac65ae686b37 (diff)
regression: stateless benchmark fixes
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/automation/regression/stateless_tests/stl_benchmark_test.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/automation/regression/stateless_tests/stl_benchmark_test.py b/scripts/automation/regression/stateless_tests/stl_benchmark_test.py
index 65efa55e..097006e0 100755
--- a/scripts/automation/regression/stateless_tests/stl_benchmark_test.py
+++ b/scripts/automation/regression/stateless_tests/stl_benchmark_test.py
@@ -16,7 +16,7 @@ class STLBenchmark_Test(CStlGeneral_Test):
cpu_utils = deque([0] * stabilize, maxlen = stabilize)
kwargs = profile_bench.get('kwargs', {})
print('Testing profile %s, kwargs: %s' % (profile_bench['name'], kwargs))
- profile = STLProfile.load(os.path.join(CTRexScenario.scripts_path, profile_bench['name']), port_id = 0, **kwargs)
+ profile = STLProfile.load(os.path.join(CTRexScenario.scripts_path, profile_bench['name']), **kwargs)
self.stl_trex.reset()
self.stl_trex.clear_stats()
@@ -36,11 +36,14 @@ class STLBenchmark_Test(CStlGeneral_Test):
raise Exception('Timeout on waiting for stabilization, CPU util values: %s' % cpu_utils)
if stats[0]['opackets'] < 10000 or stats[1]['opackets'] < 10000:
raise Exception('Too few opackets, port0: %s, port1: %s' % (stats[0]['opackets'], stats[1]['opackets']))
- print stats['global']
if stats['global']['queue_full'] > 100000:
raise Exception('Too much queue_full: %s' % stats['global']['queue_full'])
+ if not cpu_utils[-1]:
+ raise Exception('CPU util is zero, last values: %s' % cpu_utils)
+ if not stats['global']['tx_bps']:
+ raise Exception('TX bps is zero: %s' % stats['global']['tx_bps'])
bw_per_core = 100 * stats['global']['tx_bps'] / cpu_utils[-1] / 1e6
print('Done (%ss), CPU util: %4g, bw_per_core: %6sMb/core' % (int(time() - start_time), cpu_utils[-1], int(bw_per_core)))
-
+ # TODO: add check of benchmark based on results from regression