aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/ansible_library/plugins
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-05-19 00:19:16 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-05-19 00:19:16 +0000
commit83860ac43ac02ef202f1316eba1790ab3de3ff6d (patch)
tree15501260bf8be15813a765db03c22269657714aa /tests/unit/ansible_library/plugins
parent73b0a82bdff1c53846c8cd99475ba3a58b0fdca4 (diff)
parentab72f9c49cabd945d35c946dce4158ea8e228e2a (diff)
Merge "Implement sunburst badge for QPI"
Diffstat (limited to 'tests/unit/ansible_library/plugins')
-rw-r--r--tests/unit/ansible_library/plugins/action/calculate_test.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/unit/ansible_library/plugins/action/calculate_test.py b/tests/unit/ansible_library/plugins/action/calculate_test.py
index 68a03e2a..31d72120 100644
--- a/tests/unit/ansible_library/plugins/action/calculate_test.py
+++ b/tests/unit/ansible_library/plugins/action/calculate_test.py
@@ -45,8 +45,8 @@ def section_spec(metric_spec):
@pytest.fixture
def qpi_spec(section_spec):
return {
- "description": "QTIP Performance Index of compute",
"name": "compute",
+ "description": "QTIP Performance Index of compute",
"sections": [section_spec]
}
@@ -54,23 +54,29 @@ def qpi_spec(section_spec):
@pytest.fixture()
def metric_result():
return {'score': 1.0,
- 'workload_results': [
- {'name': 'rsa_sign', 'score': 1.0},
- {'name': 'rsa_verify', 'score': 1.0}]}
+ 'name': 'ssl_rsa',
+ 'description': 'metric',
+ 'children': [{'description': 'workload', 'name': 'rsa_sign', 'score': 1.0},
+ {'description': 'workload', 'name': 'rsa_verify', 'score': 1.0}]}
@pytest.fixture()
def section_result(metric_result):
return {'score': 1.0,
- 'metric_results': [{'name': 'ssl_rsa', 'result': metric_result}]}
+ 'name': 'ssl',
+ 'description': 'cryptography and SSL/TLS performance',
+ 'children': [metric_result]}
@pytest.fixture()
def qpi_result(qpi_spec, section_result, metrics):
return {'score': 2048,
- 'spec': qpi_spec,
- 'metrics': metrics,
- 'section_results': [{'name': 'ssl', 'result': section_result}]}
+ 'name': 'compute',
+ 'description': 'QTIP Performance Index of compute',
+ 'children': [section_result],
+ 'details': {
+ 'spec': qpi_spec,
+ 'metrics': metrics}}
def test_calc_metric(metric_spec, metrics, metric_result):