[PATCH] [TEST] Fixing VSSDC 01_forward.py
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1217416905 25200
# Node ID ee9f77162c6d8979230dd17e8526db2cdbae45d8
# Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb
[TEST] Fixing VSSDC 01_forward.py
This tc was failing on KVM with current sources.
Fix tested for Xen, XenFV and KVM with current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 2efc46fd30f3 -r ee9f77162c6d suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Wed Jul 23 17:42:47 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Wed Jul 30 04:21:45 2008 -0700
@@ -66,7 +66,6 @@ test_dom = "VSSDC_dom"
test_dom = "VSSDC_dom"
test_vcpus = 2
test_mac = "00:11:22:33:44:aa"
-test_disk = 'xvda'
def init_list(test_disk, test_mac, virt='Xen'):
"""
@@ -118,6 +117,12 @@ def main():
status = FAIL
destroy_and_undefine_all(options.ip)
+
+ if options.virt == "Xen":
+ test_disk = "xvdb"
+ else:
+ test_disk = "hdb"
+
prop_list = init_list(test_disk, test_mac, options.virt)
virt_xml = vxml.get_class(options.virt)
if options.virt == 'LXC':
16 years, 5 months
[PATCH] [TEST] #2 Update ElementSettingData.03 for XenFV support
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1217396027 25200
# Node ID f5e68364070e684580fadf659592aac5565f8b69
# Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb
[TEST] #2 Update ElementSettingData.03 for XenFV support
Updates from 1 to 2:
When Xen guest creation finish, set options.virt to 'Xen'
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 2efc46fd30f3 -r f5e68364070e suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py
--- a/suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py Wed Jul 23 17:42:47 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py Tue Jul 29 22:33:47 2008 -0700
@@ -60,7 +60,7 @@ from XenKvmLib.classes import get_typed_
from XenKvmLib.classes import get_typed_class
from CimTest.ReturnCodes import PASS, FAIL
-sup_types = ['Xen', 'KVM', 'LXC']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
test_dom = "hd_domain1"
test_mac = "00:11:22:33:44:55"
@@ -91,6 +91,8 @@ def main():
logger.error("Failed to Create the dom: %s" % test_dom)
status = FAIL
return status
+ if options.virt == "XenFV":
+ options.virt = "Xen"
try:
instid = '%s:%s' % (options.virt, test_dom)
rasd_list = assoc.Associators(options.ip, vssdc_cn, vssd_cn,
16 years, 5 months
[PATCH] [TEST] Update ElementSettingData.03 for LXC support
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1216869559 25200
# Node ID de9cf9b8a9302a55eff582f15c133cca98547c9b
# Parent 32d78f23f6e73f5443022179410128767896465d
[TEST] Update ElementSettingData.03 for LXC support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 32d78f23f6e7 -r de9cf9b8a930 suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py
--- a/suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py Wed Jul 23 00:32:36 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py Wed Jul 23 20:19:19 2008 -0700
@@ -60,7 +60,7 @@ from XenKvmLib.classes import get_typed_
from XenKvmLib.classes import get_typed_class
from CimTest.ReturnCodes import PASS, FAIL
-sup_types = ['Xen', 'KVM', 'LXC']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
test_dom = "hd_domain1"
test_mac = "00:11:22:33:44:55"
@@ -79,6 +79,8 @@ expr_values = {
@do_main(sup_types)
def main():
options = main.options
+ if options.virt == 'XenFV':
+ options.virt = 'Xen'
status = PASS
virtxml = vxml.get_class(options.virt)
16 years, 5 months
[PATCH] [TEST] #2 Update ResourcePool.01 & 02 for XenFV support
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1217390631 25200
# Node ID f4ee15598db4fe3042b8cd0485ae17803c778795
# Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb
[TEST] #2 Update ResourcePool.01 & 02 for XenFV support
I cooked up a patche for fix ResourcePool.01 on the way, so I rebased this patch.
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 2efc46fd30f3 -r f4ee15598db4 suites/libvirt-cim/cimtest/ResourcePool/01_enum.py
--- a/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Wed Jul 23 17:42:47 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Tue Jul 29 21:03:51 2008 -0700
@@ -39,7 +39,7 @@ from XenKvmLib.common_util import cleanu
from XenKvmLib.common_util import cleanup_restore, test_dpath, \
create_diskpool_file
-sup_types = ['Xen', 'KVM', 'LXC']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
diskid = "%s/%s" % ("DiskPool", test_dpath)
dp_cn = 'DiskPool'
@@ -105,7 +105,10 @@ def verify_fields(pool_list, poolname, c
@do_main(sup_types)
def main():
ip = main.options.ip
- virt = main.options.virt
+ if main.options.virt == "XenFV":
+ virt = "Xen"
+ else:
+ virt = main.options.virt
status, pool_list = init_list(ip, virt)
if status != PASS:
logger.error("Failed to initialise the list")
diff -r 2efc46fd30f3 -r f4ee15598db4 suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py
--- a/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py Wed Jul 23 17:42:47 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py Tue Jul 29 21:03:51 2008 -0700
@@ -40,7 +40,7 @@ from XenKvmLib.common_util import cleanu
from XenKvmLib.common_util import cleanup_restore, test_dpath, \
create_diskpool_file
-sup_types = ['Xen', 'KVM', 'LXC']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
expr_values = {
"invalid_keyname" : { 'rc' : pywbem.CIM_ERR_FAILED,
@@ -88,7 +88,10 @@ def err_invalid_instid_keyvalue(conn, cl
@do_main(sup_types)
def main():
ip = main.options.ip
- virt = main.options.virt
+ if main.options.virt == "XenFV":
+ virt = "Xen"
+ else:
+ virt = main.options.virt
conn = assoc.myWBEMConnection('http://%s' % ip, (CIM_USER, CIM_PASS),
CIM_NS)
16 years, 5 months
[PATCH] [TEST] Fix ResourcePool.01 failure for Xen, verify exp_value in a list not the first item
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1217387789 25200
# Node ID e803555f6857e4e230749f0a8b72c0ddb3c7e8fe
# Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb
[TEST] Fix ResourcePool.01 failure for Xen, verify exp_value in a list not the first item
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 2efc46fd30f3 -r e803555f6857 suites/libvirt-cim/cimtest/ResourcePool/01_enum.py
--- a/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Wed Jul 23 17:42:47 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Tue Jul 29 20:16:29 2008 -0700
@@ -89,11 +89,14 @@ def verify_fields(pool_list, poolname, c
logger.error("%s return %i instances, expected atleast 1 instance" \
% (cn, len(poolname)))
return FAIL
- ret_value = poolname[0].InstanceID
exp_value = pool_list[cn][0]
- if ret_value != exp_value:
- print_error('InstanceID', ret_value, exp_value)
- status = FAIL
+ for i in range(0, len(poolname)):
+ ret_value = poolname[i].InstanceID
+ if ret_value == exp_value:
+ break
+ elif ret_value != exp_value and i == len(poolname)-1:
+ print_error('InstanceID', ret_value, exp_value)
+ status = FAIL
ret_value = poolname[0].ResourceType
exp_value = pool_list[cn][1]
if ret_value != exp_value:
16 years, 5 months
[PATCH] [TEST] #2 Check that the DefineSystem() result can be passed to GetInstance()
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1217262054 25200
# Node ID a39dc855b73eb6f5a960bc377a093d3fa953f926
# Parent 3c80ea156a3c45bc321f9c465ba7692c011ab2e0
[TEST] #2 Check that the DefineSystem() result can be passed to GetInstance()
Changes:
- Check that ResultingSystem is a REF instead of an instance too
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 3c80ea156a3c -r a39dc855b73e suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_define_result.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_define_result.py Mon Jul 28 09:20:54 2008 -0700
@@ -0,0 +1,97 @@
+#!/usr/bin/python
+#
+# Copyright 2008 IBM Corp.
+#
+# Authors:
+# Dan Smith <danms(a)us.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+sup_types = ['Xen', 'XenFV', 'KVM']
+default_dom = "define_test"
+
+import sys
+import pywbem
+from CimTest.ReturnCodes import FAIL, PASS
+from CimTest.Globals import do_main
+from CimTest.Globals import logger
+from CimTest import Globals
+from XenKvmLib import vsms
+from XenKvmLib.classes import get_typed_class
+
+def define_system(host, virt, name, vssd, rasds):
+ vsms_class = eval("vsms." + \
+ get_typed_class(virt,
+ "VirtualSystemManagementService"))
+
+ service = vsms_class(host)
+
+ rc, results = service.DefineSystem(SystemSettings=vssd,
+ ResourceSettings=rasds,
+ ReferenceConfiguration=' ')
+
+ system = results["ResultingSystem"]
+
+ return rc, system
+
+def get_instance_by_ref(host, ref):
+ conn = pywbem.WBEMConnection('http://%s' % host,
+ (Globals.CIM_USER, Globals.CIM_PASS),
+ ref.namespace)
+ return conn.GetInstance(ref)
+
+def define_test_system(options):
+ vssd_class = vsms.get_vssd_class(options.virt)
+ vssd = vssd_class(name=default_dom, virt=options.virt)
+
+ mrasd_class = vsms.get_masd_class(options.virt)
+ mrasd = mrasd_class(32, default_dom)
+
+ rc, system = define_system(options.ip,
+ options.virt,
+ default_dom,
+ vssd.mof(),
+ [mrasd.mof()])
+
+ return system
+
+@do_main(sup_types)
+def main():
+ options = main.options
+
+ systemref = define_test_system(options)
+
+ if not isinstance(systemref, pywbem.CIMInstanceName):
+ logger.error("ResultingSystem is not a Reference!")
+ return FAIL
+
+ if systemref.namespace is None:
+ logger.error("Returned reference had no namespace!")
+ return FAIL
+
+ logger.info("GetInstance(%s)" % systemref)
+ system = get_instance_by_ref(options.ip, systemref)
+
+ if system["Name"] == default_dom:
+ logger.info("Validated resulting system instance")
+ return PASS
+ else:
+ logger.error("Result system was: %s instead of %s" % (system["Name"],
+ default_dom))
+ return FAIL
+
+if __name__ == "__main__":
+ sys.exit(main())
16 years, 5 months
[PATCH] [TEST] Convert HostSystem - 04_hs_to_EAPF.py for XenFV/KVM support
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1216972699 25200
# Node ID be268ff56f1a52fb77fe8d98da8a4a7ff3602397
# Parent 32d78f23f6e73f5443022179410128767896465d
[TEST] Convert HostSystem - 04_hs_to_EAPF.py for XenFV/KVM support
Also fix failure for Xen, remove CCName parameter from verify_device_values() function
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 32d78f23f6e7 -r be268ff56f1a suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py
--- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Wed Jul 23 00:32:36 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Fri Jul 25 00:58:19 2008 -0700
@@ -52,17 +52,17 @@ from CimTest.Globals import logger, CIM_
from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES, \
CIM_ERROR_ASSOCIATORS
from CimTest.Globals import do_main
+from XenKvmLib.vxml import XenXML, KVMXML, get_class
from XenKvmLib.assoc import AssociatorNames, Associators
from XenKvmLib.common_util import get_host_info
+from XenKvmLib.classes import get_typed_class
from CimTest.ReturnCodes import PASS, FAIL, SKIP
-from XenKvmLib.test_xml import testxml_bridge
-from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all
-from VirtLib.live import network_by_bridge
+from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib.logicaldevices import verify_device_values
from XenKvmLib.common_util import cleanup_restore, test_dpath, \
create_diskpool_file
-sup_types = ['Xen']
+sup_types = ['Xen', 'KVM', 'XenFV']
test_dom = "CrossClass_GuestDom"
test_mac = "00:11:22:33:44:aa"
@@ -72,30 +72,6 @@ diskid = "%s/%s" % ("DiskPool", test_dpa
diskid = "%s/%s" % ("DiskPool", test_dpath)
memid = "%s/%s" % ("MemoryPool", 0)
procid = "%s/%s" % ("ProcessorPool", 0)
-
-def setup_env(server):
- destroy_and_undefine_all(server)
- test_xml, bridge = testxml_bridge(test_dom, mem = test_mem,
- vcpus = test_vcpus, mac = test_mac,
- disk = test_disk, server = server)
- if bridge == None:
- logger.error("Unable to find virtual bridge")
- return SKIP
-
- if test_xml == None:
- logger.error("Guest xml was not created properly")
- return FAIL
-
- virt_network = network_by_bridge(bridge, server)
- if virt_network == None:
- logger.error("No virtual network found for bridge %s", bridge)
- return SKIP
-
- ret = test_domain_function(test_xml, server, cmd = "create")
- if not ret:
- logger.error("Failed to create the dom: %s", test_dom)
- return FAIL
- return PASS
def print_err(err, detail, cn):
logger.error(err % cn)
@@ -112,34 +88,39 @@ def pool_init_list(pool_assoc):
in_pllist[classname_keyvalue] = instid
return in_pllist
-def eapf_list():
+def eapf_list(server, virt="Xen"):
+ disk_inst = get_typed_class(virt, "LogicalDisk")
+ proc_inst = get_typed_class(virt, "Processor")
+ net_inst = get_typed_class(virt, "NetworkPort")
+ mem_inst = get_typed_class(virt, "Memory")
+
disk = {
'SystemName' : test_dom,
- 'CreationClassName' : "Xen_LogicalDisk",
- 'DeviceID' : "%s/%s" % (test_dom,test_disk),
+ 'CreationClassName' : disk_inst,
+ 'DeviceID' : "%s/%s" % (test_dom, test_disk),
'Name' : test_disk
}
proc = {
'SystemName' : test_dom,
- 'CreationClassName' : "Xen_Processor",
+ 'CreationClassName' : proc_inst,
'DeviceID' : "%s/%s" % (test_dom,0)
}
net = {
'SystemName' : test_dom,
- 'CreationClassName' : "Xen_NetworkPort",
+ 'CreationClassName' : net_inst,
'DeviceID' : "%s/%s" % (test_dom, test_mac),
'NetworkAddresses' : test_mac
}
mem = {
'SystemName' : test_dom,
- 'CreationClassName' : "Xen_Memory",
+ 'CreationClassName' : mem_inst,
'DeviceID' : "%s/%s" % (test_dom, "mem"),
'NumberOfBlocks' : test_mem * 1024
}
- eaf_values = { "Xen_Processor" : proc,
- "Xen_LogicalDisk" : disk,
- "Xen_NetworkPort" : net,
- "Xen_Memory" : mem
+ eaf_values = { proc_inst : proc,
+ disk_inst : disk,
+ net_inst : net,
+ mem_inst : mem
}
return eaf_values
@@ -152,13 +133,14 @@ def get_inst_for_dom(assoc_val):
return dom_list
-def get_assocname_info(server, cn, an, qcn, hostname):
+def get_assocname_info(server, cn, an, qcn, hostname, virt="Xen"):
status = PASS
assoc_info = []
try:
assoc_info = AssociatorNames(server,
an,
cn,
+ virt,
CreationClassName=cn,
Name = hostname)
if len(assoc_info) < 1:
@@ -172,7 +154,6 @@ def get_assocname_info(server, cn, an, q
if status != PASS:
cleanup_restore(server, virt='Xen')
- test_domain_function(test_dom, server, "destroy")
return status, assoc_info
@@ -183,24 +164,24 @@ def check_len(an, assoc_list_info, qcn,
return FAIL
return PASS
-def verify_eafp_values(server, in_pllist):
+def verify_eafp_values(server, in_pllist, virt="Xen"):
# Looping through the in_pllist to get association for various pools.
status = PASS
- an = "Xen_ElementAllocatedFromPool"
+ an = get_typed_class(virt, "ElementAllocatedFromPool")
exp_len = 1
qcn = "Logical Devices"
- eafp_values = eapf_list()
+ eafp_values = eapf_list(server, virt)
for cn, instid in sorted(in_pllist.items()):
try:
- assoc_info = Associators(server, an, cn, InstanceID = instid)
+ assoc_info = Associators(server, an, cn, virt, InstanceID = instid)
inst_list = get_inst_for_dom(assoc_info)
status = check_len(an, inst_list, qcn, exp_len)
if status != PASS:
break
assoc_eafp_info = inst_list[0]
CCName = assoc_eafp_info['CreationClassName']
- status = verify_device_values(assoc_eafp_info, CCName,
- eafp_values, virt='Xen')
+ status = verify_device_values(assoc_eafp_info,
+ eafp_values, virt)
if status != PASS:
return status
@@ -216,22 +197,36 @@ def main():
def main():
options= main.options
server = options.ip
- virt=options.virt
+ if options.virt == "XenFV":
+ virt = "Xen"
+ else:
+ virt=options.virt
# Get the host info
- status, host_name, classname = get_host_info(server)
+ status, host_name, classname = get_host_info(server, virt)
if status != PASS:
return status
+ destroy_and_undefine_all(server)
+ virt_type = get_class(virt)
+ if virt == 'LXC':
+ vsxml = virt_type(test_dom)
+ else:
+ vsxml = virt_type(test_dom, vcpus = test_vcpus, mac = test_mac,
+ disk = test_disk)
+
+ ret = vsxml.define(server)
+ if not ret:
+ logger.error("Failed to Create the dom: '%s'", test_dom)
+ return FAIL
# Verify DiskPool on machine
status = create_diskpool_file()
if status != PASS:
return status
-
# Get the hostedResourcePool info first
cn = classname
- an = "Xen_HostedResourcePool"
+ an = get_typed_class(virt, "HostedResourcePool")
qcn = "Device Pool"
- status, pool = get_assocname_info(server, cn, an, qcn, host_name)
+ status, pool = get_assocname_info(server, cn, an, qcn, host_name, virt)
if status != PASS:
return status
@@ -241,15 +236,9 @@ def main():
if status != PASS:
return FAIL
- status = setup_env(server)
- if status != PASS:
- cleanup_restore(server, virt=virt)
- test_domain_function(test_dom, server, cmd = "destroy")
- return status
-
in_pllist = pool_init_list(pool)
- status = verify_eafp_values(server, in_pllist)
- ret = test_domain_function(test_dom, server, cmd = "destroy")
+ status = verify_eafp_values(server, in_pllist, virt)
+ vsxml.undefine(server)
cleanup_restore(server, virt=virt)
return status
if __name__ == "__main__":
16 years, 5 months
[PATCH] [TEST] Update ResourcePool.01 & 02 for XenFV support
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1216973963 25200
# Node ID f45e90649f2f3f21e169537463d491e965723cdd
# Parent 32d78f23f6e73f5443022179410128767896465d
[TEST] Update ResourcePool.01 & 02 for XenFV support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 32d78f23f6e7 -r f45e90649f2f suites/libvirt-cim/cimtest/ResourcePool/01_enum.py
--- a/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Wed Jul 23 00:32:36 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Fri Jul 25 01:19:23 2008 -0700
@@ -39,7 +39,7 @@ from XenKvmLib.common_util import cleanu
from XenKvmLib.common_util import cleanup_restore, test_dpath, \
create_diskpool_file
-sup_types = ['Xen', 'KVM', 'LXC']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
diskid = "%s/%s" % ("DiskPool", test_dpath)
dp_cn = 'DiskPool'
@@ -105,7 +105,10 @@ def verify_fields(pool_list, poolname, c
@do_main(sup_types)
def main():
ip = main.options.ip
- virt = main.options.virt
+ if main.options.virt == "XenFV":
+ virt = "Xen"
+ else:
+ virt = main.options.virt
status, pool_list = init_list(ip, virt)
if status != PASS:
logger.error("Failed to initialise the list")
diff -r 32d78f23f6e7 -r f45e90649f2f suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py
--- a/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py Wed Jul 23 00:32:36 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py Fri Jul 25 01:19:23 2008 -0700
@@ -40,7 +40,7 @@ from XenKvmLib.common_util import cleanu
from XenKvmLib.common_util import cleanup_restore, test_dpath, \
create_diskpool_file
-sup_types = ['Xen', 'KVM', 'LXC']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
expr_values = {
"invalid_keyname" : { 'rc' : pywbem.CIM_ERR_FAILED,
@@ -88,7 +88,10 @@ def err_invalid_instid_keyvalue(conn, cl
@do_main(sup_types)
def main():
ip = main.options.ip
- virt = main.options.virt
+ if main.options.virt == "XenFV":
+ virt = "Xen"
+ else:
+ virt = main.options.virt
conn = assoc.myWBEMConnection('http://%s' % ip, (CIM_USER, CIM_PASS),
CIM_NS)
16 years, 5 months
[PATCH] [TEST] Verify functionality of MemoryRASD units specification for VSMS
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1216930253 25200
# Node ID 2972728363defd7c9a7683ebfa85a4dfc8225e32
# Parent c9acfbbfedda129e2058ed5f0049780f8a8ad8e9
[TEST] Verify functionality of MemoryRASD units specification for VSMS
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r c9acfbbfedda -r 2972728363de suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Thu Jul 24 13:10:53 2008 -0700
@@ -0,0 +1,138 @@
+#!/usr/bin/python
+#
+# Copyright 2008 IBM Corp.
+#
+# Authors:
+# Dan Smith <danms(a)us.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+import sys
+import pywbem
+from VirtLib import live
+from XenKvmLib import vsms
+from XenKvmLib.test_doms import undefine_test_domain
+from XenKvmLib.common_util import create_using_definesystem
+from XenKvmLib import rasd
+from XenKvmLib.classes import get_typed_class
+from XenKvmLib import enumclass
+from CimTest.Globals import do_main
+from CimTest.Globals import logger
+from CimTest.ReturnCodes import FAIL, PASS
+
+sup_types = ['Xen', 'XenFV', 'KVM']
+default_dom = "memrasd_test"
+
+mem_bytes = 2 << 30
+
+values = [
+ ("Bytes", 0),
+ ("KiloBytes", 10),
+ ("MegaBytes", 20),
+ ("GigaBytes", 30),
+ ]
+
+def try_define(options, service, vssd, units, value):
+ mrasd_class = vsms.get_masd_class(options.virt)
+ mrasd = mrasd_class(None, default_dom)
+
+ mrasd.AllocationUnits = units
+ mrasd.VirtualQuantity = value
+
+ params = {
+ "vssd" : vssd.mof(),
+ "rasd" : [mrasd.mof()],
+ }
+
+ logger.info("Defining with %s = %i" % (units, value))
+ rc = create_using_definesystem(default_dom,
+ options.ip,
+ params=params,
+ virt=options.virt)
+
+ if rc != PASS:
+ logger.error("DefineSystem (%s) failed" % units)
+ return False
+
+ return True
+
+def check_value(options):
+ mrasd_cn = get_typed_class(options.virt, rasd.masd_cn)
+ rasds = enumclass.enumerate_inst(options.ip, mrasd_cn, options.virt)
+
+ the_rasd = None
+ mem_kb = mem_bytes >> 10
+
+ for _rasd in rasds:
+ if _rasd["InstanceID"] == "%s/mem" % default_dom:
+ the_rasd = _rasd
+
+ if not the_rasd:
+ logger.error("Did not find test RASD on server")
+ return False
+
+ if the_rasd["AllocationUnits"] != "KiloBytes":
+ logger.error("MRASD units are not kilobytes?")
+ return False
+
+ cim_kb = int(the_rasd["VirtualQuantity"])
+
+ if cim_kb != mem_kb:
+ logger.error("CIM reports %i KB instead of %i KB" % (cim_kb, mem_kb))
+ return False
+
+ logger.info("Verified %i KB" % mem_kb)
+
+ return True
+
+
+@do_main(sup_types)
+def main():
+ options = main.options
+
+ vssd_class = vsms.get_vssd_class(options.virt)
+ vssd = vssd_class(name=default_dom, virt=options.virt)
+
+ try:
+ service = vsms.enumerate_instances(options.ip, options.virt)[0]
+ except Exception, e:
+ logger.error("Did not find VSMS instance: %s" % e)
+ return FAIL
+
+ status = PASS
+
+ for units, shift in values:
+ value = mem_bytes >> shift
+
+ if not try_define(options, service, vssd, units, value):
+ status = FAIL
+ break
+
+ if not check_value(options):
+ status = FAIL
+ break
+
+ undefine_test_domain(default_dom, options.ip, virt=options.virt)
+
+ try:
+ undefine_test_domain(default_dom, options.ip, virt=options.virt)
+ except Exception, e:
+ pass
+
+ return status
+
+if __name__ == "__main__":
+ sys.exit(main())
16 years, 5 months