diff --git a/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_host_stats_shutil.p.gz b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_host_stats_shutil.p.gz new file mode 100644 index 00000000..805931bb Binary files /dev/null and b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_host_stats_shutil.p.gz differ diff --git a/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_host_stats_wmi.p.gz b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_host_stats_wmi.p.gz new file mode 100644 index 00000000..e9852d03 Binary files /dev/null and b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_host_stats_wmi.p.gz differ diff --git a/nova/tests/test_hypervapi.py b/nova/tests/test_hypervapi.py index 0ae65fea..e3f9fde4 100644 --- a/nova/tests/test_hypervapi.py +++ b/nova/tests/test_hypervapi.py @@ -103,6 +103,7 @@ class HyperVAPITestCase(basetestcase.BaseTestCase): # Modules in which the mocks are going to be injected from nova.virt.hyperv import baseops + from nova.virt.hyperv import hostops from nova.virt.hyperv import livemigrationops from nova.virt.hyperv import snapshotops from nova.virt.hyperv import vmops @@ -112,6 +113,7 @@ class HyperVAPITestCase(basetestcase.BaseTestCase): modules_to_test = [ driver_hyperv, baseops, + hostops, vmops, vmutils, volumeops, @@ -157,6 +159,14 @@ class HyperVAPITestCase(basetestcase.BaseTestCase): self.assertEquals(dic['hypervisor_hostname'], platform.node()) + def test_get_host_stats(self): + dic = self._conn.get_host_stats(True) + + self.assertEquals(dic['disk_total'], + dic['disk_used'] + dic['disk_available']) + self.assertEquals(dic['host_memory_total'], + dic['host_memory_overhead'] + dic['host_memory_free']) + def test_list_instances(self): num_vms = self._hypervutils.get_vm_count() instances = self._conn.list_instances()