summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-14 20:03:52 +0000
committerGerrit Code Review <review@openstack.org>2013-01-14 20:03:52 +0000
commitb097b59c375c853170954724bbc6bdfff24e08ea (patch)
tree3de371b300c7af4ecac41ffa97f56c44610b981e /nova/tests
parent4142a849274d233188df6f9a141ba62b738e9e8d (diff)
parent82b55c97d10a55e6a825261397816f6a7ad00fd7 (diff)
Merge "Fix addition of CPU features when running against legacy libvirt"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_libvirt.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
index 53bb1b984..a1206d7fd 100644
--- a/nova/tests/test_libvirt.py
+++ b/nova/tests/test_libvirt.py
@@ -904,6 +904,9 @@ class LibvirtConnTestCase(test.TestCase):
cpu.model = "Opteron_G4"
cpu.vendor = "AMD"
+ cpu.features.append(vconfig.LibvirtConfigGuestCPUFeature("tm2"))
+ cpu.features.append(vconfig.LibvirtConfigGuestCPUFeature("ht"))
+
caps = vconfig.LibvirtConfigCaps()
caps.host = vconfig.LibvirtConfigCapsHost()
caps.host.cpu = cpu
@@ -927,6 +930,9 @@ class LibvirtConnTestCase(test.TestCase):
self.assertEquals(conf.cpu.mode, None)
self.assertEquals(conf.cpu.model, "Opteron_G4")
self.assertEquals(conf.cpu.vendor, "AMD")
+ self.assertEquals(len(conf.cpu.features), 2)
+ self.assertEquals(conf.cpu.features[0].name, "tm2")
+ self.assertEquals(conf.cpu.features[1].name, "ht")
def test_get_guest_cpu_config_custom_old(self):
def get_lib_version_stub(self):