[Libvirt-cim] [PATCH] [TEST] Update VSMigrationS.01 for XenFV support, also convert test_xml call to vxml

yunguol at cn.ibm.com yunguol at cn.ibm.com
Tue Jul 22 09:55:11 UTC 2008


# HG changeset patch
# User Guolian Yun <yunguol at cn.ibm.com>
# Date 1216720500 25200
# Node ID 51375198603807e18dd34c986a03acbd2e751b32
# Parent  3703b7be5a107c67e901546978e974546b3d5562
[TEST] Update VSMigrationS.01 for XenFV support, also convert test_xml call to vxml

Signed-off-by: Guolian Yun <yunguol at cn.ibm.com>

diff -r 3703b7be5a10 -r 513751986038 suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py	Wed Jul 16 07:23:32 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py	Tue Jul 22 02:55:00 2008 -0700
@@ -27,8 +27,8 @@
 import pywbem
 from pywbem.cim_obj import CIMInstanceName
 from VirtLib import utils
-from XenKvmLib.test_doms import define_test_domain, start_test_domain, destroy_and_undefine_domain
-from XenKvmLib.test_xml import *
+from XenKvmLib.test_doms import destroy_and_undefine_domain
+from XenKvmLib import vxml
 from XenKvmLib import computersystem
 from XenKvmLib import vsmigrations
 from XenKvmLib.vsmigrations import check_possible_host_migration, migrate_guest_to_host, check_migration_job
@@ -36,25 +36,18 @@
 from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, do_main
 from CimTest.ReturnCodes import PASS, FAIL, XFAIL
 
-sup_types = ['Xen']
+sup_types = ['Xen', 'XenFV']
 dom_name = 'dom_migrate'
 
-def start_guest_get_ref(ip, guest_name):
-    try:
-        xmlfile = testxml(guest_name)   
-        ret = define_test_domain(xmlfile, ip)
-        if not ret:
-            return FAIL, None
+def start_guest_get_ref(ip, guest_name, virt='Xen'):
+    virt_xml = vxml.get_class(virt)
+    cxml = virt_xml(guest_name)
+    ret = cxml.create(ip)
+    if not ret:
+        logger.error("Error create domain %s" % guest_name)
+        return FAIL
 
-        ret = start_test_domain(guest_name, ip)
-        if not ret:
-            return FAIL, None
-
-        time.sleep(10)
-    except Exception:
-        logger.error("Error creating domain %s" % guest_name)
-        return FAIL, None
-
+    time.sleep(10)
     classname = 'Xen_ComputerSystem'
     cs_ref = CIMInstanceName(classname, keybindings = {
                                         'Name':guest_name,
@@ -85,9 +78,9 @@
     else:
         local_migrate = 0
 
-    status, cs_ref = start_guest_get_ref(options.ip, dom_name)
+    status, cs_ref = start_guest_get_ref(options.ip, dom_name, options.virt)
     if status != PASS:
-        destroy_and_undefine_domain(guest_name, options.ip)
+        destroy_and_undefine_domain(dom_name, options.ip)
         return FAIL
 
     guest_name = cs_ref['Name']




More information about the Libvirt-cim mailing list