aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/ansible_library/plugins/action
diff options
context:
space:
mode:
authorTaseer <taseer94@gmail.com>2017-06-29 05:24:25 +0500
committerTaseer <taseer94@gmail.com>2017-06-29 21:04:03 +0500
commit0a3a3045b97eee0583de82b532880b96807bd82a (patch)
treea1e910bed36d6cfd0cdec151beee5e5e57e7a126 /tests/unit/ansible_library/plugins/action
parent76cb6b08ce04492bd02bec43487a82f99a0a2c5f (diff)
Integrate Report with CLI.
- Migrate fixtures to conftest to be used by multiple files Change-Id: I9a705b93189ac1f2e6fd2fc4e3f05aec7af379f1 Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
Diffstat (limited to 'tests/unit/ansible_library/plugins/action')
-rw-r--r--tests/unit/ansible_library/plugins/action/calculate_test.py120
1 files changed, 0 insertions, 120 deletions
diff --git a/tests/unit/ansible_library/plugins/action/calculate_test.py b/tests/unit/ansible_library/plugins/action/calculate_test.py
index 2a0b6a7c..b053a4b9 100644
--- a/tests/unit/ansible_library/plugins/action/calculate_test.py
+++ b/tests/unit/ansible_library/plugins/action/calculate_test.py
@@ -12,126 +12,6 @@ import pytest
from qtip.ansible_library.plugins.action import calculate
-@pytest.fixture()
-def metrics():
- return {
- "ssl_rsa": {
- "rsa_sign": [500],
- "rsa_verify": [600]
- }
- }
-
-
-@pytest.fixture()
-def metric_spec():
- return {
- "name": "ssl_rsa",
- "workloads": [
- {"name": "rsa_sign"},
- {"name": "rsa_verify"}
- ]
- }
-
-
-@pytest.fixture()
-def section_spec(metric_spec):
- return {
- "name": "ssl",
- "description": "cryptography and SSL/TLS performance",
- "metrics": [metric_spec]
- }
-
-
-@pytest.fixture()
-def qpi_spec(section_spec):
- return {
- "name": "compute",
- "description": "QTIP Performance Index of compute",
- "sections": [section_spec]
- }
-
-
-@pytest.fixture()
-def rsa_sign_baseline():
- return {'name': 'rsa_sign', 'baseline': '500'}
-
-
-@pytest.fixture()
-def rsa_verify_baseline():
- return {"name": "rsa_verify", "baseline": 600}
-
-
-@pytest.fixture()
-def metric_baseline(rsa_sign_baseline, rsa_verify_baseline):
- return {
- "name": "ssl_rsa",
- "workloads": [rsa_sign_baseline, rsa_verify_baseline]
- }
-
-
-@pytest.fixture()
-def section_baseline(metric_baseline):
- return {
- "name": "ssl",
- "metrics": [metric_baseline]
- }
-
-
-@pytest.fixture()
-def qpi_baseline(section_baseline):
- return {
- "name": "compute-baseline",
- "description": "The baseline for compute QPI",
- "score": 2048,
- "sections": [section_baseline]
- }
-
-
-@pytest.fixture()
-def metric_result():
- return {'score': 1.0,
- 'name': 'ssl_rsa',
- 'description': 'metric',
- 'workloads': [{'description': 'workload', 'name': 'rsa_sign',
- 'score': 1.0, 'result': 500},
- {'description': 'workload', 'name': 'rsa_verify',
- 'score': 1.0, 'result': 600}]}
-
-
-@pytest.fixture()
-def section_result(metric_result):
- return {'score': 1.0,
- 'name': 'ssl',
- 'description': 'cryptography and SSL/TLS performance',
- 'metrics': [metric_result]}
-
-
-@pytest.fixture()
-def info():
- return {
- "system_info": {
- "kernel": "4.4.0-72-generic x86_64 (64 bit)",
- "product": "EC600G3",
- "os": "Ubuntu 16.04 xenial",
- "cpu": "2 Deca core Intel Xeon E5-2650 v3s (-HT-MCP-SMP-)",
- "disk": "1200.3GB (25.1% used)",
- "memory": "30769.7/128524.1MB"
- }
- }
-
-
-@pytest.fixture()
-def qpi_result(section_result, info):
- return {'score': 2048,
- 'name': 'compute',
- 'description': 'QTIP Performance Index of compute',
- 'system_info': info,
- 'sections': [section_result],
- 'spec': "https://git.opnfv.org/qtip/tree/resources/QPI/compute.yaml",
- 'baseline': "https://git.opnfv.org/qtip/tree/resources/QPI/compute-baseline.json",
- }
-
-
def test_calc_metric(metric_spec, metrics, metric_baseline, metric_result):
assert calculate.calc_metric(metric_spec,
metrics['ssl_rsa'],