Reviewed-by: Daniel Barboza <dhbarboza82(a)gmail.com>
On 03/17/2015 05:20 PM, Aline Manera wrote:
libvirt Test driver only supports i686 arch.
So fix feature tests to get the right arch according to libvirt driver.
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
src/kimchi/model/featuretests.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/kimchi/model/featuretests.py b/src/kimchi/model/featuretests.py
index f22fada..4aac8ed 100644
--- a/src/kimchi/model/featuretests.py
+++ b/src/kimchi/model/featuretests.py
@@ -20,13 +20,13 @@
import cherrypy
import libvirt
import lxml.etree as ET
+import platform
import socket
import subprocess
import threading
from lxml.builder import E
-from kimchi import osinfo
from kimchi.rollbackcontext import RollbackContext
from kimchi.utils import kimchi_log, run_command, servermethod
@@ -102,8 +102,9 @@ class FeatureTests(object):
@staticmethod
def libvirt_supports_iso_stream(conn, protocol):
- domain_type = 'test' if conn.getType().lower() == 'test' else
'kvm'
- arch = osinfo.defaults['arch']
+ conn_type = conn.getType().lower()
+ domain_type = 'test' if conn_type == 'test' else 'kvm'
+ arch = 'i686' if conn_type == 'test' else platform.machine()
arch = 'ppc64' if arch == 'ppc64le' else arch
xml = ISO_STREAM_XML % {'name': FEATURETEST_VM_NAME,
'domain': domain_type, 'protocol':
protocol,
@@ -198,8 +199,9 @@ class FeatureTests(object):
with RollbackContext() as rollback:
FeatureTests.disable_libvirt_error_logging()
rollback.prependDefer(FeatureTests.enable_libvirt_error_logging)
- domain_type = 'test' if conn.getType().lower() == 'test'
else 'kvm'
- arch = osinfo.defaults['arch']
+ conn_type = conn.getType().lower()
+ domain_type = 'test' if conn_type == 'test' else
'kvm'
+ arch = 'i686' if conn_type == 'test' else
platform.machine()
arch = 'ppc64' if arch == 'ppc64le' else arch
dom = conn.defineXML(SIMPLE_VM_XML % {'name': FEATURETEST_VM_NAME,
'domain': domain_type,