# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1214423985 25200
# Node ID ef376bdad2e186904b15cda1afd230d8056e8015
# Parent 5c90c9a2fd567d7cf592932db189afbc8a4756f8
[TEST] A few migration related fixes.
Fixes:
-Remove destroy_and_undefine_domain() call from migrate_guest_to_host(). This call takes
the domain name as a parameter, but migrate_guest_to_host() doesn't take the domain
name So calling destroy_and_undefine_domain() resulted in an error.
-Add a hack to get_typed_class() so it supports Virt_MigrationJob (which doesn't fit
the typical <virt>_<basename> pattern.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 5c90c9a2fd56 -r ef376bdad2e1
suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Thu
Jun 19 10:35:59 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Wed
Jun 25 12:59:45 2008 -0700
@@ -90,10 +90,10 @@
return FAIL
status, ret = migrate_guest_to_host(service, cs_ref, target_ip)
-
if status == FAIL:
logger.error("MigrateVirtualSystemToHost: unexpected list length %s"
% len(ret))
+ destroy_and_undefine_domain(dom_name, options.ip)
return status
elif len(ret) == 2:
id = ret[1]['Job'].keybindings['InstanceID']
@@ -102,7 +102,7 @@
guest_name, local_migrate)
- destroy_and_undefine_domain(dom_name, options.ip)
+ destroy_and_undefine_domain(dom_name, options.ip)
return status
diff -r 5c90c9a2fd56 -r ef376bdad2e1
suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Thu
Jun 19 10:35:59 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Wed
Jun 25 12:59:45 2008 -0700
@@ -145,12 +145,11 @@
logger.info("Migrating guest with the following options:")
logger.info("%s" % item)
- status, ret = migrate_guest_to_host(service, cs_ref, target_ip,
- item)
-
+ status, ret = migrate_guest_to_host(service, cs_ref, target_ip, item)
if status == FAIL:
logger.error("MigrateVirtualSystemToHost: unexpected list length
%s"
% len(ret))
+ destroy_and_undefine_domain(dom_name, options.ip)
return status
elif len(ret) == 2:
id = ret[1]['Job'].keybindings['InstanceID']
diff -r 5c90c9a2fd56 -r ef376bdad2e1 suites/libvirt-cim/lib/XenKvmLib/classes.py
--- a/suites/libvirt-cim/lib/XenKvmLib/classes.py Thu Jun 19 10:35:59 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/classes.py Wed Jun 25 12:59:45 2008 -0700
@@ -23,7 +23,8 @@
def get_typed_class(virt, basename):
if virt not in virt_types:
- raise ValueError('Invalid class type')
+ if virt != "Virt" and basename != "MigrationJob":
+ raise ValueError('Invalid class type')
if basename == None or basename == '':
raise ValueError('Invalide class base name')
diff -r 5c90c9a2fd56 -r ef376bdad2e1 suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Thu Jun 19 10:35:59 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Wed Jun 25 12:59:45 2008 -0700
@@ -95,10 +95,10 @@
except Exception, details:
logger.error("Error invoke method
'MigrateVirtualSystemToHost\'.")
logger.error("%s", details)
+ return FAIL, ret
if len(ret) == 0:
logger.error("MigrateVirtualSystemToHost returns an empty list")
- destroy_and_undefine_domain(test_dom, ip)
return FAIL, ret
return PASS, ret
Show replies by date