# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1223037335 25200
# Node ID e437224852a71d5123f66c998a15d7893e1528dc
# Parent 93041fa7f05b5db0ef3aeb9fbcf072c5d427454f
[TEST] Updating VSSD, VSMS, ElementCapabilities, ElementConforms tc for Association
parameter changes
1) updated 04_vssd_to_rasd.py for Association parameter changes
2) updated 12_referenced_config.py, 13_refconfig_additional_devs.py for Association
parameter changes
3) updated VirtualSystemSettingDataComponent - 01_forward.py, 02_reverse.py for
Association parameter changes.
4) updated ElementCapabilities - 01_forward.py for Association parameter changes
5) updated ElementConforms - 01_forward.py for Association parameter changes
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 93041fa7f05b -r e437224852a7
suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py Fri Oct 03 03:37:16
2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py Fri Oct 03 05:35:35
2008 -0700
@@ -31,6 +31,7 @@ from XenKvmLib.const import do_main
from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL, SKIP
from XenKvmLib.enumclass import enumerate
+from XenKvmLib.common_util import get_host_info
sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
@@ -60,22 +61,21 @@ def main():
options = main.options
server = options.ip
virt = options.virt
- keys = ['Name', 'CreationClassName']
- try:
- host_sys = enumclass.enumerate(server, 'HostSystem', keys, virt)[0]
- except Exception:
- logger.error(CIM_ERROR_ENUMERATE, get_typed_class(virt, 'HostSystem'))
- return FAIL
+
+ status, host_name, host_ccn = get_host_info(server, virt)
+ if status != PASS:
+ logger.error("Failed to get host info")
+ return status
+
try:
+ an = get_typed_class(virt, "ElementCapabilities")
elc = assoc.AssociatorNames(server,
- "ElementCapabilities",
- "HostSystem",
- virt,
- Name = host_sys.Name,
- CreationClassName = host_sys.CreationClassName)
+ an, host_ccn,
+ Name = host_name,
+ CreationClassName = host_ccn)
except Exception:
- logger.error(CIM_ERROR_ASSOCIATORNAMES % host_sys.Name)
+ logger.error(CIM_ERROR_ASSOCIATORNAMES, an)
return FAIL
@@ -107,10 +107,7 @@ def main():
for system in cs:
try:
elec = assoc.AssociatorNames(server,
- "ElementCapabilities",
- "ComputerSystem",
- virt,
- Name = system,
+ an, ccn, Name = system,
CreationClassName = ccn)
except Exception:
logger.error(CIM_ERROR_ASSOCIATORNAMES % system)
diff -r 93041fa7f05b -r e437224852a7
suites/libvirt-cim/cimtest/ElementConforms/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Fri Oct 03 03:37:16 2008
-0700
+++ b/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Fri Oct 03 05:35:35 2008
-0700
@@ -160,8 +160,8 @@ def get_proflist(server, reg_classname,
def verify_ectp_assoc(server, virt):
- reg_classname = "RegisteredProfile"
- an = "ElementConformsToProfile"
+ reg_classname = get_typed_class(virt, "RegisteredProfile")
+ an = get_typed_class(virt,"ElementConformsToProfile")
status, inst_lst = get_proflist(server, reg_classname, virt)
if status != PASS:
@@ -174,7 +174,6 @@ def verify_ectp_assoc(server, virt):
assoc_info = assoc.Associators(server,
an,
reg_classname,
- virt,
InstanceID = devid)
if len(assoc_info) < 1:
status = FAIL
diff -r 93041fa7f05b -r e437224852a7 suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py
--- a/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Fri Oct 03 03:37:16 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Fri Oct 03 05:35:35 2008 -0700
@@ -145,12 +145,14 @@ def get_rasd_values_from_vssdc_assoc(vss
qcn = vssd_values[0].classname
assoc_cname = get_typed_class(virt, 'VirtualSystemSettingDataComponent')
try:
- vssdc_assoc_info = assoc.Associators(server, assoc_cname, qcn, virt, InstanceID =
instIdval)
+ vssdc_assoc_info = assoc.Associators(server, assoc_cname, qcn,
+ InstanceID = instIdval)
if len(vssdc_assoc_info) == 1 and \
vssdc_assoc_info[0].classname ==
'LXC_MemResourceAllocationSettingData':
logger.info("%s returned expect objects" % assoc_cname)
elif len(vssdc_assoc_info) < 4:
- logger.error("%s returned %i %s objects, expected 4" %
(assoc_cname, len(vssdc_assoc_info), qcn))
+ logger.error("%s returned %i %s objects, expected 4",
+ assoc_cname, len(vssdc_assoc_info), qcn)
status = FAIL
except Exception, details:
diff -r 93041fa7f05b -r e437224852a7
suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_referenced_config.py
---
a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_referenced_config.py Fri
Oct 03 03:37:16 2008 -0700
+++
b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_referenced_config.py Fri
Oct 03 05:35:35 2008 -0700
@@ -69,8 +69,8 @@ def get_vssd_ref(ip, virt):
cn = "ComputerSystem"
ccn = get_typed_class(virt, cn)
- vssd = AssociatorNames(ip, 'SettingsDefineState', cn, virt=virt,
- Name = test_dom, CreationClassName = ccn)
+ an = get_typed_class(virt, 'SettingsDefineState')
+ vssd = AssociatorNames(ip, an, ccn, Name = test_dom, CreationClassName = ccn)
if len(vssd) != 1:
logger.error("Returned %i vssd insts for '%s'", len(vssd),
test_dom)
diff -r 93041fa7f05b -r e437224852a7
suites/libvirt-cim/cimtest/VirtualSystemManagementService/13_refconfig_additional_devs.py
---
a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/13_refconfig_additional_devs.py Fri
Oct 03 03:37:16 2008 -0700
+++
b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/13_refconfig_additional_devs.py Fri
Oct 03 05:35:35 2008 -0700
@@ -48,8 +48,8 @@ def get_vssd_ref(ip, virt):
cn = "ComputerSystem"
ccn = get_typed_class(virt, cn)
- vssd = AssociatorNames(ip, 'SettingsDefineState', cn, virt=virt,
- Name = test_dom, CreationClassName = ccn)
+ an = get_typed_class(virt, 'SettingsDefineState')
+ vssd = AssociatorNames(ip, an, ccn, Name = test_dom, CreationClassName = ccn)
if len(vssd) != 1:
logger.error("Returned %i vssd insts for '%s'", len(vssd),
test_dom)
diff -r 93041fa7f05b -r e437224852a7
suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Fri Oct
03 03:37:16 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Fri Oct
03 05:35:35 2008 -0700
@@ -166,8 +166,9 @@ def main():
# Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist
an = get_typed_class(options.virt, 'VirtualSystemSettingDataComponent')
for rasd_cname, prop in prop_list.iteritems():
+ logger.error("DEBUG rasd_cname is %s", rasd_cname)
assoc_info = assoc.Associators(options.ip, an, rasd_cname,
- options.virt, InstanceID = prop)
+ InstanceID = prop)
# Verify the association fields returned for particular rasd_cname.
status = assoc_values(options.ip, assoc_info, rasd_cname, an,
vssd)
diff -r 93041fa7f05b -r e437224852a7
suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Fri Oct
03 03:37:16 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Fri Oct
03 05:35:35 2008 -0700
@@ -156,10 +156,9 @@ def main():
instIdval = "%s:%s" % (options.virt, test_dom)
try:
- assoc_info = assoc.AssociatorNames(options.ip,
- 'VirtualSystemSettingDataComponent',
- 'VirtualSystemSettingData',
- options.virt,
+ an = get_typed_class(options.virt, 'VirtualSystemSettingDataComponent')
+ cn = get_typed_class(options.virt, 'VirtualSystemSettingData')
+ assoc_info = assoc.AssociatorNames(options.ip, an, cn,
InstanceID = instIdval)
status = assoc_values(options.ip, assoc_info, options.virt)
except Exception, detail :