[virt-tools-list] [virt-manager PATCH] test: load the devices data when in test suite

Chen Hanxiao chenhanxiao at cn.fujitsu.com
Wed May 21 08:19:28 UTC 2014


commit 4f056dcba97bc337dcd35fe0cfb62417ac09d036
breaks a lot of test cases.
This patch will use the old method
when in test suite.

Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
---
 virtinst/osdict.py | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/virtinst/osdict.py b/virtinst/osdict.py
index 7ffecb1..ec7f34f 100644
--- a/virtinst/osdict.py
+++ b/virtinst/osdict.py
@@ -21,6 +21,7 @@
 
 _SENTINEL = -1234
 _allvariants = {}
+import os as Os
 from datetime import datetime
 from gi.repository import Libosinfo as libosinfo
 from inspect import isfunction
@@ -467,14 +468,24 @@ class _OsVariantOsInfo(_OSVariant):
         xen_disable_acpi = self._get_xen_disable_acpi()
         virtiommio = self._is_virtiommio()
         qemu_ga = self._is_qemu_ga()
-        virtioconsole = lambda: self._is_virtioconsole()
-        netmodel = lambda: self._get_netmodel()
-        videomodel = lambda: self._get_videomodel()
-        diskbus = lambda: self._get_diskbus()
-        inputtype = lambda: self._get_inputtype()
-        inputbus = lambda: self.get_inputbus()
-        virtiodisk = lambda: self._is_virtiodisk()
-        virtionet = lambda: self._is_virtionet()
+        if "VIRTINST_TEST_SUITE" in Os.environ:
+            virtioconsole = self._is_virtioconsole()
+            netmodel = self._get_netmodel()
+            videomodel = self._get_videomodel()
+            diskbus = self._get_diskbus()
+            inputtype = self._get_inputtype()
+            inputbus = self.get_inputbus()
+            virtiodisk = self._is_virtiodisk()
+            virtionet = self._is_virtionet()
+        else:
+            virtioconsole = lambda: self._is_virtioconsole()
+            netmodel = lambda: self._get_netmodel()
+            videomodel = lambda: self._get_videomodel()
+            diskbus = lambda: self._get_diskbus()
+            inputtype = lambda: self._get_inputtype()
+            inputbus = lambda: self.get_inputbus()
+            virtiodisk = lambda: self._is_virtiodisk()
+            virtionet = lambda: self._is_virtionet()
         _OSVariant.__init__(self, name=name, label=label, is_type=is_type,
                 typename=typename, sortby=sortby, parent="generic",
                 urldistro=urldistro, supported=supported,
-- 
1.9.0




More information about the virt-tools-list mailing list