[Kimchi-devel] [PATCH v8 2/2] Mockmodel test for cpuinfo

Christy Perez christy at linux.vnet.ibm.com
Mon Nov 24 17:02:06 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 fa93fab..34c7b22 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
@@ -67,6 +69,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
@@ -134,6 +138,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