[PATCH] [TEST] Update VSMigrationS.05 for XenFV support, also convert test_xml call to vxml

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1216719536 25200 # Node ID 5368f189cb2196ac260e07c4f2ea958ffdf68807 # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] Update VSMigrationS.05 for XenFV support, also convert test_xml call to vxml Signed-off-by: Guolian Yun <yunguol@cn.ibm.com> diff -r 3703b7be5a10 -r 5368f189cb21 suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Tue Jul 22 02:38:56 2008 -0700 @@ -24,14 +24,14 @@ 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 CimTest.Globals import logger, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV'] test_dom = 'dom_migration' exp_rc = 1 #CIM_ERR_FAILED @@ -40,23 +40,17 @@ @do_main(sup_types) def main(): options = main.options - xmlfile = testxml(test_dom) + + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom) + ret = cxml.create(options.ip) + if not ret: + logger.error("Error create domain %s" % test_dom ) + return FAIL status = FAIL rc = -1 - try: - define_test_domain(xmlfile, options.ip) - except Exception: - logger.error("Error define domain %s" % test_dom) - return FAIL - - try: - start_test_domain(test_dom, options.ip) - except Exception: - logger.error("Error start domain %s" % test_dom) - return FAIL - try: service = vsmigrations.Xen_VirtualSystemMigrationService(options.ip) except Exception:

@do_main(sup_types) def main(): options = main.options - xmlfile = testxml(test_dom) + + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom) + ret = cxml.create(options.ip) + if not ret: + logger.error("Error create domain %s" % test_dom ) + return FAIL
Since you're creating the guest using cxml.create, can you replace the destroy_and_undefine_domain() with cxml.destroy() and cxml.undefine() calls? If a test is updated to use the .define() / .create() calls, I'd like to phase out the destroy_and_undefine_domain() and related calls. These calls are still necessary if a guest is being defined using DefineSystem(). Don't forget to remove the "from XenKvmLib.test_doms import destroy_and_undefine_domain" line as well. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
participants (2)
-
Kaitlin Rupert
-
yunguol@cn.ibm.com