summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_host_stats_shutil.p.gzbin0 -> 290 bytes
-rw-r--r--nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_host_stats_wmi.p.gzbin0 -> 888 bytes
-rw-r--r--nova/tests/test_hypervapi.py10
3 files changed, 10 insertions, 0 deletions
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 000000000..805931bbb
--- /dev/null
+++ b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_host_stats_shutil.p.gz
Binary files 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 000000000..e9852d038
--- /dev/null
+++ b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_host_stats_wmi.p.gz
Binary files differ
diff --git a/nova/tests/test_hypervapi.py b/nova/tests/test_hypervapi.py
index 0ae65feaf..e3f9fde4c 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()