[PATCH] [TEST].2# ElementCapabilities.03 for XenFV and KVM support
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1207024837 25200
# Node ID 6e38a0bd9771df7b5269d8cae8dd6faaae45cf50
# Parent 5d47437104551b638aa75e2e525e49ec4b41e3ec
[TEST].2# ElementCapabilities.03 for XenFV and KVM support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 5d4743710455 -r 6e38a0bd9771 suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py Mon Mar 31 07:54:19 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py Mon Mar 31 21:40:37 2008 -0700
@@ -25,11 +25,12 @@ from pywbem.cim_obj import CIMInstanceNa
from pywbem.cim_obj import CIMInstanceName
from XenKvmLib import assoc
from XenKvmLib import hostsystem
+from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from CimTest.Globals import log_param, logger, do_main
from CimTest.ReturnCodes import PASS, FAIL
-sup_types = ['Xen']
+sup_types = ['Xen', 'XenFV', 'KVM']
exp_rc = 6 #CIM_ERR_NOT_FOUND
exp_desc = "No such instance"
@@ -38,13 +39,12 @@ def try_assoc(ref, ref_class, exp_rc, ex
conn = assoc.myWBEMConnection('http://%s' % options.ip,
(Globals.CIM_USER, Globals.CIM_PASS),
Globals.CIM_NS)
- log_param()
status = FAIL
rc = -1
names = []
try:
- names = conn.AssociatorNames(ref, AssocClass = "Xen_ElementCapabilities")
+ names = conn.AssociatorNames(ref, AssocClass = get_typed_class(options.virt, "ElementCapabilities"))
rc = 0
except pywbem.CIMError, (rc, desc):
if rc == exp_rc and desc.find(exp_desc) >= 0:
@@ -57,7 +57,8 @@ def try_assoc(ref, ref_class, exp_rc, ex
logger.error(details)
finally:
if rc == 0:
- logger.error("Xen_ElementCapabilities associator should NOT return excepted result with a wrong key name and value of %s input" % ref_class)
+ logger.error("ElementCapabilities associator should NOT return excepted \
+ result with a wrong key name and value of %s input" % ref_class)
status = FAIL
return status
@@ -67,18 +68,22 @@ def main():
def main():
options = main.options
rc = PASS
+ log_param()
- instanceref = CIMInstanceName("Xen_HostSystem",
+ hs = get_typed_class(options.virt, "HostSystem")
+ cs = get_typed_class(options.virt, "ComputerSystem")
+
+ instanceref = CIMInstanceName(hs,
keybindings = {"Name" : "wrong", "CreationClassName" : "wrong"})
- rc = try_assoc(instanceref, "Xen_HostSystem", exp_rc, exp_desc, options)
+ rc = try_assoc(instanceref, hs, exp_rc, exp_desc, options)
if rc != PASS:
status = FAIL
return status
- instance_cs = CIMInstanceName("Xen_ComputerSystem",
+ instance_cs = CIMInstanceName(cs,
keybindings = {"Name" : "wrong", "CreationClassName" : "Xen_ComputerSystem"})
- rc = try_assoc(instance_cs, "Xen_ComputerSystem", exp_rc, exp_desc, options)
+ rc = try_assoc(instance_cs, cs, exp_rc, exp_desc, options)
if rc != PASS:
status = FAIL
return status
16 years, 8 months
[PATCH] [CU] add indicatons attribute in server class to keep received indications
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1207016212 25200
# Node ID cb353ff8b1cc60ba8c2d4bc3de9807a024cfac4d
# Parent e9037a5a7df99bb63ae5e90ade698592af7b7e92
[CU] add indicatons attribute in server class to keep received indications
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r e9037a5a7df9 -r cb353ff8b1cc tools/indication_tester.py
--- a/tools/indication_tester.py Mon Mar 10 12:05:59 2008 -0700
+++ b/tools/indication_tester.py Mon Mar 31 19:16:52 2008 -0700
@@ -295,6 +295,7 @@ class CIMSocketHandler(BaseHTTPServer.Ba
print "Got indication: %s" % indication
if self.server.print_ind:
print "%s\n\n" % data
+ self.server.indications.append(indication)
class CIMIndicationSubscription:
def __init__(self, name, typ, ns, print_ind, sysname):
@@ -306,6 +307,7 @@ class CIMIndicationSubscription:
self.server = BaseHTTPServer.HTTPServer(('', 8000), CIMSocketHandler)
self.server.print_ind = print_ind
self.port = 8000
+ self.server.indications = []
self.filter_xml = filter_xml(name, typ, ns, sysname)
self.handler_xml = handler_xml(name, self.port, sysname)
16 years, 8 months