[PATCH] [CU] Commented some structures in the std_association.h file
by Richard Maciel
# HG changeset patch
# User Richard Maciel <richardm(a)br.ibm.com>
# Date 1226604430 7200
# Node ID b26dabfc31b3c528fe632c011ce76fd5426e0fd3
# Parent 5fbf96fedcf7df32fccc3f989aa4520af8c9a264
[CU] Commented some structures in the std_association.h file
* Commented the std_assoc and std_assoc_info structures
to make easier for newbies to learn how to create new associations.
Signed-off-by: Richard Maciel <richardm(a)br.ibm.com>
diff -r 5fbf96fedcf7 -r b26dabfc31b3 std_association.h
--- a/std_association.h Wed Oct 08 10:32:18 2008 -0700
+++ b/std_association.h Thu Nov 13 17:27:10 2008 -0200
@@ -31,24 +31,61 @@
struct std_assoc_info *info,
struct inst_list *list);
-typedef CMPIInstance *(*make_ref_t)(const CMPIObjectPath *,
- const CMPIInstance *,
+typedef CMPIInstance *(*make_ref_t)(const CMPIObjectPath *ref,
+ const CMPIInstance *inst,
struct std_assoc_info *info,
- struct std_assoc *);
+ struct std_assoc *assoc);
+/*
+ * std_assoc is the definition that the developer puts in their source file. It
+ * defines an association relationship between a set of source and target
+ * classes, through a named (set of) association classes and the function
+ * handler which does the work.
+ * It must be registered using the macro STDA_AssocMIStub.
+ */
struct std_assoc {
char **source_class;
+ /* Defines the list of possible classes that can be passed to the
+ association for this case */
+
char *source_prop;
+ /* Defines the property of the association class that refers
+ to the input (source class) of this case. This must match
+ that of the schema, and is used for automatic generation of
+ the reference object in the References() or ReferenceNames()
+ operation */
char **target_class;
+ /* Same as source_class, applied for target */
+
char *target_prop;
+ /* Same as source_prop, applied for target */
char **assoc_class;
+ /* Defines the list of association classes which implement this
+ association */
assoc_handler_t handler;
+ /* Function handler responsible for doing the association and
+ returning the list of target instances of the association.
+ The handler function receives the reference of the source
+ class of the association and must map it to a list of
+ CMPIInstance objects (targets of the association). */
+
make_ref_t make_ref;
+ /* Function handler responsible for creating an instance of the
+ association class as requested by the References() or
+ ReferenceNames() operation.
+ The handler function receives the source object path,
+ and the target instance, so it can create the reference which is returned
+ by the function. */
};
+/*
+ * The std_assoc_info is used to keep information related to the query done
+ * All members of this structure are named after the formal CIM association
+ * query components.
+ */
struct std_assoc_info {
const char *assoc_class;
const char *result_class;
16 years, 1 month
Questions about Libvirt-CIM classes and Cimtest items
by Toshifumi Fujimura
Hi,
I make a simple comparison CIM classes list between
Libvirt-CIM, Cimtest and DSP10xx specifications.
(See Summary_number_of_classes.ods)
According to this summary, I come up with two questions.
I would appreciate if you answer the questions.
(1)If Libvirt-CIM fills CIM Schema specifications,
it needs to add more 11 classes(*1).
(2)If Cimtest fills both Libvirt-CIM classes and CIM Schema specifications,
it needs to add more about 100 test items(*2).
What do you think?
*1:See red cells in ods file.
*2:See red and yellow cells in ods files.
There are 5 test items a Cimtest class on average.
5(items/class) * (14+11)(classes) = 100(items)
--
Toshifumi Fujimura.
16 years, 1 month
KVM on Pegasus Test Run Summary for Nov 13 2008
by Guo Lian Yun
=================================================
KVM on Pegasus Test Run Summary for Nov 13 2008
=================================================
Distro: Fedora release 9 (Sulphur)
Kernel: 2.6.25.14-108.fc9.x86_64
libvirt: 0.4.4
Hypervisor: QEMU 0.9.1
CIMOM: Pegasus 2.7.0
Libvirt-cim revision: 613
Libvirt-cim changeset: 1fcf330fadf8+
Cimtest revision: 490
Cimtest changeset: 8d6f2db22eda
=================================================
FAIL : 3
XFAIL : 2
SKIP : 8
PASS : 126
-----------------
Total : 139
=================================================
FAIL Test Summary:
ElementConforms - 01_forward.py: FAIL
VirtualSystemManagementService - 14_define_sys_disk.py: FAIL
VirtualSystemManagementService - 15_mod_system_settings.py: FAIL
=================================================
XFAIL Test Summary:
ComputerSystem - 32_start_reboot.py: XFAIL
ComputerSystem - 33_suspend_reboot.py: XFAIL
=================================================
SKIP Test Summary:
ComputerSystem - 02_nosystems.py: SKIP
LogicalDisk - 02_nodevs.py: SKIP
RedirectionService - 01_enum_crs.py: SKIP
RedirectionService - 02_enum_crscap.py: SKIP
VSSD - 02_bootldr.py: SKIP
VirtualSystemMigrationService - 01_migratable_host.py: SKIP
VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP
VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP
=================================================
Full report:
--------------------------------------------------------------------
AllocationCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
AllocationCapabilities - 02_alloccap_gi_errs.py: PASS
--------------------------------------------------------------------
ComputerSystem - 01_enum.py: PASS
--------------------------------------------------------------------
ComputerSystem - 02_nosystems.py: SKIP
ERROR - System has defined domains; unable to run
--------------------------------------------------------------------
ComputerSystem - 03_defineVS.py: PASS
--------------------------------------------------------------------
ComputerSystem - 04_defineStartVS.py: PASS
--------------------------------------------------------------------
ComputerSystem - 05_activate_defined_start.py: PASS
--------------------------------------------------------------------
ComputerSystem - 06_paused_active_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 22_define_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 23_suspend_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 27_define_suspend_errs.py: PASS
--------------------------------------------------------------------
ComputerSystem - 32_start_reboot.py: XFAIL
ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation
Failed')
ERROR - Unable to 'Reboot' dom 'cs_test_domain' using
RequestedStateChange()
InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed
Bug:<00005>
--------------------------------------------------------------------
ComputerSystem - 33_suspend_reboot.py: XFAIL
ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation
Failed')
ERROR - Unable to 'Reboot' dom 'test_domain' using
RequestedStateChange()
InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed
Bug:<00005>
--------------------------------------------------------------------
ComputerSystem - 35_start_reset.py: PASS
--------------------------------------------------------------------
ComputerSystem - 40_RSC_start.py: PASS
--------------------------------------------------------------------
ComputerSystem - 41_cs_to_settingdefinestate.py: PASS
--------------------------------------------------------------------
ComputerSystem - 42_cs_gi_errs.py: PASS
--------------------------------------------------------------------
ComputerSystemIndication - 01_created_indication.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 01_forward.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 03_reverse_errs.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 04_forward_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 01_forward.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 03_forward_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 05_hostsystem_cap.py: PASS
--------------------------------------------------------------------
ElementConforms - 01_forward.py: FAIL
ERROR - 'KVM_ElementConformsToProfile' returned (0)
'KVM_RegisteredProfile' objects
CIM_ERR_INVALID_CLASS: Linux_ComputerSystem
--------------------------------------------------------------------
ElementConforms - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementConforms - 03_ectp_fwd_errs.py: PASS
--------------------------------------------------------------------
ElementConforms - 04_ectp_rev_errs.py: PASS
--------------------------------------------------------------------
ElementSettingData - 01_forward.py: PASS
--------------------------------------------------------------------
ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS
--------------------------------------------------------------------
EnabledLogicalElementCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS
--------------------------------------------------------------------
HostSystem - 01_enum.py: PASS
--------------------------------------------------------------------
HostSystem - 02_hostsystem_to_rasd.py: PASS
--------------------------------------------------------------------
HostSystem - 03_hs_to_settdefcap.py: PASS
--------------------------------------------------------------------
HostSystem - 04_hs_to_EAPF.py: PASS
--------------------------------------------------------------------
HostSystem - 05_hs_gi_errs.py: PASS
--------------------------------------------------------------------
HostSystem - 06_hs_to_vsms.py: PASS
--------------------------------------------------------------------
HostedDependency - 01_forward.py: PASS
--------------------------------------------------------------------
HostedDependency - 02_reverse.py: PASS
--------------------------------------------------------------------
HostedDependency - 03_enabledstate.py: PASS
--------------------------------------------------------------------
HostedDependency - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 01_forward.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 02_reverse.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 03_forward_errs.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
HostedService - 01_forward.py: PASS
--------------------------------------------------------------------
HostedService - 02_reverse.py: PASS
--------------------------------------------------------------------
HostedService - 03_forward_errs.py: PASS
--------------------------------------------------------------------
HostedService - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
LogicalDisk - 01_disk.py: PASS
--------------------------------------------------------------------
LogicalDisk - 02_nodevs.py: SKIP
ERROR - System has defined domains; unable to run
--------------------------------------------------------------------
LogicalDisk - 03_ld_gi_errs.py: PASS
--------------------------------------------------------------------
Memory - 01_memory.py: PASS
--------------------------------------------------------------------
Memory - 02_defgetmem.py: PASS
--------------------------------------------------------------------
Memory - 03_mem_gi_errs.py: PASS
--------------------------------------------------------------------
NetworkPort - 01_netport.py: PASS
--------------------------------------------------------------------
NetworkPort - 02_np_gi_errors.py: PASS
--------------------------------------------------------------------
NetworkPort - 03_user_netport.py: PASS
--------------------------------------------------------------------
Processor - 01_processor.py: PASS
--------------------------------------------------------------------
Processor - 02_definesys_get_procs.py: PASS
--------------------------------------------------------------------
Processor - 03_proc_gi_errs.py: PASS
--------------------------------------------------------------------
Profile - 01_enum.py: PASS
--------------------------------------------------------------------
Profile - 02_profile_to_elec.py: PASS
--------------------------------------------------------------------
Profile - 03_rprofile_gi_errs.py: PASS
--------------------------------------------------------------------
RASD - 01_verify_rasd_fields.py: PASS
--------------------------------------------------------------------
RASD - 02_enum.py: PASS
--------------------------------------------------------------------
RASD - 03_rasd_errs.py: PASS
--------------------------------------------------------------------
RASD - 04_disk_rasd_size.py: PASS
--------------------------------------------------------------------
RedirectionService - 01_enum_crs.py: SKIP
--------------------------------------------------------------------
RedirectionService - 02_enum_crscap.py: SKIP
--------------------------------------------------------------------
ReferencedProfile - 01_verify_refprof.py: PASS
--------------------------------------------------------------------
ReferencedProfile - 02_refprofile_errs.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 01_forward.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 02_reverse.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 03_forward_errs.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 05_RAPF_err.py: PASS
--------------------------------------------------------------------
ResourcePool - 01_enum.py: PASS
--------------------------------------------------------------------
ResourcePool - 02_rp_gi_errors.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 01_enum.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py:
PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS
--------------------------------------------------------------------
SettingsDefine - 01_forward.py: PASS
--------------------------------------------------------------------
SettingsDefine - 02_reverse.py: PASS
--------------------------------------------------------------------
SettingsDefine - 03_sds_fwd_errs.py: PASS
--------------------------------------------------------------------
SettingsDefine - 04_sds_rev_errs.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 01_forward.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 03_forward_errs.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS
--------------------------------------------------------------------
SystemDevice - 01_forward.py: PASS
--------------------------------------------------------------------
SystemDevice - 02_reverse.py: PASS
--------------------------------------------------------------------
SystemDevice - 03_fwderrs.py: PASS
--------------------------------------------------------------------
VSSD - 01_enum.py: PASS
--------------------------------------------------------------------
VSSD - 02_bootldr.py: SKIP
--------------------------------------------------------------------
VSSD - 03_vssd_gi_errs.py: PASS
--------------------------------------------------------------------
VSSD - 04_vssd_to_rasd.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 01_definesystem_name.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 02_destroysystem.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 03_definesystem_ess.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 04_definesystem_ers.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 05_destroysystem_neg.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 06_addresource.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 07_addresource_neg.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 08_modifyresource.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 09_procrasd_persist.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 10_hv_version.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 11_define_memrasdunits.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 12_referenced_config.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 13_refconfig_additional_devs.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 14_define_sys_disk.py: FAIL
ERROR - Unexpected rc code 1 and description:
CIM_ERR_FAILED: ResourceSettings Error: Missing `VirtualDevice' property
ERROR - Unable to define rstest_disk_domain
InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error:
Missing `VirtualDevice' property
--------------------------------------------------------------------
VirtualSystemManagementService - 15_mod_system_settings.py: FAIL
ERROR - rstest_domain not updated properly.
ERROR - Exp AutomaticRecoveryAction=3, got 2
--------------------------------------------------------------------
VirtualSystemMigrationCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationService - 01_migratable_host.py: SKIP
--------------------------------------------------------------------
VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP
--------------------------------------------------------------------
VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP
--------------------------------------------------------------------
VirtualSystemMigrationSettingData - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 01_forward.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 02_reverse.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotService - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py:
PASS
--------------------------------------------------------------------
16 years, 1 month
[PATCH] [TEST] Fix HostSystem/02_hostsystem_to_rasd.py for LXC
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1226458889 28800
# Node ID d97222cfb717a382136108c319dee64cc2466716
# Parent 8d6f2db22eda9bda08ff26caa8982f137a3d4486
[TEST] Fix HostSystem/02_hostsystem_to_rasd.py for LXC
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 8d6f2db22eda -r d97222cfb717 suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py
--- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Tue Nov 11 00:19:20 2008 -0800
+++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Tue Nov 11 19:01:29 2008 -0800
@@ -75,6 +75,8 @@
global test_disk
if virt == "Xen":
test_disk = "xvda"
+ if virt == "LXC":
+ test_disk = "/tmp"
else:
test_disk = "hda"
virt_xml = get_class(virt)
16 years, 1 month
[PATCH] [TEST] #3 Fix ECTP 01_forward.py to support system with multiple networks defined
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1226441701 28800
# Node ID 89135530d992a488e3240e5ae6418464cc3fd187
# Parent 9d24629f17819c31889e22f22492e998760d1394
[TEST] #3 Fix ECTP 01_forward.py to support system with multiple networks defined
This test was doing a lot of unnecessary checking (and unessary building of
lists). Instead, this test calls EnumInstances on each of the classes expected
to be returned by the association.
These instances are then compared against the list of instances returned by the ECTP association query.
The FIXME will be fixed when bug 0007 is fixed.
Updates from 2 to 3:
-Place most of main block in a try/except. When a failure is encountered,
an exception is raised, and the test is cleaned up properly.
-If the provider is < 680, don't check the ECTP values for
CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0 - ECTP doesn't support
this provider version.
Updates from 1 to 2:
-Return from test case if init_vs_pool_values() returns a failure
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 9d24629f1781 -r 89135530d992 suites/libvirt-cim/cimtest/ElementConforms/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Sun Nov 09 20:40:42 2008 -0800
+++ b/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Tue Nov 11 14:15:01 2008 -0800
@@ -23,10 +23,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# This tc is used to verify the EnabledState, HealthState, EnabledDefault and
-# the Classname are set appropriately for the results returned by the
-# ElementConformsToProfile association for the RegisteredProfile class
-# and ManagedElement Class
+# This tc is used to verify the results of the ElementConformsToProfile
+# association. This test focuses on RegisteredProfile -> ManagedElement
#
# "CIM:DSP1042-SystemVirtualization-1.0.0" ,
# "CIM:DSP1057-VirtualSystem-1.0.0a"
@@ -45,98 +43,64 @@
from XenKvmLib.classes import get_typed_class
from XenKvmLib import vxml
from CimTest import Globals
-from XenKvmLib.common_util import print_field_error, check_sblim
-from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORS, CIM_ERROR_ENUMERATE
-from XenKvmLib.const import do_main
+from XenKvmLib.common_util import print_field_error, check_sblim, get_host_info
+from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
+from XenKvmLib.const import do_main, get_provider_version
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
from XenKvmLib.enumclass import EnumInstances
-from XenKvmLib.const import default_network_name, default_pool_name
-from XenKvmLib.const import get_provider_version
-
sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
test_dom = "domU"
bug_sblim = '00007'
libvirt_cim_ectp_changes = 680
-def pool_init(verify_list, pool_cn, pool_name, virt):
- ccn = get_typed_class(virt, pool_cn)
- instid = '%s/%s' %(pool_cn, pool_name)
- verify_list[ccn]= {'InstanceID' : instid }
- return verify_list
-
def init_vs_pool_values(server, virt):
- verify_ectp_list = { }
- hs_ccn = get_typed_class(virt, 'HostSystem')
- host = live.hostname(server)
- cs_fields = {
- 'CreationClassName' : hs_ccn,
- 'Name' : host
- }
+ verify_ectp_list = {}
- verify_ectp_list[hs_ccn] = cs_fields
+ cn_names = ["VirtualSystemMigrationService", "ComputerSystem", "DiskPool",
+ "NetworkPool", "ProcessorPool", "MemoryPool"]
- cs_ccn = get_typed_class(virt, 'ComputerSystem')
- verify_ectp_list[cs_ccn] = cs_fields.copy()
- verify_ectp_list[cs_ccn]['CreationClassName'] = cs_ccn
- verify_ectp_list[cs_ccn]['Name'] = test_dom
+ status, host_name, host_ccn = get_host_info(server, virt)
+ if status != PASS:
+ logger.error("Unable to get host system instance objects")
+ return FAIL, verify_ectp_list
- vs_ccn = get_typed_class(virt, 'VirtualSystemMigrationService')
- verify_ectp_list[vs_ccn] = cs_fields.copy()
- verify_ectp_list[vs_ccn]['CreationClassName'] = vs_ccn
- verify_ectp_list[vs_ccn]['SystemCreationClassName'] = hs_ccn
- verify_ectp_list[vs_ccn]['SystemName'] = host
- verify_ectp_list[vs_ccn]['Name'] = 'MigrationService'
+ #FIXME - get_host_info() should be updated to return the host instance
+ insts = EnumInstances(server, host_ccn, True)
+ if len(insts) < 1:
+ logger.error("Expected 1 %s instance", host_ccn)
+ return FAIL, verify_ectp_list
- verify_ectp_list = pool_init(verify_ectp_list, 'DiskPool',
- default_pool_name, virt)
- verify_ectp_list = pool_init(verify_ectp_list, 'NetworkPool',
- default_network_name, virt)
- verify_ectp_list = pool_init(verify_ectp_list, 'ProcessorPool', 0, virt)
- verify_ectp_list = pool_init(verify_ectp_list, 'MemoryPool', 0, virt)
+ verify_ectp_list[host_ccn] = insts
-
- return verify_ectp_list
+ for cn_base in cn_names:
+ cn = get_typed_class(virt, cn_base)
+ insts = EnumInstances(server, cn, True)
+
+ if len(insts) < 1:
+ logger.error("Expected at least 1 %s instance", cn)
+ return FAIL, verify_ectp_list
-def verify_fields(assoc_val, pllst_index, vs_pool_values):
+ verify_ectp_list[cn] = insts
+
+ return PASS, verify_ectp_list
+
+def verify_fields(assoc_val, managed_ele_values):
try:
- field_names = vs_pool_values[pllst_index].keys()
- values = vs_pool_values[pllst_index]
- for field in field_names:
- if values[field] != assoc_val[field]:
- print_field_error(field, assoc_val[field], values[field])
- return FAIL
+ cn = assoc_val.classname
+ elements = managed_ele_values[cn]
+
+ for ele in elements:
+ if assoc_val.items() == ele.items():
+ managed_ele_values[cn].remove(ele)
+ return PASS, managed_ele_values
+
except Exception, details:
- logger.error("Exception: In fn verify_fields() %s", details)
- return FAIL
+ logger.error("verify_fields() exception: %s", details)
+ return FAIL, managed_ele_values
- return PASS
-
-def verify_cs_hs_mig_fields(assoc_info, vs_pool_values):
- try:
- pllst_index = assoc_info[0]['CreationClassName']
- assoc_val = None
- if 'HostSystem' in pllst_index or \
- 'VirtualSystemMigrationService' in pllst_index:
- if len(assoc_info) != 1:
- logger.error("'%s' returned '%d' records, expected 1",
- pllst_index, len(assoc_info))
- return FAIL
- assoc_val = assoc_info[0]
- else:
- # For ComputerSystem info
- for inst in assoc_info:
- if inst['Name'] == test_dom:
- assoc_val = inst
- break
- except Exception, details:
- logger.error("Exception: In fn verify_cs_hs_mig_fields() %s", details)
- return FAIL
-
- if assoc_val == None:
- return FAIL
-
- return verify_fields(assoc_val, pllst_index, vs_pool_values)
+ logger.error("%s not in expected list %s", assoc_val, elements)
+ return FAIL, managed_ele_values
def get_proflist(server, reg_classname, virt):
profiles_instid_list = []
@@ -150,7 +114,7 @@
len_prof_list = 7
if len(proflist) < len_prof_list:
logger.error("'%s' returned '%d' '%s' objects, expected atleast %d",
- reg_classname, len(proflist), 'Profile', len_prof_list)
+ reg_classname, len(proflist), 'Profile', len_prof_list)
status = FAIL
except Exception, detail:
@@ -165,58 +129,13 @@
return status, profiles_instid_list
-
-def verify_ectp_assoc(server, virt):
- 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:
- return status
-
- verify_ectp_list = init_vs_pool_values(server, virt)
- for devid in inst_lst :
- logger.info("Verifying '%s' with '%s'", an, devid)
- try:
- assoc_info = assoc.Associators(server,
- an,
- reg_classname,
- InstanceID = devid)
- if len(assoc_info) < 1:
- ret_val, linux_cs = check_sblim(server, virt)
- if ret_val != PASS:
- logger.error(" '%s' returned (%d) '%s' objects", an,
- len(assoc_info), reg_classname)
- return FAIL
- else:
- return XFAIL_RC(bug_sblim)
- break
-
- if 'DSP1059' in devid or 'DSP1045' in devid:
- instid = assoc_info[0]['InstanceID']
- index, other = instid.split("/")
- cn = get_typed_class(virt, index)
- status = verify_fields(assoc_info[0], cn, verify_ectp_list)
- else:
- ccn = assoc_info[0]['CreationClassName']
- status = verify_cs_hs_mig_fields(assoc_info, verify_ectp_list)
-
- if status != PASS:
- break
-
- except Exception, detail:
- logger.error(CIM_ERROR_ASSOCIATORS, an)
- logger.error("Exception: %s" % detail)
- status = FAIL
- return status
-
@do_main(sup_types)
def main():
options = main.options
server = options.ip
virt = options.virt
- status = PASS
+ status = None
destroy_and_undefine_all(options.ip, options.virt)
virt_xml = vxml.get_class(options.virt)
@@ -232,11 +151,59 @@
logger.error('Unable to start domain %s' % test_dom)
return FAIL
-
prev_namespace = Globals.CIM_NS
Globals.CIM_NS = 'root/interop'
- status = verify_ectp_assoc(server, virt)
+ try:
+ reg_classname = get_typed_class(virt, "RegisteredProfile")
+ an = get_typed_class(virt,"ElementConformsToProfile")
+
+ status, prof_inst_lst = get_proflist(server, reg_classname, virt)
+ if status != PASS:
+ raise Exception("Failed to get profile list")
+
+ status, verify_ectp_list = init_vs_pool_values(server, virt)
+ if status != PASS:
+ raise Exception("Failed to get instances needed for verification")
+
+ curr_cim_rev, changeset = get_provider_version(virt, server)
+
+ for prof_id in prof_inst_lst:
+ logger.info("Verifying '%s' with '%s'", an, prof_id)
+ assoc_info = assoc.Associators(server,
+ an,
+ reg_classname,
+ InstanceID = prof_id)
+
+ if curr_cim_rev < libvirt_cim_ectp_changes and \
+ prof_id.find("GenericDeviceResourceVirtualization"):
+ continue
+
+ if len(assoc_info) < 1:
+ ret_val, linux_cs = check_sblim(server, virt)
+ if ret_val != PASS:
+ logger.error(" '%s' returned (%d) '%s' objects", an,
+ len(assoc_info), reg_classname)
+ return FAIL
+ else:
+ return XFAIL_RC(bug_sblim)
+ break
+
+ for inst in assoc_info:
+ status, verify_ectp_list = verify_fields(inst, verify_ectp_list)
+ if status != PASS:
+ raise Exception("Failed to verify instance")
+
+ if status == PASS:
+ for k, l in verify_ectp_list.iteritems():
+ if len(l) != 0:
+ raise Exception("%s items weren't returned: %s", k, l)
+ status = FAIL
+
+ except Exception, detail:
+ logger.error("Exception: %s" % detail)
+ if status == None:
+ status = FAIL
Globals.CIM_NS = prev_namespace
cxml.destroy(server)
16 years, 1 month
[PATCH] [CU] Commented some structures in the std_association.h file
by Richard Maciel
# HG changeset patch
# User Richard Maciel <richardm(a)br.ibm.com>
# Date 1226511618 7200
# Node ID a0bfb9da65f0ae911dbd7d18936d0a5fdcd63345
# Parent 5fbf96fedcf7df32fccc3f989aa4520af8c9a264
[CU] Commented some structures in the std_association.h file
* Commented the assoc_handler_t, make_ref_t types and the std_assoc, std_assoc_info structures
to make easier for newbies to learn how to create new associations.
Signed-off-by: Richard Maciel <richardm(a)br.ibm.com>
diff -r 5fbf96fedcf7 -r a0bfb9da65f0 std_association.h
--- a/std_association.h Wed Oct 08 10:32:18 2008 -0700
+++ b/std_association.h Wed Nov 12 15:40:18 2008 -0200
@@ -27,15 +27,68 @@
struct std_assoc;
struct std_assoc_info;
+/*
+ * This type defines the signature of the association handler function. The
+ * handler function receives the reference of the source class of the
+ * association and must map it to a list of CMPIInstance objects (targets
+ * of the association).
+ *
+ * In parameters:
+ * CMPIObjectPath * - Path to the source class
+ * struct std_assoc_info * - See std_assoc_info comment
+ *
+ * Out parameters:
+ * struct inst_list * - Instances associated to ref
+ */
typedef CMPIStatus (*assoc_handler_t)(const CMPIObjectPath *ref,
struct std_assoc_info *info,
struct inst_list *list);
+/*
+ * This type defines the signature of the handler which creates the
+ * reference. The handler function receives the source object path,
+ * and the target instance, so it can create the reference which is returned
+ * by the function.
+ *
+ * In parameters:
+ * CMPIObjectPath * - Path to the source class
+ * CMPIInstance * - Target instance
+ * std_assoc_info - Information from the query that called this function.
+ * See std_assoc_info comment for more information.
+ * std_assoc - This structure keeps the following necessary info to
+ * the creation of the association class instance:
+ * association class name and the names of the attributes
+ * which will be set into the association class.
+ * See the std_assoc comment for more info
+ */
typedef CMPIInstance *(*make_ref_t)(const CMPIObjectPath *,
const CMPIInstance *,
struct std_assoc_info *info,
struct std_assoc *);
+/*
+ * std_assoc is the definition that the developer puts in their source file.
+ * It must be registered using the macro STDA_AssocMIStub.
+ *
+ * source_class - Defines the list of possible classes that can be passed to
+ * the association for this case
+ * source_prop - Defines the property of the association class that refers
+ * to the input (source class) of this case. This must match
+ * that of the schema, and is used for automatic generation of
+ * the reference object in the References() or ReferenceNames()
+ * operation
+ * target_class - Same as source_class, applied for target
+ * target_prop - Same as source_prop, applied for target
+ * assoc_class - Defines the list of association classes which implement this
+ * association
+ * handler - Function handler responsible for doing the association and
+ * returning the list of target instances of the association.
+ * See assoc_handler_t comment for more info
+ * make_ref - Function handler responsible for creating an instance of the
+ * association class as requested by the References() or
+ * ReferenceNames() operation. See make_ref_t comment for more
+ * info
+ */
struct std_assoc {
char **source_class;
char *source_prop;
@@ -49,6 +102,17 @@
make_ref_t make_ref;
};
+/*
+ * The std_assoc_info is used to keep information related to the query done
+ *
+ * assoc_class - Name of the association class
+ * result_class - Name of the class of the target
+ * role - Name of the property of the source class
+ * result_role - Name of the property of the target class
+ * properties -
+ * context -
+ * provider_name - Calling provider name
+ */
struct std_assoc_info {
const char *assoc_class;
const char *result_class;
16 years, 1 month
[PATCH] Fix RASD provider unregistration
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1225926818 28800
# Node ID 6f62d6165aa6f5b60156c2c56c2d72a12a021886
# Parent 16aa18cf5325f5e689c4967d35288d15825fc2be
Fix RASD provider unregistration.
Since <>_ResourceAllocationSettingData is listed first in the mof, it doesn't
get properly unregistered because <>_ProcResourceAllocationSettingData (etc)
hasn't been unregistered yet.
This patch forces the ResourceAllocationSettingData unregistration to be run
twice, which isn't ideal, but ensures the classes are properly cleaned up.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 16aa18cf5325 -r 6f62d6165aa6 Makefile.am
--- a/Makefile.am Wed Nov 05 15:09:49 2008 -0800
+++ b/Makefile.am Wed Nov 05 15:13:38 2008 -0800
@@ -112,6 +112,10 @@
schema/ElementConformsToProfile.registration \
schema/ReferencedProfile.registration
+# This definition is needed during provider unregistration
+RASD_MOF = schema/ResourceAllocationSettingData.mof
+RASD_REG = schema/ResourceAllocationSettingData.registration
+
pkgdata_DATA = $(MOFS) $(REGS) $(INTEROP_MOFS) $(INTEROP_REGS)
pkgdata_SCRIPTS = provider-register.sh
@@ -134,6 +138,7 @@
preuninstall:
sh provider-register.sh -v -d -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(REGS) -m $(MOFS)
+ sh provider-register.sh -v -d -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(RASD_REG) -m $(RASD_MOF)
sh provider-register.sh -v -d -t @CIMSERVER@ -n root/interop -r $(INTEROP_REGS) -m $(INTEROP_MOFS)
rpm: clean
16 years, 1 month