[PATCH] [TEST] #3 Remove old enumerate and getInstance and update device related tc
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1224814635 25200
# Node ID a4aa517fe9263494afc0183e172dac0ac4615056
# Parent ddd578da75558cb4f029354ac5ff9350a3dd5cf6
[TEST] #3 Remove old enumerate and getInstance and update device related tc
Updats from 2 to 3:
Stay CIM_Instance class
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r ddd578da7555 -r a4aa517fe926 suites/libvirt-cim/cimtest/LogicalDisk/01_disk.py
--- a/suites/libvirt-cim/cimtest/LogicalDisk/01_disk.py Thu Oct 23 05:38:42 2008 -0700
+++ b/suites/libvirt-cim/cimtest/LogicalDisk/01_disk.py Thu Oct 23 19:17:15 2008 -0700
@@ -26,7 +26,7 @@
import sys
import pywbem
from VirtLib import utils
-from XenKvmLib import devices
+from XenKvmLib.enumclass import GetInstance
from XenKvmLib.classes import get_typed_class
from XenKvmLib.vxml import XenXML, KVMXML, get_class
from CimTest.Globals import logger
@@ -48,13 +48,13 @@
vsxml.cim_define(options.ip)
devid = "%s/%s" % (test_dom, test_dev)
+ disk = get_typed_class(options.virt, "LogicalDisk")
key_list = { 'DeviceID' : devid,
- 'CreationClassName' : get_typed_class(options.virt, "LogicalDisk"),
+ 'CreationClassName' : disk,
'SystemName' : test_dom,
'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem")
}
- dev = eval('devices.' + get_typed_class(options.virt, "LogicalDisk"))(options.ip, key_list)
-
+ dev = GetInstance(options.ip, disk, key_list)
status = 0
if dev.Name != test_dev:
diff -r ddd578da7555 -r a4aa517fe926 suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py
--- a/suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py Thu Oct 23 05:38:42 2008 -0700
+++ b/suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py Thu Oct 23 19:17:15 2008 -0700
@@ -125,7 +125,7 @@
import pywbem
from VirtLib import utils
from XenKvmLib import assoc
-from XenKvmLib import devices
+from XenKvmLib.enumclass import GetInstance
from XenKvmLib.common_util import try_getinstance
from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib.classes import get_typed_class
@@ -133,7 +133,7 @@
from CimTest.ReturnCodes import PASS, FAIL
from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS, \
CIM_ERROR_GETINSTANCE
-from XenKvmLib.const import do_main, get_provider_version
+from XenKvmLib.const import do_main
sup_types = ['Xen', 'KVM', 'XenFV']
@@ -198,7 +198,7 @@
'SystemName' : test_dom,
'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem")
}
- disk = eval('devices.' + get_typed_class(options.virt, "LogicalDisk"))(options.ip, key_list)
+ disk = GetInstance(options.ip, classname, key_list)
except Exception,detail:
logger.error(CIM_ERROR_GETINSTANCE, classname)
logger.error("Exception: %s", detail)
@@ -206,13 +206,6 @@
global conn
conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS)
-
- rev, changeset = get_provider_version(options.virt, options.ip)
- if rev < 682:
- old_ret = { 'rc' : pywbem.CIM_ERR_NOT_FOUND,
- 'desc' : "No such instance (INVALID_DevID_Keyvalue)"
- }
- expr_values["invalid_devid_keyvalue"] = old_ret
global name_val
name_val = [
diff -r ddd578da7555 -r a4aa517fe926 suites/libvirt-cim/cimtest/Memory/01_memory.py
--- a/suites/libvirt-cim/cimtest/Memory/01_memory.py Thu Oct 23 05:38:42 2008 -0700
+++ b/suites/libvirt-cim/cimtest/Memory/01_memory.py Thu Oct 23 19:17:15 2008 -0700
@@ -26,7 +26,7 @@
import pywbem
from VirtLib import utils
from VirtLib import live
-from XenKvmLib import devices
+from XenKvmLib.enumclass import GetInstance
from XenKvmLib.classes import get_typed_class
from XenKvmLib.vxml import XenXML, KVMXML, get_class
from CimTest.Globals import logger
@@ -46,12 +46,13 @@
alloc_mem = int(vsxml.xml_get_mem())
devid = "%s/mem" % test_dom
+ mem_class = get_typed_class(options.virt, "Memory")
key_list = { 'DeviceID' : devid,
- 'CreationClassName' : get_typed_class(options.virt, "Memory"),
+ 'CreationClassName' : mem_class,
'SystemName' : test_dom,
'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem")
}
- dev = eval('devices.' + get_typed_class(options.virt, "Memory"))(options.ip, key_list)
+ dev = GetInstance(options.ip, mem_class, key_list)
status = 0
diff -r ddd578da7555 -r a4aa517fe926 suites/libvirt-cim/cimtest/NetworkPort/01_netport.py
--- a/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Thu Oct 23 05:38:42 2008 -0700
+++ b/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Thu Oct 23 19:17:15 2008 -0700
@@ -33,7 +33,7 @@
import pywbem
from VirtLib import utils
from VirtLib import live
-from XenKvmLib import devices
+from XenKvmLib.enumclass import GetInstance
from XenKvmLib.classes import get_typed_class
from XenKvmLib.vxml import XenXML, KVMXML, get_class
from CimTest.Globals import logger
@@ -67,16 +67,17 @@
vsxml.cim_define(options.ip)
devid = "%s/%s" % (test_dom, test_mac)
+ net_class = get_typed_class(options.virt, "NetworkPort")
key_list = { 'DeviceID' : devid,
- 'CreationClassName' : get_typed_class(options.virt, "NetworkPort"),
+ 'CreationClassName' : net_class,
'SystemName' : test_dom,
'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem")
}
dev = None
-
+
try:
- dev = eval('devices.' + get_typed_class(options.virt, "NetworkPort"))(options.ip, key_list)
+ dev = GetInstance(options.ip, net_class, key_list)
except Exception, detail:
logger.error("Exception: %s" % detail)
diff -r ddd578da7555 -r a4aa517fe926 suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py
--- a/suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py Thu Oct 23 05:38:42 2008 -0700
+++ b/suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py Thu Oct 23 19:17:15 2008 -0700
@@ -28,7 +28,7 @@
import sys
import pywbem
from XenKvmLib import const
-from XenKvmLib import devices
+from XenKvmLib.enumclass import GetInstance
from XenKvmLib.vxml import KVMXML
from CimTest.Globals import logger
from XenKvmLib.const import do_main
@@ -57,7 +57,7 @@
dev = None
try:
- dev = devices.KVM_NetworkPort(options.ip, key_list)
+ dev = GetInstance(options.ip, 'KVM_NetworkPort', key_list)
except Exception, detail:
logger.error("Exception: %s" % detail)
cxml.undefine(options.ip)
diff -r ddd578da7555 -r a4aa517fe926 suites/libvirt-cim/cimtest/Processor/01_processor.py
--- a/suites/libvirt-cim/cimtest/Processor/01_processor.py Thu Oct 23 05:38:42 2008 -0700
+++ b/suites/libvirt-cim/cimtest/Processor/01_processor.py Thu Oct 23 19:17:15 2008 -0700
@@ -26,7 +26,7 @@
import pywbem
from VirtLib import utils
from VirtLib import live
-from XenKvmLib import devices
+from XenKvmLib.enumclass import GetInstance
from XenKvmLib.test_xml import testxml
from XenKvmLib.classes import get_typed_class
from XenKvmLib.vxml import XenXML, KVMXML, get_class
@@ -49,6 +49,7 @@
# Processor instance enumerate need the domain to be active
domlist = live.active_domain_list(options.ip, options.virt)
+ proc_class = get_typed_class(options.virt, "Processor")
if test_dom not in domlist:
status = FAIL
logger.error("Domain not started, we're not able to check vcpu")
@@ -56,12 +57,12 @@
for i in range(0, test_vcpus):
devid = "%s/%s" % (test_dom, i)
key_list = { 'DeviceID' : devid,
- 'CreationClassName' : get_typed_class(options.virt, "Processor"),
+ 'CreationClassName' : proc_class,
'SystemName' : test_dom,
'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem")
}
try:
- dev = eval(('devices.' + get_typed_class(options.virt, 'Processor')))(options.ip, key_list)
+ dev = GetInstance(options.ip, proc_class, key_list)
if dev.DeviceID == devid:
logger.info("Checked device %s" % devid)
else:
diff -r ddd578da7555 -r a4aa517fe926 suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py
--- a/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Thu Oct 23 05:38:42 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Thu Oct 23 19:17:15 2008 -0700
@@ -30,7 +30,7 @@
from VirtLib import utils
from XenKvmLib import vxml
from XenKvmLib import assoc
-from XenKvmLib import devices
+from XenKvmLib.enumclass import GetInstance
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from XenKvmLib.const import do_main
@@ -99,8 +99,8 @@
exp_inst_id_val[cn] = key_list['DeviceID']
try:
- dev_class = devices.get_class(get_typed_class(options.virt, cn))
- devlist[cn] = dev_class(options.ip, key_list)
+ dev_class = get_typed_class(options.virt, cn)
+ devlist[cn] = GetInstance(options.ip, dev_class, key_list)
logelelst[cn] = devlist[cn].DeviceID
except Exception, detail:
print_error(cn, detail)
diff -r ddd578da7555 -r a4aa517fe926 suites/libvirt-cim/lib/XenKvmLib/devices.py
--- a/suites/libvirt-cim/lib/XenKvmLib/devices.py Thu Oct 23 05:38:42 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py Thu Oct 23 19:17:15 2008 -0700
@@ -40,63 +40,6 @@
def __str__(self):
print self.inst.items()
-class CIM_LogicalDevice(CIM_Instance):
- def __init__(self, server, keys):
- conn = pywbem.WBEMConnection('http://%s' % server,
- (Globals.CIM_USER, Globals.CIM_PASS),
- Globals.CIM_NS)
-
- try:
- classname = self.__class__.__name__
- ref = CIMInstanceName(classname,
- keybindings=keys)
- inst = conn.GetInstance(ref)
- except pywbem.CIMError, arg:
- raise arg
-
- CIM_Instance.__init__(self, inst)
-
-class CIM_LogicalDisk(CIM_LogicalDevice):
- pass
-
-class CIM_NetworkPort(CIM_LogicalDevice):
- pass
-
-class CIM_Memory(CIM_LogicalDevice):
- pass
-
-class CIM_Processor(CIM_LogicalDevice):
- pass
-
-class Xen_LogicalDisk(CIM_LogicalDisk):
- pass
-
-class KVM_LogicalDisk(CIM_LogicalDisk):
- pass
-
-class LXC_LogicalDisk(CIM_LogicalDisk):
- pass
-
-class Xen_NetworkPort(CIM_NetworkPort):
- pass
-
-class KVM_NetworkPort(CIM_NetworkPort):
- pass
-
-class Xen_Memory(CIM_Memory):
- pass
-
-class KVM_Memory(CIM_Memory):
- pass
-
-class LXC_Memory(CIM_Memory):
- pass
-
-class Xen_Processor(CIM_Processor):
- pass
-
-class KVM_Processor(CIM_Processor):
- pass
def get_class(classname):
return eval(classname)
diff -r ddd578da7555 -r a4aa517fe926 suites/libvirt-cim/lib/XenKvmLib/enumclass.py
--- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Thu Oct 23 05:38:42 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Thu Oct 23 19:17:15 2008 -0700
@@ -30,332 +30,6 @@
from CimTest import Globals, CimExt
from VirtLib import utils
from CimTest.Globals import logger
-
-class CIM_MyClass(CIM_Instance):
- def __init__(self, server, keys):
- conn = pywbem.WBEMConnection('http://%s' % server,
- (Globals.CIM_USER, Globals.CIM_PASS),
- Globals.CIM_NS)
-
- try:
- classname = self.__class__.__name__
- ref = CIMInstanceName(classname,
- keybindings=keys)
- inst = conn.GetInstance(ref)
- except pywbem.CIMError, arg:
- raise arg
-
- self.conn = conn
- self.inst = inst
- self.ref = ref
-
- CIM_Instance.__init__(self, inst)
-
- def __invoke(self, method, params):
- try:
- return self.conn.InvokeMethod(method,
- self.ref,
- **params)
- except pywbem.CIMError, arg:
- print 'InvokeMethod(%s): %s' % (method, arg[1])
- raise
-
- def __getattr__(self, attr):
- if self.inst.has_key(attr):
- return self.inst[attr]
- else:
- return CimExt._Method(self.__invoke, attr)
-
-class Linux_ComputerSystem(CIM_Instance):
- def __init__(self, server, keys):
- conn = pywbem.WBEMConnection('http://%s' % server,
- (Globals.CIM_USER, Globals.CIM_PASS),
- Globals.CIM_NS)
-
- try:
- classname = self.__class__.__name__
- ref = CIMInstanceName(classname,
- keybindings=keys)
- inst = conn.GetInstance(ref)
- except pywbem.CIMError, arg:
- raise arg
-
- CIM_Instance.__init__(self, inst)
-
-
-class CIM_ComputerSystem(CIM_MyClass):
- pass
-
-class CIM_System(CIM_MyClass):
- pass
-
-class CIM_AllocationCapabilities(CIM_MyClass):
- pass
-
-class CIM_RegisteredProfile(CIM_MyClass):
- pass
-
-class CIM_LogicalDevice(CIM_MyClass):
- pass
-
-class CIM_ResourcePool(CIM_MyClass):
- pass
-
-class CIM_VirtualSystemManagementCapabilities(CIM_MyClass):
- pass
-
-class CIM_ResourcePoolConfigurationCapabilities(CIM_MyClass):
- pass
-
-class CIM_EnabledLogicalElementCapabilities(CIM_MyClass):
- pass
-
-class Virt_VirtualSystemMigrationCapabilities(CIM_MyClass):
- pass
-
-class CIM_VirtualSystemMigrationSettingData(CIM_MyClass):
- pass
-
-class CIM_VirtualSystemSnapshotService(CIM_MyClass):
- pass
-
-class CIM_VirtualSystemSnapshotServiceCapabilities(CIM_MyClass):
- pass
-
-class CIM_NetResourceAllocationSettingData(CIM_MyClass):
- pass
-
-class CIM_MemResourceAllocationSettingData(CIM_MyClass):
- pass
-
-class CIM_ProcResourceAllocationSettingData(CIM_MyClass):
- pass
-
-class CIM_DiskResourceAllocationSettingData(CIM_MyClass):
- pass
-
-class Xen_ComputerSystem(CIM_ComputerSystem):
- pass
-
-class KVM_ComputerSystem(CIM_ComputerSystem):
- pass
-
-class LXC_ComputerSystem(CIM_ComputerSystem):
- pass
-
-class Xen_HostSystem(CIM_System):
- pass
-
-class KVM_HostSystem(CIM_System):
- pass
-
-class LXC_HostSystem(CIM_System):
- pass
-
-class Xen_MigrationJob(CIM_MyClass):
- pass
-
-class Xen_RegisteredProfile(CIM_RegisteredProfile):
- pass
-
-class KVM_RegisteredProfile(CIM_RegisteredProfile):
- pass
-
-class LXC_RegisteredProfile(CIM_RegisteredProfile):
- pass
-
-class Xen_VirtualSystemSettingData(CIM_MyClass):
- pass
-
-class KVM_VirtualSystemSettingData(CIM_MyClass):
- pass
-
-class LXC_VirtualSystemSettingData(CIM_MyClass):
- pass
-
-class Xen_LogicalDisk(CIM_LogicalDevice):
- pass
-
-class KVM_LogicalDisk(CIM_LogicalDevice):
- pass
-
-class Xen_Memory(CIM_LogicalDevice):
- pass
-
-class KVM_Memory(CIM_LogicalDevice):
- pass
-
-class LXC_Memory(CIM_LogicalDevice):
- pass
-
-class LXC_Memory(CIM_LogicalDevice):
- pass
-
-class Xen_Processor(CIM_LogicalDevice):
- pass
-
-class KVM_Processor(CIM_LogicalDevice):
- pass
-
-class Xen_NetworkPort(CIM_LogicalDevice):
- pass
-
-class KVM_NetworkPort(CIM_LogicalDevice):
- pass
-
-class Xen_MemoryPool(CIM_ResourcePool):
- pass
-
-class KVM_MemoryPool(CIM_ResourcePool):
- pass
-
-class LXC_MemoryPool(CIM_ResourcePool):
- pass
-
-class Xen_ProcessorPool(CIM_ResourcePool):
- pass
-
-class KVM_ProcessorPool(CIM_ResourcePool):
- pass
-
-class LXC_ProcessorPool(CIM_ResourcePool):
- pass
-
-class Xen_VirtualSystemManagementCapabilities(CIM_VirtualSystemManagementCapabilities):
- pass
-
-class KVM_VirtualSystemManagementCapabilities(CIM_VirtualSystemManagementCapabilities):
- pass
-
-class LXC_VirtualSystemManagementCapabilities(CIM_VirtualSystemManagementCapabilities):
- pass
-
-class Xen_ResourcePoolConfigurationCapabilities(CIM_ResourcePoolConfigurationCapabilities):
- pass
-
-class KVM_ResourcePoolConfigurationCapabilities(CIM_ResourcePoolConfigurationCapabilities):
- pass
-
-class LXC_ResourcePoolConfigurationCapabilities(CIM_ResourcePoolConfigurationCapabilities):
- pass
-
-class Xen_EnabledLogicalElementCapabilities(CIM_EnabledLogicalElementCapabilities):
- pass
-
-class KVM_EnabledLogicalElementCapabilities(CIM_EnabledLogicalElementCapabilities):
- pass
-
-class LXC_EnabledLogicalElementCapabilities(CIM_EnabledLogicalElementCapabilities):
- pass
-
-class Xen_DiskPool(CIM_ResourcePool):
- pass
-
-class KVM_DiskPool(CIM_ResourcePool):
- pass
-
-class LXC_DiskPool(CIM_ResourcePool):
- pass
-
-class Xen_NetworkPool(CIM_ResourcePool):
- pass
-
-class KVM_NetworkPool(CIM_ResourcePool):
- pass
-
-class LXC_NetworkPool(CIM_ResourcePool):
- pass
-
-class Xen_VirtualSystemMigrationCapabilities(Virt_VirtualSystemMigrationCapabilities):
- pass
-
-class KVM_VirtualSystemMigrationCapabilities(Virt_VirtualSystemMigrationCapabilities):
- pass
-
-class LXC_VirtualSystemMigrationCapabilities(Virt_VirtualSystemMigrationCapabilities):
- pass
-
-class Xen_AllocationCapabilities(CIM_AllocationCapabilities):
- pass
-
-class KVM_AllocationCapabilities(CIM_AllocationCapabilities):
- pass
-
-class LXC_AllocationCapabilities(CIM_AllocationCapabilities):
- pass
-
-class Xen_VirtualSystemMigrationSettingData(CIM_VirtualSystemMigrationSettingData):
- pass
-
-class KVM_VirtualSystemMigrationSettingData(CIM_VirtualSystemMigrationSettingData):
- pass
-
-class LXC_VirtualSystemMigrationSettingData(CIM_VirtualSystemMigrationSettingData):
- pass
-
-class Xen_VirtualSystemSnapshotService(CIM_VirtualSystemSnapshotService):
- pass
-
-class KVM_VirtualSystemSnapshotService(CIM_VirtualSystemSnapshotService):
- pass
-
-class LXC_VirtualSystemSnapshotService(CIM_VirtualSystemSnapshotService):
- pass
-
-class Xen_VirtualSystemSnapshotServiceCapabilities(CIM_VirtualSystemSnapshotServiceCapabilities):
- pass
-
-class KVM_VirtualSystemSnapshotServiceCapabilities(CIM_VirtualSystemSnapshotServiceCapabilities):
- pass
-
-class LXC_VirtualSystemSnapshotServiceCapabilities(CIM_VirtualSystemSnapshotServiceCapabilities):
- pass
-
-class Xen_MemResourceAllocationSettingData(CIM_MemResourceAllocationSettingData):
- pass
-
-class KVM_MemResourceAllocationSettingData(CIM_MemResourceAllocationSettingData):
- pass
-
-class LXC_MemResourceAllocationSettingData(CIM_MemResourceAllocationSettingData):
- pass
-
-class Xen_NetResourceAllocationSettingData(CIM_NetResourceAllocationSettingData):
- pass
-
-class KVM_NetResourceAllocationSettingData(CIM_NetResourceAllocationSettingData):
- pass
-
-class Xen_ProcResourceAllocationSettingData(CIM_ProcResourceAllocationSettingData):
- pass
-
-class KVM_ProcResourceAllocationSettingData(CIM_ProcResourceAllocationSettingData):
- pass
-
-class Xen_DiskResourceAllocationSettingData(CIM_DiskResourceAllocationSettingData):
- pass
-
-class KVM_DiskResourceAllocationSettingData(CIM_DiskResourceAllocationSettingData):
- pass
-
-class KVM_VirtualSystemMigrationService(CIM_MyClass):
- pass
-
-class Xen_VirtualSystemMigrationService(CIM_MyClass):
- pass
-
-class LXC_VirtualSystemMigrationService(CIM_MyClass):
- pass
-
-class Xen_VirtualSystemManagementService(CIM_MyClass):
- pass
-
-class KVM_VirtualSystemManagementService(CIM_MyClass):
- pass
-
-class LXC_VirtualSystemManagementService(CIM_MyClass):
- pass
-
class CIM_CimtestClass(CIM_Instance):
16 years, 1 month
Request for all in one instllation page
by Toshifumi Fujimura
Hello.
I am installing Cimtest environment from Libvirt-CIM.
Is there good documentation which discribes from Libvirt-CIM,
OpenPegasus and Cimtest?
At this moment, these documentations are distributed.
I hope setup pages are united.
Thanks.
Toshifumi Fujimura.
16 years, 1 month
Problem in running libvirt-cim test suite
by srinivas k
Hi,
I trying to install libvirt-cim in my ubuntu-xen-3.2.1 machine. I am able to
install all dependencies and libvirt-cim , but when I run cimtest which has
given in libvirt.org, I am getting following error message
* Starting test suite: libvirt-cim
ERROR - Failed to create Virtual Network 'cimtest-networkpool'
Unable to create network pool cimtest-networkpool
Please check your environment.*
Is there any special networking setup is require to run cimtest.
Any help would be appreciated. Apologies if this topic has been covered
already. I can't find it anywhere using Google
Thanks,
seenu.
16 years, 2 months
[PATCH] [TEST] #2 Adding new tc 02_enum_crscap.py to verify ConsoleRedirectionServiceCapabilities fields
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1224835478 25200
# Node ID 0f340004e1cd48f5ede60a68283a850ae60c9ebe
# Parent 1f9f2d2c410e9dfb53bda9befe230475fcacf159
[TEST] #2 Adding new tc 02_enum_crscap.py to verify ConsoleRedirectionServiceCapabilities fields.
Tested on KVM and LXC with current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 1f9f2d2c410e -r 0f340004e1cd suites/libvirt-cim/cimtest/RedirectionService/02_enum_crscap.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/RedirectionService/02_enum_crscap.py Fri Oct 24 01:04:38 2008 -0700
@@ -0,0 +1,81 @@
+#!/usr/bin/python
+#
+# Copyright 2008 IBM Corp.
+#
+# Authors:
+# Deepti B. Kalakeri <dkalaker(a)in.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# This test case is used to verify the ConsoleRedirectionServiceCapabilities
+# properties in detail.
+#
+# Date : 22-10-2008
+#
+
+import sys
+from VirtLib.live import domain_list
+from XenKvmLib.enumclass import EnumInstances
+from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
+from XenKvmLib.classes import get_typed_class
+from XenKvmLib.const import do_main
+from CimTest.ReturnCodes import PASS, FAIL
+
+SHAREMODESUPP = 3
+
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
+@do_main(sup_types)
+def main():
+ virt = main.options.virt
+ server = main.options.ip
+ cname = 'ConsoleRedirectionServiceCapabilities'
+ cap_name = 'ConsoleRedirectionCapabilities'
+ classname = get_typed_class(virt, cname)
+ try:
+ crs = EnumInstances(server, classname)
+
+ if len(crs) != 1:
+ logger.error("'%s' returned %i records, expected 1",
+ classname, len(crs))
+ return FAIL
+
+ crs_val = crs[0]
+ if crs_val.InstanceID != cap_name:
+ logger.error("InstanceID Mismatch")
+ logger.error("Got '%s', Expected '%s'", crs_val.InstanceID,
+ cap_name)
+ return FAIL
+
+ if crs_val.ElementName != cap_name:
+ logger.error("ElementName Mismatch")
+ logger.error("Got '%s', Expected '%s'", crs_val.ElementName,
+ cap_name)
+ return FAIL
+
+ mode_supp = crs_val.SharingModeSupported[0]
+ if mode_supp != SHAREMODESUPP:
+ logger.error("SharingModeSupported Mismatch")
+ logger.error("Got '%s', Expected '%s'", mode_supp, SHAREMODESUPP)
+ return FAIL
+
+ except Exception, detail:
+ logger.error(CIM_ERROR_ENUMERATE, classname)
+ logger.error("Exception: %s", detail)
+ return FAIL
+
+ return PASS
+
+if __name__ == "__main__":
+ sys.exit(main())
16 years, 2 months
[PATCH] [TEST] Adding new tc 02_enum_crscap.py to verify ConsoleRedirectionServiceCapabilities fields
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1224748128 25200
# Node ID 2c77be4e041a0a8669d234d6219e1f207b6d4ed5
# Parent 73be202634a52607d5ab54ca62a2706ec7aca23b
[TEST] Adding new tc 02_enum_crscap.py to verify ConsoleRedirectionServiceCapabilities fields.
Tested on KVM with current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 73be202634a5 -r 2c77be4e041a suites/libvirt-cim/cimtest/RedirectionService/02_enum_crscap.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/RedirectionService/02_enum_crscap.py Thu Oct 23 00:48:48 2008 -0700
@@ -0,0 +1,73 @@
+#!/usr/bin/python
+#
+# Copyright 2008 IBM Corp.
+#
+# Authors:
+# Deepti B. Kalakeri <dkalaker(a)in.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# This test case is used to verify the ConsoleRedirectionServiceCapabilities
+# properties in detail.
+#
+# Date : 22-10-2008
+#
+
+import sys
+from VirtLib.live import domain_list
+from XenKvmLib.enumclass import EnumInstances
+from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
+from XenKvmLib.classes import get_typed_class
+from XenKvmLib.const import do_main
+from CimTest.ReturnCodes import PASS, FAIL
+
+sup_types = ['Xen', 'KVM', 'XenFV']
+@do_main(sup_types)
+def main():
+ virt = main.options.virt
+ server = main.options.ip
+ cname = 'ConsoleRedirectionServiceCapabilities'
+ cap_name = 'ConsoleRedirectionCapabilities'
+ classname = get_typed_class(virt, cname)
+ try:
+ crs = EnumInstances(server, classname)
+ crs_val = crs[0]
+ if crs_val.InstanceID != cap_name:
+ logger.error("InstanceID Mismatch")
+ logger.error("Got '%s', Expected '%s'", crs_val.InstanceID,
+ cap_name)
+ return FAIL
+
+ if crs_val.ElementName != cap_name:
+ logger.error("ElementName Mismatch")
+ logger.error("Got '%s', Expected '%s'", crs_val.ElementName,
+ cap_name)
+ return FAIL
+
+ mode_supp = crs_val.SharingModeSupported[0]
+ if mode_supp != 3:
+ logger.error("SharingModeSupported Mismatch")
+ logger.error("Got '%s', Expected '%s'", mode_supp, 3)
+ return FAIL
+
+ except Exception, detail:
+ logger.error(CIM_ERROR_ENUMERATE, classname)
+ logger.error("Exception: %s", detail)
+ return FAIL
+
+ return PASS
+
+if __name__ == "__main__":
+ sys.exit(main())
16 years, 2 months
[PATCH] [TEST] Addring new tc 01_enum_crs.py to verify CRS fields
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1224746643 25200
# Node ID 73be202634a52607d5ab54ca62a2706ec7aca23b
# Parent 868aa0f5175568c5752787c1fcbd2b1df4001aad
[TEST] Addring new tc 01_enum_crs.py to verify CRS fields.
Assumption :
The value of MaxConcurrentEnabledSAPs = 2* nof of guest on the machine.
This needs to be updated
Tested on KVM with current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 868aa0f51755 -r 73be202634a5 suites/libvirt-cim/cimtest/RedirectionService/01_enum_crs.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/RedirectionService/01_enum_crs.py Thu Oct 23 00:24:03 2008 -0700
@@ -0,0 +1,80 @@
+#!/usr/bin/python
+#
+# Copyright 2008 IBM Corp.
+#
+# Authors:
+# Deepti B. Kalakeri <dkalaker(a)in.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# This test case is used to verify the RedirectionService
+# properties in detail.
+#
+# Date : 22-10-2008
+#
+
+import sys
+from VirtLib.live import domain_list
+from XenKvmLib.enumclass import EnumInstances
+from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
+from XenKvmLib.classes import get_typed_class
+from XenKvmLib.const import do_main
+from CimTest.ReturnCodes import PASS, FAIL
+from XenKvmLib.common_util import get_host_info
+
+sup_types = ['Xen', 'KVM', 'XenFV']
+@do_main(sup_types)
+def main():
+ virt = main.options.virt
+ server = main.options.ip
+ cname = 'ConsoleRedirectionService'
+ classname = get_typed_class(virt, cname)
+ try:
+ crs = EnumInstances(server, classname)
+ except Exception, detail:
+ logger.error(CIM_ERROR_ENUMERATE, classname)
+ logger.error("Exception: %s", detail)
+ return FAIL
+
+ status, host_name, host_cn = get_host_info(server, virt)
+ if status != PASS:
+ return status
+
+ max_con_saps = 2 * len(domain_list(server, virt))
+ crs_list = {
+ 'ElementName' : cname,
+ 'SystemCreationClassName' : host_cn,
+ 'SystemName' : host_name,
+ 'CreationClassName' : classname,
+ 'Name' : cname,
+ 'RedirectionServiceType' : [3],
+ 'SharingMode' : 3,
+ 'EnabledState' : 2,
+ 'EnabledDefault' : 2,
+ 'RequestedState' : 12,
+ 'MaxConcurrentEnabledSAPs': max_con_saps
+ }
+
+ crs_val = crs[0]
+ for k, exp_val in crs_list.iteritems():
+ res_val = eval("crs_val." + k)
+ if res_val != exp_val:
+ logger.error("'%s' Mismatch", k)
+ logger.error("Expected '%s', Got '%s'", exp_val, res_val)
+ return FAIL
+ return PASS
+
+if __name__ == "__main__":
+ sys.exit(main())
16 years, 2 months
[PATCH] [TEST] #2 Adding new tc 01_enum_crs.py to verify CRS fields
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1224835317 25200
# Node ID 1f9f2d2c410e9dfb53bda9befe230475fcacf159
# Parent ddd578da75558cb4f029354ac5ff9350a3dd5cf6
[TEST] #2 Adding new tc 01_enum_crs.py to verify CRS fields.
Tested on KVM and LXC with current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r ddd578da7555 -r 1f9f2d2c410e suites/libvirt-cim/cimtest/RedirectionService/01_enum_crs.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/RedirectionService/01_enum_crs.py Fri Oct 24 01:01:57 2008 -0700
@@ -0,0 +1,88 @@
+#!/usr/bin/python
+#
+# Copyright 2008 IBM Corp.
+#
+# Authors:
+# Deepti B. Kalakeri <dkalaker(a)in.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# This test case is used to verify the RedirectionService
+# properties in detail.
+#
+# Date : 22-10-2008
+#
+
+import sys
+from VirtLib.live import domain_list
+from XenKvmLib.enumclass import EnumInstances
+from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
+from XenKvmLib.classes import get_typed_class
+from XenKvmLib.const import do_main
+from CimTest.ReturnCodes import PASS, FAIL
+from XenKvmLib.common_util import get_host_info
+
+SHAREMODE = 3
+REDIRECTION_SER_TYPE = 3
+MAX_SAP_SESSIONS = 65535
+
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
+@do_main(sup_types)
+def main():
+ virt = main.options.virt
+ server = main.options.ip
+
+ status, host_name, host_cn = get_host_info(server, virt)
+ if status != PASS:
+ return status
+
+ cname = 'ConsoleRedirectionService'
+ classname = get_typed_class(virt, cname)
+ crs_list = {
+ 'ElementName' : cname,
+ 'SystemCreationClassName' : host_cn,
+ 'SystemName' : host_name,
+ 'CreationClassName' : classname,
+ 'Name' : cname,
+ 'RedirectionServiceType' : [REDIRECTION_SER_TYPE],
+ 'SharingMode' : SHAREMODE,
+ 'EnabledState' : 2,
+ 'EnabledDefault' : 2,
+ 'RequestedState' : 12,
+ 'MaxConcurrentEnabledSAPs': MAX_SAP_SESSIONS
+ }
+
+ try:
+ crs = EnumInstances(server, classname)
+ except Exception, detail:
+ logger.error(CIM_ERROR_ENUMERATE, classname)
+ logger.error("Exception: %s", detail)
+ return FAIL
+
+ if len(crs) != 1:
+ logger.error("'%s' returned %i records, expected 1", classname, len(crs))
+ return FAIL
+
+ crs_val = crs[0]
+ for k, exp_val in crs_list.iteritems():
+ res_val = eval("crs_val." + k)
+ if res_val != exp_val:
+ logger.error("'%s' Mismatch", k)
+ logger.error("Expected '%s', Got '%s'", exp_val, res_val)
+ return FAIL
+ return PASS
+
+if __name__ == "__main__":
+ sys.exit(main())
16 years, 2 months
[PATCH] [TEST]#2 Remove old enumerate and getInstance and update device related tc
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1224744576 25200
# Node ID 50b2dcc3ef1eabcaf09858ad18b78ba1c4e96031
# Parent 35ff687c818e5c4d38e152aef0f35ca22a4956cf
[TEST]#2 Remove old enumerate and getInstance and update device related tc
This patch will result SystemDevice - 01_forward.py fails, due to the remove of CIM_*, follow patch will fix it.
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 35ff687c818e -r 50b2dcc3ef1e suites/libvirt-cim/cimtest/LogicalDisk/01_disk.py
--- a/suites/libvirt-cim/cimtest/LogicalDisk/01_disk.py Wed Oct 22 02:08:26 2008 -0700
+++ b/suites/libvirt-cim/cimtest/LogicalDisk/01_disk.py Wed Oct 22 23:49:36 2008 -0700
@@ -26,7 +26,7 @@
import sys
import pywbem
from VirtLib import utils
-from XenKvmLib import devices
+from XenKvmLib.enumclass import GetInstance
from XenKvmLib.classes import get_typed_class
from XenKvmLib.vxml import XenXML, KVMXML, get_class
from CimTest.Globals import logger
@@ -48,13 +48,13 @@
vsxml.cim_define(options.ip)
devid = "%s/%s" % (test_dom, test_dev)
+ disk = get_typed_class(options.virt, "LogicalDisk")
key_list = { 'DeviceID' : devid,
- 'CreationClassName' : get_typed_class(options.virt, "LogicalDisk"),
+ 'CreationClassName' : disk,
'SystemName' : test_dom,
'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem")
}
- dev = eval('devices.' + get_typed_class(options.virt, "LogicalDisk"))(options.ip, key_list)
-
+ dev = GetInstance(options.ip, disk, key_list)
status = 0
if dev.Name != test_dev:
diff -r 35ff687c818e -r 50b2dcc3ef1e suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py
--- a/suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py Wed Oct 22 02:08:26 2008 -0700
+++ b/suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py Wed Oct 22 23:49:36 2008 -0700
@@ -125,7 +125,7 @@
import pywbem
from VirtLib import utils
from XenKvmLib import assoc
-from XenKvmLib import devices
+from XenKvmLib.enumclass import GetInstance
from XenKvmLib.common_util import try_getinstance
from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib.classes import get_typed_class
@@ -198,7 +198,7 @@
'SystemName' : test_dom,
'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem")
}
- disk = eval('devices.' + get_typed_class(options.virt, "LogicalDisk"))(options.ip, key_list)
+ disk = GetInstance(options.ip, classname, key_list)
except Exception,detail:
logger.error(CIM_ERROR_GETINSTANCE, classname)
logger.error("Exception: %s", detail)
diff -r 35ff687c818e -r 50b2dcc3ef1e suites/libvirt-cim/cimtest/Memory/01_memory.py
--- a/suites/libvirt-cim/cimtest/Memory/01_memory.py Wed Oct 22 02:08:26 2008 -0700
+++ b/suites/libvirt-cim/cimtest/Memory/01_memory.py Wed Oct 22 23:49:36 2008 -0700
@@ -26,7 +26,7 @@
import pywbem
from VirtLib import utils
from VirtLib import live
-from XenKvmLib import devices
+from XenKvmLib.enumclass import GetInstance
from XenKvmLib.classes import get_typed_class
from XenKvmLib.vxml import XenXML, KVMXML, get_class
from CimTest.Globals import logger
@@ -46,12 +46,13 @@
alloc_mem = int(vsxml.xml_get_mem())
devid = "%s/mem" % test_dom
+ mem_class = get_typed_class(options.virt, "Memory")
key_list = { 'DeviceID' : devid,
- 'CreationClassName' : get_typed_class(options.virt, "Memory"),
+ 'CreationClassName' : mem_class,
'SystemName' : test_dom,
'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem")
}
- dev = eval('devices.' + get_typed_class(options.virt, "Memory"))(options.ip, key_list)
+ dev = GetInstance(options.ip, mem_class, key_list)
status = 0
diff -r 35ff687c818e -r 50b2dcc3ef1e suites/libvirt-cim/cimtest/NetworkPort/01_netport.py
--- a/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Wed Oct 22 02:08:26 2008 -0700
+++ b/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Wed Oct 22 23:49:36 2008 -0700
@@ -33,7 +33,7 @@
import pywbem
from VirtLib import utils
from VirtLib import live
-from XenKvmLib import devices
+from XenKvmLib.enumclass import GetInstance
from XenKvmLib.classes import get_typed_class
from XenKvmLib.vxml import XenXML, KVMXML, get_class
from CimTest.Globals import logger
@@ -67,16 +67,17 @@
vsxml.cim_define(options.ip)
devid = "%s/%s" % (test_dom, test_mac)
+ net_class = get_typed_class(options.virt, "NetworkPort")
key_list = { 'DeviceID' : devid,
- 'CreationClassName' : get_typed_class(options.virt, "NetworkPort"),
+ 'CreationClassName' : net_class,
'SystemName' : test_dom,
'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem")
}
dev = None
-
+
try:
- dev = eval('devices.' + get_typed_class(options.virt, "NetworkPort"))(options.ip, key_list)
+ dev = GetInstance(options.ip, net_class, key_list)
except Exception, detail:
logger.error("Exception: %s" % detail)
diff -r 35ff687c818e -r 50b2dcc3ef1e suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py
--- a/suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py Wed Oct 22 02:08:26 2008 -0700
+++ b/suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py Wed Oct 22 23:49:36 2008 -0700
@@ -28,7 +28,7 @@
import sys
import pywbem
from XenKvmLib import const
-from XenKvmLib import devices
+from XenKvmLib.enumclass import GetInstance
from XenKvmLib.vxml import KVMXML
from CimTest.Globals import logger
from XenKvmLib.const import do_main
@@ -57,7 +57,7 @@
dev = None
try:
- dev = devices.KVM_NetworkPort(options.ip, key_list)
+ dev = GetInstance(options.ip, 'KVM_NetworkPort', key_list)
except Exception, detail:
logger.error("Exception: %s" % detail)
cxml.undefine(options.ip)
diff -r 35ff687c818e -r 50b2dcc3ef1e suites/libvirt-cim/cimtest/Processor/01_processor.py
--- a/suites/libvirt-cim/cimtest/Processor/01_processor.py Wed Oct 22 02:08:26 2008 -0700
+++ b/suites/libvirt-cim/cimtest/Processor/01_processor.py Wed Oct 22 23:49:36 2008 -0700
@@ -26,7 +26,7 @@
import pywbem
from VirtLib import utils
from VirtLib import live
-from XenKvmLib import devices
+from XenKvmLib.enumclass import GetInstance
from XenKvmLib.test_xml import testxml
from XenKvmLib.classes import get_typed_class
from XenKvmLib.vxml import XenXML, KVMXML, get_class
@@ -49,6 +49,7 @@
# Processor instance enumerate need the domain to be active
domlist = live.active_domain_list(options.ip, options.virt)
+ proc_class = get_typed_class(options.virt, "Processor")
if test_dom not in domlist:
status = FAIL
logger.error("Domain not started, we're not able to check vcpu")
@@ -56,12 +57,12 @@
for i in range(0, test_vcpus):
devid = "%s/%s" % (test_dom, i)
key_list = { 'DeviceID' : devid,
- 'CreationClassName' : get_typed_class(options.virt, "Processor"),
+ 'CreationClassName' : proc_class,
'SystemName' : test_dom,
'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem")
}
try:
- dev = eval(('devices.' + get_typed_class(options.virt, 'Processor')))(options.ip, key_list)
+ dev = GetInstance(options.ip, proc_class, key_list)
if dev.DeviceID == devid:
logger.info("Checked device %s" % devid)
else:
diff -r 35ff687c818e -r 50b2dcc3ef1e suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py
--- a/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Wed Oct 22 02:08:26 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Wed Oct 22 23:49:36 2008 -0700
@@ -30,7 +30,7 @@
from VirtLib import utils
from XenKvmLib import vxml
from XenKvmLib import assoc
-from XenKvmLib import devices
+from XenKvmLib.enumclass import GetInstance
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from XenKvmLib.const import do_main
@@ -99,8 +99,8 @@
exp_inst_id_val[cn] = key_list['DeviceID']
try:
- dev_class = devices.get_class(get_typed_class(options.virt, cn))
- devlist[cn] = dev_class(options.ip, key_list)
+ dev_class = get_typed_class(options.virt, cn)
+ devlist[cn] = GetInstance(options.ip, dev_class, key_list)
logelelst[cn] = devlist[cn].DeviceID
except Exception, detail:
print_error(cn, detail)
diff -r 35ff687c818e -r 50b2dcc3ef1e suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Wed Oct 22 02:08:26 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Wed Oct 22 23:49:36 2008 -0700
@@ -31,7 +31,6 @@
from CimTest import Globals
from XenKvmLib import enumclass
from pywbem.cim_obj import CIMInstanceName
-from XenKvmLib.devices import CIM_Instance
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, \
CIM_ERROR_GETINSTANCE
diff -r 35ff687c818e -r 50b2dcc3ef1e suites/libvirt-cim/lib/XenKvmLib/devices.py
--- a/suites/libvirt-cim/lib/XenKvmLib/devices.py Wed Oct 22 02:08:26 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py Wed Oct 22 23:49:36 2008 -0700
@@ -40,63 +40,6 @@
def __str__(self):
print self.inst.items()
-class CIM_LogicalDevice(CIM_Instance):
- def __init__(self, server, keys):
- conn = pywbem.WBEMConnection('http://%s' % server,
- (Globals.CIM_USER, Globals.CIM_PASS),
- Globals.CIM_NS)
-
- try:
- classname = self.__class__.__name__
- ref = CIMInstanceName(classname,
- keybindings=keys)
- inst = conn.GetInstance(ref)
- except pywbem.CIMError, arg:
- raise arg
-
- CIM_Instance.__init__(self, inst)
-
-class CIM_LogicalDisk(CIM_LogicalDevice):
- pass
-
-class CIM_NetworkPort(CIM_LogicalDevice):
- pass
-
-class CIM_Memory(CIM_LogicalDevice):
- pass
-
-class CIM_Processor(CIM_LogicalDevice):
- pass
-
-class Xen_LogicalDisk(CIM_LogicalDisk):
- pass
-
-class KVM_LogicalDisk(CIM_LogicalDisk):
- pass
-
-class LXC_LogicalDisk(CIM_LogicalDisk):
- pass
-
-class Xen_NetworkPort(CIM_NetworkPort):
- pass
-
-class KVM_NetworkPort(CIM_NetworkPort):
- pass
-
-class Xen_Memory(CIM_Memory):
- pass
-
-class KVM_Memory(CIM_Memory):
- pass
-
-class LXC_Memory(CIM_Memory):
- pass
-
-class Xen_Processor(CIM_Processor):
- pass
-
-class KVM_Processor(CIM_Processor):
- pass
def get_class(classname):
return eval(classname)
diff -r 35ff687c818e -r 50b2dcc3ef1e suites/libvirt-cim/lib/XenKvmLib/enumclass.py
--- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Wed Oct 22 02:08:26 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Wed Oct 22 23:49:36 2008 -0700
@@ -25,340 +25,13 @@
#
import pywbem
from pywbem.cim_obj import CIMInstanceName
-from XenKvmLib.devices import CIM_Instance
from XenKvmLib.classes import get_typed_class
from CimTest import Globals, CimExt
from VirtLib import utils
from CimTest.Globals import logger
-class CIM_MyClass(CIM_Instance):
- def __init__(self, server, keys):
- conn = pywbem.WBEMConnection('http://%s' % server,
- (Globals.CIM_USER, Globals.CIM_PASS),
- Globals.CIM_NS)
- try:
- classname = self.__class__.__name__
- ref = CIMInstanceName(classname,
- keybindings=keys)
- inst = conn.GetInstance(ref)
- except pywbem.CIMError, arg:
- raise arg
-
- self.conn = conn
- self.inst = inst
- self.ref = ref
-
- CIM_Instance.__init__(self, inst)
-
- def __invoke(self, method, params):
- try:
- return self.conn.InvokeMethod(method,
- self.ref,
- **params)
- except pywbem.CIMError, arg:
- print 'InvokeMethod(%s): %s' % (method, arg[1])
- raise
-
- def __getattr__(self, attr):
- if self.inst.has_key(attr):
- return self.inst[attr]
- else:
- return CimExt._Method(self.__invoke, attr)
-
-class Linux_ComputerSystem(CIM_Instance):
- def __init__(self, server, keys):
- conn = pywbem.WBEMConnection('http://%s' % server,
- (Globals.CIM_USER, Globals.CIM_PASS),
- Globals.CIM_NS)
-
- try:
- classname = self.__class__.__name__
- ref = CIMInstanceName(classname,
- keybindings=keys)
- inst = conn.GetInstance(ref)
- except pywbem.CIMError, arg:
- raise arg
-
- CIM_Instance.__init__(self, inst)
-
-
-class CIM_ComputerSystem(CIM_MyClass):
- pass
-
-class CIM_System(CIM_MyClass):
- pass
-
-class CIM_AllocationCapabilities(CIM_MyClass):
- pass
-
-class CIM_RegisteredProfile(CIM_MyClass):
- pass
-
-class CIM_LogicalDevice(CIM_MyClass):
- pass
-
-class CIM_ResourcePool(CIM_MyClass):
- pass
-
-class CIM_VirtualSystemManagementCapabilities(CIM_MyClass):
- pass
-
-class CIM_ResourcePoolConfigurationCapabilities(CIM_MyClass):
- pass
-
-class CIM_EnabledLogicalElementCapabilities(CIM_MyClass):
- pass
-
-class Virt_VirtualSystemMigrationCapabilities(CIM_MyClass):
- pass
-
-class CIM_VirtualSystemMigrationSettingData(CIM_MyClass):
- pass
-
-class CIM_VirtualSystemSnapshotService(CIM_MyClass):
- pass
-
-class CIM_VirtualSystemSnapshotServiceCapabilities(CIM_MyClass):
- pass
-
-class CIM_NetResourceAllocationSettingData(CIM_MyClass):
- pass
-
-class CIM_MemResourceAllocationSettingData(CIM_MyClass):
- pass
-
-class CIM_ProcResourceAllocationSettingData(CIM_MyClass):
- pass
-
-class CIM_DiskResourceAllocationSettingData(CIM_MyClass):
- pass
-
-class Xen_ComputerSystem(CIM_ComputerSystem):
- pass
-
-class KVM_ComputerSystem(CIM_ComputerSystem):
- pass
-
-class LXC_ComputerSystem(CIM_ComputerSystem):
- pass
-
-class Xen_HostSystem(CIM_System):
- pass
-
-class KVM_HostSystem(CIM_System):
- pass
-
-class LXC_HostSystem(CIM_System):
- pass
-
-class Xen_MigrationJob(CIM_MyClass):
- pass
-
-class Xen_RegisteredProfile(CIM_RegisteredProfile):
- pass
-
-class KVM_RegisteredProfile(CIM_RegisteredProfile):
- pass
-
-class LXC_RegisteredProfile(CIM_RegisteredProfile):
- pass
-
-class Xen_VirtualSystemSettingData(CIM_MyClass):
- pass
-
-class KVM_VirtualSystemSettingData(CIM_MyClass):
- pass
-
-class LXC_VirtualSystemSettingData(CIM_MyClass):
- pass
-
-class Xen_LogicalDisk(CIM_LogicalDevice):
- pass
-
-class KVM_LogicalDisk(CIM_LogicalDevice):
- pass
-
-class Xen_Memory(CIM_LogicalDevice):
- pass
-
-class KVM_Memory(CIM_LogicalDevice):
- pass
-
-class LXC_Memory(CIM_LogicalDevice):
- pass
-
-class LXC_Memory(CIM_LogicalDevice):
- pass
-
-class Xen_Processor(CIM_LogicalDevice):
- pass
-
-class KVM_Processor(CIM_LogicalDevice):
- pass
-
-class Xen_NetworkPort(CIM_LogicalDevice):
- pass
-
-class KVM_NetworkPort(CIM_LogicalDevice):
- pass
-
-class Xen_MemoryPool(CIM_ResourcePool):
- pass
-
-class KVM_MemoryPool(CIM_ResourcePool):
- pass
-
-class LXC_MemoryPool(CIM_ResourcePool):
- pass
-
-class Xen_ProcessorPool(CIM_ResourcePool):
- pass
-
-class KVM_ProcessorPool(CIM_ResourcePool):
- pass
-
-class LXC_ProcessorPool(CIM_ResourcePool):
- pass
-
-class Xen_VirtualSystemManagementCapabilities(CIM_VirtualSystemManagementCapabilities):
- pass
-
-class KVM_VirtualSystemManagementCapabilities(CIM_VirtualSystemManagementCapabilities):
- pass
-
-class LXC_VirtualSystemManagementCapabilities(CIM_VirtualSystemManagementCapabilities):
- pass
-
-class Xen_ResourcePoolConfigurationCapabilities(CIM_ResourcePoolConfigurationCapabilities):
- pass
-
-class KVM_ResourcePoolConfigurationCapabilities(CIM_ResourcePoolConfigurationCapabilities):
- pass
-
-class LXC_ResourcePoolConfigurationCapabilities(CIM_ResourcePoolConfigurationCapabilities):
- pass
-
-class Xen_EnabledLogicalElementCapabilities(CIM_EnabledLogicalElementCapabilities):
- pass
-
-class KVM_EnabledLogicalElementCapabilities(CIM_EnabledLogicalElementCapabilities):
- pass
-
-class LXC_EnabledLogicalElementCapabilities(CIM_EnabledLogicalElementCapabilities):
- pass
-
-class Xen_DiskPool(CIM_ResourcePool):
- pass
-
-class KVM_DiskPool(CIM_ResourcePool):
- pass
-
-class LXC_DiskPool(CIM_ResourcePool):
- pass
-
-class Xen_NetworkPool(CIM_ResourcePool):
- pass
-
-class KVM_NetworkPool(CIM_ResourcePool):
- pass
-
-class LXC_NetworkPool(CIM_ResourcePool):
- pass
-
-class Xen_VirtualSystemMigrationCapabilities(Virt_VirtualSystemMigrationCapabilities):
- pass
-
-class KVM_VirtualSystemMigrationCapabilities(Virt_VirtualSystemMigrationCapabilities):
- pass
-
-class LXC_VirtualSystemMigrationCapabilities(Virt_VirtualSystemMigrationCapabilities):
- pass
-
-class Xen_AllocationCapabilities(CIM_AllocationCapabilities):
- pass
-
-class KVM_AllocationCapabilities(CIM_AllocationCapabilities):
- pass
-
-class LXC_AllocationCapabilities(CIM_AllocationCapabilities):
- pass
-
-class Xen_VirtualSystemMigrationSettingData(CIM_VirtualSystemMigrationSettingData):
- pass
-
-class KVM_VirtualSystemMigrationSettingData(CIM_VirtualSystemMigrationSettingData):
- pass
-
-class LXC_VirtualSystemMigrationSettingData(CIM_VirtualSystemMigrationSettingData):
- pass
-
-class Xen_VirtualSystemSnapshotService(CIM_VirtualSystemSnapshotService):
- pass
-
-class KVM_VirtualSystemSnapshotService(CIM_VirtualSystemSnapshotService):
- pass
-
-class LXC_VirtualSystemSnapshotService(CIM_VirtualSystemSnapshotService):
- pass
-
-class Xen_VirtualSystemSnapshotServiceCapabilities(CIM_VirtualSystemSnapshotServiceCapabilities):
- pass
-
-class KVM_VirtualSystemSnapshotServiceCapabilities(CIM_VirtualSystemSnapshotServiceCapabilities):
- pass
-
-class LXC_VirtualSystemSnapshotServiceCapabilities(CIM_VirtualSystemSnapshotServiceCapabilities):
- pass
-
-class Xen_MemResourceAllocationSettingData(CIM_MemResourceAllocationSettingData):
- pass
-
-class KVM_MemResourceAllocationSettingData(CIM_MemResourceAllocationSettingData):
- pass
-
-class LXC_MemResourceAllocationSettingData(CIM_MemResourceAllocationSettingData):
- pass
-
-class Xen_NetResourceAllocationSettingData(CIM_NetResourceAllocationSettingData):
- pass
-
-class KVM_NetResourceAllocationSettingData(CIM_NetResourceAllocationSettingData):
- pass
-
-class Xen_ProcResourceAllocationSettingData(CIM_ProcResourceAllocationSettingData):
- pass
-
-class KVM_ProcResourceAllocationSettingData(CIM_ProcResourceAllocationSettingData):
- pass
-
-class Xen_DiskResourceAllocationSettingData(CIM_DiskResourceAllocationSettingData):
- pass
-
-class KVM_DiskResourceAllocationSettingData(CIM_DiskResourceAllocationSettingData):
- pass
-
-class KVM_VirtualSystemMigrationService(CIM_MyClass):
- pass
-
-class Xen_VirtualSystemMigrationService(CIM_MyClass):
- pass
-
-class LXC_VirtualSystemMigrationService(CIM_MyClass):
- pass
-
-class Xen_VirtualSystemManagementService(CIM_MyClass):
- pass
-
-class KVM_VirtualSystemManagementService(CIM_MyClass):
- pass
-
-class LXC_VirtualSystemManagementService(CIM_MyClass):
- pass
-
-
-
-class CIM_CimtestClass(CIM_Instance):
+class CIM_CimtestClass:
def __init__(self, host, ref):
conn = pywbem.WBEMConnection('http://%s' % host,
@@ -373,7 +46,6 @@
self.inst = inst
self.ref = ref
- CIM_Instance.__init__(self, inst)
def __invoke(self, method, params):
try:
16 years, 2 months
[PATCH] [TEST] Fixing the 01_forward.py tc of HostedResourcePool
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1224765522 25200
# Node ID 695725ffeb3d3b13c8d02e8c9ef9aa6e094a64fa
# Parent 35ff687c818e5c4d38e152aef0f35ca22a4956cf
[TEST] Fixing the 01_forward.py tc of HostedResourcePool .
Tested on KVM with F9 rpm.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 35ff687c818e -r 695725ffeb3d suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py
--- a/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Wed Oct 22 02:08:26 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Thu Oct 23 05:38:42 2008 -0700
@@ -107,7 +107,7 @@
#Verifying that we get the atleast the expected instanceid
#for every pool class
for key in exp_pllist.keys():
- if Set(exp_pllist[key]) != Set(res_pllist[key]):
+ if Set(exp_pllist[key]) - Set(res_pllist[key]):
logger.error("InstanceID mismatch")
raise Exception("Expected InstanceID: %s \n \t Got: %s"
% (sorted(exp_pllist[key]),
16 years, 2 months