[PATCH] [TEST] add VirtualSystemSettingDataComponent/02_reverse.py.02 for XenFV & KVM support
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1208488335 -28800
# Node ID a2306ae3ec7d442913108f7073ab07c6b92579f8
# Parent c1d9b3ba06ca4c76fe9b1cf63a77a7f92bb01d22
[TEST] add VirtualSystemSettingDataComponent/02_reverse.py.02 for XenFV & KVM support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r c1d9b3ba06ca -r a2306ae3ec7d suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Thu Apr 17 10:12:46 2008 +0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Fri Apr 18 11:12:15 2008 +0800
@@ -47,28 +47,25 @@
import sys
from XenKvmLib import enumclass
from VirtLib import utils
-from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all
-from XenKvmLib import test_xml
-from XenKvmLib.test_xml import testxml
+from XenKvmLib.test_doms import destroy_and_undefine_all
+from XenKvmLib import vxml
+from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from XenKvmLib import assoc
from XenKvmLib.rasd import InstId_err
from CimTest.Globals import log_param, logger, do_main
from CimTest.ReturnCodes import PASS, FAIL
-sup_types = ['Xen']
+sup_types = ['Xen', 'XenFV', 'KVM']
test_dom = "VSSDC_dom"
test_vcpus = 1
test_mem = 128
test_mac = "00:11:22:33:44:aa"
-test_disk = 'xvdb'
-VSType = "Xen"
def check_rasd_values(id, exp_id):
try:
if id != exp_id:
- InstId_err(assoc_info[i], rasd_list['proc_rasd'])
return FAIL
except Exception, detail :
@@ -77,7 +74,7 @@
return PASS
-def assoc_values(ip, assoc_info):
+def assoc_values(ip, assoc_info, virt="Xen"):
"""
The association info of
Xen_VirtualSystemSettingDataComponent is
@@ -94,28 +91,28 @@
if len(assoc_info) <= 0:
logger.error("No RASD instances returned")
return FAIL
+
+ proc_cn = get_typed_class(virt, 'ProcResourceAllocationSettingData')
+ net_cn = get_typed_class(virt, 'NetResourceAllocationSettingData')
+ disk_cn = get_typed_class(virt, 'DiskResourceAllocationSettingData')
+ mem_cn = get_typed_class(virt, 'MemResourceAllocationSettingData')
for inst in assoc_info:
- if inst.classname == 'Xen_ProcResourceAllocationSettingData':
+ if inst.classname == proc_cn:
status = check_rasd_values(inst['InstanceID'],
rasd_list['proc_rasd'])
- elif inst.classname == 'Xen_NetResourceAllocationSettingData':
+ elif inst.classname == net_cn:
status = check_rasd_values(inst['InstanceID'],
rasd_list['net_rasd'])
- elif inst.classname == 'Xen_DiskResourceAllocationSettingData':
+ elif inst.classname == disk_cn:
status = check_rasd_values(inst['InstanceID'],
rasd_list['disk_rasd'])
- elif inst.classname == 'Xen_MemResourceAllocationSettingData':
+ elif inst.classname == mem_cn:
status = check_rasd_values(inst['InstanceID'],
rasd_list['mem_rasd'])
else:
logger.error("Unexpected RASD instance type" )
status = FAIL
-
- if status != FAIL:
- logger.error("Mistmatching association value" )
- break
-
except Exception, detail :
logger.error("Exception in assoc_values function: %s" % detail)
status = FAIL
@@ -129,32 +126,40 @@
log_param()
destroy_and_undefine_all(options.ip)
- test_xml1 = testxml(test_dom, mem = test_mem, \
- vcpus = test_vcpus, \
- mac = test_mac, \
- disk = test_disk)
- ret = test_domain_function(test_xml1, options.ip, cmd = "create")
+ global test_disk
+ if options.virt == "Xen":
+ test_disk = "xvdb"
+ else:
+ test_disk = "hdb"
+ virt_xml = vxml.get_class(options.virt)
+ cxml = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, disk = test_disk)
+ ret = cxml.create(options.ip)
if not ret:
- logger.error("Failed to create the dom: %s", test_dom)
- status = FAIL
- return status
+ logger.error('Unable to create domain %s' % test_dom)
+ return FAIL
+ if options.virt == "Xen" or options.virt == "XenFV":
+ instIdval = "Xen:%s" % test_dom
+ else:
+ instIdval = "KVM:%s" % test_dom
- instIdval = "%s:%s" % (VSType, test_dom)
try:
assoc_info = assoc.AssociatorNames(options.ip,
- 'Xen_VirtualSystemSettingDataComponent',
- 'Xen_VirtualSystemSettingData',
- InstanceID = instIdval)
- status = assoc_values(options.ip, assoc_info)
+ 'VirtualSystemSettingDataComponent',
+ 'VirtualSystemSettingData',
+ options.virt,
+ InstanceID = instIdval)
+ status = assoc_values(options.ip, assoc_info, options.virt)
except Exception, detail :
logger.error(Globals.CIM_ERROR_ASSOCIATORS,
- 'Xen_VirtualSystemSettingDataComponent')
+ 'VirtualSystemSettingDataComponent')
logger.error("Exception : %s" % detail)
status = FAIL
- test_domain_function(test_dom, options.ip, "destroy")
+ cxml.destroy(options.ip)
+ cxml.undefine(options.ip)
+
return status
if __name__ == "__main__":
16 years, 6 months
[PATCH] [TEST] fix verification error in VirtualSystemSettingDataComponent.02
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1208484506 -28800
# Node ID 166104f07e8900f0f38049da02bfe58c5766e6e3
# Parent c1d9b3ba06ca4c76fe9b1cf63a77a7f92bb01d22
[TEST] fix verification error in VirtualSystemSettingDataComponent.02
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r c1d9b3ba06ca -r 166104f07e89 suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Thu Apr 17 10:12:46 2008 +0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Fri Apr 18 10:08:26 2008 +0800
@@ -112,7 +112,7 @@
logger.error("Unexpected RASD instance type" )
status = FAIL
- if status != FAIL:
+ if status == FAIL:
logger.error("Mistmatching association value" )
break
16 years, 6 months
[PATCH] Fix Virt_SettingsDefineCapabilities provider install issue
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1208479105 25200
# Node ID e415e98ec3b386ecff91449696a71f5d7607ca6a
# Parent a3c65a655c61fe82b056a590cdaef5356626e3e6
Fix Virt_SettingsDefineCapabilities provider install issue.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r a3c65a655c61 -r e415e98ec3b3 src/Makefile.am
--- a/src/Makefile.am Thu Apr 17 14:57:07 2008 -0700
+++ b/src/Makefile.am Thu Apr 17 17:38:25 2008 -0700
@@ -121,13 +121,6 @@
-lVirt_VirtualSystemManagementService \
-lVirt_VSMigrationService
-libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_VSMigrationCapabilities.la libVirt_VSMigrationSettingData.la
-libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c
-libVirt_SettingsDefineCapabilities_la_LIBADD = -lVirt_RASD \
- -lVirt_DevicePool \
- -lVirt_VSMigrationCapabilities \
- -lVirt_VSMigrationSettingData
-
libVirt_RegisteredProfile_la_SOURCES = Virt_RegisteredProfile.c
libVirt_HostedResourcePool_la_DEPENDENCIES = libVirt_DevicePool.la libVirt_HostSystem.la
@@ -181,3 +174,11 @@
libVirt_VirtualSystemSnapshotServiceCapabilities_la_DEPENDENCIES =
libVirt_VirtualSystemSnapshotServiceCapabilities_la_SOURCES = Virt_VirtualSystemSnapshotServiceCapabilities.c
libVirt_VirtualSystemSnapshotServiceCapabilities_la_LIBADD =
+
+libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_VSMigrationCapabilities.la libVirt_VSMigrationSettingData.la
+libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c
+libVirt_SettingsDefineCapabilities_la_LIBADD = -lVirt_RASD \
+ -lVirt_DevicePool \
+ -lVirt_VSMigrationCapabilities \
+ -lVirt_VSMigrationSettingData
+
16 years, 6 months
[PATCH] Enable localhost migration
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1208468793 25200
# Node ID cde152f395894de028ff76e84ea2450aff7276f6
# Parent f02d710dc8bde391311002d8c3104166c741164d
Enable localhost migration.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r f02d710dc8bd -r cde152f39589 src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Wed Apr 16 16:55:52 2008 -0700
+++ b/src/Virt_VSMigrationService.c Thu Apr 17 14:46:33 2008 -0700
@@ -76,6 +76,7 @@
virConnectPtr conn;
char *ref_cn;
char *ref_ns;
+ char *host;
uint16_t type;
char uuid[33];
};
@@ -1045,12 +1046,15 @@
goto out;
}
- if (domain_exists(job->conn, job->domain)) {
- CU_DEBUG("Remote domain `%s' exists", job->domain);
- cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Remote already has domain `%s'", job->domain);
- goto out;
+ if (!STREQ(job->host, "localhost")) {
+ if (domain_exists(job->conn, job->domain)) {
+ CU_DEBUG("Remote domain `%s' exists", job->domain);
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Remote already has domain `%s'",
+ job->domain);
+ goto out;
+ }
}
s = prepare_migrate(dom, &xml);
@@ -1131,6 +1135,7 @@
free(job->domain);
free(job->ref_cn);
free(job->ref_ns);
+ free(job->host);
free(job);
return NULL;
@@ -1238,6 +1243,7 @@
job->domain = strdup(domain);
job->ref_cn = strdup(CLASSNAME(ref));
job->ref_ns = strdup(NAMESPACE(ref));
+ job->host = strdup(host);
uuid_generate(uuid);
uuid_unparse(uuid, job->uuid);
16 years, 6 months
[PATCH] [TEST] fix processor DeviceID in HostSystem.02
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1208504750 -28800
# Node ID a7726fe74b99078b61e57bf86ca3b379252712bd
# Parent c1d9b3ba06ca4c76fe9b1cf63a77a7f92bb01d22
[TEST] fix processor DeviceID in HostSystem.02
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r c1d9b3ba06ca -r a7726fe74b99 suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py
--- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Thu Apr 17 10:12:46 2008 +0800
+++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Fri Apr 18 15:45:50 2008 +0800
@@ -79,7 +79,7 @@
rasd_values = {
proc_cn : {
- "InstanceID" : '%s/%s' %(test_dom, "proc"),
+ "InstanceID" : '%s/%s' %(test_dom, "0"),
"ResourceType" : 3,
},
disk_cn : {
16 years, 6 months
[PATCH] [TEST] .2# KVM support and refactor to Profile.01
by zli@linux.vnet.ibm.com
# HG changeset patch
# User Zhengang Li <lizg(a)cn.ibm.com>
# Date 1208497724 -28800
# Node ID 968b3985877ad40a77f06e0b862a51294a660a9a
# Parent 23d81827fa93f4fd06e2b6ba06f53e68f7f5b0e7
[TEST] .2# KVM support and refactor to Profile.01
Updates:
- return as soon as we found an error.
Signed-off-by: Zhengang Li <lizg(a)cn.ibm.com>
diff -r 23d81827fa93 -r 968b3985877a suites/libvirt-cim/cimtest/Profile/01_enum.py
--- a/suites/libvirt-cim/cimtest/Profile/01_enum.py Fri Apr 18 13:44:00 2008 +0800
+++ b/suites/libvirt-cim/cimtest/Profile/01_enum.py Fri Apr 18 13:48:44 2008 +0800
@@ -28,77 +28,55 @@ import sys
import sys
import pywbem
from XenKvmLib import enumclass
+from XenKvmLib.classes import get_typed_class
from CimTest import Globals
-from CimTest.Globals import do_main
+from CimTest.Globals import do_main, logger
+from CimTest.ReturnCodes import PASS, FAIL
-sup_types = ['Xen']
+sup_types = ['Xen', 'KVM']
@do_main(sup_types)
def main():
options = main.options
- registeredOrganization = 2
- registeredname = ['System Virtualization', \
- 'Virtual System Profile' ]
- inst_id = ['CIM:DSP1042-SystemVirtualization-1.0.0', \
- 'CIM:DSP1057-VirtualSystem-1.0.0a']
- registeredversion = [ '1.0.0', '1.0.0a']
- cn = 'Xen_RegisteredProfile'
- index = 0
+ explist = [['CIM:DSP1042-SystemVirtualization-1.0.0', 2,
+ 'System Virtualization', '1.0.0'],
+ ['CIM:DSP1057-VirtualSystem-1.0.0a', 2,
+ 'Virtual System Profile', '1.0.0a']]
+ cn = 'RegisteredProfile'
- status = 0
+ status = PASS
prev_namespace = Globals.CIM_NS
Globals.CIM_NS = 'root/interop'
Globals.log_param()
try:
key_list = ["InstanceID"]
- proflist = enumclass.enumerate(options.ip, \
- enumclass.Xen_RegisteredProfile, \
- key_list)
+ proflist = enumclass.enumerate(options.ip, cn, key_list, options.virt)
+ except Exception, detail:
+ logger.error(Globals.CIM_ERROR_ENUMERATE, get_typed_class(options.virt,
+ cn))
+ logger.error("Exception: %s", detail)
+ status = FAIL
+ Globals.CIM_NS = prev_namespace
+ return status
+
+ Globals.CIM_NS = prev_namespace
- # For each of the instances verify :
- # -RegisteredOrganization = 2
- # -InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0"
- # -RegisteredName="System Virtualization"
- # -RegisteredVersion="1.0.0"
+ checklist = [[x.InstanceID, x.RegisteredOrganization,
+ x.RegisteredName, x.RegisteredVersion] for x in proflist]
+ for exp_prof in explist:
+ if exp_prof in checklist:
+ logger.info("Profile %s found" % exp_prof[0])
+ else:
+ logger.error("Profile %s is not found" % exp_prof[0])
+ status = FAIL
+ break
- for profile in proflist:
- Globals.logger.log(int(Globals.logging.PRINT),"Verifying the \
-fields for :%s", profile.RegisteredName)
- if profile.InstanceID == "" :
- Globals.logger.error("InstanceID is %s instead of %s", \
- 'NULL', inst_id[index])
- status = 1
- if inst_id[index] != profile.InstanceID :
- Globals.logger.error("InstanceID is %s instead of %s", \
- profile.InstanceID, inst_id[index])
- status = 1
- if registeredOrganization != profile.RegisteredOrganization:
- Globals.logger.error("RegisteredOrganization is %s instead of %s"\
- , profile.RegisteredOrganization, registeredOrganization)
- status = 1
- if registeredname[index] != profile.RegisteredName:
- Globals.logger.error("RegisteredName is %s instead of %s", \
- profile.RegisteredName, registeredname[index])
- status = 1
- if registeredversion[index] != profile.RegisteredVersion:
- Globals.logger.error("RegisteredVersion is %s instead of \
-%s", profile.RegisteredVersion, registeredversion[index])
- status = 1
- if status != 0:
- Globals.CIM_NS = prev_namespace
- return status
- index = index + 1
- except Exception, detail:
- Globals.logger.error(Globals.CIM_ERROR_ENUMERATE, 'Xen_RegisteredProfile')
- Globals.logger.error("Exception: %s", detail)
- status = 1
- return status
-
-# The execution will reach here only if all the checks are successful
- Globals.logger.log(int(Globals.logging.PRINT), "Verification of the properties \
-for the class '%s' was successful", cn)
+ if status == PASS:
+ logger.info("Properties check for %s passed" % cn)
+ else:
+ logger.error("Properties check for %s failed" % cn)
return status
if __name__ == "__main__":
16 years, 6 months