# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1239181167 25200
# Node ID 9fc3064048044e18e14f96d12cadf7a0f8245c07
# Parent a2c6bcec55c1fb8c7a0e7ced19d6840865180297
[TEST] Adding check_mig_support() to vsmigration.py.
This check is used to verify if local migration is triggered for KVM.
Tested for Xen/KVM with current sources and rpm.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r a2c6bcec55c1 -r 9fc306404804 suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Mon Apr 06 03:43:45 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Wed Apr 08 01:59:27 2009 -0700
@@ -22,6 +22,7 @@
#
from time import sleep
+from socket import gethostbyaddr
from pywbem import WBEMConnection, CIMInstanceName
from CimTest.CimExt import CIMMethodClass, CIMClassMOF
from CimTest.ReturnCodes import PASS, FAIL
@@ -129,6 +130,15 @@
return msd.mof()
+def check_mig_support(virt, options):
+ s_sysname = gethostbyaddr(options.ip)[0]
+ t_sysname = gethostbyaddr(options.t_url)[0]
+ if virt == 'KVM' and (t_sysname == s_sysname or t_sysname in s_sysname):
+ logger.info("Libvirt does not support local migration for KVM")
+ return SKIP, s_sysname, t_sysname
+
+ return PASS, s_sysname, t_sysname
+
def check_possible_host_migration(service, cs_ref, ip, msd=None):
res = None
try: