[PATCH] [TEST] fix AllocationUnits Mismatch in 41_cs_to_settingdefinestate.py
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1207728990 25200
# Node ID 1cc1342a903c152e698609753317981cd07deb15
# Parent 262153788503c8b10c76c77719bba081df9a7b88
[TEST] fix AllocationUnits Mismatch in 41_cs_to_settingdefinestate.py
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 262153788503 -r 1cc1342a903c suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Tue Apr 08 17:58:44 2008 +0530
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Wed Apr 09 01:16:30 2008 -0700
@@ -102,7 +102,7 @@ def rasd_init_list():
mem_rasd = {
"InstanceID" : '%s/%s' %(test_dom, "mem"), \
"ResourceType" : 4, \
- "AllocationUnits" : "MegaBytes",\
+ "AllocationUnits" : "KiloBytes",\
"VirtualQuantity" : (test_mem * 1024), \
}
rasd_values = { "Xen_Processor" : proc_rasd, \
16 years, 8 months
[PATCH] [TEST] Change KVM default network type to bridge
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1207647488 25200
# Node ID 6ec8fdc414f8c86160a8c578465901c77e8cfcc0
# Parent 851b6729397e782b7ac6fbadee849ee7da9b16d3
[TEST] Change KVM default network type to bridge
The original 'user' is not listed in provider code for valid check.
(Consider update provider, too?)
This fix the SettingsDefine failure on recent KVM run.
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 851b6729397e -r 6ec8fdc414f8 suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Apr 07 08:27:46 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Apr 08 02:38:08 2008 -0700
@@ -501,9 +501,10 @@ class KVMXML(VirtXML):
self.add_sub_node(disk, 'source', file=disk_img)
self.add_sub_node(disk, 'target', dev=disk_dev)
- interface = self.add_sub_node(devices, 'interface', type='user')
+ interface = self.add_sub_node(devices, 'interface', type='bridge')
self.add_sub_node(interface, 'mac', address=net_mac)
-
+ self.set_bridge(CIM_IP)
+
def set_emulator(self, emu):
return self._set_emulator(emu)
16 years, 8 months
[PATCH] [TEST] fix VirtualSystemSnapshotServiceCapabilities.02 to reflect the recent lib changes
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1207719860 25200
# Node ID 23b6feafdf89d992a636793bf6ec9d0c621bf69c
# Parent 262153788503c8b10c76c77719bba081df9a7b88
[TEST] fix VirtualSystemSnapshotServiceCapabilities.02 to reflect the recent lib changes
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 262153788503 -r 23b6feafdf89 suites/libvirt-cim/cimtest/VirtualSystemSnapshotServiceCapabilities/01_enum.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSnapshotServiceCapabilities/01_enum.py Tue Apr 08 17:58:44 2008 +0530
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSnapshotServiceCapabilities/01_enum.py Tue Apr 08 22:44:20 2008 -0700
@@ -42,9 +42,8 @@ def main():
try:
vs_sservicecap = enumclass.enumerate_inst(options.ip,
- eval('enumclass.' + \
- get_typed_class(options.virt, \
- "VirtualSystemSnapshotServiceCapabilities")))
+ "VirtualSystemSnapshotServiceCapabilities",
+ options.virt)
except Exception, detail:
logger.error(CIM_ERROR_ENUMERATE, cn)
logger.error("Exception: %s", detail)
16 years, 8 months
[PATCH] [TEST] #2 Fixing 02_hostsystem_to_rasd.py tc
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1207725464 -19800
# Node ID cc4020f5ed18fa1134b8c63c3c9f9f828d3df23f
# Parent 262153788503c8b10c76c77719bba081df9a7b88
[TEST] #2 Fixing 02_hostsystem_to_rasd.py tc.
1) Fixed the tc failure.
2) Removed ununsed import stmt.
3) updated it to use the xml_get_disk_source() to get disk info.
4) Removed the global declaration of the vsxml and passed it as arguement where req.
5) changed the init_list() to use get_typed_class().
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 262153788503 -r cc4020f5ed18 suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py
--- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Tue Apr 08 17:58:44 2008 +0530
+++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Wed Apr 09 12:47:44 2008 +0530
@@ -47,12 +47,10 @@
# Date : 29.01.2008
import sys
-from VirtLib import utils
-from CimTest import Globals
from CimTest.Globals import do_main
-from XenKvmLib.vxml import XenXML, KVMXML, get_class
+from XenKvmLib.vxml import get_class
from XenKvmLib.classes import get_typed_class
-from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all
+from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib.assoc import Associators, AssociatorNames
from XenKvmLib.common_util import get_host_info
from CimTest.Globals import log_param, logger, CIM_ERROR_ASSOCIATORNAMES, \
@@ -69,38 +67,44 @@ test_mem = 128
test_mem = 128
test_mac = "00:11:22:33:44:aa"
-def init_list(virt="Xen"):
+def init_list(vsxml, virt="Xen"):
"""
Creating the lists that will be used for comparisons.
"""
- disk_path = "/tmp/default-%s-dimage" % virt.lower()
+ 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 = {"%s_Processor" % virt : {
- "InstanceID" : '%s/%s' %(test_dom,0),\
- "ResourceType" : 3,\
- }, \
- "%s_LogicalDisk" % virt: {
- "InstanceID" : '%s/%s' %(test_dom, test_disk), \
- "ResourceType" : 17, \
- "Address" : disk_path, \
- }, \
- "%s_NetworkPort" % virt: {
- "InstanceID" : '%s/%s' %(test_dom,test_mac), \
- "ResourceType" : 10 , \
- "ntype1": "bridge", \
- "ntype2": "ethernet", \
- }, \
- "%s_Memory"% virt: {
- "InstanceID" : '%s/%s' %(test_dom, "mem"), \
- "ResourceType" : 4, \
- "AllocationUnits" : "MegaBytes",\
- "VirtualQuantity" : (test_mem * 1024), \
- }
+ rasd_values = {
+ proc_cn : {
+ "InstanceID" : '%s/%s' %(test_dom,0),
+ "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),
+ }
}
return rasd_values
def setup_env(server, virt="Xen"):
+ vsxml_info = None
status = PASS
destroy_and_undefine_all(server)
global test_disk
@@ -108,23 +112,24 @@ def setup_env(server, virt="Xen"):
test_disk = "xvda"
else:
test_disk = "hda"
-
- vsxml = get_class(virt)(test_dom, mem = test_mem,
+ virt_xml = get_class(virt)
+ vsxml_info = virt_xml(test_dom, mem = test_mem,
vcpus=test_vcpus,
mac = test_mac,
disk = test_disk)
- ret = vsxml.define(server)
+ ret = vsxml_info.define(server)
if not ret:
logger.error("Failed to define the dom: %s", test_dom)
status = FAIL
- return status
+
+ return status, vsxml_info
def print_err(err, detail, cn):
logger.error(err % cn)
logger.error("Exception: %s", detail)
-def get_inst_from_list(server, cn, cs_list, filter_name, exp_val):
+def get_inst_from_list(server, cn, cs_list, filter_name, exp_val, vsxml):
status = PASS
ret = -1
inst = []
@@ -135,12 +140,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, "undefine")
+ vsxml.undefine(server)
status = FAIL
return status, inst
-def get_assoc_info(server, cn, an, qcn, name, virt="Xen"):
+def get_assoc_info(server, cn, an, qcn, name, vsxml, virt="Xen"):
status = PASS
assoc_info = []
try:
@@ -159,11 +164,11 @@ def get_assoc_info(server, cn, an, qcn,
status = FAIL
if status != PASS:
- test_domain_function(test_dom, server, "undefine")
+ vsxml.undefine(server)
return status, assoc_info
-def verify_RASD_values(server, sd_assoc_info, virt="Xen"):
+def verify_RASD_values(server, sd_assoc_info, vsxml, virt="Xen"):
in_setting_define_state = {}
status = PASS
try:
@@ -172,7 +177,7 @@ 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(virt)
+ rasd_values = init_list(vsxml, virt)
an = get_typed_class(virt, 'SettingsDefineState')
sccn = get_typed_class(virt, 'ComputerSystem')
for cn, devid in sorted(in_setting_define_state.items()):
@@ -192,13 +197,13 @@ def verify_RASD_values(server, sd_assoc_
index = (len(assoc_info) - 1)
rasd = rasd_values[cn]
CCName = assoc_info[index].classname
- if CCName == get_typed_class(virt, 'ProcResourceAllocationSettingData'):
+ if 'ProcResourceAllocationSettingData' in CCName:
status = verify_procrasd_values(assoc_info[index], rasd)
- elif CCName == get_typed_class(virt, 'NetResourceAllocationSettingData'):
+ elif 'NetResourceAllocationSettingData' in CCName:
status = verify_netrasd_values(assoc_info[index], rasd)
- elif CCName == get_typed_class(virt, 'DiskResourceAllocationSettingData'):
+ elif 'DiskResourceAllocationSettingData' in CCName:
status = verify_diskrasd_values(assoc_info[index], rasd)
- elif CCName == get_typed_class(virt, 'MemResourceAllocationSettingData'):
+ elif 'MemResourceAllocationSettingData' in CCName:
status = verify_memrasd_values(assoc_info[index], rasd)
else:
status = FAIL
@@ -219,16 +224,14 @@ def main():
status, host_name, classname = get_host_info(server, options.virt)
if status != PASS:
return status
- if options.virt == "XenFV":
- options.virt = "Xen"
- status = setup_env(server, options.virt)
- if status != PASS:
+ status, vsxml = setup_env(server, options.virt)
+ if status != PASS or vsxml == None:
return status
cn = classname
an = get_typed_class(options.virt, 'HostedDependency')
qcn = get_typed_class(options.virt, 'ComputerSystem')
name = host_name
- status, cs_assoc_info = get_assoc_info(server, cn, an, qcn, name, options.virt)
+ status, cs_assoc_info = get_assoc_info(server, cn, an, qcn, name, vsxml, options.virt)
if status != PASS or len(cs_assoc_info) == 0:
return status
filter_name = {"key" : "Name"}
@@ -236,18 +239,19 @@ def main():
cn,
cs_assoc_info,
filter_name,
- test_dom)
+ test_dom,
+ vsxml)
if status != PASS or len(cs_dom) == 0:
return status
cn = cs_dom['CreationClassName']
- an = '%s_SystemDevice' % options.virt
+ an = get_typed_class(options.virt, 'SystemDevice')
qcn = 'Devices'
name = test_dom
- status, sd_assoc_info = get_assoc_info(server, cn, an, qcn, name, options.virt)
+ status, sd_assoc_info = get_assoc_info(server, cn, an, qcn, name, vsxml, options.virt)
if status != PASS or len(sd_assoc_info) == 0:
return status
- status = verify_RASD_values(server, sd_assoc_info, options.virt)
- test_domain_function(test_dom, server, "undefine")
+ status = verify_RASD_values(server, sd_assoc_info, vsxml, options.virt)
+ vsxml.undefine(server)
return status
if __name__ == "__main__":
sys.exit(main())
16 years, 8 months
[PATCH] [TEST].2# fix domain created error in RASD.01
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1207707589 25200
# Node ID bee8c36f919afa0c9e82f747f5b7cd2c0e596858
# Parent 262153788503c8b10c76c77719bba081df9a7b88
[TEST].2# fix domain created error in RASD.01
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 262153788503 -r bee8c36f919a suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py
--- a/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Tue Apr 08 17:58:44 2008 +0530
+++ b/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Tue Apr 08 19:19:49 2008 -0700
@@ -54,11 +54,13 @@ from XenKvmLib.test_doms import destroy_
from XenKvmLib.test_doms import destroy_and_undefine_all
import XenKvmLib
from XenKvmLib import assoc
+from XenKvmLib import vxml
from XenKvmLib.vxml import XenXML, KVMXML, get_class
from XenKvmLib.classes import get_typed_class
from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \
verify_diskrasd_values, verify_memrasd_values
from CimTest.Globals import log_param, logger
+from CimTest.ReturnCodes import PASS, FAIL
sup_types = ['Xen', 'KVM', 'XenFV']
@@ -66,9 +68,8 @@ test_vcpus = 1
test_vcpus = 1
test_mem = 128
test_mac = "00:11:22:33:44:aa"
-test_disk = 'xvda'
-def init_list(virt="Xen"):
+def init_list(xml, disk, virt="Xen"):
"""
Creating the lists that will be used for comparisons.
"""
@@ -86,9 +87,9 @@ def init_list(virt="Xen"):
"CreationClassName": get_typed_class(virt, 'NetResourceAllocationSettingData')
}
- address = vsxml.xml_get_disk_source()
+ address = xml.xml_get_disk_source()
diskrasd = {
- "InstanceID" : '%s/%s' %(test_dom, test_disk), \
+ "InstanceID" : '%s/%s' %(test_dom, disk), \
"ResourceType" : 17, \
"Address" : address, \
"CreationClassName": get_typed_class(virt, 'DiskResourceAllocationSettingData')
@@ -102,8 +103,8 @@ def init_list(virt="Xen"):
}
return procrasd, netrasd, diskrasd, memrasd
-def assoc_values(ip, assoc_info, virt="Xen"):
- procrasd, netrasd, diskrasd, memrasd = init_list(virt)
+def assoc_values(ip, assoc_info, xml, disk, virt="Xen"):
+ procrasd, netrasd, diskrasd, memrasd = init_list(xml, disk, virt)
proc_status = 1
net_status = 0
disk_status = 1
@@ -133,28 +134,22 @@ def assoc_values(ip, assoc_info, virt="X
@do_main(sup_types)
def main():
- global vsxml
options = main.options
status = 0
rc = 1
log_param()
destroy_and_undefine_all(options.ip)
- vsxml = get_class(options.virt)(test_dom, \
- mem=test_mem, \
- vcpus = test_vcpus, \
- mac = test_mac, \
- disk = test_disk)
- try:
- rc = vsxml.define(options.ip)
- sc = vsxml.start(options.ip)
- if rc == 0 or sc == 0:
- logger.error("Define or start domain failed")
- status = 1
- except Exception, details:
- logger.error("Unknonw exception happened")
- logger.error("Exception : %s" % details)
- status = 1
-
+ if options.virt == 'Xen':
+ test_disk = 'xvda'
+ else:
+ test_disk = 'hda'
+
+ virt_xml = vxml.get_class(options.virt)
+ cxml = virt_xml(test_dom, mem=test_mem, 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)
+ return FAIL
if status == 1:
destroy_and_undefine_all(options.ip)
return 1
@@ -169,7 +164,7 @@ def main():
'VirtualSystemSettingData', \
options.virt, \
InstanceID = instIdval)
- status = assoc_values(options.ip, assoc_info, options.virt)
+ status = assoc_values(options.ip, assoc_info, cxml, test_disk, options.virt)
except Exception, details:
logger.error(Globals.CIM_ERROR_ASSOCIATORS, \
get_typed_class(options.virt, 'VirtualSystemSettingDataComponent'))
@@ -177,8 +172,8 @@ def main():
status = 1
try:
- vsxml.destroy(options.ip)
- vsxml.undefine(options.ip)
+ cxml.destroy(options.ip)
+ cxml.undefine(options.ip)
except Exception:
logger.error("Destroy or undefine domain failed")
return status
16 years, 8 months
[PATCH 0 of 2] [RFC] First steps in new processor RASD behavior
by Jay Gagnon
Just want to get this out before I start in on the resource add/mod/del stuff, to see if I'm on the right track. The idea here is that we are not supporting processor pinning, will support scheduling (weight/limit attributes), and are making Processor RASDs one-per-domain. Does this look sane?
16 years, 8 months
Test report on KVM
by Dan Smith
Hi all,
Today I ran a full test run against my local machine in KVM mode (with
"-v KVM"). Things look pretty good, and I think most of the failures
are likely to be test-related and not necessarily provider-related.
For those of you working on the test suite, I'd appreciate it if you
could look through these and figure out what the issues are.
Thanks!
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com
> ElementCapabilities - 01_forward.py: FAIL
> CIM_ERR_NOT_FOUND: The requested object could not be found: "No such instance (CreationClassName)"
> ElementCapabilities - 05_hostsystem_cap.py: FAIL
> CIM_ERR_NOT_FOUND: The requested object could not be found: "No such instance"
This looks like a test case error that is failing to provide a key
> ElementConforms - 01_forward.py: FAIL
> ElementConforms - 02_reverse.py: FAIL
The log:
> ====01_forward.py Log====
> 1. Property values for CIM:DSP1057-VirtualSystem-1.0.0a and domain Domain-0 is
> EnabState = 2 EnabDefault = 2 ReqSt = 12
> 2. Values for CIM:DSP1042-SystemVirtualization-1.0.0 and host guaranine.danplanet.com is
> EnabState = 5 EnabDefault = 2 ReqSt = 12
> ====02_reverse.py Log====
The lack of a log for 02 is troubling.
> HostSystem - 02_hostsystem_to_rasd.py: FAIL
> Traceback (most recent call last):
> File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit
> msg = self.format(record)
> File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format
> return fmt.format(record)
> File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format
> record.message = record.getMessage()
> File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage
> msg = msg % self.args
> TypeError: not enough arguments for format string
Looks like a testcase error.
> RASD - 01_verify_rasd_fields.py: FAIL
No log for this one either.
> RASD - 02_enum.py: FAIL
> Traceback (most recent call last):
> File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit
> msg = self.format(record)
> File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format
> return fmt.format(record)
> File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format
> record.message = record.getMessage()
> File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage
> msg = msg % self.args
> TypeError: not enough arguments for format string
Same as above.
> SettingsDefine - 01_forward.py: FAIL
> SettingsDefine - 02_reverse.py: FAIL
> SettingsDefine - 03_sds_fwd_errs.py: FAIL
No log.
> SystemDevice - 01_forward.py: FAIL
Log:
> ====01_forward.py Log====
> Examined test_domain/00:11:22:33:44:55
> Examined test_domain/mem
> Examined test_domain/xvdb
> Examined test_domain/0
> SystemDevice - 03_fwderrs.py: FAIL
> Traceback (most recent call last):
> File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit
> msg = self.format(record)
> File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format
> return fmt.format(record)
> File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format
> record.message = record.getMessage()
> File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage
> msg = msg % self.args
> TypeError: not all arguments converted during string formatting
This is repeated a bunch of times, but I've snipped them out.
> VSSD - 04_vssd_to_rasd.py: FAIL
> Traceback (most recent call last):
> File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit
> msg = self.format(record)
> File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format
> return fmt.format(record)
> File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format
> record.message = record.getMessage()
> File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage
> msg = msg % self.args
> TypeError: not enough arguments for format string
Seems to be a common issue.
> VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL
Log:
> destroy_fail>>nonexistent: Got expected return code 4
> destroy_fail>>nonexistent: Got expected return code 4
> VirtualSystemMigrationSettingData - 01_enum.py: FAIL
No log.
> VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL
No log.
16 years, 8 months
[PATCH] [TEST]Fixing verify_memrasd_values() of rasd.py
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1207657724 -19800
# Node ID 37016dd67bef77cc50d114578c239d8197d4de84
# Parent 4b2bfa729df71d618e7bc8e3b1b89eacf86c419b
[TEST]Fixing verify_memrasd_values() of rasd.py.
Removed the extra format string in the log stmt.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 4b2bfa729df7 -r 37016dd67bef suites/libvirt-cim/lib/XenKvmLib/rasd.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Tue Apr 08 17:54:15 2008 +0530
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Tue Apr 08 17:58:44 2008 +0530
@@ -92,7 +92,7 @@ def verify_memrasd_values(assoc_info, me
status = FAIL
if assoc_info['AllocationUnits'] != memrasd_list['AllocationUnits']:
Globals.logger.error("%s Mismatch", 'AllocationUnits')
- Globals.logger.error("Returned %s instead of %s or %s", \
+ Globals.logger.error("Returned %s instead of %s ", \
assoc_info['AllocationUnits'], memrasd_list['AllocationUnits'])
status = FAIL
if assoc_info['VirtualQuantity'] != memrasd_list['VirtualQuantity']:
16 years, 8 months
[PATCH] [TEST] Fixing the 02_hostsystem_to_rasd.py tc
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1207657455 -19800
# Node ID 4b2bfa729df71d618e7bc8e3b1b89eacf86c419b
# Parent 6e8932e6628a5475b39e196bb8b5182b5c5a3f11
[TEST] Fixing the 02_hostsystem_to_rasd.py tc.
1) Fixed the tc failure.
2) Removed ununsed import stmt.
3) updated it to use the xml_get_disk_source() to get disk info.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 6e8932e6628a -r 4b2bfa729df7 suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py
--- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Tue Apr 08 16:23:16 2008 +0530
+++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Tue Apr 08 17:54:15 2008 +0530
@@ -47,10 +47,8 @@
# Date : 29.01.2008
import sys
-from VirtLib import utils
-from CimTest import Globals
from CimTest.Globals import do_main
-from XenKvmLib.vxml import XenXML, KVMXML, get_class
+from XenKvmLib.vxml import get_class
from XenKvmLib.classes import get_typed_class
from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all
from XenKvmLib.assoc import Associators, AssociatorNames
@@ -73,34 +71,35 @@ def init_list(virt="Xen"):
"""
Creating the lists that will be used for comparisons.
"""
- disk_path = "/tmp/default-%s-dimage" % virt.lower()
+ disk_path = vsxml.xml_get_disk_source()
rasd_values = {"%s_Processor" % virt : {
- "InstanceID" : '%s/%s' %(test_dom,0),\
- "ResourceType" : 3,\
- }, \
+ "InstanceID" : '%s/%s' %(test_dom,0),
+ "ResourceType" : 3,
+ },
"%s_LogicalDisk" % virt: {
- "InstanceID" : '%s/%s' %(test_dom, test_disk), \
- "ResourceType" : 17, \
- "Address" : disk_path, \
- }, \
+ "InstanceID" : '%s/%s' %(test_dom, test_disk),
+ "ResourceType" : 17,
+ "Address" : disk_path,
+ },
"%s_NetworkPort" % virt: {
- "InstanceID" : '%s/%s' %(test_dom,test_mac), \
- "ResourceType" : 10 , \
- "ntype1": "bridge", \
- "ntype2": "ethernet", \
- }, \
+ "InstanceID" : '%s/%s' %(test_dom,test_mac),
+ "ResourceType" : 10 ,
+ "ntype1": "bridge",
+ "ntype2": "ethernet",
+ },
"%s_Memory"% virt: {
- "InstanceID" : '%s/%s' %(test_dom, "mem"), \
- "ResourceType" : 4, \
- "AllocationUnits" : "MegaBytes",\
- "VirtualQuantity" : (test_mem * 1024), \
+ "InstanceID" : '%s/%s' %(test_dom, "mem"),
+ "ResourceType" : 4,
+ "AllocationUnits" : "KiloBytes",
+ "VirtualQuantity" : (test_mem * 1024),
}
}
return rasd_values
def setup_env(server, virt="Xen"):
+ vsxml_info = None
status = PASS
destroy_and_undefine_all(server)
global test_disk
@@ -108,17 +107,18 @@ def setup_env(server, virt="Xen"):
test_disk = "xvda"
else:
test_disk = "hda"
-
- vsxml = get_class(virt)(test_dom, mem = test_mem,
+ virt_xml = get_class(virt)
+ vsxml_info = virt_xml(test_dom, mem = test_mem,
vcpus=test_vcpus,
mac = test_mac,
disk = test_disk)
- ret = vsxml.define(server)
+ ret = vsxml_info.define(server)
if not ret:
logger.error("Failed to define the dom: %s", test_dom)
status = FAIL
- return status
+
+ return status, vsxml_info
def print_err(err, detail, cn):
logger.error(err % cn)
@@ -214,15 +214,16 @@ def main():
def main():
options = main.options
log_param()
+ global vsxml
server = options.ip
status = PASS
status, host_name, classname = get_host_info(server, options.virt)
if status != PASS:
return status
if options.virt == "XenFV":
- options.virt = "Xen"
- status = setup_env(server, options.virt)
- if status != PASS:
+ options.virt = "Xen"
+ status, vsxml = setup_env(server, options.virt)
+ if status != PASS or vsxml == None:
return status
cn = classname
an = get_typed_class(options.virt, 'HostedDependency')
16 years, 8 months