
# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1246471673 25200 # Node ID 7672e676c7abbfea91cdc28b47cb591451090b89 # Parent 896b0360aebfe0c69ddda55567fa096c4d7d4236 [TEST] #2 07 -Remove cleanup_guest_netpool() def and call it from vsmigration.py Updates from 1 to 2: -Don't attempt to destroy() or undefine() the guest unless the guest is present on the system Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 896b0360aebf -r 7672e676c7ab suites/libvirt-cim/cimtest/VirtualSystemMigrationService/07_remote_offline_migration.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/07_remote_offline_migration.py Wed Jul 01 11:04:13 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/07_remote_offline_migration.py Wed Jul 01 11:07:53 2009 -0700 @@ -35,9 +35,9 @@ from XenKvmLib.const import do_main, default_network_name from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.classes import get_typed_class -from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate -from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf,\ - destroy_netpool +from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate, \ + cleanup_guest_netpool +from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf sup_types = ['KVM', 'Xen'] @@ -60,35 +60,6 @@ return PASS, cxml -def cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, s_sysname): - # Clean the domain on target machine. - # This is req when migration is successful, also when migration is not - # completely successful VM might be created on the target machine - # and hence need to clean. - target_list = domain_list(t_sysname, virt) - if target_list != None and test_dom in target_list: - ret_value = cxml.undefine(t_sysname) - if not ret_value: - logger.info("Failed to undefine the migrated domain '%s' on '%s'", - test_dom, t_sysname) - - # clean the networkpool created on the remote machine - target_net_list = net_list(t_sysname, virt) - if target_net_list != None and default_network_name in target_net_list: - ret_value = destroy_netpool(t_sysname, virt, default_network_name) - if ret_value != PASS: - logger.info("Unable to destroy networkpool '%s' on '%s'", - default_network_name, t_sysname) - - # Remote Migration not Successful, clean the domain on src machine - src_list = domain_list(s_sysname, virt) - if src_list != None and test_dom in src_list: - ret_value = cxml.undefine(s_sysname) - if not ret_value: - logger.info("Failed to undefine the domain '%s' on source '%s'", - test_dom, s_sysname) - - @do_main(sup_types) def main(): options = main.options diff -r 896b0360aebf -r 7672e676c7ab suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Wed Jul 01 11:04:13 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Wed Jul 01 11:07:53 2009 -0700 @@ -30,7 +30,7 @@ from CimTest.ReturnCodes import PASS, FAIL, SKIP from XenKvmLib.enumclass import EnumInstances from XenKvmLib.classes import get_typed_class, virt_types -from XenKvmLib.xm_virt_util import domain_list, net_list +from XenKvmLib.xm_virt_util import domain_list, net_list, active_domain_list from XenKvmLib.const import get_provider_version, default_network_name from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS, \ CIM_ERROR_ENUMERATE @@ -435,13 +435,15 @@ # This is req when migration is successful, also when migration is not # completely successful VM might be created on the target machine # and hence need to clean. - target_list = domain_list(t_sysname, virt) - if target_list != None and test_dom in target_list: + target_list = active_domain_list(t_sysname, virt) + if target_list != None and test_dom in target_list: ret_value = cxml.cim_destroy(t_sysname) if not ret_value: logger.info("Failed to destroy the migrated domain '%s' on '%s'", test_dom, t_sysname) + target_list = domain_list(t_sysname, virt) + if target_list != None and test_dom in target_list: ret_value = cxml.undefine(t_sysname) if not ret_value: logger.info("Failed to undefine the migrated domain '%s' on '%s'",