[Kimchi-devel] [PATCH v7 2/2] Mockmodel test for cpuinfo
Christy Perez
christy at linux.vnet.ibm.com
Thu Nov 20 20:30:36 UTC 2014
Signed-off-by: Christy Perez <christy at linux.vnet.ibm.com>
---
src/kimchi/mockmodel.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index 9089ef6..d3a980e 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -23,6 +23,8 @@
import random
import time
+import kimchi.model.cpuinfo
+
from lxml import objectify
from kimchi import config
@@ -65,6 +67,8 @@ def __init__(self, objstore_loc=None):
self._mock_swupdate = MockSoftwareUpdate()
self._mock_repositories = MockRepositories()
+ kimchi.model.cpuinfo.get_topo_capabilities = \
+ MockModel.get_topo_capabilities
libvirt.virConnect.defineXML = MockModel.domainDefineXML
libvirt.virDomain.XMLDesc = MockModel.domainXMLDesc
libvirt.virDomain.undefine = MockModel.undefineDomain
@@ -130,6 +134,12 @@ def reset(self):
self.storagevolume_delete('default-pool', v)
@staticmethod
+ def get_topo_capabilities(conn):
+ # The libvirt test driver doesn't return topology.
+ xml = "<topology sockets='1' cores='2' threads='2'/>"
+ return ET.fromstring(xml)
+
+ @staticmethod
def domainDefineXML(conn, xml):
name = objectify.fromstring(xml).name.text
try:
--
1.9.3
More information about the Kimchi-devel
mailing list