# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1216798356 25200
# Node ID 567173832c7fb213be726e0dff29cc1b559449f8
# Parent 3703b7be5a107c67e901546978e974546b3d5562
[TEST] #2 Convert VirtualSystemMigrationService.05 to support XenFV
Updates from 1 to 2:
Change the destroy_and_undefine_domain() calls to .destroy() and .undefine() calls
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 3703b7be5a10 -r 567173832c7f
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 Wed
Jul 23 00:32:36 2008 -0700
@@ -24,14 +24,13 @@
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 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 +39,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:
@@ -87,7 +80,9 @@
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__":