diff options
Diffstat (limited to 'tests/unit/ansible_library/plugins/action')
-rw-r--r-- | tests/unit/ansible_library/plugins/action/calculate_test.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/unit/ansible_library/plugins/action/calculate_test.py b/tests/unit/ansible_library/plugins/action/calculate_test.py index 80a07206..a83e1286 100644 --- a/tests/unit/ansible_library/plugins/action/calculate_test.py +++ b/tests/unit/ansible_library/plugins/action/calculate_test.py @@ -105,10 +105,25 @@ def section_result(metric_result): @pytest.fixture() -def qpi_result(section_result, metrics): +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, metrics, info): return {'score': 2048, 'name': 'compute', 'description': 'QTIP Performance Index of compute', + 'system_info': info, 'children': [section_result], 'details': { 'spec': "https://git.opnfv.org/qtip/tree/resources/QPI/compute.yaml", @@ -128,10 +143,10 @@ def test_calc_section(section_spec, metrics, section_baseline, section_result): section_baseline) == section_result -def test_calc_qpi(qpi_spec, metrics, qpi_baseline, qpi_result): +def test_calc_qpi(qpi_spec, metrics, qpi_baseline, info, qpi_result): assert calculate.calc_qpi(qpi_spec, metrics, - qpi_baseline) == qpi_result + qpi_baseline, info) == qpi_result @pytest.mark.parametrize('metrics, baseline, expected', [ |