[PATCH] [TEST] Fixing 01_forward.py tc of HostedDependency, accomdating sblim-base-provider changes
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1222369936 25200
# Node ID cdf9d7ee99cac967eb9ec0935709b02db6c9dabd
# Parent 375ae129b8e910fe42a5e4434b67ada5589bc72f
[TEST] Fixing 01_forward.py tc of HostedDependency, accomdating sblim-base-provider changes.
This tc changes requires the check_sblim() fn changes.
Tested with Xen, XenFV, KVM on current sources and witjh/without sblim-base-provider installed.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 375ae129b8e9 -r cdf9d7ee99ca suites/libvirt-cim/cimtest/HostedDependency/01_forward.py
--- a/suites/libvirt-cim/cimtest/HostedDependency/01_forward.py Tue Sep 23 04:45:04 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedDependency/01_forward.py Thu Sep 25 12:12:16 2008 -0700
@@ -31,7 +31,7 @@
#
# The output should be a single record and it will look something like this:
# localhost:5988/root/virt:Xen_HostSystem.CreationClassName="Xen_HostSystem",
-# Name="mx3650b.in.ibm.com"
+# Name="x3650"
# ......
# -CommunicationStatus
# -CreationClassName="Xen_HostSystem"
@@ -51,8 +51,10 @@ from XenKvmLib import enumclass
from XenKvmLib import enumclass
from XenKvmLib.classes import get_class_basename
from CimTest import Globals
+from CimTest.Globals import logger
from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL
+from XenKvmLib.common_util import check_sblim
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
@@ -71,25 +73,41 @@ def main():
cxml = virtxml(test_dom, mac = test_mac)
ret = cxml.define(options.ip)
if not ret:
- Globals.logger.error("Failed to Create the dom: %s", test_dom)
+ logger.error("Failed to Create the dom: %s", test_dom)
status = FAIL
return status
+
keys = ['Name', 'CreationClassName']
+
try:
- host = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
+ ret, linux_cs = check_sblim(options.ip)
+ host_info = enumclass.enumerate(options.ip, 'HostSystem', keys,
+ options.virt)
except Exception,detail:
- Globals.logger.error(Globals.CIM_ERROR_ENUMERATE, 'Hostsystem')
- Globals.logger.error("Exception: %s", detail)
+ logger.error(Globals.CIM_ERROR_ENUMERATE, 'Hostsystem')
+ logger.error("Exception: %s", detail)
status = FAIL
cxml.undefine(options.ip)
return status
-
- keys = ['Name', 'CreationClassName']
+
+ # This below modification is req to accomadate the
+ # sblim-base-provider provider related changes
+ if ret == PASS and len(host_info) == 0:
+ host = linux_cs
+ elif ret == FAIL and len(host_info) == 1:
+ host = host_info[0]
+ elif (ret == FAIL and len(host_info) == 0) or \
+ (ret == PASS and len(host_info) == 1):
+ logger.error("Error in getting HostSystem information, Exiting...")
+ cxml.undefine(options.ip)
+ return FAIL
+
try:
- cs = enumclass.enumerate(options.ip, 'ComputerSystem', keys, options.virt)
+ cs = enumclass.enumerate(options.ip, 'ComputerSystem', keys,
+ options.virt)
except Exception,detail:
- Globals.logger.error(Globals.CIM_ERROR_ENUMERATE, 'ComputerSystem')
- Globals.logger.error("Exception: %s", detail)
+ logger.error(Globals.CIM_ERROR_ENUMERATE, 'ComputerSystem')
+ logger.error("Exception: %s", detail)
status = FAIL
cxml.undefine(options.ip)
return status
@@ -104,14 +122,15 @@ def main():
if not hs:
cxml.undefine(options.ip)
- Globals.logger.error("HostName seems to be empty")
+ logger.error("HostName seems to be empty")
status = FAIL
break
if len(hs) != 1:
test = "(len(hs), system.name)"
- Globals.logger.error("HostedDependency returned %i HostSystem \
-objects for domain '%s'", len(hs), system.name)
+ logger.error("'%s' returned %i HostSystem "
+ "objects for domain '%s'",
+ hs_cn, len(hs), system.name)
status = FAIL
break
@@ -119,19 +138,19 @@ objects for domain '%s'", len(hs), syste
sn = hs[0]["Name"]
if cn != host.CreationClassName:
- Globals.logger.error("CreationClassName does not match")
+ logger.error("CreationClassName does not match")
status = FAIL
if sn != host.Name:
- Globals.logger.error("Name does not match")
+ logger.error("Name does not match")
status = FAIL
- if status != 0:
+ if status != PASS:
break
except Exception,detail:
- Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, hs_cn)
- Globals.logger.error("Exception: %s", detail)
+ logger.error(Globals.CIM_ERROR_ASSOCIATORS, hs_cn)
+ logger.error("Exception: %s", detail)
status = FAIL
cxml.undefine(options.ip)
return status
16 years, 3 months
[PATCH] [TEST] #4 Fix HostSystem-01 with sblim base provider installed
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222409147 25200
# Node ID f0bc2872b93607b69e32aed0e34e4aea2d45107b
# Parent 61a90c7c9141a64af825e6d4e5645723879df078
[TEST] #4 Fix HostSystem-01 with sblim base provider installed
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 61a90c7c9141 -r f0bc2872b936 suites/libvirt-cim/cimtest/HostSystem/01_enum.py
--- a/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Wed Sep 24 20:27:48 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Thu Sep 25 23:05:47 2008 -0700
@@ -30,6 +30,7 @@ from XenKvmLib.classes import get_typed_
from XenKvmLib.classes import get_typed_class
from VirtLib import live
from VirtLib import utils
+from XenKvmLib.common_util import check_sblim
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL
@@ -43,10 +44,29 @@ def main():
status = FAIL
keys = ['Name', 'CreationClassName']
+ name = get_typed_class(options.virt, 'HostSystem')
+
+ net, linux_cs = check_sblim(options.ip, options.virt)
try:
hs = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)
- name = get_typed_class(options.virt, 'HostSystem')
-
+ except Exception, details:
+ logger.error("%s %s: %s" % (CIM_ERROR_ENUMERATE, name, details))
+ status = FAIL
+
+ if net == PASS:
+ if len(hs) != 0:
+ logger.error("Unexpected instance returned")
+ return FAIL
+ else:
+ if linux_cs.CreationClassName != 'Linux_ComputerSystem'\
+ or linux_cs.Name != host:
+ logger.error("Exp Linux_ComputerSystem, got %s" \
+ % linux_cs.CreationClassName)
+ logger.error("Exp %s, got %s" % (host, system.Name))
+ return FAIL
+ else:
+ return PASS
+ else:
if len(hs) != 1:
logger.error("Expected 1 %s instance returned" % name)
return FAIL
@@ -61,10 +81,6 @@ def main():
logger.info("%s is %s" % (name, host))
status = PASS
- except Exception, details:
- logger.error("%s %s: %s" % (CIM_ERROR_ENUMERATE, name, details))
- status = FAIL
-
return status
if __name__ == "__main__":
16 years, 3 months
KVM on sfcb Test Run Summary for Sep 26 2008
by Guo Lian Yun
=================================================
KVM on sfcb Test Run Summary for Sep 26 2008
=================================================
Distro: Fedora release 9.90.1 (Rawhide)
Kernel: 2.6.26-rc2-mm1-netns
libvirt: 0.4.5
Hypervisor: QEMU 0.9.1
CIMOM: sfcb sfcbd 1.3.0
Libvirt-cim revision: 694
Libvirt-cim changeset: 6ad8bd7d0ed8
=================================================
FAIL : 11
XFAIL : 3
SKIP : 4
PASS : 117
-----------------
Total : 135
=================================================
FAIL Test Summary:
ComputerSystemIndication - 01_created_indication.py: FAIL
VirtualSystemManagementCapabilities - 01_enum.py: FAIL
VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: FAIL
VirtualSystemMigrationCapabilities - 01_enum.py: FAIL
VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: FAIL
VirtualSystemMigrationSettingData - 01_enum.py: FAIL
VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: FAIL
VirtualSystemSnapshotService - 01_enum.py: FAIL
VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: FAIL
VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL
VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py:
FAIL
=================================================
XFAIL Test Summary:
ComputerSystem - 32_start_reboot.py: XFAIL
ComputerSystem - 33_suspend_reboot.py: XFAIL
SettingsDefineCapabilities - 03_forward_errs.py: XFAIL
=================================================
SKIP Test Summary:
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: PASS
--------------------------------------------------------------------
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'Domain Operation Failed')
ERROR - Unable to 'Reboot' dom 'cs_test_domain' using
RequestedStateChange()
InvokeMethod(RequestStateChange): Domain Operation Failed
Bug:<00005>
--------------------------------------------------------------------
ComputerSystem - 33_suspend_reboot.py: XFAIL
ERROR - Exception: (1, u'Domain Operation Failed')
ERROR - Unable to 'Reboot' dom 'test_domain' using
RequestedStateChange()
InvokeMethod(RequestStateChange): 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: FAIL
ERROR - Exception: not enough arguments for format string
Got indication: KVM_ComputerSystemCreatedIndication
ERROR - Received indication error: 256
ERROR - Exception: not enough arguments for format string
Got indication: KVM_ComputerSystemCreatedIndication
ERROR - Received indication error: 256
--------------------------------------------------------------------
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: PASS
--------------------------------------------------------------------
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: PASS
--------------------------------------------------------------------
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
--------------------------------------------------------------------
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: XFAIL
ERROR - 'KVM_SettingsDefineCapabilities' association failed to
generate an exception and 'WrongClassName' passed.
ERROR - ------ FAILED: Invalid CCName Key Name.------
Bug:<>
--------------------------------------------------------------------
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: FAIL
ERROR - 'KVM_VirtualSystemManagementCapabilities' returned '0'
instance, excepted only 1
Provider not found or not loadable
--------------------------------------------------------------------
VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: FAIL
ERROR - Unexpected rc code 5 and description Provider not found
or not loadable
ERROR - ------ FAILED: Invalid InstanceID Key Value.------
ERROR - Unexpected rc code 5 and description Provider not found
or not loadable
ERROR - ------ FAILED: Invalid InstanceID Key Name.------
--------------------------------------------------------------------
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
--------------------------------------------------------------------
VirtualSystemMigrationCapabilities - 01_enum.py: FAIL
ERROR - KVM_VirtualSystemMigrationCapabilities return 0
instances, excepted only 1 instance
Provider not found or not loadable
--------------------------------------------------------------------
VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: FAIL
ERROR - Unexpected rc code 5 and description Provider not found
or not loadable
ERROR - ------ FAILED: Invalid InstanceID Key Name.------
ERROR - Unexpected rc code 5 and description Provider not found
or not loadable
ERROR - ------ FAILED: Invalid InstanceID Key Value.------
--------------------------------------------------------------------
VirtualSystemMigrationService - 01_migratable_host.py: SKIP
--------------------------------------------------------------------
VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP
--------------------------------------------------------------------
VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP
--------------------------------------------------------------------
VirtualSystemMigrationSettingData - 01_enum.py: FAIL
ERROR - KVM_VirtualSystemMigrationSettingData return 0
instances, excepted only 1 instance
Provider not found or not loadable
--------------------------------------------------------------------
VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: FAIL
ERROR - Unexpected rc code 5 and description Provider not found
or not loadable
ERROR - ------ FAILED: to check INVALID_Instid_KeyName.------
--------------------------------------------------------------------
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: FAIL
ERROR - KVM_VirtualSystemSnapshotService return 0 instances,
excepted only 1 instance
Class not found
Provider not found or not loadable
--------------------------------------------------------------------
VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: FAIL
ERROR - Unexpected rc code 5 and description Provider not found
or not loadable
ERROR - ------ FAILED: to check INVALID_CCName_KeyName.------
Class not found
--------------------------------------------------------------------
VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL
ERROR - KVM_VirtualSystemSnapshotServiceCapabilities return 0
instances, excepted only 1 instance
Provider not found or not loadable
--------------------------------------------------------------------
VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py:
FAIL
ERROR - Unexpected rc code 5 and description Provider not found
or not loadable
ERROR - ------ FAILED: to check INVALID_Instid_KeyName.------
--------------------------------------------------------------------
16 years, 3 months
[PATCH] [TEST] #3 Fix HostSystem-01_enum.py to work with sblim base provider installed and without
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222312954 25200
# Node ID 2321fefe8d19520613c3704ed511d8c3d43242e0
# Parent 375ae129b8e910fe42a5e4434b67ada5589bc72f
[TEST] #3 Fix HostSystem-01_enum.py to work with sblim base provider installed and without
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 375ae129b8e9 -r 2321fefe8d19 suites/libvirt-cim/cimtest/HostSystem/01_enum.py
--- a/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Tue Sep 23 04:45:04 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Wed Sep 24 20:22:34 2008 -0700
@@ -27,6 +27,7 @@
import sys
from XenKvmLib import enumclass
+from XenKvmLib.common_util import check_sblim
from XenKvmLib.classes import get_typed_class
from VirtLib import live
from VirtLib import utils
@@ -43,27 +44,41 @@ def main():
status = FAIL
keys = ['Name', 'CreationClassName']
+
+ ret, linux_cs = check_sblim(options.ip, options.virt)
try:
hs = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)
- name = get_typed_class(options.virt, 'HostSystem')
-
- if len(hs) != 1:
- logger.error("Expected 1 %s instance returned" % name)
- return FAIL
-
- system = hs[0]
-
- if system.CreationClassName != name or system.Name != host:
- logger.error("Exp %s, got %s" % (name, system.CreationClassName))
- logger.error("Exp %s, got %s" % (host, system.Name))
- status = FAIL
- else:
- logger.info("%s is %s" % (name, host))
- status = PASS
-
except Exception, details:
logger.error("%s %s: %s" % (CIM_ERROR_ENUMERATE, name, details))
status = FAIL
+ hostname = get_typed_class(options.virt, 'HostSystem')
+
+ if ret == PASS and len(hs) == 0:
+ name = 'Linux_ComputerSystem'
+ system = linux_cs
+ if ret == FAIL and len(hs) == 1:
+ name = hostname
+ system = hs[0]
+ if system.CreationClassName != name or system.Name != host:
+ logger.error("Exp %s, got %s" % (name, system.CreationClassName))
+ logger.error("Exp %s, got %s" % (host, system.Name))
+ status = FAIL
+ else:
+ logger.info("%s is %s" % (name, host))
+ status = PASS
+
+ if ret == PASS and len(hs) == 1:
+ if linux_cs.CreationClassName != 'Linux_ComputerSystem' \
+ or linux_cs.Name != host \
+ or hs[0].CreationClassName != hostname\
+ or hs[0].Name != host:
+ logger.error("Exp Linux_ComputerSystem, got %s" % linux_cs.CreationClassName)
+ logger.error("Exp %s, got %s" % (host, linux_cs.Name))
+ logger.error("Exp %s, got %s" % (hostname, hs[0].CreationClassName))
+ logger.error("Exp %s, got %s" % (host, hs[0].Name))
+ status = FAIL
+ else:
+ status = PASS
return status
16 years, 3 months
KVM on Pegasus Test Run Summary for Sep 26 2008
by Guo Lian Yun
=================================================
KVM on Pegasus Test Run Summary for Sep 26 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: 694
Libvirt-cim changeset: 6ad8bd7d0ed8
=================================================
FAIL : 2
XFAIL : 2
SKIP : 6
PASS : 125
-----------------
Total : 135
=================================================
FAIL Test Summary:
ElementConforms - 01_forward.py: FAIL
ReferencedProfile - 01_verify_refprof.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
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 - 'RegisteredProfile' returned '5' 'Profile' objects,
expected atleast 7
--------------------------------------------------------------------
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
--------------------------------------------------------------------
ReferencedProfile - 01_verify_refprof.py: FAIL
ERROR - InstanceID Mismatch
ERROR - Returned CIM:DSP1081-VirtualSystemMigration-1.0 instead
of CIM:DSP1081-VirtualSystemMigration-0.8.1
--------------------------------------------------------------------
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
--------------------------------------------------------------------
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, 3 months
[PATCH] [TEST] Fixing 01_forward.py tc of HostedDependency, accomdating sblim-base-provider changes
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1222369936 25200
# Node ID cdf9d7ee99cac967eb9ec0935709b02db6c9dabd
# Parent 375ae129b8e910fe42a5e4434b67ada5589bc72f
[TEST] Fixing 01_forward.py tc of HostedDependency, accomdating sblim-base-provider changes.
This tc changes requires the check_sblim() fn changes.
Tested with Xen, XenFV, KVM on current sources and witjh/without sblim-base-provider installed.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 375ae129b8e9 -r cdf9d7ee99ca suites/libvirt-cim/cimtest/HostedDependency/01_forward.py
--- a/suites/libvirt-cim/cimtest/HostedDependency/01_forward.py Tue Sep 23 04:45:04 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedDependency/01_forward.py Thu Sep 25 12:12:16 2008 -0700
@@ -31,7 +31,7 @@
#
# The output should be a single record and it will look something like this:
# localhost:5988/root/virt:Xen_HostSystem.CreationClassName="Xen_HostSystem",
-# Name="mx3650b.in.ibm.com"
+# Name="x3650"
# ......
# -CommunicationStatus
# -CreationClassName="Xen_HostSystem"
@@ -51,8 +51,10 @@ from XenKvmLib import enumclass
from XenKvmLib import enumclass
from XenKvmLib.classes import get_class_basename
from CimTest import Globals
+from CimTest.Globals import logger
from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL
+from XenKvmLib.common_util import check_sblim
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
@@ -71,25 +73,41 @@ def main():
cxml = virtxml(test_dom, mac = test_mac)
ret = cxml.define(options.ip)
if not ret:
- Globals.logger.error("Failed to Create the dom: %s", test_dom)
+ logger.error("Failed to Create the dom: %s", test_dom)
status = FAIL
return status
+
keys = ['Name', 'CreationClassName']
+
try:
- host = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
+ ret, linux_cs = check_sblim(options.ip)
+ host_info = enumclass.enumerate(options.ip, 'HostSystem', keys,
+ options.virt)
except Exception,detail:
- Globals.logger.error(Globals.CIM_ERROR_ENUMERATE, 'Hostsystem')
- Globals.logger.error("Exception: %s", detail)
+ logger.error(Globals.CIM_ERROR_ENUMERATE, 'Hostsystem')
+ logger.error("Exception: %s", detail)
status = FAIL
cxml.undefine(options.ip)
return status
-
- keys = ['Name', 'CreationClassName']
+
+ # This below modification is req to accomadate the
+ # sblim-base-provider provider related changes
+ if ret == PASS and len(host_info) == 0:
+ host = linux_cs
+ elif ret == FAIL and len(host_info) == 1:
+ host = host_info[0]
+ elif (ret == FAIL and len(host_info) == 0) or \
+ (ret == PASS and len(host_info) == 1):
+ logger.error("Error in getting HostSystem information, Exiting...")
+ cxml.undefine(options.ip)
+ return FAIL
+
try:
- cs = enumclass.enumerate(options.ip, 'ComputerSystem', keys, options.virt)
+ cs = enumclass.enumerate(options.ip, 'ComputerSystem', keys,
+ options.virt)
except Exception,detail:
- Globals.logger.error(Globals.CIM_ERROR_ENUMERATE, 'ComputerSystem')
- Globals.logger.error("Exception: %s", detail)
+ logger.error(Globals.CIM_ERROR_ENUMERATE, 'ComputerSystem')
+ logger.error("Exception: %s", detail)
status = FAIL
cxml.undefine(options.ip)
return status
@@ -104,14 +122,15 @@ def main():
if not hs:
cxml.undefine(options.ip)
- Globals.logger.error("HostName seems to be empty")
+ logger.error("HostName seems to be empty")
status = FAIL
break
if len(hs) != 1:
test = "(len(hs), system.name)"
- Globals.logger.error("HostedDependency returned %i HostSystem \
-objects for domain '%s'", len(hs), system.name)
+ logger.error("'%s' returned %i HostSystem "
+ "objects for domain '%s'",
+ hs_cn, len(hs), system.name)
status = FAIL
break
@@ -119,19 +138,19 @@ objects for domain '%s'", len(hs), syste
sn = hs[0]["Name"]
if cn != host.CreationClassName:
- Globals.logger.error("CreationClassName does not match")
+ logger.error("CreationClassName does not match")
status = FAIL
if sn != host.Name:
- Globals.logger.error("Name does not match")
+ logger.error("Name does not match")
status = FAIL
- if status != 0:
+ if status != PASS:
break
except Exception,detail:
- Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, hs_cn)
- Globals.logger.error("Exception: %s", detail)
+ logger.error(Globals.CIM_ERROR_ASSOCIATORS, hs_cn)
+ logger.error("Exception: %s", detail)
status = FAIL
cxml.undefine(options.ip)
return status
16 years, 3 months
[PATCH] (#2) Remove CMSetObjectPath() from rasd_to_vdev()
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1222363795 25200
# Node ID 7c0a09c0695b7a37e2a1215b982bb1acffa69712
# Parent 193c94848d62dfeb5eb00566d0331995c4a42931
(#2) Remove CMSetObjectPath() from rasd_to_vdev()
This is only needed because default_device_pool() needs an ObjectPath with a proper namespace set. Since this is only needed in the network case, remove the calls to CMSetObjectPath() and CMSetNameSpace() from rasd_to_vdev().
Instead, pass the namespace to _default_network(), which sets the namespace on the ObjectPath directly. This removes any need of setting the ObjectPath of the instance.
Also, remove kvm_net_rasd_to_vdev() and xen_net_rasd_to_vdev() - these calls are identical. Move this functionality into net_rasd_to_vdev() and clean up net_rasd_to_vdev(). This means that only net_rasd_to_vdev() needs to be updated with an additional parameter.
Updates:
-Added ns paramerter to _container_rasd_to_vdev() for consistency with _sysvirt_rasd_to_vdev()
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 193c94848d62 -r 7c0a09c0695b src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Tue Sep 23 13:21:48 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Thu Sep 25 10:29:55 2008 -0700
@@ -285,7 +285,8 @@
return ret;
}
-static const char *_default_network(CMPIInstance *inst)
+static const char *_default_network(CMPIInstance *inst,
+ const char* ns)
{
CMPIInstance *pool;
CMPIObjectPath *op;
@@ -299,6 +300,13 @@
return NULL;
}
+ s = CMSetNameSpace(op, ns);
+ if (s.rc != CMPI_RC_OK) {
+ CU_DEBUG("Failed to set the namespace of net objectpath");
+ return NULL;
+ }
+
+ CU_DEBUG("No PoolID specified, looking up default network pool");
pool = default_device_pool(_BROKER, op, CIM_RES_TYPE_NET, &s);
if ((pool == NULL) || (s.rc != CMPI_RC_OK)) {
CU_DEBUG("Failed to get default network pool: %s",
@@ -311,46 +319,6 @@
}
return poolid;
-}
-
-static const char *xen_net_rasd_to_vdev(CMPIInstance *inst,
- struct virt_device *dev)
-{
- const char *val = NULL;
-
- free(dev->dev.net.type);
- dev->dev.net.type = strdup("network");
-
- if (cu_get_str_prop(inst, "PoolID", &val) != CMPI_RC_OK)
- val = _default_network(inst);
-
- if (val == NULL)
- return "No NetworkPool specified and no default available";
-
- free(dev->dev.net.source);
- dev->dev.net.source = name_from_pool_id(val);
-
- return NULL;
-}
-
-static const char *kvm_net_rasd_to_vdev(CMPIInstance *inst,
- struct virt_device *dev)
-{
- const char *val = NULL;
-
- free(dev->dev.net.type);
- dev->dev.net.type = strdup("network");
-
- if (cu_get_str_prop(inst, "PoolID", &val) != CMPI_RC_OK)
- val = _default_network(inst);
-
- if (val == NULL)
- return "No NetworkPool specified and no default available";
-
- free(dev->dev.net.source);
- dev->dev.net.source = name_from_pool_id(val);
-
- return NULL;
}
static const char *_net_rand_mac(void)
@@ -394,10 +362,10 @@
}
static const char *net_rasd_to_vdev(CMPIInstance *inst,
- struct virt_device *dev)
+ struct virt_device *dev,
+ const char *ns)
{
const char *val = NULL;
- CMPIObjectPath *op;
const char *msg = NULL;
if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) {
@@ -414,21 +382,17 @@
free(dev->id);
dev->id = strdup(dev->dev.net.mac);
- op = CMGetObjectPath(inst, NULL);
- if (op == NULL) {
- CU_DEBUG("Unable to get instance path");
- goto out;
- }
+ free(dev->dev.net.type);
+ dev->dev.net.type = strdup("network");
- if (STARTS_WITH(CLASSNAME(op), "Xen"))
- msg = xen_net_rasd_to_vdev(inst, dev);
- else if (STARTS_WITH(CLASSNAME(op), "KVM"))
- msg = kvm_net_rasd_to_vdev(inst, dev);
- else {
- msg = "Unknown class type for net device";
- CU_DEBUG("Unknown class type for net device: %s",
- CLASSNAME(op));
- }
+ if (cu_get_str_prop(inst, "PoolID", &val) != CMPI_RC_OK)
+ val = _default_network(inst, ns);
+
+ if (val == NULL)
+ return "No NetworkPool specified and no default available";
+
+ free(dev->dev.net.source);
+ dev->dev.net.source = name_from_pool_id(val);
out:
return msg;
@@ -552,12 +516,13 @@
static const char *_sysvirt_rasd_to_vdev(CMPIInstance *inst,
struct virt_device *dev,
- uint16_t type)
+ uint16_t type,
+ const char *ns)
{
if (type == CIM_RES_TYPE_DISK) {
return disk_rasd_to_vdev(inst, dev);
} else if (type == CIM_RES_TYPE_NET) {
- return net_rasd_to_vdev(inst, dev);
+ return net_rasd_to_vdev(inst, dev, ns);
} else if (type == CIM_RES_TYPE_MEM) {
return mem_rasd_to_vdev(inst, dev);
} else if (type == CIM_RES_TYPE_PROC) {
@@ -569,7 +534,8 @@
static const char *_container_rasd_to_vdev(CMPIInstance *inst,
struct virt_device *dev,
- uint16_t type)
+ uint16_t type,
+ const char *ns)
{
if (type == CIM_RES_TYPE_MEM) {
return mem_rasd_to_vdev(inst, dev);
@@ -595,9 +561,6 @@
goto out;
}
- CMSetNameSpace(op, ns);
- CMSetObjectPath(inst, op);
-
if (res_type_from_rasd_classname(CLASSNAME(op), &type) != CMPI_RC_OK) {
msg = "Unable to get device type";
goto out;
@@ -606,9 +569,9 @@
dev->type = (int)type;
if (domain->type == DOMAIN_LXC)
- msg = _container_rasd_to_vdev(inst, dev, type);
+ msg = _container_rasd_to_vdev(inst, dev, type, ns);
else
- msg = _sysvirt_rasd_to_vdev(inst, dev, type);
+ msg = _sysvirt_rasd_to_vdev(inst, dev, type, ns);
out:
if (msg)
CU_DEBUG("rasd_to_vdev(%s): %s", CLASSNAME(op), msg);
16 years, 3 months
[PATCH] [RFC] Remove CMSetObjectPath() from rasd_to_vdev()
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1222306223 25200
# Node ID 6a60ecb3eac34f34593803ec736539147f5dd692
# Parent 193c94848d62dfeb5eb00566d0331995c4a42931
[RFC] Remove CMSetObjectPath() from rasd_to_vdev()
This is only needed because default_device_pool() needs an ObjectPath with a proper namespace set. Since this is only needed in the network case, remove the calls to CMSetObjectPath() and CMSetNameSpace() from rasd_to_vdev().
Instead, pass the namespace to _default_network(), which sets the namespace on the ObjectPath directly. This removes any need of setting the ObjectPath of the instance.
Also, remove kvm_net_rasd_to_vdev() and xen_net_rasd_to_vdev() - these calls are identical. Move this functionality into net_rasd_to_vdev() and clean up net_rasd_to_vdev().
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 193c94848d62 -r 6a60ecb3eac3 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Tue Sep 23 13:21:48 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Wed Sep 24 18:30:23 2008 -0700
@@ -285,7 +285,8 @@
return ret;
}
-static const char *_default_network(CMPIInstance *inst)
+static const char *_default_network(CMPIInstance *inst,
+ const char* ns)
{
CMPIInstance *pool;
CMPIObjectPath *op;
@@ -299,6 +300,13 @@
return NULL;
}
+ s = CMSetNameSpace(op, ns);
+ if (s.rc != CMPI_RC_OK) {
+ CU_DEBUG("Failed to set the namespace of net objectpath");
+ return NULL;
+ }
+
+ CU_DEBUG("No PoolID specified, looking up default network pool");
pool = default_device_pool(_BROKER, op, CIM_RES_TYPE_NET, &s);
if ((pool == NULL) || (s.rc != CMPI_RC_OK)) {
CU_DEBUG("Failed to get default network pool: %s",
@@ -311,46 +319,6 @@
}
return poolid;
-}
-
-static const char *xen_net_rasd_to_vdev(CMPIInstance *inst,
- struct virt_device *dev)
-{
- const char *val = NULL;
-
- free(dev->dev.net.type);
- dev->dev.net.type = strdup("network");
-
- if (cu_get_str_prop(inst, "PoolID", &val) != CMPI_RC_OK)
- val = _default_network(inst);
-
- if (val == NULL)
- return "No NetworkPool specified and no default available";
-
- free(dev->dev.net.source);
- dev->dev.net.source = name_from_pool_id(val);
-
- return NULL;
-}
-
-static const char *kvm_net_rasd_to_vdev(CMPIInstance *inst,
- struct virt_device *dev)
-{
- const char *val = NULL;
-
- free(dev->dev.net.type);
- dev->dev.net.type = strdup("network");
-
- if (cu_get_str_prop(inst, "PoolID", &val) != CMPI_RC_OK)
- val = _default_network(inst);
-
- if (val == NULL)
- return "No NetworkPool specified and no default available";
-
- free(dev->dev.net.source);
- dev->dev.net.source = name_from_pool_id(val);
-
- return NULL;
}
static const char *_net_rand_mac(void)
@@ -394,10 +362,10 @@
}
static const char *net_rasd_to_vdev(CMPIInstance *inst,
- struct virt_device *dev)
+ struct virt_device *dev,
+ const char *ns)
{
const char *val = NULL;
- CMPIObjectPath *op;
const char *msg = NULL;
if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) {
@@ -414,21 +382,17 @@
free(dev->id);
dev->id = strdup(dev->dev.net.mac);
- op = CMGetObjectPath(inst, NULL);
- if (op == NULL) {
- CU_DEBUG("Unable to get instance path");
- goto out;
- }
+ free(dev->dev.net.type);
+ dev->dev.net.type = strdup("network");
- if (STARTS_WITH(CLASSNAME(op), "Xen"))
- msg = xen_net_rasd_to_vdev(inst, dev);
- else if (STARTS_WITH(CLASSNAME(op), "KVM"))
- msg = kvm_net_rasd_to_vdev(inst, dev);
- else {
- msg = "Unknown class type for net device";
- CU_DEBUG("Unknown class type for net device: %s",
- CLASSNAME(op));
- }
+ if (cu_get_str_prop(inst, "PoolID", &val) != CMPI_RC_OK)
+ val = _default_network(inst, ns);
+
+ if (val == NULL)
+ return "No NetworkPool specified and no default available";
+
+ free(dev->dev.net.source);
+ dev->dev.net.source = name_from_pool_id(val);
out:
return msg;
@@ -552,12 +516,13 @@
static const char *_sysvirt_rasd_to_vdev(CMPIInstance *inst,
struct virt_device *dev,
- uint16_t type)
+ uint16_t type,
+ const char *ns)
{
if (type == CIM_RES_TYPE_DISK) {
return disk_rasd_to_vdev(inst, dev);
} else if (type == CIM_RES_TYPE_NET) {
- return net_rasd_to_vdev(inst, dev);
+ return net_rasd_to_vdev(inst, dev, ns);
} else if (type == CIM_RES_TYPE_MEM) {
return mem_rasd_to_vdev(inst, dev);
} else if (type == CIM_RES_TYPE_PROC) {
@@ -595,9 +560,6 @@
goto out;
}
- CMSetNameSpace(op, ns);
- CMSetObjectPath(inst, op);
-
if (res_type_from_rasd_classname(CLASSNAME(op), &type) != CMPI_RC_OK) {
msg = "Unable to get device type";
goto out;
@@ -608,7 +570,7 @@
if (domain->type == DOMAIN_LXC)
msg = _container_rasd_to_vdev(inst, dev, type);
else
- msg = _sysvirt_rasd_to_vdev(inst, dev, type);
+ msg = _sysvirt_rasd_to_vdev(inst, dev, type, ns);
out:
if (msg)
CU_DEBUG("rasd_to_vdev(%s): %s", CLASSNAME(op), msg);
16 years, 3 months
[PATCH] [TEST] #2Fix VirtualSystemSnapshotService.01&02 to work with sblim base provider installed and without
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222313268 25200
# Node ID 3305a480c2e2b117b9a45d2e7c7ede9fd24375bf
# Parent 375ae129b8e910fe42a5e4434b67ada5589bc72f
[TEST] #2Fix VirtualSystemSnapshotService.01&02 to work with sblim base provider installed and without
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 375ae129b8e9 -r 3305a480c2e2 suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py Tue Sep 23 04:45:04 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py Wed Sep 24 20:27:48 2008 -0700
@@ -23,6 +23,7 @@
# Date: 25-03-2008
import sys
from XenKvmLib import enumclass
+from XenKvmLib.common_util import check_sblim
from CimTest.Globals import CIM_ERROR_ENUMERATE, logger
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.const import do_main
@@ -40,9 +41,14 @@ def main():
# Expected results from enumeration
cn = get_typed_class(options.virt, "VirtualSystemSnapshotService")
Name = 'SnapshotService'
- status, host_name, classname = get_host_info(options.ip, options.virt)
- if status != PASS:
- return status
+ status, linux_cs = check_sblim(options.ip, options.virt)
+ if status == PASS:
+ host_name = linux_cs.Name
+ classname = linux_cs.CreationClassName
+ else:
+ status, host_name, classname = get_host_info(options.ip, options.virt)
+ if status != PASS:
+ return status
try:
vs_sservice = enumclass.enumerate_inst(options.ip,
"VirtualSystemSnapshotService",
diff -r 375ae129b8e9 -r 3305a480c2e2 suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/02_vs_sservice_gi_errs.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/02_vs_sservice_gi_errs.py Tue Sep 23 04:45:04 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/02_vs_sservice_gi_errs.py Wed Sep 24 20:27:48 2008 -0700
@@ -28,6 +28,7 @@ import sys
import sys
import pywbem
from XenKvmLib import assoc
+from XenKvmLib.common_util import check_sblim
from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS
from CimTest.ReturnCodes import PASS
from XenKvmLib.common_util import try_getinstance
@@ -231,7 +232,12 @@ def main():
conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS)
ccn = get_typed_class(options.virt, "VirtualSystemSnapshotService")
name = "SnapshotService"
- status, sys_name, sccn = get_host_info(options.ip, options.virt)
+ status, linux_cs = check_sblim(options.ip, options.virt)
+ if status == PASS:
+ sys_name = linux_cs.Name
+ sccn = linux_cs.CreationClassName
+ else:
+ status, sys_name, sccn = get_host_info(options.ip, options.virt)
if status != PASS:
return status
field = 'INVALID_CCName'
16 years, 3 months
[PATCH] [TEST] #2 Fix ResourcePoolConfigurationService.01&02 to work with sblim base provider installed and without
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222313124 25200
# Node ID 6f009d69469751477d8c3a91a37109a418e69412
# Parent 375ae129b8e910fe42a5e4434b67ada5589bc72f
[TEST] #2 Fix ResourcePoolConfigurationService.01&02 to work with sblim base provider installed and without
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 375ae129b8e9 -r 6f009d694697 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py Tue Sep 23 04:45:04 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py Wed Sep 24 20:25:24 2008 -0700
@@ -25,6 +25,7 @@ import sys
import sys
from XenKvmLib import enumclass
from XenKvmLib import rpcs
+from XenKvmLib.common_util import check_sblim
from CimTest import Globals
from CimTest.ReturnCodes import PASS, FAIL
from CimTest.Globals import logger
@@ -39,12 +40,16 @@ def main():
server = options.ip
classname = get_typed_class(options.virt, "ResourcePoolConfigurationService")
keys = ['Name', 'CreationClassName']
- try:
- host_sys = enumclass.enumerate(server, 'HostSystem', keys, options.virt)[0]
- except Exception:
- host_cn = get_typed_class(options.virt, "HostSystem")
- logger.error(Globals.CIM_ERROR_ENUMERATE % host_cn)
- return FAIL
+ status, linux_cs = check_sblim(options.ip, options.virt)
+ if status == PASS:
+ host_sys = linux_cs
+ else:
+ try:
+ host_sys = enumclass.enumerate(server, 'HostSystem', keys, options.virt)[0]
+ except Exception:
+ host_cn = get_typed_class(options.virt, "HostSystem")
+ logger.error(Globals.CIM_ERROR_ENUMERATE % host_cn)
+ return FAIL
try:
rpcservice = rpcs.enumerate(server, classname)
diff -r 375ae129b8e9 -r 6f009d694697 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py Tue Sep 23 04:45:04 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py Wed Sep 24 20:25:24 2008 -0700
@@ -29,6 +29,7 @@ import pywbem
import pywbem
from CimTest.ReturnCodes import PASS
from XenKvmLib import assoc
+from XenKvmLib.common_util import check_sblim
from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS
from XenKvmLib.common_util import get_host_info, try_getinstance
from XenKvmLib.const import do_main
@@ -237,10 +238,15 @@ def main():
conn = assoc.myWBEMConnection('http://%s' % options.ip,
(CIM_USER, CIM_PASS), CIM_NS)
virt = options.virt
- status, hostname, sccname = get_host_info(server, virt)
- if status != PASS:
- logger.error("Problem getting host information")
- return status
+ status, linux_cs = check_sblim(options.ip, options.virt)
+ if status == PASS:
+ hostname = linux_cs.Name
+ sccname = linux_cs.CreationClassName
+ else:
+ status, hostname, sccname = get_host_info(server, virt)
+ if status != PASS:
+ logger.error("Problem getting host information")
+ return status
classname = get_typed_class(virt, 'ResourcePoolConfigurationService')
ret_value = err_invalid_ccname_keyname(conn, classname, hostname, sccname, \
field='INVALID_CCName_KeyName')
16 years, 3 months