diff options
Diffstat (limited to 'tests/unit/network_services/nfvi/test_resource.py')
-rw-r--r-- | tests/unit/network_services/nfvi/test_resource.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/unit/network_services/nfvi/test_resource.py b/tests/unit/network_services/nfvi/test_resource.py index cb26fd085..1c2c1f3e2 100644 --- a/tests/unit/network_services/nfvi/test_resource.py +++ b/tests/unit/network_services/nfvi/test_resource.py @@ -54,7 +54,7 @@ class TestResourceProfile(unittest.TestCase): 'local_ip': '172.16.100.19', 'type': 'PCI-PASSTHROUGH', 'netmask': '255.255.255.0', - 'dpdk_port_num': '0', + 'dpdk_port_num': 0, 'bandwidth': '10 Gbps', 'dst_ip': '172.16.100.20', 'local_mac': '3c:fd:fe:a1:2b:80'}, @@ -66,7 +66,7 @@ class TestResourceProfile(unittest.TestCase): 'local_ip': '172.16.40.19', 'type': 'PCI-PASSTHROUGH', 'netmask': '255.255.255.0', - 'dpdk_port_num': '1', + 'dpdk_port_num': 1, 'bandwidth': '10 Gbps', 'dst_ip': '172.16.40.20', 'local_mac': '3c:fd:fe:a1:2b:81'}, @@ -108,13 +108,13 @@ class TestResourceProfile(unittest.TestCase): def test_get_cpu_data(self): reskey = ["", "cpufreq", "cpufreq-0"] value = "metric:10" - val = self.resource_profile.get_cpu_data(reskey, value) + val = self.resource_profile.get_cpu_data(reskey[1], reskey[2], value) self.assertIsNotNone(val) def test_get_cpu_data_error(self): reskey = ["", "", ""] value = "metric:10" - val = self.resource_profile.get_cpu_data(reskey, value) + val = self.resource_profile.get_cpu_data(reskey[0], reskey[1], value) self.assertEqual(val, ('error', 'Invalid', '', '')) def test__start_collectd(self): @@ -274,6 +274,7 @@ class TestResourceProfile(unittest.TestCase): res = self.resource_profile.parse_collectd_result({}, [0, 1, 2]) expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {}, 'memory': {}, 'ovs_stats': {}, 'timestamp': '', + 'intel_pmu': {}, 'virt': {}} self.assertDictEqual(res, expected_result) @@ -286,6 +287,7 @@ class TestResourceProfile(unittest.TestCase): res = self.resource_profile.parse_collectd_result(metric, [0, 1, 2]) expected_result = {'cpu': {1: {'ipc': '1234'}}, 'dpdkstat': {}, 'hugepages': {}, 'memory': {}, 'ovs_stats': {}, 'timestamp': '', + 'intel_pmu': {}, 'virt': {}} self.assertDictEqual(res, expected_result) @@ -294,6 +296,7 @@ class TestResourceProfile(unittest.TestCase): res = self.resource_profile.parse_collectd_result(metric, [0, 1, 2]) expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {}, 'memory': {'bw': '101'}, 'ovs_stats': {}, 'timestamp': '', + 'intel_pmu': {}, 'virt': {}} self.assertDictEqual(res, expected_result) @@ -305,6 +308,7 @@ class TestResourceProfile(unittest.TestCase): expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {'free': '101'}, 'memory': {}, 'ovs_stats': {}, 'timestamp': '', + 'intel_pmu': {}, 'virt': {}} self.assertDictEqual(res, expected_result) @@ -321,6 +325,7 @@ class TestResourceProfile(unittest.TestCase): res = self.resource_profile.parse_collectd_result(metric, [0, 1, 2]) expected_result = {'cpu': {}, 'dpdkstat': {'tx': '101'}, 'hugepages': {}, 'memory': {}, 'ovs_stats': {'tx': '101'}, 'timestamp': '', + 'intel_pmu': {}, 'virt': {'memory': '101'}} self.assertDictEqual(res, expected_result) |