[PATCH] [TEST] Update HostSystem.03 for LXC support
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1213285886 -28800
# Node ID b90b6fe46296b90cb87f5169b2654c7ba0970f98
# Parent 254bc5464030a03b6f791fd49acd208f6ec1db23
[TEST] Update HostSystem.03 for LXC support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 254bc5464030 -r b90b6fe46296 suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py
--- a/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Wed Jun 11 20:56:07 2008 +0800
+++ b/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Thu Jun 12 23:51:26 2008 +0800
@@ -51,7 +51,7 @@
from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib.const import CIM_REV
-sup_types = ['Xen', 'KVM', 'XenFV']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
test_dom = "domgst"
test_vcpus = 1
libvirtcim_sdc_rasd_rev = 571
@@ -115,10 +115,13 @@
status = PASS
devpool = []
- ccnlist = { '%s_ProcessorPool' % virt : 'Processors',
- '%s_MemoryPool' % virt : 'KiloBytes',
- '%s_DiskPool' % virt : 'Megabytes' ,
- '%s_NetworkPool' % virt : None }
+ if virt == "LXC":
+ ccnlist = { '%s_MemoryPool' % virt : 'KiloBytes'}
+ else:
+ ccnlist = { '%s_ProcessorPool' % virt : 'Processors',
+ '%s_MemoryPool' % virt : 'KiloBytes' ,
+ '%s_DiskPool' % virt : 'Megabytes' ,
+ '%s_NetworkPool' % virt : None }
try:
assoc_info = Associators(server,
an1,
@@ -151,11 +154,13 @@
alloccap = []
filter = {"key" : "ResourceType"}
-
- ccnlist = { '%s_ProcessorPool' % virt: 3,
- '%s_MemoryPool' % virt : 4,
- '%s_DiskPool' % virt : 17 ,
- '%s_NetworkPool' % virt : 10 }
+ if virt == 'LXC':
+ ccnlist = {'%s_MemoryPool' % virt : 4}
+ else:
+ ccnlist = { '%s_ProcessorPool' % virt: 3,
+ '%s_MemoryPool' % virt : 4,
+ '%s_DiskPool' % virt : 17 ,
+ '%s_NetworkPool' % virt : 10 }
for inst in devpool:
try:
@@ -193,11 +198,14 @@
ccn = '%s_AllocationCapabilities' % virt
an = '%s_SettingsDefineCapabilities' % virt
- rtype = {
- "%s_DiskResourceAllocationSettingData" % virt : 17, \
- "%s_MemResourceAllocationSettingData" % virt : 4, \
- "%s_NetResourceAllocationSettingData" % virt : 10, \
- "%s_ProcResourceAllocationSettingData" % virt : 3
+ if virt == 'LXC':
+ rtype = {"%s_MemResourceAllocationSettingData" % virt : 4}
+ else:
+ rtype = {
+ "%s_DiskResourceAllocationSettingData" % virt : 17, \
+ "%s_MemResourceAllocationSettingData" % virt : 4, \
+ "%s_NetResourceAllocationSettingData" % virt : 10, \
+ "%s_ProcResourceAllocationSettingData" % virt : 3
}
rangelist = {
"Default" : 0, \
16 years, 6 months
[PATCH] Add a default graphics device to all domains so that we create the
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1213198304 25200
# Node ID cb1993563ebbca5bb4f7392f42d33019af7668bc
# Parent ad4804559dd83bd2afd10fa0768b087f6a9914a9
Add a default graphics device to all domains so that we create the
<graphics ...> tag in the resulting XML. Later, this will be replaced
by a proper conversion of a console RASD, like the rest of the devices.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r ad4804559dd8 -r cb1993563ebb src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Tue Jun 10 12:02:09 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Wed Jun 11 08:31:44 2008 -0700
@@ -192,6 +192,22 @@
return 1;
}
+static bool default_graphics_device(CMPIInstance *inst,
+ struct domain *domain)
+{
+ free(domain->dev_graphics);
+ domain->dev_graphics = calloc(1, sizeof(*domain->dev_graphics));
+ if (domain->dev_graphics == NULL) {
+ CU_DEBUG("Failed to allocate default graphics device");
+ return false;
+ }
+
+ domain->dev_graphics->dev.graphics.type = strdup("vnc");
+ domain->dev_graphics->dev.graphics.port = strdup("-1");
+
+ return true;
+}
+
static int vssd_to_domain(CMPIInstance *inst,
struct domain *domain)
{
@@ -240,6 +256,10 @@
else {
CU_DEBUG("Unknown domain prefix: %s", pfx);
}
+
+ if (!default_graphics_device(inst, domain))
+ ret = 0;
+
out:
free(pfx);
16 years, 6 months
[PATCH] [TEST] Update VirtualSystemSettingDataComponent.02&03 for LXC support
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1213276778 -28800
# Node ID 73e4e701cb907af69177fe92fa741b9e0428615d
# Parent 254bc5464030a03b6f791fd49acd208f6ec1db23
[TEST] Update VirtualSystemSettingDataComponent.02&03 for LXC support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 254bc5464030 -r 73e4e701cb90 suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Wed Jun 11 20:56:07 2008 +0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Thu Jun 12 21:19:38 2008 +0800
@@ -57,7 +57,7 @@
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.const import CIM_REV
-sup_types = ['Xen', 'XenFV', 'KVM']
+sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
test_dom = "VSSDC_dom"
test_vcpus = 1
@@ -143,7 +143,10 @@
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)
+ if options.virt == "LXC":
+ cxml = virt_xml(test_dom)
+ else:
+ 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)
@@ -152,6 +155,8 @@
if options.virt == "Xen" or options.virt == "XenFV":
instIdval = "Xen:%s" % test_dom
+ elif options.virt == "LXC":
+ instIdval = "LXC:%s" % test_dom
else:
instIdval = "KVM:%s" % test_dom
diff -r 254bc5464030 -r 73e4e701cb90 suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/03_vssdc_fwd_errs.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/03_vssdc_fwd_errs.py Wed Jun 11 20:56:07 2008 +0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/03_vssdc_fwd_errs.py Thu Jun 12 21:19:38 2008 +0800
@@ -64,7 +64,7 @@
from CimTest.Globals import CIM_USER, CIM_PASS, CIM_NS
from XenKvmLib.const import CIM_REV
-sup_types = ['Xen', 'XenFV', 'KVM']
+sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
test_dom = "domu1"
test_mac = "00:11:22:33:44:aa"
@@ -115,7 +115,10 @@
test_disk = "hda"
virt_xml = vxml.get_class(options.virt)
- cxml = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, disk = test_disk)
+ if options.virt == "LXC":
+ cxml = virt_xml(test_dom)
+ else:
+ cxml = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, disk = test_disk)
ret = cxml.create(options.ip)
if not ret:
logger.error('Unable to create domain %s' % test_dom)
16 years, 6 months
[TEST] NULL of LXC_ElementCapabilities assocaition with LXC_ManagementService
by Guo Lian Yun
Hi,
I can get any instance by ElementCapabilities associations with
ManagementService, that is to say, below querying return NULL.
wbemcli ain -ac LXC_ElementCapabilities
'http://root:password@localhost/root/virt:LXC_VirtualSystemManagementServi..."LXC_HostSystem",SystemName="nine",CreationClassName="LXC_VirtualSystemManagementService",Name="Management
Service"'
But LXC_ElementCapabilities associations with
LXC_VirtualSystemMigrationService return expect result.
wbemcli ain -ac LXC_ElementCapabilities
'http://root:password@localhost/root/virt:LXC_VirtualSystemMigrationServic..."LXC_HostSystem",SystemName="nine",CreationClassName="LXC_VirtualSystemMigrationService",Name="MigrationService"'
localhost:5988/root/virt:LXC_VirtualSystemMigrationCapabilities.InstanceID="MigrationCapabilities"
Best,
Regards
Daisy (运国莲)
VSM Team, China Systems & Technology Labs (CSTL)
E-mail: yunguol(a)cn.ibm.com
TEL: (86)-21-60922144
Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203
16 years, 6 months
[PATCH] [TEST] Updating the 41_cs_to_settingdefinestate.py tc of ComputerSystem
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1213189732 25200
# Node ID 7988bef766e44f1da43b188e802be3c18b7b098d
# Parent 104523eca0848e00d54656d329a9e5829c21ce1a
[TEST] Updating the 41_cs_to_settingdefinestate.py tc of ComputerSystem.
1) Updated the tc to use vxml fn().
2) Updated the tc to use rasd_init_list() fn of rasd.py.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 104523eca084 -r 7988bef766e4 suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Wed Jun 11 06:05:04 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Wed Jun 11 06:08:52 2008 -0700
@@ -59,15 +59,17 @@ import sys
import sys
from VirtLib import utils
from XenKvmLib import computersystem
-from XenKvmLib.test_xml import testxml, disk_path
-from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all
+from XenKvmLib.vxml import get_class
+from XenKvmLib.classes import get_typed_class
+from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib.assoc import Associators, AssociatorNames
from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES, \
CIM_ERROR_ASSOCIATORS
from CimTest.Globals import do_main
from CimTest.ReturnCodes import PASS, FAIL
+from XenKvmLib import rasd
from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \
-verify_diskrasd_values, verify_memrasd_values
+verify_diskrasd_values, verify_memrasd_values, rasd_init_list
sup_types = ['Xen']
@@ -75,43 +77,7 @@ test_vcpus = 1
test_vcpus = 1
test_mem = 128
test_mac = "00:11:22:33:44:aa"
-test_disk = 'xvda'
vstype = 'Xen'
-
-
-def rasd_init_list():
- """
- Creating the lists that will be used for comparisons.
- """
- proc_rasd = {
- "InstanceID" : '%s/%s' %(test_dom, "proc"),\
- "ResourceType" : 3,\
- }
-
- disk_rasd = {
- "InstanceID" : '%s/%s' %(test_dom, test_disk), \
- "ResourceType" : 17, \
- "Address" : disk_path, \
- }
- net_rasd = {
- "InstanceID" : '%s/%s' %(test_dom,test_mac), \
- "ResourceType" : 10 , \
- "ntype1": "bridge", \
- "ntype2": "ethernet", \
- }
- mem_rasd = {
- "InstanceID" : '%s/%s' %(test_dom, "mem"), \
- "ResourceType" : 4, \
- "AllocationUnits" : "KiloBytes",\
- "VirtualQuantity" : (test_mem * 1024), \
- }
- rasd_values = { "Xen_Processor" : proc_rasd, \
- "Xen_LogicalDisk" : disk_rasd, \
- "Xen_NetworkPort" : net_rasd, \
- "Xen_Memory" : mem_rasd
- }
- return rasd_values
-
def vssd_init_list():
"""
@@ -142,19 +108,27 @@ def cs_init_list(cs_dom):
}
return cs_values
-def setup_env(server):
+def setup_env(server, virt):
+ vsxml_info = None
status = PASS
destroy_and_undefine_all(server)
- test_xml = testxml(test_dom, mem = test_mem, \
- vcpus = test_vcpus, \
- mac = test_mac, \
- disk = test_disk)
+ if virt == "Xen":
+ test_disk = "xvda"
+ else:
+ test_disk = "hda"
+ virt_xml = get_class(virt)
+ vsxml_info = virt_xml(test_dom, mem = test_mem,
+ vcpus=test_vcpus,
+ mac = test_mac,
+ disk = test_disk)
- ret = test_domain_function(test_xml, server, cmd = "create")
+ ret = vsxml_info.create(server)
if not ret:
logger.error("Failed to create the dom: %s", test_dom)
status = FAIL
- return status
+
+ return status, vsxml_info, test_disk
+
def print_err(err, detail, cn):
logger.error(err % cn)
@@ -168,7 +142,7 @@ def vssd_sds_err( an, fieldname, ret_val
logger.error(err)
logger.error(detail)
-def get_inst_from_list(server, cn, cs_list, exp_val):
+def get_inst_from_list(server, vsxml, cn, cs_list, exp_val):
status = PASS
ret = -1
inst = None
@@ -179,12 +153,12 @@ def get_inst_from_list(server, cn, cs_li
if ret != PASS:
logger.error("%s with %s was not returned" % (cn, exp_val))
- test_domain_function(test_dom, server, "destroy")
+ vsxml.destroy(server)
status = FAIL
return status, inst
-def get_associatornames_info(server, cn, an, qcn, name):
+def get_associatornames_info(server, vsxml, cn, an, qcn, name):
status = PASS
assoc_info = []
try:
@@ -201,11 +175,11 @@ def get_associatornames_info(server, cn,
status = FAIL
if status != PASS:
- test_domain_function(test_dom, server, "destroy")
+ vsxml.destroy(server)
return status, assoc_info
-def get_associators_info(server, cn, an, qcn, instid):
+def get_associators_info(server, vsxml, cn, an, qcn, instid):
status = PASS
assoc_info = []
try:
@@ -223,17 +197,19 @@ def get_associators_info(server, cn, an,
status = FAIL
if status != PASS:
- test_domain_function(test_dom, server, "destroy")
+ vsxml.destroy(server)
return status, assoc_info
def check_len(an, assoc_list_info, qcn, exp_len):
if len(assoc_list_info) != exp_len:
- logger.error("%s returned %i %s objects" % (an, len(assoc_list_info), qcn))
+ logger.error("%s returned %i %s objects" % (an,
+ len(assoc_list_info), qcn))
return FAIL
return PASS
-def get_setdefstate_verify_RASD_build_vssdc_input(server, sd_assoc_info):
+def get_setdefstate_verify_RASD_build_vssdc_input(server, virt, vsxml, test_disk,
+ sd_assoc_info):
status = PASS
in_setting_define_state = {}
in_vssdc = {}
@@ -254,7 +230,11 @@ def get_setdefstate_verify_RASD_build_vs
return FAIL, in_setting_define_state
# Get the rasd values that will be used to compare with the Xen_SettingsDefineState
# output.
- rasd_values = rasd_init_list()
+ status, rasd_values = rasd_init_list(vsxml, virt, test_disk, test_dom,
+ test_mac, test_mem)
+ if status != PASS:
+ return status
+
sccn = "Xen_ComputerSystem"
an = "Xen_SettingsDefineState"
for cn, devid in sorted(in_setting_define_state.items()):
@@ -350,21 +330,23 @@ def verify_CS_values(assoc_info, cs_valu
@do_main(sup_types)
def main():
server = main.options.ip
- status = setup_env(server)
+ virt = main.options.virt
+ status, vsxml, test_disk = setup_env(server, virt)
if status != PASS:
return status
cs_enum = computersystem.enumerate(server)
if len(cs_enum) == 0:
- test_domain_function(test_dom, server, "destroy")
+ vsxml.destroy(server)
return status
cn = cs_enum[0].CreationClassName
status, cs_dom = get_inst_from_list(server,
+ vsxml,
cn,
cs_enum,
test_dom)
if status != PASS:
- test_domain_function(test_dom, server, "destroy")
+ vsxml.destroy(server)
return status
# Creating the cs info list which will be used later for comparison.
@@ -372,26 +354,30 @@ def main():
if cs_values['EnabledState'] != 2 :
logger.error("Improper EnabledState value set for domain %s", test_dom)
logger.error("Should have been 2 instead of %s", cs_values['EnabledState'])
- test_domain_function(test_dom, server, "destroy")
+ vsxml.destroy(server)
return FAIL
cn = cs_dom.CreationClassName
an = 'Xen_SystemDevice'
qcn = 'Logical Devices'
name = test_dom
- status, sd_assoc_info = get_associatornames_info(server, cn, an, qcn, name)
+ status, sd_assoc_info = get_associatornames_info(server, vsxml,
+ cn, an, qcn, name)
if status != PASS or len(sd_assoc_info) == 0:
return status
- status, in_vssdc_list = get_setdefstate_verify_RASD_build_vssdc_input(server, \
- sd_assoc_info)
+ status, in_vssdc_list = get_setdefstate_verify_RASD_build_vssdc_input(server,
+ virt,
+ vsxml,
+ test_disk,
+ sd_assoc_info)
if status != PASS or len(in_vssdc_list) == 0 :
- test_domain_function(test_dom, server, "destroy")
+ vsxml.destroy(server)
return status
# Verifying that the in_vssdc_list contains 4 entries one each for mem rasd,
# network rasd, processor rasd and disk rasd.
exp_len = 4
if check_len(an, in_vssdc_list, qcn, exp_len) != PASS:
- test_domain_function(test_dom, server, "destroy")
+ vsxml.destroy(server)
return FAIL
# Get the vssd values which will be used for verifying the Xen_VirtualSystemSettingData
# output from the Xen_VirtualSystemSettingDataComponent results.
@@ -399,14 +385,15 @@ def main():
an = 'Xen_VirtualSystemSettingDataComponent'
qcn = 'Xen_VirtualSystemSettingData'
for cn, instid in sorted((in_vssdc_list.items())):
- status, vssd_assoc_info = get_associators_info(server, cn, an, qcn, instid)
+ status, vssd_assoc_info = get_associators_info(server, vsxml, cn, an, qcn,
+ instid)
if status != PASS or len(vssd_assoc_info) == 0:
break
status = verify_VSSD_values(vssd_assoc_info, vssd_values, an, qcn)
if status != PASS:
break
if status != PASS:
- test_domain_function(test_dom, server, "destroy")
+ vsxml.destroy(server)
return status
# Since the Xen_VirtualSystemSettingDataComponent returns similar output when queried with
# every RASD, we are taking the output of the last associtaion query as inputs for
@@ -415,13 +402,13 @@ def main():
an = 'Xen_SettingsDefineState'
qcn = 'Xen_ComputerSystem'
instid = vssd_assoc_info[0]['InstanceID']
- status, cs_assoc_info = get_associators_info(server, cn, an, qcn, instid)
+ status, cs_assoc_info = get_associators_info(server, vsxml, cn, an, qcn, instid)
if status != PASS or len(cs_assoc_info) == 0:
return status
# verify the results of Xen_SettingsDefineState with the cs_values list that was
# built using the output of the enumeration on Xen_ComputerSystem.
status = verify_CS_values(cs_assoc_info, cs_values, an, qcn)
- test_domain_function(test_dom, server, "destroy")
+ vsxml.destroy(server)
return status
if __name__ == "__main__":
sys.exit(main())
16 years, 6 months
[PATCH] [TEST] Fixing the 02_hostsystem_to_rasd.py tc of HostSystem
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1213189504 25200
# Node ID 104523eca0848e00d54656d329a9e5829c21ce1a
# Parent 87e9c774d6e0d0500911ecd7763a592449eb0e3c
[TEST] Fixing the 02_hostsystem_to_rasd.py tc of HostSystem.
1) Fixing the tc failure bcs of the modifications that was done to default network type.
2) Using the rasd_init_list() fn of the rasd.py .
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 87e9c774d6e0 -r 104523eca084 suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py
--- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Wed Jun 11 06:01:37 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Wed Jun 11 06:05:04 2008 -0700
@@ -57,7 +57,7 @@ CIM_ERROR_ASSOCIATORS
CIM_ERROR_ASSOCIATORS
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \
-verify_diskrasd_values, verify_memrasd_values
+verify_diskrasd_values, verify_memrasd_values, rasd_init_list
from XenKvmLib.const import CIM_REV
sup_types = ['Xen', 'KVM', 'XenFV']
@@ -69,47 +69,6 @@ test_mac = "00:11:22:33:44:aa"
test_mac = "00:11:22:33:44:aa"
rev = 529
proc_instid_rev = 590
-
-def init_list(vsxml, virt="Xen"):
- """
- Creating the lists that will be used for comparisons.
- """
- disk_path = vsxml.xml_get_disk_source()
- proc_cn = get_typed_class(virt, "Processor")
- mem_cn = get_typed_class(virt, "Memory")
- net_cn = get_typed_class(virt, "NetworkPort")
- disk_cn = get_typed_class(virt, "LogicalDisk")
-
- rasd_values = {
- proc_cn : {
- "InstanceID" : '%s/%s' %(test_dom, "proc"),
- "ResourceType" : 3,
- },
- disk_cn : {
- "InstanceID" : '%s/%s' %(test_dom, test_disk),
- "ResourceType" : 17,
- "Address" : disk_path,
- },
- net_cn : {
- "InstanceID" : '%s/%s' %(test_dom,test_mac),
- "ResourceType" : 10 ,
- "ntype1": "bridge",
- "ntype2": "ethernet",
- },
- mem_cn : {
- "InstanceID" : '%s/%s' %(test_dom, "mem"),
- "ResourceType" : 4,
- "AllocationUnits" : "KiloBytes",
- "VirtualQuantity" : (test_mem * 1024),
- }
- }
- if CIM_REV < rev:
- rasd_values[mem_cn]['AllocationUnits'] = "MegaBytes"
-
- if CIM_REV < proc_instid_rev:
- rasd_values[proc_cn]['InstanceID'] = '%s/%s' %(test_dom, 0)
-
- return rasd_values
def setup_env(server, virt="Xen"):
vsxml_info = None
@@ -185,7 +144,12 @@ def verify_RASD_values(server, sd_assoc_
classname_keyvalue = sd_assoc_info[i]['CreationClassName']
deviceid = sd_assoc_info[i]['DeviceID']
in_setting_define_state[classname_keyvalue] = deviceid
- rasd_values = init_list(vsxml, virt)
+
+ status, rasd_values = rasd_init_list(vsxml, virt, test_disk, test_dom,
+ test_mac, test_mem)
+ if status != PASS:
+ return status
+
an = get_typed_class(virt, 'SettingsDefineState')
sccn = get_typed_class(virt, 'ComputerSystem')
for cn, devid in sorted(in_setting_define_state.items()):
16 years, 6 months
[PATCH] [TEST] Updating the tc to use the rasd_init_list() fn of rasd.py
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1213189297 25200
# Node ID 87e9c774d6e0d0500911ecd7763a592449eb0e3c
# Parent 9fb67711f2dfe3010d20862f36160b5a91b36c49
[TEST] Updating the tc to use the rasd_init_list() fn of rasd.py.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 9fb67711f2df -r 87e9c774d6e0 suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py
--- a/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Wed Jun 11 05:53:58 2008 -0700
+++ b/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Wed Jun 11 06:01:37 2008 -0700
@@ -57,6 +57,9 @@ from XenKvmLib.const import CIM_REV
from XenKvmLib.const import CIM_REV
from CimTest.Globals import logger
from CimTest.ReturnCodes import PASS, FAIL
+from XenKvmLib import rasd
+from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \
+verify_diskrasd_values, verify_memrasd_values, rasd_init_list
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
@@ -64,44 +67,18 @@ test_vcpus = 1
test_vcpus = 1
test_mem = 128
test_mac = "00:11:22:33:44:aa"
-prev = 531
-mrev = 529
-
-def init_list(xml, disk, virt="Xen"):
- """
- Creating the lists that will be used for comparisons.
- """
- procrasd = {
- "InstanceID" : '%s/%s' % (test_dom, "proc"),
- "ResourceType" : 3,
- "CreationClassName" : get_typed_class(virt, rasd.pasd_cn)}
- netrasd = {
- "InstanceID" : '%s/%s' % (test_dom,test_mac),
- "ResourceType" : 10 ,
- "ntype1" : "bridge",
- "ntype2" : "ethernet",
- "CreationClassName" : get_typed_class(virt, rasd.nasd_cn)}
- address = xml.xml_get_disk_source()
- diskrasd = {
- "InstanceID" : '%s/%s' % (test_dom, disk),
- "ResourceType" : 17,
- "Address" : address,
- "CreationClassName" : get_typed_class(virt, rasd.dasd_cn)}
- memrasd = {
- "InstanceID" : '%s/%s' % (test_dom, "mem"),
- "ResourceType" : 4,
- "AllocationUnits" : "KiloBytes",
- "VirtualQuantity" : (test_mem * 1024),
- "CreationClassName" : get_typed_class(virt, rasd.masd_cn)}
- if CIM_REV < prev:
- procrasd['InstanceID'] = '%s/0' % test_dom
- if CIM_REV < mrev:
- memrasd['AllocationUnits'] = 'MegaBytes'
-
- return procrasd, netrasd, diskrasd, memrasd
def assoc_values(assoc_info, xml, disk, virt="Xen"):
- procrasd, netrasd, diskrasd, memrasd = init_list(xml, disk, virt)
+ status, rasd_values = rasd_init_list(xml, virt, disk, test_dom,
+ test_mac, test_mem)
+ if status != PASS:
+ return status
+
+ procrasd = rasd_values['%s' %rasd.proc_cn]
+ netrasd = rasd_values['%s' %rasd.net_cn]
+ diskrasd = rasd_values['%s' %rasd.disk_cn]
+ memrasd = rasd_values['%s' %rasd.mem_cn]
+
if virt == 'LXC':
proc_status = 0
disk_status = 0
diff -r 9fb67711f2df -r 87e9c774d6e0 suites/libvirt-cim/cimtest/RASD/02_enum.py
--- a/suites/libvirt-cim/cimtest/RASD/02_enum.py Wed Jun 11 05:53:58 2008 -0700
+++ b/suites/libvirt-cim/cimtest/RASD/02_enum.py Wed Jun 11 06:01:37 2008 -0700
@@ -37,6 +37,10 @@ from XenKvmLib.const import CIM_REV
from XenKvmLib.const import CIM_REV
from CimTest.Globals import logger
from CimTest.ReturnCodes import PASS, FAIL
+from XenKvmLib import rasd
+from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \
+verify_diskrasd_values, verify_memrasd_values, rasd_init_list
+
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
@@ -44,41 +48,6 @@ test_vcpus = 1
test_vcpus = 1
test_mem = 128
test_mac = "00:11:22:33:44:aa"
-prev = 531
-mrev = 529
-
-def init_list(virt):
- """
- Creating the lists that will be used for comparisons.
- """
- proc = {
- "InstanceID" : '%s/%s' % (test_dom, "proc"),
- "ResourceType" : 3,
- "CreationClassName" : get_typed_class(virt, rasd.pasd_cn)}
- net = {
- "InstanceID" : '%s/%s' % (test_dom,test_mac),
- "ResourceType" : 10 ,
- "ntype1" : "bridge",
- "ntype2" : "ethernet",
- "CreationClassName" : get_typed_class(virt, rasd.nasd_cn)}
- address = vsxml.xml_get_disk_source()
- disk = {
- "InstanceID" : '%s/%s' % (test_dom, test_disk),
- "ResourceType" : 17,
- "Address" : address,
- "CreationClassName" : get_typed_class(virt, rasd.dasd_cn)}
- mem = {
- "InstanceID" : '%s/%s' % (test_dom, "mem"),
- "ResourceType" : 4,
- "AllocationUnits" : "KiloBytes",
- "VirtualQuantity" : (test_mem * 1024),
- "CreationClassName" : get_typed_class(virt, rasd.masd_cn)}
- if CIM_REV < prev:
- proc['InstanceID'] = '%s/0' % test_dom
- if CIM_REV < mrev:
- mem['AllocationUnits'] = 'MegaBytes'
-
- return proc, net, disk, mem
def get_inst_from_list(server, classname, rasd_list, filter_name, exp_val):
status = PASS
@@ -125,7 +94,7 @@ def verify_rasd_values(rasd_values_info)
for rasd_instance in rasd_values_info:
CCName = rasd_instance.classname
if rasd.pasd_cn in CCName :
- status = rasd.verify_procrasd_values(rasd_instance, procrasd,)
+ status = rasd.verify_procrasd_values(rasd_instance, procrasd)
elif rasd.nasd_cn in CCName :
status = rasd.verify_netrasd_values(rasd_instance, netrasd)
elif rasd.dasd_cn in CCName:
@@ -176,8 +145,15 @@ def main():
logger.error("Exception : %s", details)
return FAIL
- status = PASS
- procrasd, netrasd, diskrasd, memrasd = init_list(virt)
+ status, rasd_values_list = rasd_init_list(vsxml, virt, test_disk, test_dom,
+ test_mac, test_mem)
+ if status != PASS:
+ return status
+
+ procrasd = rasd_values_list['%s' %rasd.proc_cn]
+ netrasd = rasd_values_list['%s' %rasd.net_cn]
+ diskrasd = rasd_values_list['%s' %rasd.disk_cn]
+ memrasd = rasd_values_list['%s' %rasd.mem_cn]
# For each loop
# 1) Enumerate one RASD type
diff -r 9fb67711f2df -r 87e9c774d6e0 suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py
--- a/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Wed Jun 11 05:53:58 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Wed Jun 11 06:01:37 2008 -0700
@@ -51,8 +51,9 @@ from XenKvmLib import assoc
from XenKvmLib import assoc
from XenKvmLib.vxml import get_class
from XenKvmLib.classes import get_typed_class
+from XenKvmLib import rasd
from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \
-verify_diskrasd_values, verify_memrasd_values
+verify_diskrasd_values, verify_memrasd_values, rasd_init_list
from XenKvmLib.const import CIM_REV
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
@@ -87,44 +88,6 @@ def setup_env(virt):
logger.error("Exception : %s", details)
return FAIL, vsxml_info
return PASS, vsxml_info
-
-def init_list(virt):
- """
- Creating the lists that will be used for comparisons.
- """
- procrasd = {
- "InstanceID" : '%s/%s' %(test_dom, "proc"),
- "ResourceType" : 3,
- "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData')
- }
- if CIM_REV < proc_rev:
- procrasd['InstanceID'] = '%s/%s' %(test_dom, "0")
-
- netrasd = {
- "InstanceID" : '%s/%s' %(test_dom,test_mac),
- "ResourceType" : 10 ,
- "ntype1": "bridge",
- "ntype2": "ethernet",
- "CreationClassName": get_typed_class(virt, 'NetResourceAllocationSettingData')
- }
-
- address = vsxml.xml_get_disk_source()
- diskrasd = {
- "InstanceID" : '%s/%s' %(test_dom, test_disk),
- "ResourceType" : 17,
- "Address" : address,
- "CreationClassName": get_typed_class(virt, 'DiskResourceAllocationSettingData')
- }
- memrasd = {
- "InstanceID" : '%s/%s' %(test_dom, "mem"),
- "ResourceType" : 4,
- "AllocationUnits" : "KiloBytes",
- "VirtualQuantity" : (test_mem * 1024),
- "CreationClassName": get_typed_class(virt, 'MemResourceAllocationSettingData')
- }
- if CIM_REV < mem_rev:
- memrasd['AllocationUnits'] = "MegaBytes"
- return procrasd, netrasd, diskrasd, memrasd
def get_inst_from_list(classname, vssd_list, filter_name, exp_val):
status = PASS
@@ -199,7 +162,16 @@ def get_rasd_values_from_vssdc_assoc(vss
return status, vssdc_assoc_info
def verify_rasd_values(rasd_values_info):
- procrasd, netrasd, diskrasd, memrasd = init_list(virt)
+ status, rasd_values = rasd_init_list(vsxml, virt, test_disk, test_dom,
+ test_mac, test_mem)
+ if status != PASS:
+ return status
+
+ procrasd = rasd_values['%s' %rasd.proc_cn]
+ netrasd = rasd_values['%s' %rasd.net_cn]
+ diskrasd = rasd_values['%s' %rasd.disk_cn]
+ memrasd = rasd_values['%s' %rasd.mem_cn]
+
try:
for rasd_instance in rasd_values_info:
CCName = rasd_instance.classname
16 years, 6 months
[PATCH] [TEST] Update SettingsDefineCapabilities.01 for LXC support
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1213188967 -28800
# Node ID 8bf3a489f215999dd76e31730ea6725fb95678b7
# Parent ca8841f47805d5d2a23069220563713412d6a7bd
[TEST] Update SettingsDefineCapabilities.01 for LXC support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r ca8841f47805 -r 8bf3a489f215 suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py
--- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Fri Jun 06 02:05:34 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Jun 11 20:56:07 2008 +0800
@@ -67,6 +67,8 @@
from XenKvmLib.common_util import print_field_error
from XenKvmLib.const import CIM_REV
+platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC']
+
memid = "%s/%s" % ("MemoryPool", 0)
procid = "%s/%s" % ("ProcessorPool", 0)
libvirtcim_sdc_rasd_rev = 571
@@ -93,24 +95,29 @@
Creating the lists that will be used for comparisons.
"""
- instlist = [
- dpool.InstanceID,
- mpool.InstanceID,
- npool.InstanceID,
- ppool.InstanceID
- ]
- cllist = [
- get_typed_class(virt, "DiskResourceAllocationSettingData"),
- get_typed_class(virt, "MemResourceAllocationSettingData"),
- get_typed_class(virt, "NetResourceAllocationSettingData"),
- get_typed_class(virt, "ProcResourceAllocationSettingData")
- ]
- rtype = {
- get_typed_class(virt, "DiskResourceAllocationSettingData") : 17,
- get_typed_class(virt, "MemResourceAllocationSettingData") : 4,
- get_typed_class(virt, "NetResourceAllocationSettingData") : 10,
- get_typed_class(virt, "ProcResourceAllocationSettingData") : 3
- }
+ if virt == 'LXC':
+ instlist = [ mpool.InstanceID ]
+ cllist = [ get_typed_class(virt, "MemResourceAllocationSettingData") ]
+ rtype = { get_typed_class(virt, "MemResourceAllocationSettingData") : 4 }
+ else:
+ instlist = [
+ dpool.InstanceID,
+ mpool.InstanceID,
+ npool.InstanceID,
+ ppool.InstanceID
+ ]
+ cllist = [
+ get_typed_class(virt, "DiskResourceAllocationSettingData"),
+ get_typed_class(virt, "MemResourceAllocationSettingData"),
+ get_typed_class(virt, "NetResourceAllocationSettingData"),
+ get_typed_class(virt, "ProcResourceAllocationSettingData")
+ ]
+ rtype = {
+ get_typed_class(virt, "DiskResourceAllocationSettingData") : 17,
+ get_typed_class(virt, "MemResourceAllocationSettingData") : 4,
+ get_typed_class(virt, "NetResourceAllocationSettingData") : 10,
+ get_typed_class(virt, "ProcResourceAllocationSettingData") : 3
+ }
rangelist = {
"Default" : 0,
"Minimum" : 1,
16 years, 6 months
[PATCH] [TEST] Update SettingsDefineCapabilities.04&05 for LXC support
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1213188039 -28800
# Node ID 7d6929a806cf9bd23f9dee481fc48abf134ebfcb
# Parent ca8841f47805d5d2a23069220563713412d6a7bd
[TEST] Update SettingsDefineCapabilities.04&05 for LXC support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r ca8841f47805 -r 7d6929a806cf suites/libvirt-cim/cimtest/SettingsDefineCapabilities/04_forward_vsmsdata.py
--- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/04_forward_vsmsdata.py Fri Jun 06 02:05:34 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/04_forward_vsmsdata.py Wed Jun 11 20:40:39 2008 +0800
@@ -43,6 +43,7 @@
from XenKvmLib.classes import get_typed_class
from XenKvmLib.common_util import print_field_error
+platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC']
@do_main(platform_sup)
def main():
options = main.options
diff -r ca8841f47805 -r 7d6929a806cf suites/libvirt-cim/cimtest/SettingsDefineCapabilities/05_reverse_vsmcap.py
--- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/05_reverse_vsmcap.py Fri Jun 06 02:05:34 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/05_reverse_vsmcap.py Wed Jun 11 20:40:39 2008 +0800
@@ -45,6 +45,7 @@
from XenKvmLib.classes import get_typed_class
from XenKvmLib.common_util import print_field_error
+platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC']
@do_main(platform_sup)
def main():
options = main.options
16 years, 6 months
[PATCH] [TEST] Fixing the tc 40_RSC_start.py of ComputerSystem
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1213180729 25200
# Node ID b9100cec9aedb9f9243d753111a9a856e9480335
# Parent 254bc5464030a03b6f791fd49acd208f6ec1db23
[TEST] Fixing the tc 40_RSC_start.py of ComputerSystem.
Changes:
Patch 1 to 2:
-------------
Fixed the return value , setting FAIL instead of rc.
Patch 1:
--------
The tc was passing with false positive.
The parameters passed to check_attributes() were incorrect and fixed it.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 254bc5464030 -r b9100cec9aed suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Wed Jun 11 20:56:07 2008 +0800
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Wed Jun 11 03:38:49 2008 -0700
@@ -85,14 +85,14 @@ def main():
raise Exception("Unable start dom %s using RequestedStateChange()",
default_dom)
- rc = check_attributes(domain_name, ip, options.virt)
+ rc = check_attributes(default_dom, options.ip, options.virt)
if rc != 0:
raise Exception("Attributes for %s not set as expected.",
default_dom)
except Exception, detail:
logger.error("Exception: %s", detail)
- status = rc
+ status = FAIL
undefine_test_domain(default_dom, options.ip, options.virt)
16 years, 6 months