aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGwenael Lambrouin <gwenael.lambrouin@orange.com>2021-09-06 07:07:05 +0000
committerGerrit Code Review <gerrit@opnfv.org>2021-09-06 07:07:05 +0000
commite4d8ed5180195622bb2102326b7137f99404d36f (patch)
treee94aa6a6368ce664e50a6cedad59a5ffdeabfd10
parenta395f6c6ca1f350e4e19f57dd7d7afbba8bd397d (diff)
parent1fc8c811a3fe4da2d6bf9c8ec94a9e661fe8b720 (diff)
Merge "behave_tests: tweak nfvbench results JSON filename"HEADmaster
-rw-r--r--behave_tests/features/environment.py1
-rw-r--r--behave_tests/features/steps/steps.py16
2 files changed, 13 insertions, 4 deletions
diff --git a/behave_tests/features/environment.py b/behave_tests/features/environment.py
index 61096f6..7621075 100644
--- a/behave_tests/features/environment.py
+++ b/behave_tests/features/environment.py
@@ -73,6 +73,7 @@ def before_scenario(context, scenario):
if loopvm_flavor:
context.json['flavor_type'] = loopvm_flavor
context.synthesis = {}
+ context.percentage_rate = None
context.logger.info('before_scenario: ' + scenario.name)
diff --git a/behave_tests/features/steps/steps.py b/behave_tests/features/steps/steps.py
index e7d9b2c..cfb5848 100644
--- a/behave_tests/features/steps/steps.py
+++ b/behave_tests/features/steps/steps.py
@@ -269,11 +269,19 @@ def run_nfvbench_traffic(context, repeat=1):
f"rate={context.json['rate']} repeat={repeat}")
if 'json' not in context.json:
+ # Build filename for nfvbench results in JSON format
context.json['json'] = '/var/lib/xtesting/results/' + context.CASE_NAME + \
- '/nfvbench-' + context.tag + '-fs_' + \
- context.json['frame_sizes'][0] + '-fc_' + \
- context.json['flow_count'] + '-rate_' + \
- context.json['rate'] + '.json'
+ '/nfvbench-' + context.tag + \
+ '-fs_' + context.json['frame_sizes'][0] + \
+ '-fc_' + context.json['flow_count']
+ if context.percentage_rate is not None:
+ # Add rate as a percentage, eg '-rate_70%'
+ context.json['json'] += '-rate_' + context.percentage_rate
+ else:
+ # Add rate in bits or packets per second, eg '-rate_15Gbps' or '-rate_10kpps'
+ context.json['json'] += '-rate_' + context.json['rate']
+ context.json['json'] += '.json'
+
json_base_name = context.json['json']
max_total_tx_rate = None