
# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1208246802 25200 # Node ID 078ba6cad8417f89daa8f968db4b2b8102263efa # Parent cc0804a7049ccf7cbb2274ec97a82b6c0c0fd9fd [TEST] Add KVM & XenFV suppport for VirtualSystemMigrationService.05 Signed-off-by: Guolian Yun <yunguol@cn.ibm.com> diff -r cc0804a7049c -r 078ba6cad841 suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Tue Apr 15 01:05:19 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Tue Apr 15 01:06:42 2008 -0700 @@ -28,10 +28,12 @@ from XenKvmLib.test_xml import * from XenKvmLib.test_xml import * from XenKvmLib import computersystem from XenKvmLib import vsmigrations +from XenKvmLib import vxml +from XenKvmLib.classes import get_typed_class from CimTest.Globals import log_param, logger, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] test_dom = 'dom_migration' exp_rc = 1 #CIM_ERR_FAILED @@ -41,30 +43,24 @@ def main(): def main(): options = main.options log_param() - xmlfile = testxml(test_dom) status = FAIL rc = -1 - - try: - define_test_domain(xmlfile, options.ip) - except Exception: - logger.error("Error define domain %s" % test_dom) + + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom) + ret = cxml.create(options.ip) + if not ret: + logger.error('Unable to create domain %s' % test_dom) return FAIL try: - start_test_domain(test_dom, options.ip) + service = eval('vsmigrations.' + get_typed_class(options.virt, "VirtualSystemMigrationService"))(options.ip) except Exception: - logger.error("Error start domain %s" % test_dom) - return FAIL - - try: - service = vsmigrations.Xen_VirtualSystemMigrationService(options.ip) - except Exception: - logger.error("Error when go to the class of Xen_VirtualSystemMigrationService") + logger.error("Error when go to the class of VirtualSystemMigrationService") return FAIL - classname = 'Xen_ComputerSystem' + classname = get_typed_class(options.virt, 'ComputerSystem') cs_ref = CIMInstanceName(classname, keybindings = { 'Wrong':test_dom, 'CreationClassName':classname}) @@ -88,7 +84,9 @@ def main(): if rc == 0: logger.error('Migrate to host method should NOT return OK with a wrong key input') - destroy_and_undefine_domain(test_dom, options.ip) + cxml.destroy(options.ip) + cxml.undefine(options.ip) + return status if __name__ == "__main__":