From 70619d45cc540ae4f46927fc22972060fba43750 Mon Sep 17 00:00:00 2001 From: Luis Fernandez Alvarez Date: Fri, 23 Nov 2012 09:46:52 +0100 Subject: Added cpu_info report to HyperV Compute driver It fixes bug 1082275 The current version of the HyperV Compute driver wasn't returning CPU information when it reported its resources. In order to solve it, this patch extracts the cpu properties from WMI and Win32 calls. Change-Id: I5c2a89b5e432f4e958354a15582258d4cff83658 --- ...APITestCase.test_get_available_resource_ctypes.p.gz | Bin 0 -> 926 bytes ...se.test_get_available_resource_multiprocessing.p.gz | Bin 270 -> 270 bytes ...perVAPITestCase.test_get_available_resource_os.p.gz | Bin 423 -> 423 bytes ...APITestCase.test_get_available_resource_shutil.p.gz | Bin 309 -> 309 bytes ...erVAPITestCase.test_get_available_resource_wmi.p.gz | Bin 980 -> 1276 bytes nova/tests/test_hypervapi.py | 5 +++-- 6 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_ctypes.p.gz (limited to 'nova/tests') diff --git a/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_ctypes.p.gz b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_ctypes.p.gz new file mode 100644 index 000000000..b363af55a Binary files /dev/null and b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_ctypes.p.gz differ diff --git a/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_multiprocessing.p.gz b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_multiprocessing.p.gz index dd8eb1248..92dfc0823 100644 Binary files a/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_multiprocessing.p.gz and b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_multiprocessing.p.gz differ diff --git a/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_os.p.gz b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_os.p.gz index 27611287c..e2ccdc024 100644 Binary files a/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_os.p.gz and b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_os.p.gz differ diff --git a/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_shutil.p.gz b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_shutil.p.gz index 47e882ab0..8a4186b2f 100644 Binary files a/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_shutil.p.gz and b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_shutil.p.gz differ diff --git a/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_wmi.p.gz b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_wmi.p.gz index 3b91f7e0a..3747f8f03 100644 Binary files a/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_wmi.p.gz and b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_available_resource_wmi.p.gz differ diff --git a/nova/tests/test_hypervapi.py b/nova/tests/test_hypervapi.py index 36f153531..c3091e1b7 100644 --- a/nova/tests/test_hypervapi.py +++ b/nova/tests/test_hypervapi.py @@ -76,7 +76,7 @@ class HyperVAPITestCase(basetestcase.BaseTestCase): fake_image.stub_out_image_service(self.stubs) fake_network.stub_out_nw_api_get_instance_nw_info(self.stubs) - def fake_dumps(msg): + def fake_dumps(msg, default=None, **kwargs): return '""' self.stubs.Set(json, 'dumps', fake_dumps) @@ -108,7 +108,8 @@ class HyperVAPITestCase(basetestcase.BaseTestCase): 'multiprocessing', '_winreg', 'nova.virt.configdrive', - 'nova.utils' + 'nova.utils', + 'ctypes' ] # Modules in which the mocks are going to be injected -- cgit