[PATCH] [TEST] .2# rebased VirtualSystemSettingDataComponent.02 for XenFV & KVM support
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1208746833 -28800
# Node ID 359a198f236c0733587423009200fcde5c2a02f3
# Parent 0d31dff13ae341fd6515dc844ee98c7b5300b71d
[TEST] .2# rebased VirtualSystemSettingDataComponent.02 for XenFV & KVM support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 0d31dff13ae3 -r 359a198f236c suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Fri Apr 18 17:00:16 2008 +0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Mon Apr 21 11:00:33 2008 +0800
@@ -47,23 +47,21 @@
import sys
from XenKvmLib import enumclass
from VirtLib import utils
-from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all
-from XenKvmLib import test_xml
-from XenKvmLib.test_xml import testxml
from CimTest import Globals
from XenKvmLib import assoc
+from XenKvmLib.test_doms import destroy_and_undefine_all
+from XenKvmLib import vxml
+from XenKvmLib.classes import get_typed_class
from XenKvmLib.rasd import InstId_err
from CimTest.Globals import log_param, logger, do_main
from CimTest.ReturnCodes import PASS, FAIL
-sup_types = ['Xen']
+sup_types = ['Xen', 'XenFV', 'KVM']
test_dom = "VSSDC_dom"
test_vcpus = 1
test_mem = 128
test_mac = "00:11:22:33:44:aa"
-test_disk = 'xvdb'
-VSType = "Xen"
def check_rasd_values(id, exp_id):
try:
@@ -77,7 +75,7 @@
return PASS
-def assoc_values(ip, assoc_info):
+def assoc_values(ip, assoc_info, virt="Xen"):
"""
The association info of
Xen_VirtualSystemSettingDataComponent is
@@ -95,17 +93,22 @@
logger.error("No RASD instances returned")
return FAIL
+ proc_cn = get_typed_class(virt, 'ProcResourceAllocationSettingData')
+ net_cn = get_typed_class(virt, 'NetResourceAllocationSettingData')
+ disk_cn = get_typed_class(virt, 'DiskResourceAllocationSettingData')
+ mem_cn = get_typed_class(virt, 'MemResourceAllocationSettingData')
+
for inst in assoc_info:
- if inst.classname == 'Xen_ProcResourceAllocationSettingData':
+ if inst.classname == proc_cn:
status = check_rasd_values(inst['InstanceID'],
rasd_list['proc_rasd'])
- elif inst.classname == 'Xen_NetResourceAllocationSettingData':
+ elif inst.classname == net_cn:
status = check_rasd_values(inst['InstanceID'],
rasd_list['net_rasd'])
- elif inst.classname == 'Xen_DiskResourceAllocationSettingData':
+ elif inst.classname == disk_cn:
status = check_rasd_values(inst['InstanceID'],
rasd_list['disk_rasd'])
- elif inst.classname == 'Xen_MemResourceAllocationSettingData':
+ elif inst.classname == mem_cn:
status = check_rasd_values(inst['InstanceID'],
rasd_list['mem_rasd'])
else:
@@ -129,32 +132,41 @@
log_param()
destroy_and_undefine_all(options.ip)
- test_xml1 = testxml(test_dom, mem = test_mem, \
- vcpus = test_vcpus, \
- mac = test_mac, \
- disk = test_disk)
- ret = test_domain_function(test_xml1, options.ip, cmd = "create")
+ global test_disk
+ if options.virt == "Xen":
+ test_disk = "xvdb"
+ else:
+ test_disk = "hdb"
+ virt_xml = vxml.get_class(options.virt)
+ cxml = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, disk = test_disk)
+ ret = cxml.create(options.ip)
if not ret:
logger.error("Failed to create the dom: %s", test_dom)
status = FAIL
return status
- instIdval = "%s:%s" % (VSType, test_dom)
+ if options.virt == "Xen" or options.virt == "XenFV":
+ instIdval = "Xen:%s" % test_dom
+ else:
+ instIdval = "KVM:%s" % test_dom
+
try:
assoc_info = assoc.AssociatorNames(options.ip,
- 'Xen_VirtualSystemSettingDataComponent',
- 'Xen_VirtualSystemSettingData',
- InstanceID = instIdval)
- status = assoc_values(options.ip, assoc_info)
+ 'VirtualSystemSettingDataComponent',
+ 'VirtualSystemSettingData',
+ options.virt,
+ InstanceID = instIdval)
+ status = assoc_values(options.ip, assoc_info, options.virt)
except Exception, detail :
logger.error(Globals.CIM_ERROR_ASSOCIATORS,
- 'Xen_VirtualSystemSettingDataComponent')
+ 'VirtualSystemSettingDataComponent')
logger.error("Exception : %s" % detail)
status = FAIL
- test_domain_function(test_dom, options.ip, "destroy")
+ cxml.destroy(options.ip)
+ cxml.undefine(options.ip)
return status
if __name__ == "__main__":
16 years, 7 months
[PATCH] [TEST] branches the test based on the changeset revision
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1209103730 25200
# Node ID 498f88d6e556b82d163ade5c9dc35338c0eb8a14
# Parent 0b8c0247e9b8f8e7c26f25795a580284218c56e8
[TEST] branches the test based on the changeset revision
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 0b8c0247e9b8 -r 498f88d6e556 suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Wed Apr 23 19:56:59 2008 +0530
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Thu Apr 24 23:08:50 2008 -0700
@@ -55,6 +55,7 @@ from XenKvmLib.rasd import InstId_err
from XenKvmLib.rasd import InstId_err
from CimTest.Globals import logger, do_main
from CimTest.ReturnCodes import PASS, FAIL
+from XenKvmLib.const import CIM_REV
sup_types = ['Xen', 'XenFV', 'KVM']
@@ -62,6 +63,7 @@ test_vcpus = 1
test_vcpus = 1
test_mem = 128
test_mac = "00:11:22:33:44:aa"
+rev = 531
def check_rasd_values(id, exp_id):
try:
@@ -88,6 +90,9 @@ def assoc_values(ip, assoc_info, virt="X
"disk_rasd" : '%s/%s' %(test_dom, test_disk),
"mem_rasd" : '%s/%s' %(test_dom, "mem")
}
+ if CIM_REV < rev:
+ rasd_list['proc_rasd'] = '%s/%s' %(test_dom, "0")
+
try:
if len(assoc_info) <= 0:
logger.error("No RASD instances returned")
16 years, 7 months
KVM test report on Fedora 9 (4/21)
by Zhengang Li
Distro: Fedora 9 Beta
Kernel: 2.6.25-0.121.rc5.git4.fc9
Libvirt: 0.4.1-7.fc9
CIMOM: 2.7.0-6.fc9
PyWBEM: 0.6-1
libcmpiutil: 0.3-1.fc9
libvirt-cim: 0.3-4.fc9
cimtest: changeset-102
=========FAIL=============
AllocationCapabilities - 02_alloccap_gi_errs.py: FAIL
"Requested Object could not be found." vs. "Instance not found." error
string issue. The return code is correct.
[Known Issue]
ComputerSystemIndication - 01_created_indication.py: FAIL
Exception : Authentication (or request) Failed!
Previous tests were always on sfcb. Anyone has a successful experience
on pegasus for indication?
ElementAllocatedFromPool - 03_reverse_errs.py: FAIL
exp: ERR_NOT_FOUND(6) - No such instance
ret: ERR_FAILED(1) - Invalid InstanceID or unsupported pool type
ElementConforms - 02_reverse.py: FAIL
Binary rpm provider returns CIM_ERR_INVALID_PARAMETER:
KVM_ElementConformsToProfile on the following query:
wbemain -ac KVM_ElementConformsToProfile
'http://u:p@host:5988/root/virt:KVM_ComputerSystem.CreationClassName="KVM_ComputerSystem",Name="domgst"'
Same wbemcli command gets the correct results on another system using
latest libvirt-cim tree (changeset 533).
ElementConforms - 04_ectp_rev_errs.py: FAIL
All negative checks result in the CIM_ERR_INVALID_PARAMETER. Should be
the same reason as ElementConforms.02
ElementSettingData - 03_esd_assoc_with_rasd_errs.py: FAIL
This one failed on bulk run, but passed on single group run.
I think it's because of un-cleaned domains in previous groups.
HostSystem - 02_hostsystem_to_rasd.py: FAIL
MegaBytes vs. KiloBytes issue on RASD
[Known Issue]
NetworkPort - 03_user_netport.py: FAIL
'user' network type.
[Known Issue]
RASD - 01_verify_rasd_fields.py: FAIL
RASD - 02_enum.py: FAIL
Same as HostSystem.02
ReferencedProfile - 01_verify_refprof.py: FAIL
Binary rpm provider gives 2 results on the following query:
wbemein http://u:p@host:5988/root/interop:KVM_RegisteredProfile
"CIM:DSP1042-SystemVirtualization-1.0.0"
"CIM:DSP1057-VirtualSystem-1.0.0a"
Same wbemcli command gets 5 results on changeset-533 tree on another system.
"CIM:DSP1042-SystemVirtualization-1.0.0"
"CIM:DSP1057-VirtualSystem-1.0.0a"
"CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0"
"CIM:DSP1045-MemoryResourceVirtualization-1.0.0"
"CIM:DSP1081-VirtualSystemMigration-1.0"
This leads to ReferencedProfile's 'ain' query gets only 2 results.
ReferencedProfile - 02_refprofile_errs.py: FAIL
Same as ReferencedProfile.01
ResourceAllocationFromPool - 03_forward_errs.py: FAIL
exp: ERR_NOT_FOUND(6) - No such instance (wrong) - resource pool type
mismatch
ret: ERR_FAILED(1) - Invalid InstanceID or unsupported pool type
ResourcePoolConfigurationService - 03_CreateResourcePool.py: FAIL
ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: FAIL
ResourcePoolConfigurationService -
06_RemoveResourcesFromResourcePool.py: FAIL
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL
CIM_ERR_NOT_SUPPORTED for 03, 04, 06, 07
SettingsDefine - 02_reverse.py: FAIL
ProcRASD.InstanceID is 'domname/0' in binary rpm provider. Test case
expects 'domname/proc' now.
[Know Issue]
VSSD - 04_vssd_to_rasd.py: FAIL
Same as SettingsDefine.02
[Known Issue]
VirtualSystemManagementService - 02_destroysystem.py: FAIL
Test case expect DestroySystem to destroy and to undefine the domain.
Binary rpm provider doesn't. This is fixed in recent provider.
[Known Issue]
VirtualSystemManagementService - 06_addresource.py: FAIL
Invoking AddResource results in 'CIM_ERR_FAILED: Failed to create
domain' error.
Latest provider has the same result. It passed on Xen & XenFV environment.
VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: FAIL
Test case expects CIM_ERR_NOT_FOUND: 'No such instance
(INVALID_InstID_Keyval)'
Binary rpm provider sends CIM_ERR_FAILED: 'Invalid InstanceID'
This passed on latest provider.
===FULL CIMTEST REPORT=PASS(78)=FAIL(22)=SKIP(22)=XFAIL(7)===
AllocationCapabilities - 01_enum.py: PASS
AllocationCapabilities - 02_alloccap_gi_errs.py: FAIL
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: XFAIL Bug: 85769
ComputerSystem - 06_paused_active_suspend.py: XFAIL Bug: 85769
ComputerSystem - 22_define_suspend.py: PASS
ComputerSystem - 23_suspend_suspend.py: SKIP
ComputerSystem - 27_define_suspend_errs.py: SKIP
ComputerSystem - 32_start_reboot.py: SKIP
ComputerSystem - 33_suspend_reboot.py: SKIP
ComputerSystem - 35_start_reset.py: SKIP
ComputerSystem - 40_RSC_start.py: XFAIL Bug: 91410
ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP
ComputerSystem - 42_cs_gi_errs.py: PASS
ComputerSystemIndication - 01_created_indication.py: FAIL
ElementAllocatedFromPool - 01_forward.py: SKIP
ElementAllocatedFromPool - 02_reverse.py: SKIP
ElementAllocatedFromPool - 03_reverse_errs.py: FAIL
ElementAllocatedFromPool - 04_forward_errs.py: XFAIL Bug: 88651
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: FAIL
ElementConforms - 03_ectp_fwd_errs.py: XFAIL Bug: 92642
ElementConforms - 04_ectp_rev_errs.py: FAIL
ElementSettingData - 01_forward.py: PASS
ElementSettingData - 03_esd_assoc_with_rasd_errs.py: FAIL
EnabledLogicalElementCapabilities - 01_enum.py: PASS
EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS
HostSystem - 01_enum.py: PASS
HostSystem - 02_hostsystem_to_rasd.py: FAIL
HostSystem - 03_hs_to_settdefcap.py: PASS
HostSystem - 04_hs_to_EAPF.py: SKIP
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: FAIL
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: SKIP
Profile - 03_rprofile_gi_errs.py: SKIP
RASD - 01_verify_rasd_fields.py: FAIL
RASD - 02_enum.py: FAIL
RASD - 03_rasd_errs.py: PASS
ReferencedProfile - 01_verify_refprof.py: FAIL
ReferencedProfile - 02_refprofile_errs.py: FAIL
ResourceAllocationFromPool - 01_forward.py: PASS
ResourceAllocationFromPool - 02_reverse.py: PASS
ResourceAllocationFromPool - 03_forward_errs.py: FAIL
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: FAIL
ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: FAIL
ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py:
XFAIL Bug: 92173
ResourcePoolConfigurationService -
06_RemoveResourcesFromResourcePool.py: FAIL
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL
SettingsDefine - 01_forward.py: PASS
SettingsDefine - 02_reverse.py: FAIL
SettingsDefine - 03_sds_fwd_errs.py: PASS
SettingsDefine - 04_sds_rev_errs.py: PASS
SettingsDefineCapabilities - 01_forward.py: SKIP
SettingsDefineCapabilities - 03_forward_errs.py: SKIP
SettingsDefineCapabilities - 04_forward_vsmsdata.py: SKIP
SettingsDefineCapabilities - 05_reverse_vsmcap.py: SKIP
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: SKIP
VSSD - 04_vssd_to_rasd.py: FAIL
VirtualSystemManagementCapabilities - 01_enum.py: PASS
VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS
VirtualSystemManagementService - 01_definesystem_name.py: PASS
VirtualSystemManagementService - 02_destroysystem.py: FAIL
VirtualSystemManagementService - 03_definesystem_ess.py: PASS
VirtualSystemManagementService - 04_definesystem_ers.py: PASS
VirtualSystemManagementService - 05_destroysystem_neg.py: PASS
VirtualSystemManagementService - 06_addresource.py: FAIL
VirtualSystemManagementService - 07_addresource_neg.py: PASS
VirtualSystemManagementService - 08_modifyresource.py: XFAIL Bug: 90853
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: SKIP
VirtualSystemSettingDataComponent - 02_reverse.py: SKIP
VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: FAIL
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
--
- Zhengang
16 years, 7 months
[PATCH 0 of 2] Add AC-to-HS association
by Dan Smith
This set adds the association between the HostSystem and the
AllocationCapabilities objects. It also sets the Characteristics
array for the AC reference objects, per the MOF.
16 years, 7 months
[PATCH] Expect diskpool.conf in /etc/libvirt by default
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1209055317 25200
# Node ID 670b3d932d33237f6bd6fb986fda66ea0fa74c9a
# Parent b0cbe4e6fd7d1b2f072d2a3b3c3e3ee99b45ef0f
Expect diskpool.conf in /etc/libvirt by default
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r b0cbe4e6fd7d -r 670b3d932d33 configure.ac
--- a/configure.ac Thu Apr 24 09:06:01 2008 -0700
+++ b/configure.ac Thu Apr 24 09:41:57 2008 -0700
@@ -56,9 +56,9 @@ AC_DEFINE_UNQUOTED(CIM_VIRT_NS, "$CIM_VI
AC_DEFINE_UNQUOTED(CIM_VIRT_NS, "$CIM_VIRT_NS", [Namespace for provider source])
AC_ARG_WITH([diskconfig],
- [ --with-diskconfig=PATH Set config file for disk pool. (default=/tmp/diskpool.conf)],
+ [ --with-diskconfig=PATH Set config file for disk pool. (default=/etc/libvirt/diskpool.conf)],
[DEFINE_DISK_CONFIG($with_diskconfig)],
- [DEFINE_DISK_CONFIG(/tmp/diskpool.conf)]
+ [DEFINE_DISK_CONFIG(/etc/libvirt/diskpool.conf)]
)
AC_ARG_WITH([maxmem],
[ --with-maxmem=FOO Set max memory (KB) for a guest.],
16 years, 7 months
[PATCH] [TEST]updating 01_forward.py to use of the lib fn conf_file(), cleanup_restore() and create_diskpool_file()
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1208960938 -19800
# Node ID 25d9015078055a6f6f3a6975fd3c48c4c0efef24
# Parent 413ef6a636d51ab12f16588268c8debe4d952f05
[TEST]updating 01_forward.py to use of the lib fn conf_file(), cleanup_restore() and create_diskpool_file()
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 413ef6a636d5 -r 25d901507805 suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py
--- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Apr 23 19:56:59 2008 +0530
+++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Apr 23 19:58:58 2008 +0530
@@ -55,135 +55,124 @@ import sys
import sys
import os
from distutils.file_util import move_file
-from VirtLib import utils
from XenKvmLib import assoc
from XenKvmLib import enumclass
-from CimTest import Globals
-from CimTest.Globals import do_main
from XenKvmLib.test_xml import netxml
from XenKvmLib.test_doms import create_vnet
from VirtLib.live import net_list
from CimTest.ReturnCodes import PASS, FAIL, SKIP
+from CimTest.Globals import do_main, platform_sup, logger, \
+CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIATORS
+from XenKvmLib.classes import get_typed_class
+from XenKvmLib.common_util import cleanup_restore, test_dpath, \
+create_diskpool_file
-sup_types = ['Xen']
-
-status = PASS
-test_dpath = "foo"
-disk_file = '/tmp/diskpool.conf'
-back_disk_file = disk_file + "." + "SSDC_01_forward"
diskid = "%s/%s" % ("DiskPool", test_dpath)
memid = "%s/%s" % ("MemoryPool", 0)
procid = "%s/%s" % ("ProcessorPool", 0)
-def conf_file():
- """
- Creating diskpool.conf file.
- """
- try:
- f = open(disk_file, 'w')
- f.write('%s %s' % (test_dpath, '/'))
- f.close()
- except Exception,detail:
- Globals.logger.error("Exception: %s", detail)
- status = SKIP
- sys.exit(status)
-
-def clean_up_restore():
- """
- Restoring back the original diskpool.conf
- file.
- """
- try:
- if os.path.exists(back_disk_file):
- os.remove(disk_file)
- move_file(back_disk_file, disk_file)
- except Exception, detail:
- Globals.logger.error("Exception: %s", detail)
- status = SKIP
- sys.exit(status)
-
-
-def get_or_bail(ip, id, pool_class):
+def get_or_bail(virt, ip, id, pool_class):
"""
Getinstance for the CLass and return instance on success, otherwise
exit after cleanup_restore .
"""
key_list = { 'InstanceID' : id }
-
+ status = PASS
try:
- instance = enumclass.getInstance(ip, pool_class, key_list)
+ instance = enumclass.getInstance(ip, pool_class, key_list, virt)
except Exception, detail:
- Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE, '%s' % pool_class)
- Globals.logger.error("Exception: %s", detail)
- clean_up_restore()
+ logger.error(CIM_ERROR_GETINSTANCE, '%s' % pool_class)
+ logger.error("Exception: %s", detail)
+ cleanup_restore()
status = FAIL
sys.exit(status)
return instance
-def init_list(disk, mem, net, proc):
+def init_list(virt, disk, mem, net, proc):
"""
Creating the lists that will be used for comparisons.
"""
instlist = [
- disk.InstanceID, \
- mem.InstanceID, \
- net.InstanceID, \
- proc.InstanceID
- ]
+ disk.InstanceID,
+ mem.InstanceID,
+ net.InstanceID,
+ proc.InstanceID
+ ]
cllist = [
- "Xen_DiskResourceAllocationSettingData", \
- "Xen_MemResourceAllocationSettingData", \
- "Xen_NetResourceAllocationSettingData", \
- "Xen_ProcResourceAllocationSettingData"
+ get_typed_class(virt, "DiskResourceAllocationSettingData"),
+ get_typed_class(virt, "MemResourceAllocationSettingData"),
+ get_typed_class(virt, "NetResourceAllocationSettingData"),
+ get_typed_class(virt, "ProcResourceAllocationSettingData")
]
rtype = {
- "Xen_DiskResourceAllocationSettingData" : 17, \
- "Xen_MemResourceAllocationSettingData" : 4, \
- "Xen_NetResourceAllocationSettingData" : 10, \
- "Xen_ProcResourceAllocationSettingData" : 3
+ get_typed_class(virt, "DiskResourceAllocationSettingData") : 17,
+ get_typed_class(virt, "MemResourceAllocationSettingData") : 4,
+ get_typed_class(virt, "NetResourceAllocationSettingData") : 10,
+ get_typed_class(virt, "ProcResourceAllocationSettingData") : 3
}
rangelist = {
- "Default" : 0, \
- "Minimum" : 1, \
- "Maximum" : 2, \
+ "Default" : 0,
+ "Minimum" : 1,
+ "Maximum" : 2,
"Increment" : 3
}
return instlist, cllist, rtype, rangelist
-def print_error(index, fieldname, assoc_info, exp_value):
- ret_value = assoc_info[index][fieldname]
- Globals.logger.error("%s Mismatch", fieldname)
- Globals.logger.error("Returned %s instead of %s", ret_value, exp_value)
+def print_error(fieldname, ret_value, exp_value):
+ logger.error("%s Mismatch", fieldname)
+ logger.error("Returned %s instead of %s", ret_value, exp_value)
-@do_main(sup_types)
+def verify_rasd_fields(loop, assoc_info, cllist, rtype, rangelist):
+ for inst in assoc_info:
+ if inst.classname != cllist[loop]:
+ print_error("Classname", inst.classname, cllist[loop])
+ return FAIL
+ if inst['ResourceType'] != rtype[cllist[loop]]:
+ print_error("ResourceType", inst['ResourceType'],
+ rtype[cllist[loop]])
+ return FAIL
+ ppolicy = inst['PropertyPolicy']
+ if ppolicy != 0 and ppolicy != 1:
+ print_error("PropertyPolicy", inst['PropertyPolicy'], ppolicy)
+ return FAIL
+ vrole = inst['ValueRole']
+ if vrole < 0 or vrole > 4:
+ print_error("ValueRole", inst['ValueRole'], vrole)
+ return FAIL
+ insid = inst['InstanceID']
+ vrange = rangelist[insid]
+ if vrange != inst['ValueRange']:
+ print_error("ValueRange", inst['ValueRange'], vrange)
+ return FAIL
+ return PASS
+
+
+@do_main(platform_sup)
def main():
options = main.options
- global status
-
- cn = 'Xen_AllocationCapabilities'
+
+ cn = get_typed_class(options.virt, "AllocationCapabilities")
loop = 0
server = options.ip
+ virt = options.virt
- # Taking care of already existing diskconf file
- # Creating diskpool.conf if it does not exist
- # Otherwise backing up the prev file and create new one.
- os.system("rm -f %s" % back_disk_file )
- if not (os.path.exists(disk_file)):
- conf_file()
- else:
- move_file(disk_file, back_disk_file)
- conf_file()
+ # Verify DiskPool on machine
+ status = create_diskpool_file()
+ if status != PASS:
+ return status
try :
- disk = get_or_bail(server, id=diskid, \
- pool_class=enumclass.Xen_DiskPool)
- mem = get_or_bail(server, id = memid, \
- pool_class=enumclass.Xen_MemoryPool)
- vir_network = net_list(server)
+ disk_cn = eval("enumclass." + get_typed_class(options.virt,
+ "DiskPool"))
+ disk = get_or_bail(virt, server, id=diskid, pool_class=disk_cn)
+ mem_cn = eval("enumclass." + get_typed_class(options.virt,
+ "MemoryPool"))
+ mem = get_or_bail(virt, server, id = memid, pool_class=mem_cn)
+ vir_network = net_list(server, virt)
if len(vir_network) > 0:
test_network = vir_network[0]
else:
@@ -192,68 +181,46 @@ def main():
net_xml, bridge = netxml(server, bridgename, test_network)
ret = create_vnet(server, net_xml)
if not ret:
- Globals.logger.error("Failed to create the Virtual Network '%s'", \
- test_network)
+ logger.error("Failed to create Virtual Network '%s'",
+ test_network)
return SKIP
netid = "%s/%s" % ("NetworkPool", test_network)
- net = get_or_bail(server, id = netid, \
- pool_class=enumclass.Xen_NetworkPool)
- proc = get_or_bail(server, id = procid, \
- pool_class=enumclass.Xen_ProcessorPool)
+ net_cn = eval("enumclass." + get_typed_class(options.virt,
+ "NetworkPool"))
+ net = get_or_bail(virt, server, id = netid, pool_class=net_cn)
+ proc_cn = eval("enumclass." + get_typed_class(options.virt,
+ "ProcessorPool"))
+ proc = get_or_bail(virt, server, id = procid, pool_class=proc_cn)
except Exception, detail:
- Globals.logger.error("Exception: %s", detail)
- clean_up_restore()
+ logger.error("Exception: %s", detail)
+ cleanup_restore()
status = FAIL
return status
- instlist, cllist, rtype, rangelist = init_list(disk, mem, net, proc )
-
+ instlist, cllist, rtype, rangelist = init_list(virt, disk, mem, net, proc )
+ assoc_cname = get_typed_class(virt, "SettingsDefineCapabilities")
for instid in sorted(instlist):
try:
- assoc_info = assoc.Associators(options.ip, \
- "Xen_SettingsDefineCapabilities",
- cn,
- InstanceID = instid)
+ assoc_info = assoc.Associators(options.ip, assoc_cname, cn,
+ InstanceID = instid, virt=virt)
if len(assoc_info) != 4:
- Globals.logger.error("Xen_SettingsDefineCapabilities returned \
-%i ResourcePool objects instead 4", len(assoc_info))
+ logger.error("%s returned \
+%i ResourcePool objects instead 4", assoc_cname, len(assoc_info))
status = FAIL
break
- for i in range(len(assoc_info)):
- if assoc_info[i].classname != cllist[loop]:
- print_error(i, "Classname", assoc_info, cllist[loop])
- status = FAIL
- if assoc_info[i]['ResourceType'] != rtype[cllist[loop]]:
- print_error(i, "ResourceType", assoc_info, rtype[cllist[loop]])
- status = FAIL
- ppolicy = assoc_info[i]['PropertyPolicy']
- if ppolicy != 0 and ppolicy != 1:
- print_error(i, "PropertyPolicy", assoc_info, ppolicy)
- status = FAIL
- vrole = assoc_info[i]['ValueRole']
- if vrole < 0 or vrole > 4:
- print_error(i, "ValueRole", assoc_info, vrole)
- status = FAIL
- insid = assoc_info[i]['InstanceID']
- vrange = rangelist[insid]
- if vrange != assoc_info[i]['ValueRange']:
- print_error(i, "ValueRange", assoc_info, vrange)
- status = FAIL
- if status != 0:
- break
- if status != 0:
+ status = verify_rasd_fields(loop, assoc_info, cllist, rtype, rangelist)
+ if status != PASS:
break
else:
loop = loop + 1
except Exception, detail:
- Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, \
- 'Xen_SettingsDefineCapabilities')
- Globals.logger.error("Exception: %s", detail)
- clean_up_restore()
+ logger.error(CIM_ERROR_ASSOCIATORS, assoc_cname)
+ logger.error("Exception: %s", detail)
+ cleanup_restore()
status = FAIL
- clean_up_restore()
+ cleanup_restore()
return status
if __name__ == "__main__":
16 years, 7 months
[PATCH] [TEST]updating 02_alloccap_gi_errs.py to use of the lib fn conf_file(), cleanup_restore() and create_diskpool_file()
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1208960532 -19800
# Node ID 91d726c978e3fcc360774c34293a67166bc3b9e6
# Parent 70e13e2a2abf57a666c8e4d5029d06ecd017ea69
[TEST]updating 02_alloccap_gi_errs.py to use of the lib fn conf_file(), cleanup_restore() and create_diskpool_file()
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 70e13e2a2abf -r 91d726c978e3 suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py
--- a/suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py Wed Apr 23 19:48:18 2008 +0530
+++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py Wed Apr 23 19:52:12 2008 +0530
@@ -62,10 +62,9 @@ from XenKvmLib.test_doms import create_v
from XenKvmLib.test_doms import create_vnet
from CimTest.Globals import do_main, platform_sup
from XenKvmLib.classes import get_typed_class
+from XenKvmLib.common_util import cleanup_restore, test_dpath, \
+create_diskpool_file
-test_dpath = "foo"
-disk_file = '/tmp/diskpool.conf'
-back_disk_file = disk_file + "." + "alloccap_err"
diskid = "%s/%s" % ("DiskPool", test_dpath)
memid = "%s/%s" % ("MemoryPool", 0)
procid = "%s/%s" % ("ProcessorPool", 0)
@@ -75,46 +74,19 @@ expr_values = {
"invalid_instid_keyvalue" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND, \
'desc' : 'Instance not found' }
}
-def conf_file():
- """
- Creating diskpool.conf file.
- """
- try:
- f = open(disk_file, 'w')
- f.write('%s %s' % (test_dpath, '/'))
- f.close()
- except Exception,detail:
- logger.error("Exception: %s", detail)
- status = SKIP
- sys.exit(status)
-
-def clean_up_restore():
- """
- Restoring back the original diskpool.conf
- file.
- """
- try:
- if os.path.exists(back_disk_file):
- os.remove(disk_file)
- move_file(back_disk_file, disk_file)
- except Exception, detail:
- logger.error("Exception: %s", detail)
- status = SKIP
- sys.exit(status)
@do_main(platform_sup)
def main():
options = main.options
- status = PASS
server = options.ip
- os.system("rm -f %s" % back_disk_file )
- if not (os.path.exists(disk_file)):
- conf_file()
- else:
- move_file(disk_file, back_disk_file)
- conf_file()
+ # Verify DiskPool on machine
+ status = create_diskpool_file()
+ if status != PASS:
+ return status
+
+ #Verify the virtual Network on the machine
vir_network = net_list(server)
if len(vir_network) > 0:
test_network = vir_network[0]
@@ -127,6 +99,7 @@ def main():
logger.error("Failed to create the Virtual Network '%s'", \
test_network)
return SKIP
+
net_instid = 'NetworkPool/%s' %test_network
instid_list = ['ProcessorPool/0', 'MemoryPool/0', 'DiskPool/foo', net_instid]
conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS)
@@ -151,7 +124,7 @@ def main():
status = ret_value
if status != PASS:
break
- clean_up_restore()
+ cleanup_restore()
return status
if __name__ == "__main__":
sys.exit(main())
16 years, 7 months
[PATCH] [TEST] Rebasing and adding conf_file(), clean_up_restore(), create_diskpool_file() to library
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1209036114 -19800
# Node ID 8067f7e535408298176f2cabf7b038fa36767cff
# Parent dd59f067c3831b252f30f5e46f8baff5016129a3
[TEST] Rebasing and adding conf_file(), clean_up_restore(), create_diskpool_file() to library.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r dd59f067c383 -r 8067f7e53540 suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Wed Apr 23 15:28:53 2008 +0530
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Thu Apr 24 16:51:54 2008 +0530
@@ -21,6 +21,7 @@
#
import os
import pywbem
+from distutils.file_util import move_file
from XenKvmLib.test_xml import *
from XenKvmLib.test_doms import *
from XenKvmLib import vsms
@@ -31,6 +32,10 @@ from XenKvmLib.classes import get_typed_
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger, log_param, CIM_ERROR_ENUMERATE
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
+
+test_dpath = "foo"
+disk_file = '/tmp/diskpool.conf'
+back_disk_file = disk_file + "." + "backup"
def print_field_error(fieldname, ret_value, exp_value):
logger.error("%s Mismatch", fieldname)
@@ -234,3 +239,50 @@ def profile_init_list():
}
return profiles
+
+def conf_file():
+ """
+ Creating diskpool.conf file.
+ """
+ status = PASS
+ try:
+ f = open(disk_file, 'w')
+ f.write('%s %s' % (test_dpath, '/'))
+ f.close()
+ except Exception,detail:
+ logger.error("Exception: %s", detail)
+ status = SKIP
+ if status != PASS:
+ logger.error("Creation of Disk Conf file Failed")
+ return status
+
+
+def cleanup_restore():
+ """
+ Restoring back the original diskpool.conf
+ file.
+ """
+ status = PASS
+ try:
+ if os.path.exists(back_disk_file):
+ os.remove(disk_file)
+ move_file(back_disk_file, disk_file)
+ except Exception, detail:
+ logger.error("Exception: %s", detail)
+ status = SKIP
+ if status != PASS:
+ logger.error("Failed to restore the original Disk Conf file")
+ return status
+
+def create_diskpool_file():
+ # Taking care of already existing diskconf file
+ # Creating diskpool.conf if it does not exist
+ # Otherwise backing up the prev file and create new one.
+ if (os.path.exists(back_disk_file)):
+ os.unlink(back_disk_file)
+
+ if (os.path.exists(disk_file)):
+ move_file(disk_file, back_disk_file)
+
+ return conf_file()
+
16 years, 7 months
Re: [Libvir] PATCH: Re-structuring the libvirt.org website content
by Daniel Veillard
Oops, sorry resent, I forgot to Cc: the CIM list,
On Sun, Apr 20, 2008 at 07:47:08PM +0100, Daniel P. Berrange wrote:
In a nutshell, fantastic, I like this a lot !
> - There is a page describing all applications using libvirt as their API
>
> http://berrange.fedorapeople.org/libvirt/website-demo/apps.html
>
> Shout if you have more applications you want added to this page...
We need to add the CIM provider for libvirt http://libvirt.org/CIM/
CC'ing the CIM mailing-list as they will be impacted by this, an update
of their site would make sense to keep the harmony.
> - Linked to the new wiki site, and added seemless integration betweeen
> the wiki navigation & styling, and the main site.
adding the Wiki is important, thanks, but I don't see the integration,
c.f. http://wiki.libvirt.org/page/Main_Page , what did I missed ?
> - There is a new updated CSS graphic design - I can't take credit for
> that - it is from mockups done by one of the Red Hat designers.
I like the design, just a couple of nits, the fonts are a bit small
and when going to the API page it looks a bit bizarre.
> Again, if all this is too much to take in, just go straight to the sitemap
> page on the demo site and click around...
For the API page, I would be a bit conservative, first because I hate when
URLs for documentation break, second because it's part of the search index
under the API, and as such the entries from the PHP or the database would have
to be shuffled if you break the pages.
Another thing to verify is that the indexer which fills up the database
on libvirt.org/xmlsoft.org for the search works well with the new set of pages,
I think that's okay but will have to be tested once we change the main site,
still I like this a lot :-)
Daniel
--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
16 years, 7 months