[PATCH] [TEST] #3 Add helper function() to fix HostSystem related tc work with sblim base provider installed
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222312007 25200
# Node ID 27157c757211adf675236cab10777541aa7c8922
# Parent 375ae129b8e910fe42a5e4434b67ada5589bc72f
[TEST] #3 Add helper function() to fix HostSystem related tc work with sblim base provider installed
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 375ae129b8e9 -r 27157c757211 suites/libvirt-cim/lib/XenKvmLib/classes.py
--- a/suites/libvirt-cim/lib/XenKvmLib/classes.py Tue Sep 23 04:45:04 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/classes.py Wed Sep 24 20:06:47 2008 -0700
@@ -22,10 +22,6 @@ virt_types = ['Xen', 'KVM', 'XenFV', 'LX
virt_types = ['Xen', 'KVM', 'XenFV', 'LXC']
def get_typed_class(virt, basename):
- if virt not in virt_types:
- if virt != "Virt" and basename != "MigrationJob":
- raise ValueError('Invalid class type')
-
if basename == None or basename == '':
raise ValueError('Invalide class base name')
diff -r 375ae129b8e9 -r 27157c757211 suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Tue Sep 23 04:45:04 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Wed Sep 24 20:06:47 2008 -0700
@@ -27,7 +27,8 @@ from distutils.file_util import move_fil
from distutils.file_util import move_file
from XenKvmLib.test_xml import *
from XenKvmLib.test_doms import *
-from XenKvmLib import vsms
+from XenKvmLib import vsms
+from CimTest import Globals
from XenKvmLib import enumclass
from pywbem.cim_obj import CIMInstanceName
from XenKvmLib.devices import CIM_Instance
@@ -477,4 +478,23 @@ def libvirt_cached_data_poll(ip, virt, d
sleep(1)
- return cs
+ return cs
+
+def check_sblim(server, virt='Xen'):
+ status = FAIL
+ Globals.CIM_NS = 'root/cimv2'
+ keys = ['Name', 'CreationClassName']
+ linux_cs = None
+ try:
+ linux = enumclass.enumerate(server, 'ComputerSystem', keys, 'Linux')
+ if len(linux) == 1:
+ status = PASS
+ linux_cs = linux[0]
+ else:
+ logger.info("Enumerate of Linux_ComputerSystem return NULL")
+ except Exception, detail:
+ logger.error(CIM_ERROR_ENUMERATE, 'Linux_ComputerSystem')
+ logger.error("Exception: %s", detail)
+
+ Globals.CIM_NS = 'root/virt'
+ return status, linux_cs
diff -r 375ae129b8e9 -r 27157c757211 suites/libvirt-cim/lib/XenKvmLib/enumclass.py
--- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Tue Sep 23 04:45:04 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Wed Sep 24 20:06:47 2008 -0700
@@ -63,6 +63,23 @@ class CIM_MyClass(CIM_Instance):
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
16 years
[PATCH] [TEST] Fix 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 1222241113 25200
# Node ID e8629ccc57322c25ee54826a59b53a88f092bfdb
# Parent d2ae228a60c34b78c3dd1e4f43f6a5413898980d
[TEST] Fix VirtualSystemSnapshotService.01&02 to work with sblim base provider installed and without
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r d2ae228a60c3 -r e8629ccc5732 suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py Wed Sep 24 00:25:13 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[0].Name
+ classname = linux_cs[0].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 d2ae228a60c3 -r e8629ccc5732 suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/02_vs_sservice_gi_errs.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/02_vs_sservice_gi_errs.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/02_vs_sservice_gi_errs.py Wed Sep 24 00:25:13 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[0].Name
+ sccn = linux_cs[0].CreationClassName
+ else:
+ status, sys_name, sccn = get_host_info(options.ip, options.virt)
if status != PASS:
return status
field = 'INVALID_CCName'
16 years
[PATCH] [TEST] 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 1222240437 25200
# Node ID 7c2de8fcf22951325f1bbcf67bd73b7f8cee871d
# Parent d2ae228a60c34b78c3dd1e4f43f6a5413898980d
[TEST] 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 d2ae228a60c3 -r 7c2de8fcf229 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py Wed Sep 24 00:13:57 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[0]
+ 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 d2ae228a60c3 -r 7c2de8fcf229 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py Wed Sep 24 00:13:57 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[0].Name
+ sccname = linux_cs[0].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
[PATCH] [TEST] #2 patch set of fixing HostSystem-01_enum.py with sblim base provider installed
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222236393 25200
# Node ID 83add054f191b8b6ad2c4ba53fce67cdca455989
# Parent d2ae228a60c34b78c3dd1e4f43f6a5413898980d
[TEST] #2 patch set of fixing HostSystem-01_enum.py with sblim base provider installed
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r d2ae228a60c3 -r 83add054f191 suites/libvirt-cim/cimtest/HostSystem/01_enum.py
--- a/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Tue Sep 23 23:06:33 2008 -0700
@@ -27,12 +27,13 @@
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
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
from XenKvmLib.const import do_main
-from CimTest.ReturnCodes import PASS, FAIL
+from CimTest.ReturnCodes import PASS, FAIL, XFAIL
SUPPORTED_TYPES = ['Xen', 'KVM', 'XenFV', 'LXC']
@@ -43,27 +44,34 @@ def main():
status = FAIL
keys = ['Name', 'CreationClassName']
- try:
- hs = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)
- name = get_typed_class(options.virt, 'HostSystem')
+
+ status, linux_cs = check_sblim(options.ip, options.virt)
+ if status == PASS:
+ name = 'Linux_ComputerSystem'
+ system = linux_cs[0]
+ else:
+ 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
+ if len(hs) != 1:
+ logger.error("Expected 1 %s instance returned" % name)
+ return XFAIL
- system = hs[0]
+ system = hs[0]
+ except Exception, details:
+ logger.error("%s %s: %s" % (CIM_ERROR_ENUMERATE, name, details))
+ status = FAIL
- 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))
+ 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
+
return status
diff -r d2ae228a60c3 -r 83add054f191 suites/libvirt-cim/lib/XenKvmLib/classes.py
--- a/suites/libvirt-cim/lib/XenKvmLib/classes.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/classes.py Tue Sep 23 23:06:33 2008 -0700
@@ -22,10 +22,6 @@ virt_types = ['Xen', 'KVM', 'XenFV', 'LX
virt_types = ['Xen', 'KVM', 'XenFV', 'LXC']
def get_typed_class(virt, basename):
- if virt not in virt_types:
- if virt != "Virt" and basename != "MigrationJob":
- raise ValueError('Invalid class type')
-
if basename == None or basename == '':
raise ValueError('Invalide class base name')
diff -r d2ae228a60c3 -r 83add054f191 suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Tue Sep 23 23:06:33 2008 -0700
@@ -27,7 +27,8 @@ from distutils.file_util import move_fil
from distutils.file_util import move_file
from XenKvmLib.test_xml import *
from XenKvmLib.test_doms import *
-from XenKvmLib import vsms
+from XenKvmLib import vsms
+from CimTest import Globals
from XenKvmLib import enumclass
from pywbem.cim_obj import CIMInstanceName
from XenKvmLib.devices import CIM_Instance
@@ -477,4 +478,22 @@ def libvirt_cached_data_poll(ip, virt, d
sleep(1)
- return cs
+ return cs
+
+def check_sblim(server, virt='Xen'):
+ status = FAIL
+ Globals.CIM_NS = 'root/cimv2'
+ keys = ['Name', 'CreationClassName']
+ try:
+ linux_cs = enumclass.enumerate(server, 'ComputerSystem', keys, 'Linux')
+ host_sys = enumclass.enumerate(server, 'HostSystem', keys, virt)
+ if len(linux_cs) == 1 and len(host_sys) == 0:
+ status = PASS
+ else:
+ logger.info("sblim base provider is not installed")
+ except Exception, detail:
+ logger.error(CIM_ERROR_ENUMERATE, 'Linux_ComputerSystem')
+ logger.error("Exception: %s", detail)
+
+ Globals.CIM_NS = 'root/virt'
+ return status, linux_cs
diff -r d2ae228a60c3 -r 83add054f191 suites/libvirt-cim/lib/XenKvmLib/enumclass.py
--- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Tue Sep 23 23:06:33 2008 -0700
@@ -63,6 +63,23 @@ class CIM_MyClass(CIM_Instance):
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
16 years
[PATCH] [TEST] Fix HostedService.01~04 with sblim base provider installed
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222239007 25200
# Node ID f09ea1ef1bf1c4c830985078b53e50a103635ae2
# Parent d2ae228a60c34b78c3dd1e4f43f6a5413898980d
[TEST] Fix HostedService.01~04 with sblim base provider installed
suites/libvirt-cim/cimtest/HostedService/cimtest.log
diff -r d2ae228a60c3 -r f09ea1ef1bf1 suites/libvirt-cim/cimtest/HostedService/01_forward.py
--- a/suites/libvirt-cim/cimtest/HostedService/01_forward.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/01_forward.py Tue Sep 23 23:50:07 2008 -0700
@@ -24,6 +24,7 @@ import sys
import sys
from VirtLib import utils
from XenKvmLib import assoc
+from XenKvmLib.common_util import check_sblim
from XenKvmLib import enumclass
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
@@ -36,12 +37,17 @@ sup_types = ['Xen', 'XenFV', 'KVM', 'LXC
@do_main(sup_types)
def main():
options = main.options
- keys = ['Name', 'CreationClassName']
- try:
- host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
- except Exception:
- logger.error(Globals.CIM_ERROR_ENUMERATE % host_sys.name)
- return FAIL
+
+ status, linux_cs = check_sblim(options.ip, options.virt)
+ if status == PASS:
+ host_sys = linux_cs[0]
+ else:
+ keys = ['Name', 'CreationClassName']
+ try:
+ host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
+ except Exception:
+ logger.error(Globals.CIM_ERROR_ENUMERATE % host_sys.name)
+ return FAIL
try:
service = assoc.AssociatorNames(options.ip,
"HostedService",
diff -r d2ae228a60c3 -r f09ea1ef1bf1 suites/libvirt-cim/cimtest/HostedService/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Tue Sep 23 23:50:07 2008 -0700
@@ -25,6 +25,7 @@ from VirtLib import utils
from VirtLib import utils
from XenKvmLib import assoc
from XenKvmLib import enumclass
+from XenKvmLib.common_util import check_sblim
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from XenKvmLib.const import do_main
@@ -36,12 +37,16 @@ sup_types = ['Xen', 'XenFV', 'KVM', 'LXC
@do_main(sup_types)
def main():
options = main.options
- keys = ['Name', 'CreationClassName']
- try:
- host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
- except Exception:
- logger.error(Globals.CIM_ERROR_ENUMERATE % host_sys.CreationClassName)
- return FAIL
+ status, linux_cs = check_sblim(options.ip, options.virt)
+ if status == PASS:
+ host_sys = linux_cs[0]
+ else:
+ keys = ['Name', 'CreationClassName']
+ try:
+ host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
+ except Exception:
+ logger.error(Globals.CIM_ERROR_ENUMERATE % host_sys.CreationClassName)
+ return FAIL
servicelist = {"ResourcePoolConfigurationService" : "RPCS",
"VirtualSystemManagementService" : "Management Service",
"VirtualSystemMigrationService" : "MigrationService"}
@@ -67,7 +72,7 @@ def main():
ccn = assoc_host[0].keybindings['CreationClassName']
name = assoc_host[0].keybindings['Name']
- if ccn != get_typed_class(options.virt, "HostSystem"):
+ if ccn != get_typed_class(options.virt, "HostSystem") and ccn != 'Linux_ComputerSystem' :
logger.error("CreationClassName Error")
return FAIL
elif name != host_sys.Name:
diff -r d2ae228a60c3 -r f09ea1ef1bf1 suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Tue Sep 23 23:50:07 2008 -0700
@@ -25,6 +25,7 @@ from pywbem.cim_obj import CIMInstanceNa
from pywbem.cim_obj import CIMInstanceName
from XenKvmLib import assoc
from XenKvmLib import enumclass
+from XenKvmLib.common_util import check_sblim
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_USER, \
CIM_PASS, CIM_NS
@@ -41,11 +42,15 @@ def main():
rc = -1
status = FAIL
keys = ['Name', 'CreationClassName']
- try:
- host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
- except Exception:
- logger.error(CIM_ERROR_ENUMERATE % host_sys.name)
- return FAIL
+ status, linux_cs = check_sblim(options.ip, options.virt)
+ if status == PASS:
+ host_sys = linux_cs[0]
+ else:
+ try:
+ host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
+ except Exception:
+ logger.error(CIM_ERROR_ENUMERATE % host_sys.name)
+ return FAIL
conn = assoc.myWBEMConnection('http://%s' % options.ip,
diff -r d2ae228a60c3 -r f09ea1ef1bf1 suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py
--- a/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Tue Sep 23 23:50:07 2008 -0700
@@ -25,6 +25,7 @@ from pywbem.cim_obj import CIMInstanceNa
from pywbem.cim_obj import CIMInstanceName
from XenKvmLib import assoc
from XenKvmLib import enumclass
+from XenKvmLib.common_util import check_sblim
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_USER, \
CIM_PASS, CIM_NS
@@ -41,11 +42,15 @@ def main():
rc = -1
status = FAIL
keys = ['Name', 'CreationClassName']
- try:
- host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
- except Exception:
- logger.error(CIM_ERROR_ENUMERATE % host_sys.name)
- return FAIL
+ status, linux_cs = check_sblim(options.ip, options.virt)
+ if status == PASS:
+ host_sys = linux_cs[0]
+ else:
+ try:
+ host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
+ except Exception:
+ logger.error(CIM_ERROR_ENUMERATE % host_sys.name)
+ return FAIL
servicelist = {get_typed_class(options.virt, "ResourcePoolConfigurationService") : "RPCS",
16 years
[PATCH] (#2) Fix return value of ModifySystemSettings
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1222277765 25200
# Node ID 61a72b41f401bbba89b6c503bf4629400fcce60f
# Parent 06e1fa131671f9d0ecd76a89c927864a887f0b0d
(#2) Fix return value of ModifySystemSettings
Changes:
- Fix silly compile error
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 06e1fa131671 -r 61a72b41f401 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Wed Sep 24 09:30:41 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Wed Sep 24 10:36:05 2008 -0700
@@ -1210,17 +1210,27 @@
CMPIArgs *argsout)
{
CMPIInstance *inst;
+ CMPIStatus s;
+ uint32_t rc;
if (cu_get_inst_arg(argsin, "SystemSettings", &inst) != CMPI_RC_OK) {
- CMPIStatus s;
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
"Missing SystemSettings");
- return s;
+ goto out;
}
- return update_system_settings(context, reference, inst);
+ s = update_system_settings(context, reference, inst);
+ out:
+ if (s.rc == CMPI_RC_OK)
+ rc = CIM_SVPC_RETURN_COMPLETED;
+ else
+ rc = CIM_SVPC_RETURN_FAILED;
+
+ CMReturnData(results, &rc, CMPI_uint32);
+
+ return s;
}
typedef CMPIStatus (*resmod_fn)(struct domain *,
16 years
[PATCH] Fix return value of ModifySystemSettings
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1222190876 25200
# Node ID 29d96fbb316175f6d1590929752a7e688f00fc8e
# Parent 16cdfa1774d4b9fa65e6e835a9f5fc5a37d52051
Fix return value of ModifySystemSettings
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 16cdfa1774d4 -r 29d96fbb3161 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Tue Sep 23 07:10:47 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Tue Sep 23 10:27:56 2008 -0700
@@ -1210,6 +1210,7 @@
CMPIArgs *argsout)
{
CMPIInstance *inst;
+ uint32_t rc;
if (cu_get_inst_arg(argsin, "SystemSettings", &inst) != CMPI_RC_OK) {
CMPIStatus s;
@@ -1217,10 +1218,19 @@
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
"Missing SystemSettings");
- return s;
+ goto out;
}
- return update_system_settings(context, reference, inst);
+ s = update_system_settings(context, reference, inst);
+ out:
+ if (s.rc == CMPI_RC_OK)
+ rc = CIM_SVPC_RETURN_COMPLETED;
+ else
+ rc = CIM_SVPC_RETURN_FAILED;
+
+ CMReturnData(results, &rc, CMPI_uint32);
+
+ return s;
}
typedef CMPIStatus (*resmod_fn)(struct domain *,
16 years
[PATCH] [TEST] Updating the 03_ld_gi_errs.py, 03_proc_gi_errs.py, 03_sds_fwd_errs.py tc
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1222240659 -19800
# Node ID d06e48783aa9811d497f685e3bb0e4495da629bc
# Parent d2ae228a60c34b78c3dd1e4f43f6a5413898980d
[TEST] Updating the 03_ld_gi_errs.py, 03_proc_gi_errs.py, 03_sds_fwd_errs.py tc
Updating the exception message which was used to verify the error message when an invalid
device id is passed because of the changes that went in as part of
"Add a little debugging to the device path" patch.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r d2ae228a60c3 -r d06e48783aa9 suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py
--- a/suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py Wed Sep 24 12:47:39 2008 +0530
@@ -138,15 +138,16 @@ sup_types = ['Xen', 'KVM', 'XenFV']
sup_types = ['Xen', 'KVM', 'XenFV']
expr_values = {
- "invalid_ccname" : {'rc' : pywbem.CIM_ERR_NOT_FOUND, \
- 'desc' : "No such instance (CreationClassName)" }, \
- "invalid_devid_keyname" : {'rc' : pywbem.CIM_ERR_FAILED, \
- 'desc' : "No DeviceID specified" }, \
- "invalid_devid_keyvalue" : {'rc' : pywbem.CIM_ERR_NOT_FOUND, \
- 'desc' : "No such instance (INVALID_DevID_Keyvalue)" },\
- "invalid_sccname" : {'rc' : pywbem.CIM_ERR_NOT_FOUND, \
- 'desc' : "No such instance (SystemCreationClassName)" },\
- "invalid_sysname" : {'rc' : pywbem.CIM_ERR_NOT_FOUND, \
+ "invalid_ccname" : {'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : "No such instance (CreationClassName)" },
+ "invalid_devid_keyname" : {'rc' : pywbem.CIM_ERR_FAILED,
+ 'desc' : "No DeviceID specified" },
+ "invalid_devid_keyvalue" : {'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : "No such instance "\
+ "(bad id INVALID_DevID_Keyvalue)" },
+ "invalid_sccname" : {'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : "No such instance (SystemCreationClassName)" },
+ "invalid_sysname" : {'rc' : pywbem.CIM_ERR_NOT_FOUND,
'desc' : "No such instance (SystemName)" }
}
@@ -157,13 +158,13 @@ def try_invalid_gi(i, field1, field2):
temp = name_val[i]
name_val[i] = field1
keys = {
- name_val[0] : name_val[1], \
- name_val[2] : name_val[3], \
- name_val[4] : name_val[5], \
+ name_val[0] : name_val[1],
+ name_val[2] : name_val[3],
+ name_val[4] : name_val[5],
name_val[6] : name_val[7]
}
- ret_value = try_getinstance(conn, classname, keys, field_name=field1, \
- expr_values=expr_values[field2], bug_no="")
+ ret_value = try_getinstance(conn, classname, keys, field_name=field1,
+ expr_values=expr_values[field2], bug_no="")
if ret_value != PASS:
logger.error("------ FAILED: %s------" % field1)
name_val[i] = temp
@@ -208,19 +209,19 @@ def main():
global name_val
name_val = [
- 'CreationClassName', disk.CreationClassName, \
- 'DeviceID', disk.DeviceID, \
- 'SystemCreationClassName', disk.SystemCreationClassName, \
+ 'CreationClassName', disk.CreationClassName,
+ 'DeviceID', disk.DeviceID,
+ 'SystemCreationClassName', disk.SystemCreationClassName,
'SystemName', disk.SystemName
]
- tc_scen = { 'INVALID_CCName_Keyname' : 'invalid_ccname', \
- 'INVALID_CCName_Keyvalue' : 'invalid_ccname', \
- 'INVALID_DevID_Keyname' : 'invalid_devid_keyname', \
- 'INVALID_DevID_Keyvalue' : 'invalid_devid_keyvalue', \
- 'INVALID_SCCName_Keyname' : 'invalid_sccname', \
- 'INVALID_SCCName_Keyvalue' : 'invalid_sccname', \
- 'INVALID_SysName_Keyname' : 'invalid_sysname', \
+ tc_scen = { 'INVALID_CCName_Keyname' : 'invalid_ccname',
+ 'INVALID_CCName_Keyvalue' : 'invalid_ccname',
+ 'INVALID_DevID_Keyname' : 'invalid_devid_keyname',
+ 'INVALID_DevID_Keyvalue' : 'invalid_devid_keyvalue',
+ 'INVALID_SCCName_Keyname' : 'invalid_sccname',
+ 'INVALID_SCCName_Keyvalue' : 'invalid_sccname',
+ 'INVALID_SysName_Keyname' : 'invalid_sysname',
'INVALID_SysName_Keyvalue' : 'invalid_sysname'
}
diff -r d2ae228a60c3 -r d06e48783aa9 suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py
--- a/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py Wed Sep 24 12:47:39 2008 +0530
@@ -141,7 +141,8 @@ expr_values = {
"invalid_devid_keyname" : {'rc' : pywbem.CIM_ERR_FAILED,
'desc' : "No DeviceID specified" },
"invalid_devid_keyvalue" : {'rc' : pywbem.CIM_ERR_NOT_FOUND,
- 'desc' : "No such instance (INVALID_DevID_Keyvalue)" },
+ 'desc' : "No such instance "\
+ "(bad id INVALID_DevID_Keyvalue)" },
"invalid_sccname" : {'rc' : pywbem.CIM_ERR_NOT_FOUND,
'desc' : "No such instance (SystemCreationClassName)" },
"invalid_sysname" : {'rc' : pywbem.CIM_ERR_NOT_FOUND,
@@ -161,8 +162,8 @@ def try_invalid_gi(i, field1, field2):
k = j * 2
keys[name_val[k]] = name_val[k+1]
- ret_value = try_getinstance(conn, classname, keys, field_name=field1, \
- expr_values=expr_values[field2], bug_no="")
+ ret_value = try_getinstance(conn, classname, keys, field_name=field1,
+ expr_values=expr_values[field2], bug_no="")
if ret_value != PASS:
logger.error("------ FAILED: %s------" % field1)
name_val[i] = temp
diff -r d2ae228a60c3 -r d06e48783aa9 suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py
--- a/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Mon Sep 22 11:28:02 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Wed Sep 24 12:47:39 2008 +0530
@@ -161,30 +161,30 @@ test_vcpus = 1
test_vcpus = 1
expr_values = {
- "INVALID_DevID_Keyname" : { 'rc' : pywbem.CIM_ERR_FAILED, \
- 'desc' : 'No DeviceID specified' }, \
- "INVALID_DevID_Keyval" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND, \
- 'desc' : 'No such instance (INVALID_DevID_Keyval)'}, \
- "INVALID_CCName_Keyname" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND, \
- 'desc' : 'No such instance (CreationClassName)'}, \
- "INVALID_CCName_Keyval" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND, \
- 'desc' : 'No such instance (CreationClassName)'}, \
- "INVALID_SCCName_Keyname" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND, \
- 'desc' : 'No such instance (SystemCreationClassName)'}, \
- "INVALID_SCCName_Keyval" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND, \
- 'desc' : 'No such instance (SystemCreationClassName)'}, \
- "INVALID_SysName_Keyname" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND, \
- 'desc' : 'No such instance (SystemName)'}, \
- "INVALID_SysName_Keyval" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND, \
+ "INVALID_DevID_Keyname" : { 'rc' : pywbem.CIM_ERR_FAILED,
+ 'desc' : 'No DeviceID specified' },
+ "INVALID_DevID_Keyval" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : 'No such instance (bad id INVALID_DevID_Keyval)'},
+ "INVALID_CCName_Keyname" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : 'No such instance (CreationClassName)'},
+ "INVALID_CCName_Keyval" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : 'No such instance (CreationClassName)'},
+ "INVALID_SCCName_Keyname" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : 'No such instance (SystemCreationClassName)'},
+ "INVALID_SCCName_Keyval" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : 'No such instance (SystemCreationClassName)'},
+ "INVALID_SysName_Keyname" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : 'No such instance (SystemName)'},
+ "INVALID_SysName_Keyval" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND,
'desc' : 'No such instance (SystemName)'}
}
def get_name_val(classname, device_id, sccn):
devid = "%s/%s" % (test_dom, device_id)
name_val = [
- 'DeviceID' , devid, \
- 'CreationClassName' , classname, \
- 'SystemCreationClassName' , sccn, \
+ 'DeviceID' , devid,
+ 'CreationClassName' , classname,
+ 'SystemCreationClassName' , sccn,
'SystemName' , test_dom
]
return name_val
@@ -197,8 +197,8 @@ def try_invalid_assoc(classname, name_va
k = j * 2
keys[name_val[k]] = name_val[k+1]
ac_classname = get_typed_class(virt, 'SettingsDefineState')
- ret_val = try_assoc(conn, classname, ac_classname, keys, field_name=field, \
- expr_values=expr_values[field], bug_no='')
+ ret_val = try_assoc(conn, classname, ac_classname, keys, field_name=field,
+ expr_values=expr_values[field], bug_no='')
if ret_val != PASS:
logger.error("------ FAILED: %s------" % field)
name_val[i] = temp
@@ -227,8 +227,8 @@ def main():
return FAIL
global conn
- conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, \
- CIM_PASS), CIM_NS)
+ conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER,
+ CIM_PASS), CIM_NS)
if options.virt == 'LXC':
class_id = {get_typed_class(options.virt, 'Memory') : 'mem'}
else:
@@ -240,9 +240,9 @@ def main():
}
tc_scen = [
- 'INVALID_DevID_Keyname', 'INVALID_DevID_Keyval', \
- 'INVALID_CCName_Keyname', 'INVALID_CCName_Keyval', \
- 'INVALID_SCCName_Keyname', 'INVALID_SCCName_Keyval', \
+ 'INVALID_DevID_Keyname', 'INVALID_DevID_Keyval',
+ 'INVALID_CCName_Keyname', 'INVALID_CCName_Keyval',
+ 'INVALID_SCCName_Keyname', 'INVALID_SCCName_Keyval',
'INVALID_SysName_Keyname', 'INVALID_SysName_Keyval'
]
16 years
[PATCH] [TEST]Fix HostSystem-01_enum.py with sblim cmpi base provider installed, add Linux_ComputerSystem to enumclass
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222062868 25200
# Node ID 83e6f32be2ae455bfec0f014374889a5217f1168
# Parent 892ce3fce2340df3fb51a1160f510d15838f2d54
[TEST]Fix HostSystem-01_enum.py with sblim cmpi base provider installed, add Linux_ComputerSystem to enumclass
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 892ce3fce234 -r 83e6f32be2ae suites/libvirt-cim/cimtest/HostSystem/01_enum.py
--- a/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Fri Sep 12 14:35:12 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Sun Sep 21 22:54:28 2008 -0700
@@ -32,8 +32,9 @@ from VirtLib import utils
from VirtLib import utils
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
from XenKvmLib.const import do_main
-from CimTest.ReturnCodes import PASS, FAIL
+from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
+bug = '00007'
SUPPORTED_TYPES = ['Xen', 'KVM', 'XenFV', 'LXC']
@do_main(SUPPORTED_TYPES)
@@ -43,27 +44,35 @@ def main():
status = FAIL
keys = ['Name', 'CreationClassName']
- try:
- hs = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)
- name = get_typed_class(options.virt, 'HostSystem')
+
+ linux_cs = enumclass.enumerate(options.ip, 'ComputerSystem', keys, 'Linux')
+ hs = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)
+ if len(linux_cs) == 1 and len(hs) == 0:
+ return PASS
+ if len(linux_cs) == 0 and len(hs) == 0:
+ return XFAIL_RC(bug)
+ elif len(linux_cs) == 0 and len(hs)== 1:
+ 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
+ if len(hs) != 1:
+ logger.error("Expected 1 %s instance returned" % name)
+ return FAIL
- system = hs[0]
+ 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))
+ 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
- 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
return status
diff -r 892ce3fce234 -r 83e6f32be2ae suites/libvirt-cim/lib/XenKvmLib/classes.py
--- a/suites/libvirt-cim/lib/XenKvmLib/classes.py Fri Sep 12 14:35:12 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/classes.py Sun Sep 21 22:54:28 2008 -0700
@@ -23,6 +23,8 @@ virt_types = ['Xen', 'KVM', 'XenFV', 'LX
def get_typed_class(virt, basename):
if virt not in virt_types:
+ if virt == "Linux" and basename == "ComputerSystem":
+ return 'Linux_ComputerSystem'
if virt != "Virt" and basename != "MigrationJob":
raise ValueError('Invalid class type')
diff -r 892ce3fce234 -r 83e6f32be2ae suites/libvirt-cim/lib/XenKvmLib/enumclass.py
--- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Fri Sep 12 14:35:12 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Sun Sep 21 22:54:28 2008 -0700
@@ -68,6 +68,9 @@ class CIM_ComputerSystem(CIM_MyClass):
pass
class CIM_System(CIM_MyClass):
+ pass
+
+class Linux_ComputerSystem(CIM_MyClass):
pass
class CIM_AllocationCapabilities(CIM_MyClass):
16 years