From zli at linux.vnet.ibm.com Tue Apr 1 01:33:07 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Tue, 01 Apr 2008 09:33:07 +0800 Subject: [Libvirt-cim] [PATCH 1 of 3] [TEST] SystemDevice.01_forward XenFV & KVM support In-Reply-To: <87bq4ulv1t.fsf@caffeine.beaverton.ibm.com> References: <05259e63c37a2d496411.1206974036@zeit.cn.ibm.com> <87bq4ulv1t.fsf@caffeine.beaverton.ibm.com> Message-ID: <47F190D3.8040708@linux.vnet.ibm.com> Dan Smith wrote: > ZL> + cxml = vxml.get_class(options.virt)(test_dom, vcpus = test_cpu, > ZL> + mac = test_mac, disk = test_disk) > > I'm not familiar with the "function(foo)(bar)" syntax. Can you > explain? Yes, just like what Jay explained in the other email. > > ZL> + cxml.destroy(options.ip) > ZL> + ret = cxml.create(options.ip) > > Why destroy it immediately and then create? Does vxml.get_class()() > create the domain, or are you trying to make sure it doesn't already > exist? vxml.get_class()(...) only generates the xml string. we need to define & start, or create to make the domain usable. Destroy was here to make sure no such domain alive. I was planned to delete the destroy step because the do_main did this for all test cases. This one was left out. I will remove the destroy step in the updated patch. > > ZL> + devlist = [get_typed_class(options.virt, "NetworkPort"), > ZL> + get_typed_class(options.virt, "Memory"), > ZL> + get_typed_class(options.virt, "LogicalDisk"), > ZL> + get_typed_class(options.virt, "Processor")] > > Is this used anywhere else but below? > > ZL> - if items == "Xen_NetworkPort": > ZL> + if items == devlist[0]: > ZL> _devid = "%s/%s" % (test_dom, test_mac) > ZL> - elif items == "Xen_LogicalDisk": > ZL> + elif items == devlist[1]: > ZL> + _devid = "%s/mem" % test_dom > ZL> + elif items == devlist[2]: > ZL> _devid = "%s/%s" % (test_dom, test_disk) > ZL> - elif items == "Xen_Processor": > ZL> + elif items == devlist[3]: > ZL> _devid = "%s/%d" % (test_dom, test_cpu-1) > ZL> - elif items == "Xen_Memory": > ZL> - _devid = "%s/mem" % test_dom > > Going from class names to array values makes this harder to > eye-parse. For the two comments above: I'll make it a dictionary, just like what I did to the other two test cases. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- - Zhengang From zli at linux.vnet.ibm.com Tue Apr 1 01:36:50 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Tue, 01 Apr 2008 09:36:50 +0800 Subject: [Libvirt-cim] [PATCH 1 of 5] [TEST] devices lib changes for XenFV and KVM support In-Reply-To: <41d06111a09a3f7542fa.1206950467@elm3b197.beaverton.ibm.com> References: <41d06111a09a3f7542fa.1206950467@elm3b197.beaverton.ibm.com> Message-ID: <47F191B2.3070408@linux.vnet.ibm.com> Guo Lian Yun wrote: > @@ -93,13 +93,13 @@ class KVM_Processor(CIM_Processor): > class KVM_Processor(CIM_Processor): > pass > > -def enumerate(server, devtype, keys): > +def enumerate(server, devtype, keys, virt='Xen'): > conn = pywbem.WBEMConnection('http://%s' % server, > (Globals.CIM_USER, Globals.CIM_PASS), > Globals.CIM_NS) > > list = [] > - > + devtype = eval(get_typed_class(virt, devtype)) I updated this function in another patch. We need to have an agreement on what devtype contains. It was a class object inside devices. I turned it to a string representation of the class. And here it's likely to be the basename of the class name string (excluding the 'Xen_'/'KVM_' prefix). > try: > names = conn.EnumerateInstanceNames(devtype.__name__) > except pywbem.CIMError, arg: > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- - Zhengang From zli at linux.vnet.ibm.com Tue Apr 1 01:40:04 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Tue, 01 Apr 2008 09:40:04 +0800 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] update EC.03 for XenFV and KVM support In-Reply-To: <8a88d71e2fc844fcf4a2.1206945416@elm3b197.beaverton.ibm.com> References: <8a88d71e2fc844fcf4a2.1206945416@elm3b197.beaverton.ibm.com> Message-ID: <47F19274.3050902@linux.vnet.ibm.com> Guo Lian Yun wrote: > @@ -67,18 +68,20 @@ def main(): > def main(): > options = main.options > rc = PASS > + log_param() > > - instanceref = CIMInstanceName("Xen_HostSystem", > + instanceref = CIMInstanceName(get_typed_class(options.virt, "HostSystem"), #1 > keybindings = {"Name" : "wrong", "CreationClassName" : "wrong"}) > - rc = try_assoc(instanceref, "Xen_HostSystem", exp_rc, exp_desc, options) > + rc = try_assoc(instanceref, get_typed_class(options.virt, "HostSystem"), exp_rc, exp_desc, options) #2 > > if rc != PASS: > status = FAIL > return status > > - instance_cs = CIMInstanceName("Xen_ComputerSystem", > - keybindings = {"Name" : "wrong", "CreationClassName" : "Xen_ComputerSystem"}) > - rc = try_assoc(instance_cs, "Xen_ComputerSystem", exp_rc, exp_desc, options) > + instance_cs = CIMInstanceName(get_typed_class(options.virt, "ComputerSystem"), #3 > + keybindings = {"Name" : "wrong", > + "CreationClassName" : get_typed_class(options.virt,"ComputerSystem")}) > + rc = try_assoc(instance_cs, get_typed_class(options.virt, "ComputerSystem"), exp_rc, exp_desc, options) #4 #1 & #2, #3 & #4 share some common code. I would consider use a variable to avoid duplicated get_typed_class() call. > if rc != PASS: > status = FAIL > return status > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- - Zhengang From zli at linux.vnet.ibm.com Tue Apr 1 01:41:47 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Tue, 01 Apr 2008 09:41:47 +0800 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] update EC.04 for XenFV and KVM support In-Reply-To: <8a80ce6eb0938f83877f.1206945417@elm3b197.beaverton.ibm.com> References: <8a80ce6eb0938f83877f.1206945417@elm3b197.beaverton.ibm.com> Message-ID: <47F192DB.8090908@linux.vnet.ibm.com> Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1206945382 25200 > # Node ID 8a80ce6eb0938f83877ffd54e047a6a54c58f756 > # Parent 8a88d71e2fc844fcf4a2fd45924c9971e1639dac > [TEST] update EC.04 for XenFV and KVM support > > Signed-off-by: Guolian Yun > +1 -- - Zhengang From zli at linux.vnet.ibm.com Tue Apr 1 01:43:37 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Tue, 01 Apr 2008 09:43:37 +0800 Subject: [Libvirt-cim] [PATCH 2 of 5] [TEST] update RAFP.01 for XenFV and KVM support In-Reply-To: References: Message-ID: <47F19349.1030808@linux.vnet.ibm.com> Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1206950184 25200 > # Node ID e1cd8daac37d7ac78879912e4c635f1e9b17ed0f > # Parent 41d06111a09a3f7542fab1cedfdba5bf0e87f6c8 > [TEST] update RAFP.01 for XenFV and KVM support > > Signed-off-by: Guolian Yun +1 from me :) -- - Zhengang From yunguol at cn.ibm.com Tue Apr 1 02:16:59 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 31 Mar 2008 19:16:59 -0700 Subject: [Libvirt-cim] [PATCH] [CU] add indicatons attribute in server class to keep received indications Message-ID: # HG changeset patch # User Guolian Yun # Date 1207016212 25200 # Node ID cb353ff8b1cc60ba8c2d4bc3de9807a024cfac4d # Parent e9037a5a7df99bb63ae5e90ade698592af7b7e92 [CU] add indicatons attribute in server class to keep received indications Signed-off-by: Guolian Yun diff -r e9037a5a7df9 -r cb353ff8b1cc tools/indication_tester.py --- a/tools/indication_tester.py Mon Mar 10 12:05:59 2008 -0700 +++ b/tools/indication_tester.py Mon Mar 31 19:16:52 2008 -0700 @@ -295,6 +295,7 @@ class CIMSocketHandler(BaseHTTPServer.Ba print "Got indication: %s" % indication if self.server.print_ind: print "%s\n\n" % data + self.server.indications.append(indication) class CIMIndicationSubscription: def __init__(self, name, typ, ns, print_ind, sysname): @@ -306,6 +307,7 @@ class CIMIndicationSubscription: self.server = BaseHTTPServer.HTTPServer(('', 8000), CIMSocketHandler) self.server.print_ind = print_ind self.port = 8000 + self.server.indications = [] self.filter_xml = filter_xml(name, typ, ns, sysname) self.handler_xml = handler_xml(name, self.port, sysname) From yunguol at cn.ibm.com Tue Apr 1 02:38:11 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 31 Mar 2008 19:38:11 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] add ComputerSystemCreatedIndication test case In-Reply-To: Message-ID: <7d8f3365c85f27935200.1207017491@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207017464 25200 # Node ID 7d8f3365c85f2793520086615d2ea93cc876d708 # Parent 3ea353d2ace40242b044254a865335f8523e00bf [TEST] add ComputerSystemCreatedIndication test case Signed-off-by: Guolian Yun diff -r 3ea353d2ace4 -r 7d8f3365c85f suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Mon Mar 31 19:37:44 2008 -0700 @@ -0,0 +1,92 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Guolian Yun +# +# 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 +# + +import sys +import os +import signal +import time +from CimTest.Globals import log_param, logger +from CimTest.Globals import do_main +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.common_util import create_using_definesystem +from XenKvmLib.test_doms import undefine_test_domain +from XenKvmLib.classes import get_typed_class +from XenKvmLib.indication_tester import CIMIndicationSubscription +from XenKvmLib.vxml import set_default + +SUPPORTED_TYPES = ['Xen', 'XenFV', 'KVM'] + +test_dom = "domU" + + at do_main(SUPPORTED_TYPES) +def main(): + options = main.options + log_param() + status = FAIL + + dict = set_default(options.ip) + indication_name = get_typed_class(options.virt, 'ComputerSystemCreatedIndication') + + sub = CIMIndicationSubscription(dict['default_name'], indication_name, dict['default_ns'], + dict['default_print_ind'], dict['default_sysname']) + sub.subscribe(dict['default_url'], dict['default_auth']) + logger.info("Watching for %s" % indication_name) + + try: + pid = os.fork() + if pid == 0: + sub.server.handle_request() + if len(sub.server.indications) == 0: + logger.error("No valid indications received") + sys.exit(1) + elif str(sub.server.indications[0]) != indication_name: + logger.error("Received indication %s instead of %s" % (indication_name, str(sub.server.indications[0]))) + sys.exit(2) + else: + sys.exit(0) + else: + create_using_definesystem(test_dom, options.ip, None, None, options.virt) + for i in range(0,100): + pw = os.waitpid(pid, os.WNOHANG)[1] + if pw == 0: + logger.info("Great, got indication successfuly") + status = PASS + break + elif pw == 1 and i < 99: + logger.info("still in child process, waiting for indication") + time.sleep(1) + else: + logger.error("Received indication error or wait too long") + break + except Exception, details: + logger.error("Unknown exception happened") + logger.error(details) + finally: + sub.unsubscribe(dict['default_auth']) + logger.info("Cancelling subscription for %s" % indication_name) + os.kill(pid, signal.SIGKILL) + undefine_test_domain(test_dom, options.ip, options.virt) + + return status + +if __name__=="__main__": + sys.exit(main()) From yunguol at cn.ibm.com Tue Apr 1 02:38:09 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 31 Mar 2008 19:38:09 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] bundles of ComputerSystemCreatedIndication tc Message-ID: the need patch of indication_tester is in libcmpiutil tree, you can copy it to cimtest lib make ComputerSystmeCreatedIndication tc work Signed-off-by: Guolian Yun From yunguol at cn.ibm.com Tue Apr 1 02:38:10 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 31 Mar 2008 19:38:10 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] add default value setting for indication test case In-Reply-To: Message-ID: <3ea353d2ace40242b044.1207017490@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207017308 25200 # Node ID 3ea353d2ace40242b044254a865335f8523e00bf # Parent 5d47437104551b638aa75e2e525e49ec4b41e3ec [TEST] add default value setting for indication test case Signed-off-by: Guolian Yun diff -r 5d4743710455 -r 3ea353d2ace4 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Mar 31 07:54:19 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Mar 31 19:35:08 2008 -0700 @@ -37,7 +37,7 @@ from xml import xpath from xml import xpath from VirtLib import utils, live from XenKvmLib.test_doms import set_uuid -from CimTest.Globals import logger, CIM_IP +from CimTest.Globals import logger, CIM_IP, CIM_PORT, CIM_NS, CIM_USER, CIM_PASS from CimTest.ReturnCodes import SKIP from XenKvmLib.classes import virt_types @@ -548,3 +548,17 @@ def get_class(virt): if virt in virt_types: return eval(virt + 'XML') +def set_default(server): + dict = {} + dict['default_sysname'] = live.full_hostname(server) + dict['default_port'] = CIM_PORT + dict['default_url'] = "%s:%s" % (dict['default_sysname'], dict['default_port']) + dict['default_ns'] = CIM_NS + dict['default_name'] = "Test" + dict['default_dump'] = False + dict['default_print_ind'] = False + dict['default_username'] = CIM_USER + dict['default_password'] = CIM_PASS + dict['default_auth'] = (dict['default_username'], dict['default_password']) + + return dict From yunguol at cn.ibm.com Tue Apr 1 03:15:00 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 1 Apr 2008 11:15:00 +0800 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] update EC.03 for XenFV and KVM support In-Reply-To: <47F19274.3050902@linux.vnet.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-04-01 09:40:04: > Guo Lian Yun wrote: > > @@ -67,18 +68,20 @@ def main(): > > def main(): > > options = main.options > > rc = PASS > > + log_param() > > > > - instanceref = CIMInstanceName("Xen_HostSystem", > > + instanceref = CIMInstanceName(get_typed_class(options.virt, > "HostSystem"), > #1 > > > keybindings = {"Name" : > "wrong", "CreationClassName" : "wrong"}) > > - rc = try_assoc(instanceref, "Xen_HostSystem", exp_rc, > exp_desc, options) > > + rc = try_assoc(instanceref, get_typed_class(options.virt, > "HostSystem"), exp_rc, exp_desc, options) > #2 > > > > > if rc != PASS: > > status = FAIL > > return status > > > > - instance_cs = CIMInstanceName("Xen_ComputerSystem", > > - keybindings = {"Name" : > "wrong", "CreationClassName" : "Xen_ComputerSystem"}) > > - rc = try_assoc(instance_cs, "Xen_ComputerSystem", exp_rc, > exp_desc, options) > > + instance_cs = CIMInstanceName(get_typed_class(options.virt, > "ComputerSystem"), > #3 > > > + keybindings = {"Name" : "wrong", > > + > "CreationClassName" : get_typed_class(options.virt,"ComputerSystem")}) > > + rc = try_assoc(instance_cs, get_typed_class(options.virt, > "ComputerSystem"), exp_rc, exp_desc, options) > #4 > > #1 & #2, #3 & #4 share some common code. I would consider use a variable > to avoid duplicated get_typed_class() call. Good catch! Changed and resubmit. > > > if rc != PASS: > > status = FAIL > > return status > > > > _______________________________________________ > > Libvirt-cim mailing list > > Libvirt-cim at redhat.com > > https://www.redhat.com/mailman/listinfo/libvirt-cim > > > > > -- > - Zhengang > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From lizg at cn.ibm.com Tue Apr 1 03:25:51 2008 From: lizg at cn.ibm.com (lizg at cn.ibm.com) Date: Tue, 01 Apr 2008 11:25:51 +0800 Subject: [Libvirt-cim] [PATCH 0 of 3] .2# SystemDevice XenFV & KVM support Message-ID: Signed-off-by: Zhengang Li From lizg at cn.ibm.com Tue Apr 1 03:25:52 2008 From: lizg at cn.ibm.com (lizg at cn.ibm.com) Date: Tue, 01 Apr 2008 11:25:52 +0800 Subject: [Libvirt-cim] [PATCH 1 of 3] [TEST] .2# SystemDevice.01_forward XenFV & KVM support In-Reply-To: Message-ID: <15835b6f2704b50e2b7d.1207020352@zeit.cn.ibm.com> # HG changeset patch # User Zhengang Li # Date 1207015341 -28800 # Node ID 15835b6f2704b50e2b7d872319ef0023e6348559 # Parent c67d4960d4073c641beeb1fe5180862001c247ae [TEST] .2# SystemDevice.01_forward XenFV & KVM support Use dict instead of array. More clear vxml construction. Unnecessary destroy step removed. Signed-off-by: Zhengang Li diff -r c67d4960d407 -r 15835b6f2704 suites/libvirt-cim/cimtest/SystemDevice/01_forward.py --- a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Fri Mar 28 21:46:53 2008 +0800 +++ b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Tue Apr 01 10:02:21 2008 +0800 @@ -25,19 +25,18 @@ # import sys -from XenKvmLib.test_xml import testxml from VirtLib import utils from XenKvmLib import assoc -from XenKvmLib.test_doms import test_domain_function +from XenKvmLib import vxml from XenKvmLib import devices +from XenKvmLib.classes import get_typed_class from CimTest.Globals import log_param, logger, do_main from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV'] test_dom = "test_domain" test_mac = "00:11:22:33:44:55" -test_disk = "xvdb" test_cpu = 1 @do_main(sup_types) @@ -45,17 +44,25 @@ def main(): options= main.options log_param() + if options.virt == 'Xen': + test_disk = 'xvdb' + else: + test_disk = 'hdb' + status = PASS - test_xml = testxml(test_dom, vcpus = test_cpu, mac = test_mac, \ - disk = test_disk) + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom, vcpus = test_cpu, mac = test_mac, disk = test_disk) + ret = cxml.create(options.ip) + if not ret: + logger.error('Unable to create domain %s' % test_dom) + return FAIL - test_domain_function(test_xml, options.ip, "destroy") - test_domain_function(test_xml, options.ip, "create") + sd_classname = get_typed_class(options.virt, 'SystemDevice') + cs_classname = get_typed_class(options.virt, 'ComputerSystem') - devs = assoc.AssociatorNames(options.ip, "Xen_SystemDevice", - "Xen_ComputerSystem", - Name=test_dom, - CreationClassName="Xen_ComputerSystem") + devs = assoc.AssociatorNames(options.ip, sd_classname, cs_classname, + virt=options.virt, + Name=test_dom, CreationClassName=cs_classname) if devs == None: logger.error("System association failed") return FAIL @@ -63,40 +70,37 @@ def main(): logger.error("No devices returned") return FAIL - devlist = ["Xen_NetworkPort", "Xen_Memory", "Xen_LogicalDisk", \ - "Xen_Processor"] + cn_devid = { + get_typed_class(options.virt, "NetworkPort") : '%s/%s' % (test_dom, test_mac), + get_typed_class(options.virt, "Memory") : '%s/mem' % test_dom, + get_typed_class(options.virt, "LogicalDisk") : '%s/%s' % (test_dom, test_disk), + get_typed_class(options.virt, "Processor") : '%s/%s' % (test_dom, test_cpu-1) + } key_list = {'DeviceID' : '', 'CreationClassName' : '', 'SystemName' : test_dom, - 'SystemCreationClassname' : "Xen_ComputerSystem" + 'SystemCreationClassname' : cs_classname } - for items in devlist: + for dev_cn in cn_devid.keys(): for dev in devs: key_list['CreationClassName'] = dev['CreationClassname'] key_list['DeviceID'] = dev['DeviceID'] device = devices.device_of(options.ip, key_list) - if device.CreationClassName != items: + if device.CreationClassName != dev_cn: continue devid = device.DeviceID - if items == "Xen_NetworkPort": - _devid = "%s/%s" % (test_dom, test_mac) - elif items == "Xen_LogicalDisk": - _devid = "%s/%s" % (test_dom, test_disk) - elif items == "Xen_Processor": - _devid = "%s/%d" % (test_dom, test_cpu-1) - elif items == "Xen_Memory": - _devid = "%s/mem" % test_dom - + _devid = cn_devid[dev_cn] if devid != _devid: logger.error("DeviceID `%s` != `%s'" % (devid, _devid)) status = FAIL else: logger.info("Examined %s" % _devid) - test_domain_function(test_xml, options.ip, "destroy") + cxml.destroy(options.ip) + cxml.undefine(options.ip) return status From lizg at cn.ibm.com Tue Apr 1 03:25:53 2008 From: lizg at cn.ibm.com (lizg at cn.ibm.com) Date: Tue, 01 Apr 2008 11:25:53 +0800 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] .2# SystemDevice.02_reverse XenFV & KVM support In-Reply-To: Message-ID: <9d4b1e2eb6aa19e9c9d4.1207020353@zeit.cn.ibm.com> # HG changeset patch # User Zhengang Li # Date 1207017518 -28800 # Node ID 9d4b1e2eb6aa19e9c9d45f33bca7f3cf29c871ee # Parent 15835b6f2704b50e2b7d872319ef0023e6348559 [TEST] .2# SystemDevice.02_reverse XenFV & KVM support - devices.enumerate() methods' 2nd param is now a string typed basename of the class. - LogicalDisk.02_nodevs, ResourceAllocationFromPool.02_reverse are also updated to keep up to date. (only the method reference, no other changes to the two test cases.) - More clear vxml construction. Signed-off-by: Zhengang Li diff -r 15835b6f2704 -r 9d4b1e2eb6aa suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py --- a/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Tue Apr 01 10:02:21 2008 +0800 +++ b/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Tue Apr 01 10:38:38 2008 +0800 @@ -66,10 +66,9 @@ def main(): devid = "%s/%s" % (test_dom, test_dev) status = 0 - name = eval('devices.' + get_typed_class(options.virt, "LogicalDisk")) key_list = ["DeviceID", "CreationClassName", "SystemName", "SystemCreationClassName"] - devs = devices.enumerate(options.ip, name, key_list) + devs = devices.enumerate(options.ip, 'LogicalDisk', key_list) if devs.__class__ == str: logger.error("Got error instead of empty list: %s" % devs) status = 1 diff -r 15835b6f2704 -r 9d4b1e2eb6aa suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Tue Apr 01 10:02:21 2008 +0800 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Tue Apr 01 10:38:38 2008 +0800 @@ -26,7 +26,7 @@ from VirtLib import utils from VirtLib import utils from XenKvmLib import assoc from XenKvmLib import devices -from XenKvmLib.devices import Xen_Memory, Xen_Processor +from XenKvmLib.classes import get_typed_class from CimTest import Globals from CimTest.Globals import log_param, logger, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL @@ -42,13 +42,13 @@ def main(): key_list = ["DeviceID", "CreationClassName", "SystemName", "SystemCreationClassName"] try: - mem = devices.enumerate(options.ip, Xen_Memory, key_list) + mem = devices.enumerate(options.ip, 'Memory', key_list) except Exception: logger.error(Globals.CIM_ERROR_ENUMERATE % devices.Xen_Memory) return FAIL try: - proc = devices.enumerate(options.ip, Xen_Processor, key_list) + proc = devices.enumerate(options.ip, 'Processor', key_list) except Exception: logger.error(Globals.CIM_ERROR_ENUMERATE % devices.Xen_Processor) return FAIL diff -r 15835b6f2704 -r 9d4b1e2eb6aa suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py --- a/suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py Tue Apr 01 10:02:21 2008 +0800 +++ b/suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py Tue Apr 01 10:38:38 2008 +0800 @@ -25,18 +25,15 @@ # import sys -from XenKvmLib.test_xml import testxml from VirtLib import utils +from XenKvmLib import vxml from XenKvmLib import computersystem from XenKvmLib import assoc -from XenKvmLib.test_doms import test_domain_function from XenKvmLib import devices -from XenKvmLib.devices import Xen_NetworkPort, Xen_Memory, Xen_LogicalDisk, \ - Xen_Processor from CimTest.Globals import log_param, logger, do_main from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV'] test_dom = "test_domain" test_mac = "00:11:22:33:44:55" @@ -47,21 +44,21 @@ def main(): log_param() status = FAIL - test_xml = testxml(test_dom, mac = test_mac) - test_domain_function(test_xml, options.ip, "destroy") - test_domain_function(test_xml, options.ip, "create") + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom, mac=test_mac) + cxml.create(options.ip) - devlist = [ "Xen_NetworkPort", "Xen_Memory", "Xen_LogicalDisk", \ - "Xen_Processor" ] + devlist = [ "NetworkPort", "Memory", "LogicalDisk", "Processor" ] key_list = ["DeviceID", "CreationClassName", "SystemName", "SystemCreationClassName"] for items in devlist: try: - devs = devices.enumerate(options.ip, eval(items), key_list) + devs = devices.enumerate(options.ip, items, key_list, options.virt) except Exception, detail: logger.error("Exception: %s" % detail) - test_domain_function(test_xml, options.ip, "destroy") + cxml.destroy(options.ip) + cxml.undefine(options.ip) return FAIL for dev in devs: @@ -69,24 +66,27 @@ def main(): continue try: - systems = assoc.AssociatorNames(options.ip, "Xen_SystemDevice", - items, - DeviceID=dev.DeviceID, - CreationClassName=dev.CreationClassName, - SystemName=dev.SystemName, - SystemCreationClassName=dev.SystemCreationClassName) + systems = assoc.AssociatorNames(options.ip, + "SystemDevice", items, virt=options.virt, + DeviceID=dev.DeviceID, + CreationClassName=dev.CreationClassName, + SystemName=dev.SystemName, + SystemCreationClassName=dev.SystemCreationClassName) except Exception, detail: logger.error("Exception: %s" % detail) - test_domain_function(test_xml, options.ip, "destroy") + cxml.destroy(options.ip) + cxml.undefine(options.ip) return FAIL if systems == None: logger.error("Device association failed") - test_domain_function(test_xml, options.ip, "destroy") + cxml.destroy(options.ip) + cxml.undefine(options.ip) return FAIL elif len(systems) != 1: logger.error("%s systems returned, expected 1" % len(systems)) - test_domain_function(test_xml, options.ip, "destroy") + cxml.destroy(options.ip) + cxml.undefine(options.ip) return FAIL system = computersystem.system_of(options.ip, systems[0]) @@ -98,7 +98,8 @@ def main(): logger.error("Association returned wrong system: %s" % system.Name) - test_domain_function(test_xml, options.ip, "destroy") + cxml.destroy(options.ip) + cxml.undefine(options.ip) return status diff -r 15835b6f2704 -r 9d4b1e2eb6aa suites/libvirt-cim/lib/XenKvmLib/devices.py --- a/suites/libvirt-cim/lib/XenKvmLib/devices.py Tue Apr 01 10:02:21 2008 +0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py Tue Apr 01 10:38:38 2008 +0800 @@ -93,13 +93,17 @@ class KVM_Processor(CIM_Processor): class KVM_Processor(CIM_Processor): pass -def enumerate(server, devtype, keys): +def enumerate(server, basetype, keys, virt='Xen'): conn = pywbem.WBEMConnection('http://%s' % server, (Globals.CIM_USER, Globals.CIM_PASS), Globals.CIM_NS) list = [] + #FIXME - Remove once all tests are converted for KVM + basetype = basetype.split('_', 1)[-1] + + devtype = eval(get_typed_class(virt, basetype)) try: names = conn.EnumerateInstanceNames(devtype.__name__) except pywbem.CIMError, arg: From lizg at cn.ibm.com Tue Apr 1 03:25:54 2008 From: lizg at cn.ibm.com (lizg at cn.ibm.com) Date: Tue, 01 Apr 2008 11:25:54 +0800 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] .2# SystemDevice.03_fwderrs XenFV & KVM support In-Reply-To: Message-ID: <2a7c38299fe676863577.1207020354@zeit.cn.ibm.com> # HG changeset patch # User Zhengang Li # Date 1207020339 -28800 # Node ID 2a7c38299fe676863577ff2b2f5bb9a01df35a00 # Parent 9d4b1e2eb6aa19e9c9d45f33bca7f3cf29c871ee [TEST] .2# SystemDevice.03_fwderrs XenFV & KVM support - More clear vxml construction - Strip unnecessary prefix passed to devices.enumerate() Signed-off-by: Zhengang Li diff -r 9d4b1e2eb6aa -r 2a7c38299fe6 suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py --- a/suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py Tue Apr 01 10:38:38 2008 +0800 +++ b/suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py Tue Apr 01 11:25:39 2008 +0800 @@ -32,20 +32,18 @@ import pywbem import pywbem from pywbem.cim_obj import CIMInstanceName from VirtLib import utils -from XenKvmLib.test_xml import testxml +from XenKvmLib import vxml from XenKvmLib import assoc from XenKvmLib import devices -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all -from XenKvmLib.devices import Xen_NetworkPort, Xen_Memory, Xen_LogicalDisk, Xen_Processor +from XenKvmLib.classes import get_typed_class from CimTest.Globals import log_param, logger, do_main from CimTest import Globals from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV'] test_dom = "virt1" test_mac = "00:11:22:33:44:55" -test_disk = "xvda" test_cpu = 1 exp_rc1 = 1 #CIM_ERR_FAILED @@ -59,18 +57,23 @@ def main(): def main(): options = main.options + if options.virt == 'Xen': + test_disk = 'xvda' + else: + test_disk = 'hda' + log_param() status = PASS - test_xml = testxml(test_dom, vcpus = test_cpu, mac = test_mac, disk = test_disk) + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom, vcpus = test_cpu, mac = test_mac, + disk = test_disk) - test_domain_function(test_dom, options.ip, "destroy") - ret = test_domain_function(test_xml, options.ip, "create") + ret = cxml.create(options.ip) if not ret : logger.info("error while 'create' of VS") return FAIL - devlist = [ "Xen_NetworkPort", "Xen_Memory", - "Xen_LogicalDisk", "Xen_Processor" ] + devlist = [ "NetworkPort", "Memory", "LogicalDisk", "Processor" ] # Building the dict for avoiding the correct key:val pairs # while verifying with the Invalid values for the association @@ -82,8 +85,9 @@ def main(): try: for item in devlist: - devs = devices.enumerate(options.ip, eval(item), key_list) - + devs = devices.enumerate(options.ip, item, key_list, options.virt) + if len(devs) == 0: + raise Exception('empty result returned') for dev in devs: if dev.SystemName != test_dom: continue @@ -92,7 +96,7 @@ def main(): names[item] = ("DeviceID" , dev.DeviceID ) except Exception, details: - logger.info("exception ", details , item) + logger.info("Exception %s for class %s" % (details , item)) return FAIL if len(name) <=0 or len(names) <= 0: @@ -127,13 +131,14 @@ def main(): (a, b) = names[item] if i == a and keyval == b and name[i, keyval] == item: continue + cn = get_typed_class(options.virt, item) + instanceref = CIMInstanceName(cn, keybindings = {i : keyval , + "CreationClassName" : cn}) - instanceref = CIMInstanceName(item, keybindings = \ - {i : keyval , "CreationClassName" : item}) - - try: + try: + sd_classname = get_typed_class(options.virt, 'SystemDevice') conn.AssociatorNames(instanceref, - AssocClass = "Xen_SystemDevice") + AssocClass = sd_classname) rc = 0 except pywbem.CIMError, (rc, desc): @@ -161,7 +166,8 @@ def main(): logger.info("exception" , details) status = FAIL - test_domain_function(test_dom, options.ip, "destroy") + cxml.destroy(options.ip) + cxml.undefine(options.ip) return status if __name__ == "__main__": From lizg at cn.ibm.com Tue Apr 1 04:35:09 2008 From: lizg at cn.ibm.com (lizg at cn.ibm.com) Date: Tue, 01 Apr 2008 12:35:09 +0800 Subject: [Libvirt-cim] [PATCH 0 of 4] SettingsDefine XenFV & KVM support Message-ID: SettingsDefine 01~04 Also added a helper in devices.py Signed-off-by: Zhengang Li From lizg at cn.ibm.com Tue Apr 1 04:35:10 2008 From: lizg at cn.ibm.com (lizg at cn.ibm.com) Date: Tue, 01 Apr 2008 12:35:10 +0800 Subject: [Libvirt-cim] [PATCH 1 of 4] SettingsDefine 01_forward XenFV & KVM support In-Reply-To: Message-ID: # HG changeset patch # User Zhengang Li # Date 1207024493 -28800 # Node ID f6ec7e2665e05f5335f768ea9f863b5a9237a075 # Parent 2a7c38299fe676863577ff2b2f5bb9a01df35a00 SettingsDefine 01_forward XenFV & KVM support Signed-off-by: Zhengang Li diff -r 2a7c38299fe6 -r f6ec7e2665e0 suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Tue Apr 01 11:25:39 2008 +0800 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Tue Apr 01 12:34:53 2008 +0800 @@ -27,34 +27,33 @@ # Date : 29-11-2007 import sys -from XenKvmLib.test_xml import testxml from VirtLib import utils +from XenKvmLib import vxml from XenKvmLib import assoc -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all from XenKvmLib import devices +from XenKvmLib.classes import get_typed_class from CimTest import Globals from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV'] test_dom = "domu1" test_mac = "00:11:22:33:44:aa" test_vcpus = 1 -test_disk = 'xvda' def print_error(cn, detail): Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE, cn) Globals.logger.error("Exception: %s", detail) -def get_keys(cn, device_id): +def get_keys(baseccn, device_id, basesccn, virt): id = "%s/%s" % (test_dom, device_id) key_list = { 'DeviceID' : id, - 'CreationClassName' : cn, + 'CreationClassName' : get_typed_class(virt, baseccn), 'SystemName' : test_dom, - 'SystemCreationClassName' : "Xen_ComputerSystem" + 'SystemCreationClassName' : get_typed_class(virt, basesccn) } return key_list @@ -65,69 +64,51 @@ def main(): status = PASS idx = 0 + if options.virt == 'Xen': + test_disk = 'xvda' + else: + test_disk = 'hda' Globals.log_param() - destroy_and_undefine_all(options.ip) - test_xml = testxml(test_dom, vcpus = test_vcpus, mac = test_mac, \ - disk = test_disk) + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, + disk = test_disk) - ret = test_domain_function(test_xml, options.ip, cmd = "create") + ret = cxml.create(options.ip) if not ret: Globals.logger.error("Failed to Create the dom: %s", test_dom) return FAIL - try: - cn = "Xen_LogicalDisk" - key_list = get_keys(cn, test_disk) - disk = devices.Xen_LogicalDisk(options.ip, key_list) - except Exception,detail: - print_error(cn, detail) - return FAIL + cn_id = { + 'LogicalDisk' : test_disk, + 'Memory' : 'mem', + 'NetworkPort' : test_mac, + 'Processor' : test_vcpus -1 } - try: - cn = "Xen_Memory" - key_list = get_keys(cn, "mem") - mem = devices.Xen_Memory(options.ip, key_list) - except Exception, detail: - print_error(cn, detail) - return FAIL + devlist = {} + logelelst = {} + exp_inst_id_val = {} + for cn in cn_id.keys(): + key_list = get_keys(cn, cn_id[cn], 'ComputerSystem', options.virt) + 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) + logelelst[cn] = devlist[cn].DeviceID + except Exception, detail: + print_error(cn, detail) + cxml.destroy(options.ip) + cxml.undefine(options.ip) + return FAIL - try: - cn = "Xen_NetworkPort" - key_list = get_keys(cn, test_mac) - net = devices.Xen_NetworkPort(options.ip, key_list) - except Exception, detail: - print_error(cn, detail) - return FAIL - - try: - cn = "Xen_Processor" - key_list = get_keys(cn, "0") - proc = devices.Xen_Processor(options.ip, key_list) - except Exception, detail: - print_error(cn, detail) - return FAIL - - logelelst = { - "Xen_LogicalDisk" : disk.DeviceID, \ - "Xen_Memory" : mem.DeviceID, \ - "Xen_NetworkPort" : net.DeviceID, \ - "Xen_Processor" : proc.DeviceID - } - devval = [ - "domu1/xvda", \ - "domu1/mem", \ - "domu1/00:11:22:33:44:aa", \ - "domu1/0" - ] - - sccn = "Xen_ComputerSystem" - for cn, devid in sorted(logelelst.items()): + sccn = get_typed_class(options.virt, 'ComputerSystem') + for cn in logelelst.keys(): try: - assoc_info = assoc.AssociatorNames(options.ip, \ - "Xen_SettingsDefineState", - cn, - DeviceID = devid, - CreationClassName = cn, + ccn = get_typed_class(options.virt, cn) + assoc_info = assoc.AssociatorNames(options.ip, + 'SettingsDefineState', + cn, virt=options.virt, + DeviceID = logelelst[cn], + CreationClassName = ccn, SystemName = test_dom, SystemCreationClassName = sccn) @@ -137,26 +118,22 @@ def main(): status = FAIL break - if assoc_info[0]['InstanceID'] != devval[idx]: + if assoc_info[0]['InstanceID'] != exp_inst_id_val[cn]: Globals.logger.error("InstanceID Mismatch") - Globals.logger.error("Returned %s instead of %s", \ - assoc_info[0]['InstanceID'], \ - devval[idx]) + Globals.logger.error("Returned %s instead of %s" \ + % (assoc_info[0]['InstanceID'], exp_inst_id_val[cn])) status = FAIL if status != PASS: break - else: - idx = idx + 1 except Exception, detail: - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, \ - 'Xen_SettingsDefineState') + Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, sds_classname) Globals.logger.error("Exception: %s", detail) status = FAIL - ret = test_domain_function(test_dom, options.ip, \ - cmd = "destroy") + cxml.destroy(options.ip) + cxml.undefine(options.ip) return status if __name__ == "__main__": diff -r 2a7c38299fe6 -r f6ec7e2665e0 suites/libvirt-cim/lib/XenKvmLib/devices.py --- a/suites/libvirt-cim/lib/XenKvmLib/devices.py Tue Apr 01 11:25:39 2008 +0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py Tue Apr 01 12:34:53 2008 +0800 @@ -92,6 +92,9 @@ class Xen_Processor(CIM_Processor): class KVM_Processor(CIM_Processor): pass + +def get_class(classname): + return eval(classname) def enumerate(server, basetype, keys, virt='Xen'): conn = pywbem.WBEMConnection('http://%s' % server, From lizg at cn.ibm.com Tue Apr 1 04:35:13 2008 From: lizg at cn.ibm.com (lizg at cn.ibm.com) Date: Tue, 01 Apr 2008 12:35:13 +0800 Subject: [Libvirt-cim] [PATCH 4 of 4] SettingsDefine 04_sds_rev_errs XenFV & KVM support In-Reply-To: Message-ID: <11e60ff72c22ca02118c.1207024513@zeit.cn.ibm.com> # HG changeset patch # User Zhengang Li # Date 1207024497 -28800 # Node ID 11e60ff72c22ca02118c052d50b7a5de26d612b8 # Parent 306b41f451ea89ca590907f886401d6b642c1b14 SettingsDefine 04_sds_rev_errs XenFV & KVM support Signed-off-by: Zhengang Li diff -r 306b41f451ea -r 11e60ff72c22 suites/libvirt-cim/cimtest/SettingsDefine/04_sds_rev_errs.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/04_sds_rev_errs.py Tue Apr 01 12:34:57 2008 +0800 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/04_sds_rev_errs.py Tue Apr 01 12:34:57 2008 +0800 @@ -56,20 +56,18 @@ import pywbem import pywbem from VirtLib import utils from XenKvmLib import assoc -from XenKvmLib.test_xml import testxml +from XenKvmLib import vxml from XenKvmLib.common_util import try_assoc -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all +from XenKvmLib.classes import get_typed_class from CimTest.ReturnCodes import PASS, FAIL from CimTest.Globals import do_main, log_param, logger from CimTest.Globals import CIM_USER, CIM_PASS, CIM_NS -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV'] -ac_classname = 'Xen_SettingsDefineState' test_dom = "domu1" test_mac = "00:11:22:33:44:aa" test_vcpus = 1 -test_disk = 'xvda' expr_values = { "INVALID_InstID_Keyname" : { 'rc' : pywbem.CIM_ERR_FAILED, \ @@ -78,13 +76,14 @@ expr_values = { 'desc' : 'No such instance (INVALID_InstID_Keyval)'} } -def try_invalid_assoc(classname, name_val, i, field): +def try_invalid_assoc(classname, name_val, i, field, virt): keys = {} temp = name_val[i] name_val[i] = field for j in range(len(name_val)/2): 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='') if ret_val != PASS: @@ -96,18 +95,20 @@ def try_invalid_assoc(classname, name_va @do_main(sup_types) def main(): options = main.options - if not options.ip: - parser.print_help() - return FAIL log_param() status = PASS - destroy_and_undefine_all(options.ip) - test_xml = testxml(test_dom, vcpus = test_vcpus, mac = test_mac, \ - disk = test_disk) + if options.virt == 'Xen': + test_disk = 'xvda' + else: + test_disk = 'hda' + + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, + disk = test_disk) - ret = test_domain_function(test_xml, options.ip, cmd = "create") + ret = cxml.create(options.ip) if not ret: logger.error("Failed to Create the dom: %s", test_dom) return FAIL @@ -116,11 +117,12 @@ def main(): conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, \ CIM_PASS), CIM_NS) + rasd_base= 'ResourceAllocationSettingData' class_id = { - 'Xen_DiskResourceAllocationSettingData' : test_disk, \ - 'Xen_MemResourceAllocationSettingData' : 'mem', \ - 'Xen_NetResourceAllocationSettingData' : test_mac, \ - 'Xen_ProcResourceAllocationSettingData' : '0' + get_typed_class(options.virt, 'Disk' + rasd_base) : test_disk, + get_typed_class(options.virt, 'Mem' + rasd_base) : 'mem', + get_typed_class(options.virt, 'Net' + rasd_base) : test_mac, + get_typed_class(options.virt, 'Proc' + rasd_base) : test_vcpus - 1 } tc_scen = ['INVALID_InstID_Keyname', 'INVALID_InstID_Keyval'] @@ -129,11 +131,12 @@ def main(): devid = "%s/%s" % (test_dom, devid) name_val = ['InstanceID', devid] for i in range(len(tc_scen)): - retval = try_invalid_assoc(classname, name_val, i, tc_scen[i]) + retval = try_invalid_assoc(classname, name_val, i, tc_scen[i], options.virt) if retval != PASS: status = retval - test_domain_function(test_dom, options.ip, cmd = "destroy") + cxml.destroy(options.ip) + cxml.undefine(options.ip) return status if __name__ == "__main__": From lizg at cn.ibm.com Tue Apr 1 04:35:11 2008 From: lizg at cn.ibm.com (lizg at cn.ibm.com) Date: Tue, 01 Apr 2008 12:35:11 +0800 Subject: [Libvirt-cim] [PATCH 2 of 4] SettingsDefine 02_reverse XenFV & KVM support In-Reply-To: Message-ID: <9fa6fb76969e211c8cc4.1207024511@zeit.cn.ibm.com> # HG changeset patch # User Zhengang Li # Date 1207024496 -28800 # Node ID 9fa6fb76969e211c8cc41f35b4eaa4a83060496a # Parent f6ec7e2665e05f5335f768ea9f863b5a9237a075 SettingsDefine 02_reverse XenFV & KVM support Signed-off-by: Zhengang Li diff -r f6ec7e2665e0 -r 9fa6fb76969e suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Tue Apr 01 12:34:53 2008 +0800 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Tue Apr 01 12:34:56 2008 +0800 @@ -55,46 +55,38 @@ from CimTest.Globals import log_param, l from CimTest.Globals import log_param, logger, do_main from CimTest.ReturnCodes import PASS, FAIL, SKIP from VirtLib import utils -from XenKvmLib.test_xml import testxml -from XenKvmLib.test_doms import test_domain_function from XenKvmLib import assoc +from XenKvmLib import vxml +from XenKvmLib.classes import get_typed_class, get_class_basename from XenKvmLib.rasd import InstId_err -from XenKvmLib.devices import Xen_NetworkPort, Xen_Memory, Xen_LogicalDisk, Xen_Processor - - -sup_types = ['Xen'] + + +sup_types = ['Xen', 'KVM', 'XenFV'] test_dom = "virtgst" test_vcpus = 1 test_mem = 128 test_mac = "00:11:22:33:44:aa" -test_disk = 'xvdb' -VSType = "Xen" - -resources = { - "proc" : (test_dom + '/' + `0` ), \ - "net" : (test_dom + '/' + test_mac), \ - "disk" : (test_dom + '/' + test_disk), \ - "mem" : (test_dom + '/' + 'mem' ) - } - -def call_assoc(ip, inst, exp_id, ccn): + + +def call_assoc(ip, inst, exp_id, ccn, virt): if inst['InstanceID'] != exp_id: InstId_err(inst, exp_id) return FAIL try: - associnf = assoc.Associators(ip, 'Xen_SettingsDefineState', ccn, \ - InstanceID = exp_id) + associnf = assoc.Associators(ip, 'SettingsDefineState', + ccn, virt, + InstanceID = exp_id) except BaseException, detail : logger.error("Exception %s " % detail) logger.error("Error while associating Xen_SettingsDefineState with %s" % ccn) return FAIL - return SettingsDefineStateAssoc(ip, associnf) - -def VSSDCAssoc(ip, assocn): + return SettingsDefineStateAssoc(ip, associnf, virt) + +def VSSDCAssoc(ip, assocn, virt): """ The association info of Xen_VirtualSystemSettingDataComponent is verified. @@ -106,22 +98,10 @@ def VSSDCAssoc(ip, assocn): return status try: - for i in range(len(assocn)): - if assocn[i].classname == 'Xen_ProcResourceAllocationSettingData': - status = call_assoc(ip, assocn[i], resources['proc'], \ - 'Xen_ProcResourceAllocationSettingData') - - elif assocn[i].classname == 'Xen_NetResourceAllocationSettingData': - status = call_assoc(ip, assocn[i], resources['net'], \ - 'Xen_NetResourceAllocationSettingData') - - elif assocn[i].classname =='Xen_DiskResourceAllocationSettingData': - status = call_assoc(ip, assocn[i], resources['disk'], \ - 'Xen_DiskResourceAllocationSettingData') - - elif assocn[i].classname == 'Xen_MemResourceAllocationSettingData': - status = call_assoc(ip, assocn[i], resources['mem'], \ - 'Xen_MemResourceAllocationSettingData') + for rasd in assocn: + rasd_cn = get_class_basename(rasd.classname) + if rasd_cn in rasd_devid.keys(): + status = call_assoc(ip, rasd, rasd_devid[rasd_cn], rasd_cn, virt) else: status = FAIL @@ -141,7 +121,7 @@ def check_id(inst, exp_id): return PASS -def SettingsDefineStateAssoc(ip, associnfo_setDef): +def SettingsDefineStateAssoc(ip, associnfo_setDef, virt): """ The association info of Xen_SettingsDefineState is verified. """ @@ -152,20 +132,10 @@ def SettingsDefineStateAssoc(ip, associn return status try: - for i in range(len(associnfo_setDef)): - - if associnfo_setDef[i]['CreationClassName'] == 'Xen_Processor': - status = check_id(associnfo_setDef[i], resources['proc']) - - elif associnfo_setDef[i]['CreationClassName'] == 'Xen_NetworkPort': - status = check_id(associnfo_setDef[i], resources['net']) - - elif associnfo_setDef[i]['CreationClassName'] == 'Xen_LogicalDisk': - status = check_id(associnfo_setDef[i], resources['disk']) - - elif associnfo_setDef[i]['CreationClassName'] == 'Xen_Memory': - status = check_id(associnfo_setDef[i], resources['mem']) - + for dev in associnfo_setDef: + dev_cn = get_class_basename(dev['CreationClassName']) + if dev_cn in dev_devid.keys(): + status = check_id(dev, dev_devid[dev_cn]) else: status = FAIL @@ -177,42 +147,70 @@ def SettingsDefineStateAssoc(ip, associn logger.error("Exception in SettingsDefineStateAssoc function: %s" % detail) status = FAIL - test_domain_function(test_dom, ip, "destroy") - - return status + + return status + @do_main(sup_types) def main(): options = main.options + vt = options.virt + if vt == 'Xen': + test_disk = 'xvdb' + else: + test_disk = 'hdb' + status = PASS log_param() - test_domain_function(test_dom, options.ip, "destroy") - bld_xml = testxml(test_dom, mem = test_mem, vcpus = test_vcpus, - mac = test_mac, disk = test_disk) - - ret = test_domain_function(bld_xml, options.ip, cmd = "create") + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom, mem = test_mem, 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 + + if vt == 'XenFV': + VSType = 'Xen' + else: + VSType = vt + instIdval = "%s:%s" % (VSType, test_dom) + vssdc_cn = get_typed_class(vt, 'VirtualSystemSettingDataComponent') + vssd_cn = get_typed_class(vt, 'VirtualSystemSettingData') + sds_cn = get_typed_class(vt, 'SettingsDefineState') + + global rasd_devid + rasd_devid = { + 'ProcResourceAllocationSettingData' : '%s/%s' % (test_dom, test_vcpus-1), + 'NetResourceAllocationSettingData' : '%s/%s' % (test_dom, test_mac), + 'DiskResourceAllocationSettingData' : '%s/%s' % (test_dom, test_disk), + 'MemResourceAllocationSettingData' : '%s/%s' % (test_dom, 'mem')} + global dev_devid + dev_devid = { + 'Processor' : '%s/%s' % (test_dom, test_vcpus-1), + 'NetworkPort' : '%s/%s' % (test_dom, test_mac), + 'LogicalDisk' : '%s/%s' % (test_dom, test_disk), + 'Memory' : '%s/%s' % (test_dom, 'mem')} + try: - assocn = assoc.AssociatorNames(options.ip, - 'Xen_VirtualSystemSettingDataComponent', - 'Xen_VirtualSystemSettingData', + assocn = assoc.AssociatorNames(options.ip, vssdc_cn, vssd_cn, + virt = options.virt, InstanceID = instIdval) - status = VSSDCAssoc(options.ip, assocn) - - except BaseException, detail : - logger.error(Globals.CIM_ERROR_ASSOCIATORS, - 'Xen_VirtualSystemSettingDataComponent') + + status = VSSDCAssoc(options.ip, assocn, options.virt) + + except BaseException, detail : + logger.error(Globals.CIM_ERROR_ASSOCIATORS, vssdc_cn) 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__": From lizg at cn.ibm.com Tue Apr 1 04:35:12 2008 From: lizg at cn.ibm.com (lizg at cn.ibm.com) Date: Tue, 01 Apr 2008 12:35:12 +0800 Subject: [Libvirt-cim] [PATCH 3 of 4] SettingsDefine 03_sds_fwd_errs XenFV & KVM support In-Reply-To: Message-ID: <306b41f451ea89ca5909.1207024512@zeit.cn.ibm.com> # HG changeset patch # User Zhengang Li # Date 1207024497 -28800 # Node ID 306b41f451ea89ca590907f886401d6b642c1b14 # Parent 9fa6fb76969e211c8cc41f35b4eaa4a83060496a SettingsDefine 03_sds_fwd_errs XenFV & KVM support Signed-off-by: Zhengang Li diff -r 9fa6fb76969e -r 306b41f451ea suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Tue Apr 01 12:34:56 2008 +0800 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Tue Apr 01 12:34:57 2008 +0800 @@ -147,20 +147,18 @@ import pywbem import pywbem from VirtLib import utils from XenKvmLib import assoc -from XenKvmLib.test_xml import testxml +from XenKvmLib import vxml from XenKvmLib.common_util import try_assoc -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all +from XenKvmLib.classes import get_typed_class from CimTest.ReturnCodes import PASS, FAIL from CimTest.Globals import log_param, logger, CIM_USER, CIM_PASS, CIM_NS from CimTest.Globals import do_main -sup_types = ['Xen'] - -ac_classname = 'Xen_SettingsDefineState' +sup_types = ['Xen', 'KVM', 'XenFV'] + test_dom = "domu1" test_mac = "00:11:22:33:44:aa" test_vcpus = 1 -test_disk = 'xvda' expr_values = { "INVALID_DevID_Keyname" : { 'rc' : pywbem.CIM_ERR_FAILED, \ @@ -181,23 +179,24 @@ expr_values = { 'desc' : 'No such instance (SystemName)'} } -def get_name_val(classname, device_id): +def get_name_val(classname, device_id, sccn): devid = "%s/%s" % (test_dom, device_id) name_val = [ 'DeviceID' , devid, \ 'CreationClassName' , classname, \ - 'SystemCreationClassName' , "Xen_ComputerSystem", \ + 'SystemCreationClassName' , sccn, \ 'SystemName' , test_dom ] return name_val -def try_invalid_assoc(classname, name_val, i, field): +def try_invalid_assoc(classname, name_val, i, field, virt): keys = {} temp = name_val[i] name_val[i] = field for j in range(len(name_val)/2): 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='') if ret_val != PASS: @@ -211,11 +210,16 @@ def main(): log_param() status = PASS - destroy_and_undefine_all(options.ip) - test_xml = testxml(test_dom, vcpus = test_vcpus, mac = test_mac, \ - disk = test_disk) - - ret = test_domain_function(test_xml, options.ip, cmd = "create") + if options.virt == 'Xen': + test_disk = 'xvda' + else: + test_disk = 'hda' + + 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) return FAIL @@ -225,10 +229,10 @@ def main(): CIM_PASS), CIM_NS) class_id = { - 'Xen_LogicalDisk' : test_disk, \ - 'Xen_Memory' : 'mem', \ - 'Xen_NetworkPort' : test_mac, \ - 'Xen_Processor' : '0' + get_typed_class(options.virt, 'LogicalDisk') : test_disk, + get_typed_class(options.virt, 'Memory') : 'mem', + get_typed_class(options.virt, 'NetworkPort') : test_mac, + get_typed_class(options.virt, 'Processor') : test_vcpus - 1 } tc_scen = [ @@ -238,14 +242,17 @@ def main(): 'INVALID_SysName_Keyname', 'INVALID_SysName_Keyval' ] + sccn = get_typed_class(options.virt, 'ComputerSystem') for classname, devid in sorted(class_id.items()): - name_val = get_name_val(classname, devid) + name_val = get_name_val(classname, devid, sccn) for i in range(len(tc_scen)): - retval = try_invalid_assoc(classname, name_val, i, tc_scen[i]) + retval = try_invalid_assoc(classname, name_val, i, + tc_scen[i], options.virt) if retval != PASS: status = retval - test_domain_function(test_dom, options.ip, cmd = "destroy") + cxml.destroy(options.ip) + cxml.destroy(options.ip) return status if __name__ == "__main__": From zli at linux.vnet.ibm.com Tue Apr 1 04:37:40 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Tue, 01 Apr 2008 12:37:40 +0800 Subject: [Libvirt-cim] [PATCH 0 of 3] .2# SystemDevice XenFV & KVM support In-Reply-To: References: Message-ID: <47F1BC14.8070405@linux.vnet.ibm.com> lizg at cn.ibm.com wrote: > Signed-off-by: Zhengang Li > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > Sorry, forget to add [TEST] in the .2# of SystemDevice and SettingsDefine update. -- - Zhengang From yunguol at cn.ibm.com Tue Apr 1 04:40:43 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 31 Mar 2008 21:40:43 -0700 Subject: [Libvirt-cim] [PATCH] [TEST].2# ElementCapabilities.03 for XenFV and KVM support Message-ID: <6e38a0bd9771df7b5269.1207024843@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207024837 25200 # Node ID 6e38a0bd9771df7b5269d8cae8dd6faaae45cf50 # Parent 5d47437104551b638aa75e2e525e49ec4b41e3ec [TEST].2# ElementCapabilities.03 for XenFV and KVM support Signed-off-by: Guolian Yun diff -r 5d4743710455 -r 6e38a0bd9771 suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py --- a/suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py Mon Mar 31 07:54:19 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py Mon Mar 31 21:40:37 2008 -0700 @@ -25,11 +25,12 @@ from pywbem.cim_obj import CIMInstanceNa from pywbem.cim_obj import CIMInstanceName from XenKvmLib import assoc from XenKvmLib import hostsystem +from XenKvmLib.classes import get_typed_class from CimTest import Globals from CimTest.Globals import log_param, logger, do_main from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] exp_rc = 6 #CIM_ERR_NOT_FOUND exp_desc = "No such instance" @@ -38,13 +39,12 @@ def try_assoc(ref, ref_class, exp_rc, ex conn = assoc.myWBEMConnection('http://%s' % options.ip, (Globals.CIM_USER, Globals.CIM_PASS), Globals.CIM_NS) - log_param() status = FAIL rc = -1 names = [] try: - names = conn.AssociatorNames(ref, AssocClass = "Xen_ElementCapabilities") + names = conn.AssociatorNames(ref, AssocClass = get_typed_class(options.virt, "ElementCapabilities")) rc = 0 except pywbem.CIMError, (rc, desc): if rc == exp_rc and desc.find(exp_desc) >= 0: @@ -57,7 +57,8 @@ def try_assoc(ref, ref_class, exp_rc, ex logger.error(details) finally: if rc == 0: - logger.error("Xen_ElementCapabilities associator should NOT return excepted result with a wrong key name and value of %s input" % ref_class) + logger.error("ElementCapabilities associator should NOT return excepted \ + result with a wrong key name and value of %s input" % ref_class) status = FAIL return status @@ -67,18 +68,22 @@ def main(): def main(): options = main.options rc = PASS + log_param() - instanceref = CIMInstanceName("Xen_HostSystem", + hs = get_typed_class(options.virt, "HostSystem") + cs = get_typed_class(options.virt, "ComputerSystem") + + instanceref = CIMInstanceName(hs, keybindings = {"Name" : "wrong", "CreationClassName" : "wrong"}) - rc = try_assoc(instanceref, "Xen_HostSystem", exp_rc, exp_desc, options) + rc = try_assoc(instanceref, hs, exp_rc, exp_desc, options) if rc != PASS: status = FAIL return status - instance_cs = CIMInstanceName("Xen_ComputerSystem", + instance_cs = CIMInstanceName(cs, keybindings = {"Name" : "wrong", "CreationClassName" : "Xen_ComputerSystem"}) - rc = try_assoc(instance_cs, "Xen_ComputerSystem", exp_rc, exp_desc, options) + rc = try_assoc(instance_cs, cs, exp_rc, exp_desc, options) if rc != PASS: status = FAIL return status From deeptik at linux.vnet.ibm.com Tue Apr 1 06:44:51 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 01 Apr 2008 12:14:51 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Addition] : Adding check_len() function to verify the lenght of the association, list etc Message-ID: <37958b18d9a91b23b833.1207032291@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207032270 -19800 # Node ID 37958b18d9a91b23b833248f29e5edc6ab74144b # Parent 5d47437104551b638aa75e2e525e49ec4b41e3ec [TEST][Addition] : Adding check_len() function to verify the lenght of the association, list etc. Signed-off-by: Deepti B. Kalakeri diff -r 5d4743710455 -r 37958b18d9a9 suites/libvirt-cim/lib/XenKvmLib/common_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Mon Mar 31 07:54:19 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Tue Apr 01 12:14:30 2008 +0530 @@ -187,3 +187,21 @@ def try_getinstance(conn, classname, key '%s' passed.", classname, field_name) return XFAIL_RC(bug_no) +def check_len(an, assoc_list_info, qcn, crit='eq', exp_len=0): + if crit == 'ne': + expr = 'len(assoc_list_info) != exp_len' + elif crit == 'eq': + expr = 'len(assoc_list_info) == exp_len' + elif crit == 'lt': + expr = 'len(assoc_list_info) < exp_len' + elif crit == 'gt': + expr = 'len(assoc_list_info) > exp_len' + elif crit == 'le': + expr = 'len(assoc_list_info) <= exp_len' + else: + expr = 'len(assoc_list_info) <= exp_len' + if eval(expr) : + logger.error("%s returned %i %s objects, as compared with %i" % (an, len(assoc_list_info), qcn, exp_len)) + return FAIL + return PASS + From deeptik at linux.vnet.ibm.com Tue Apr 1 06:52:21 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 01 Apr 2008 12:22:21 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Fixing] Fixing the 03_rasd_errs.py, removed the extra log message Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207032702 -19800 # Node ID b44edf769748143fc161a8efc980203533a9cac8 # Parent 37958b18d9a91b23b833248f29e5edc6ab74144b [TEST][Fixing] Fixing the 03_rasd_errs.py, removed the extra log message. Signed-off-by: Deepti B. Kalakeri diff -r 37958b18d9a9 -r b44edf769748 suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py --- a/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py Tue Apr 01 12:14:30 2008 +0530 +++ b/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py Tue Apr 01 12:21:42 2008 +0530 @@ -111,7 +111,6 @@ def verify_rasd_err(field, keys, rasd_ty if ret_value != PASS: logger.error("------ FAILED: to verify %s.------", field) status = ret_value - logger.error(CIM_ERROR_GETINSTANCE, rasd_type['cn']) except Exception, detail: logger.error(CIM_ERROR_GETINSTANCE, rasd_type['cn']) logger.error("Exception: %s", detail) From deeptik at linux.vnet.ibm.com Tue Apr 1 07:03:52 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 01 Apr 2008 12:33:52 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Fixing]: Fixing the enumerate_inst() of enumclass.py Message-ID: <9b12b065560215945ce8.1207033432@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207033425 -19800 # Node ID 9b12b065560215945ce8175fad6d34136069bd06 # Parent b44edf769748143fc161a8efc980203533a9cac8 [TEST][Fixing]: Fixing the enumerate_inst() of enumclass.py. Signed-off-by: Deepti B. Kalakeri diff -r b44edf769748 -r 9b12b0655602 suites/libvirt-cim/lib/XenKvmLib/enumclass.py --- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Tue Apr 01 12:21:42 2008 +0530 +++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Tue Apr 01 12:33:45 2008 +0530 @@ -219,8 +219,7 @@ def enumerate_inst(server, classname, vi classname = "%s" % classname new_classname = classname.split('_') if len(new_classname) == 2: - classname = classname[1] - + classname = new_classname[1] classname = eval(get_typed_class(virt, classname)) instances = [] conn = pywbem.WBEMConnection('http://%s' % server, @@ -243,7 +242,7 @@ def enumerate(server, basename, keys, vi basename = new_base[1] classname = eval(get_typed_class(virt, basename)) - instances = enumerate_inst(server, classname) + instances = enumerate_inst(server, classname, virt) list = [] From yunguol at cn.ibm.com Tue Apr 1 07:05:36 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 01 Apr 2008 00:05:36 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] ElementConforms.03 for XenFV and KVM support In-Reply-To: Message-ID: <2842b5c65fefad7348ab.1207033536@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207033501 25200 # Node ID 2842b5c65fefad7348abd031bd3977ff3db760be # Parent f34da7c52c40aaba7ec9a9475398a5fcb8825c12 [TEST] ElementConforms.03 for XenFV and KVM support Signed-off-by: Guolian Yun diff -r f34da7c52c40 -r 2842b5c65fef suites/libvirt-cim/cimtest/ElementConforms/03_ectp_fwd_errs.py --- a/suites/libvirt-cim/cimtest/ElementConforms/03_ectp_fwd_errs.py Tue Apr 01 00:03:34 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementConforms/03_ectp_fwd_errs.py Tue Apr 01 00:05:01 2008 -0700 @@ -55,14 +55,13 @@ from VirtLib import utils from VirtLib import utils from XenKvmLib import assoc from XenKvmLib.common_util import try_assoc +from XenKvmLib.classes import get_typed_class from CimTest.ReturnCodes import PASS, FAIL from CimTest import Globals from CimTest.Globals import log_param, logger, CIM_USER, CIM_PASS, do_main -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] -classname = 'Xen_RegisteredProfile' -ac_classname = 'Xen_ElementConformsToProfile' bug = '92642' expr_values = { @@ -72,7 +71,9 @@ expr_values = { 'desc' : 'No such instance' } } -def try_invalid_assoc(name_val, i, field): +def try_invalid_assoc(name_val, i, field, virt="Xen"): + classname = get_typed_class(virt, "RegisteredProfile") + ac_classname = get_typed_class(virt, "ElementConformsToProfile") j = 0 keys = {} temp = name_val[i] @@ -111,7 +112,7 @@ def main(): status = retval for i in range(len(tc_scen)): - retval = try_invalid_assoc(vs_name_val, i, tc_scen[i]) + retval = try_invalid_assoc(vs_name_val, i, tc_scen[i], options.virt) if retval != PASS: status = retval From yunguol at cn.ibm.com Tue Apr 1 07:05:34 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 01 Apr 2008 00:05:34 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] [TEST] ElementConforms.01 for XenFV and KVM support In-Reply-To: Message-ID: # HG changeset patch # User Guolian Yun # Date 1207033274 25200 # Node ID bd214f299aa9e4e407b5ca60f3f33c97254379c5 # Parent 5d47437104551b638aa75e2e525e49ec4b41e3ec [TEST] ElementConforms.01 for XenFV and KVM support Signed-off-by: Guolian Yun diff -r 5d4743710455 -r bd214f299aa9 suites/libvirt-cim/cimtest/ElementConforms/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Mon Mar 31 07:54:19 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Tue Apr 01 00:01:14 2008 -0700 @@ -3,6 +3,7 @@ # Copyright 2008 IBM Corp. # # Authors: +# Guolian Yun # Kaitlin Rupert # Veerendra Chandrappa # @@ -35,11 +36,12 @@ from VirtLib import utils, live from VirtLib import utils, live from XenKvmLib import assoc from XenKvmLib.test_doms import destroy_and_undefine_all +from XenKvmLib.classes import get_typed_class from CimTest.Globals import log_param, logger, CIM_ERROR_ASSOCIATORS, do_main from CimTest import Globals from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] def verify_cs(item, id): if item['EnabledState'] != 2 and \ @@ -79,7 +81,7 @@ def main(): log_param() status = PASS - destroy_and_undefine_all(options.ip) + destroy_and_undefine_all(options.ip, options.virt) prev_namespace = Globals.CIM_NS Globals.CIM_NS = 'root/interop' @@ -89,32 +91,36 @@ def main(): "InstID1" : "CIM:DSP1042-SystemVirtualization-1.0.0" , "InstID2" : "CIM:DSP1057-VirtualSystem-1.0.0a" } + hs = get_typed_class(options.virt, "HostSystem") + cs = get_typed_class(options.virt, "ComputerSystem") + devlist = [ - "Xen_HostSystem" , \ - "Xen_ComputerSystem" + hs , \ + cs ] for args, devid in inst_lst.items() : try: - assoc_info = assoc.Associators(options.ip, \ - "Xen_ElementConformsToProfile", - "Xen_RegisteredProfile", - InstanceID = devid) + assoc_info = assoc.Associators(options.ip, + "ElementConformsToProfile", + "RegisteredProfile", + options.virt, + InstanceID = devid) if len(assoc_info) < 1: status = FAIL - logger.error("Xen_ElementConformsToProfile returned %i\ - Xen_RegisteredProfile objects" % len(assoc_info)) + logger.error("ElementConformsToProfile returned %i\ + RegisteredProfile objects" % len(assoc_info)) break count = 0 for info in assoc_info: - if info['CreationClassName'] == "Xen_ComputerSystem" : + if info['CreationClassName'] == cs : + if options.virt == "Xen" or options.virt == "XenFV": + if info['Name'] == 'Domain-0' : + count = count + 1 + verify_cs(info, devid) - if info['Name'] == 'Domain-0' : - count = count + 1 - verify_cs(info, devid) - - elif info['CreationClassName'] == "Xen_HostSystem" and \ + elif info['CreationClassName'] == hs and \ info['Name'] == host: count = count + 1 verify_host(info, devid) @@ -133,7 +139,7 @@ def main(): except BaseException, detail: - logger.error(CIM_ERROR_ASSOCIATORS, 'Xen_ElementConformsToProfile') + logger.error(CIM_ERROR_ASSOCIATORS, 'ElementConformsToProfile') logger.error("Exception: %s" % detail) status = FAIL From yunguol at cn.ibm.com Tue Apr 1 07:05:33 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 01 Apr 2008 00:05:33 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] [TEST]bundles of ElementConforms tc for XenFV and KVM support Message-ID: Signed-off-by: Guolian Yun From yunguol at cn.ibm.com Tue Apr 1 07:05:35 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 01 Apr 2008 00:05:35 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] ElementConforms.02 for XenFV and KVM support In-Reply-To: Message-ID: # HG changeset patch # User Guolian Yun # Date 1207033414 25200 # Node ID f34da7c52c40aaba7ec9a9475398a5fcb8825c12 # Parent bd214f299aa9e4e407b5ca60f3f33c97254379c5 [TEST] ElementConforms.02 for XenFV and KVM support Signed-off-by: Guolian Yun diff -r bd214f299aa9 -r f34da7c52c40 suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py --- a/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Tue Apr 01 00:01:14 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Tue Apr 01 00:03:34 2008 -0700 @@ -3,6 +3,7 @@ # Copyright 2008 IBM Corp. # # Authors: +# Guolian Yun # Kaitlin Rupert # Veerendra Chandrappa # @@ -45,11 +46,13 @@ from XenKvmLib import hostsystem from XenKvmLib import hostsystem from XenKvmLib import computersystem from XenKvmLib import assoc -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all +from XenKvmLib.classes import get_typed_class +from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib import enumclass +from XenKvmLib.vxml import XenXML, KVMXML, get_class from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] test_dom = "domgst" @@ -82,10 +85,10 @@ def main(): status = FAIL log_param() - destroy_and_undefine_all(options.ip) - test_xml = testxml(test_dom) - - ret = test_domain_function(test_xml, options.ip, cmd = "create") + destroy_and_undefine_all(options.ip, options.virt) + vsxml = get_class(options.virt)(test_dom) + vsxml.define(options.ip) + ret = vsxml.start(options.ip) if not ret: logger.error("ERROR: Failed to Create the dom: %s" % test_dom) return status @@ -93,7 +96,7 @@ def main(): inst_list = [] try: - cs_list = computersystem.enumerate(options.ip) + cs_list = computersystem.enumerate(options.ip, options.virt) # The len should be atleast two, as the CS returns info # one regarding VS and the other one for Domain-0. if len(cs_list) < 1: @@ -109,7 +112,7 @@ def main(): return status #Getting the hostname, to verify with the value returned by the assoc. - host_sys = hostsystem.enumerate(options.ip) + host_sys = hostsystem.enumerate(options.ip, options.virt) if len(host_sys) < 1: logger.error("ERROR: Enumerate returned 0 host instances") @@ -126,15 +129,16 @@ def main(): prev_namespace = Globals.CIM_NS Globals.CIM_NS = 'root/interop' - + try: key_list = ["InstanceID"] proflist = enumclass.enumerate(options.ip, \ - enumclass.Xen_RegisteredProfile, \ - key_list) + "RegisteredProfile", \ + key_list, + options.virt) except Exception, detail: logger.error(CIM_ERROR_ENUMERATE, \ - 'Xen_RegisteredProfile') + 'RegisteredProfile') logger.error("Exception: %s", detail) return status @@ -148,8 +152,9 @@ def main(): cn = item.CreationClassName name = item.Name profs = assoc.Associators(options.ip, - "Xen_ElementConformsToProfile", - cn, + "ElementConformsToProfile", + cn, + options.virt, CreationClassName=cn, Name=name) if len(profs) != 1: @@ -161,11 +166,13 @@ def main(): logger.error("Verification of profile instance failed") except Exception, detail: - logger.error(CIM_ERROR_ASSOCIATORS, 'Xen_RegisteredProfile') + logger.error(CIM_ERROR_ASSOCIATORS, 'RegisteredProfile') logger.error("Exception: %s", detail) status = FAIL - - ret = test_domain_function(test_dom, options.ip, cmd = "destroy") + + vsxml.destroy(options.ip) + vsxml.undefine(options.ip) + return status if __name__ == "__main__": From zli at linux.vnet.ibm.com Tue Apr 1 07:34:24 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Tue, 01 Apr 2008 15:34:24 +0800 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Add define with cim feature to vxml for Xen In-Reply-To: Message-ID: # HG changeset patch # User Zhengang Li # Date 1207035087 -28800 # Node ID ef540cdd8bb436318736e538eb75e82a87744fd8 # Parent 8cd4c8418acd0293dad54bce1d355b574d429cf6 [TEST] Add define with cim feature to vxml for Xen Use xml node values to construct the VSSD & RASD instances. Currently only for Xen. Signed-off-by: Zhengang Li diff -r 8cd4c8418acd -r ef540cdd8bb4 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Apr 01 14:08:00 2008 +0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Apr 01 15:31:27 2008 +0800 @@ -33,10 +33,12 @@ import os import os import platform import tempfile +import pywbem from xml.dom import minidom, Node from xml import xpath from VirtLib import utils, live -from XenKvmLib.test_doms import set_uuid +from XenKvmLib.test_doms import set_uuid, viruuid +from XenKvmLib import vsms from CimTest.Globals import logger, CIM_IP from CimTest.ReturnCodes import SKIP from XenKvmLib.classes import virt_types @@ -386,7 +388,42 @@ class VirtXML(Virsh, XMLClass): return vbr -class XenXML(VirtXML): +class VirtCIM: + def __init__(self, virt, dom_name, disk_dev, disk_source, + net_type, net_mac, vcpus, mem): + self.virt = virt + self.domain_name = dom_name + self.vssd = vsms.get_vssd_class(virt)(name=dom_name, virt=virt) + self.dasd = vsms.get_dasd_class(virt)(dev=disk_dev, + source=disk_source, + name=dom_name) + self.nasd = vsms.get_nasd_class(virt)(type=net_type, + mac=net_mac, + name=dom_name) + self.pasd = vsms.get_pasd_class(virt)(vcpu=vcpus, name=dom_name) + self.masd = vsms.get_masd_class(virt)(megabytes=mem, name=dom_name) + + def cim_define(self, ip): + service = vsms.get_vsms_class(self.virt)(ip) + sys_settings = str(self.vssd) + res_settings = [str(self.dasd), str(self.nasd), str(self.pasd), str(self.masd)] + try: + service.DefineSystem(SystemSettings=sys_settings, + ResourceSettings=res_settings, + ReferenceConfiguration=' ') + except pywbem.CIMError, (rc, desc): + logger.error('Got CIM error %s with return code %s' % (desc, rc)) + return False + + except Exception, details: + loggerr.error('Got error %s with exception %s' % (details, details.__class__.__name__)) + return False + + set_uuid(viruuid(self.domain_name, ip, self.virt)) + return True + + +class XenXML(VirtXML, VirtCIM): image_dir = "/tmp" kernel_path = os.path.join(image_dir, 'default-xen-kernel') @@ -411,6 +448,9 @@ class XenXML(VirtXML): self._os(self.kernel_path, self.init_path) self._devices(disk_file_path, disk, self.default_net_type, mac) + VirtCIM.__init__(self, 'Xen', test_dom, disk, disk_file_path, + self.default_net_type, mac, vcpus, mem) + def _os(self, os_kernel, os_initrd): os = self.get_node('/domain/os') self.add_sub_node(os, 'type', 'linux') @@ -432,12 +472,15 @@ class XenXML(VirtXML): def set_bootloader(self, ip, gtype=0): bldr = live.bootloader(ip, gtype) self.add_sub_node('/domain', 'bootloader', bldr) + self.vssd.Bootloader = bldr return bldr def set_bridge(self, ip): + self.nasd.NetworkType = 'bridge' return self._set_bridge(ip) def set_vbridge(self, ip): + self.nasd.NetworkType = 'bridge' return self._set_vbridge(ip, 'Xen') From zli at linux.vnet.ibm.com Tue Apr 1 07:34:23 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Tue, 01 Apr 2008 15:34:23 +0800 Subject: [Libvirt-cim] [PATCH 0 of 2] cim_define in vxml Message-ID: cim_define added in class VirtCIM in vxml. Also added a const module to move the default values in vxml to avoid cyclic import between vxml and vsms. Signed-off-by: Zhengang Li From zli at linux.vnet.ibm.com Tue Apr 1 07:34:25 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Tue, 01 Apr 2008 15:34:25 +0800 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Move Xen/KVM/XenFV specific const values to new place In-Reply-To: Message-ID: <322f822fa9b66dee2e5d.1207035265@zeit.cn.ibm.com> # HG changeset patch # User Zhengang Li # Date 1207035096 -28800 # Node ID 322f822fa9b66dee2e5d76bfcb87071adf27a58e # Parent ef540cdd8bb436318736e538eb75e82a87744fd8 [TEST] Move Xen/KVM/XenFV specific const values to new place. Added const.py Move reference to vxml default const values to use the new const module. This is to avoid cyclic import between vsms and vxml Signed-off-by: Zhengang Li diff -r ef540cdd8bb4 -r 322f822fa9b6 suites/libvirt-cim/lib/XenKvmLib/const.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Tue Apr 01 15:31:36 2008 +0800 @@ -0,0 +1,64 @@ +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Zhengang Li +# +# 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 + +import os +import platform + +# vxml.NetXML +default_bridge_name = 'testbridge' +default_network_name = 'default-net' + +# vxml.VirtXML +default_domname = 'domU1' +default_memory = 128 +default_vcpus = 1 + + +_image_dir = '/tmp' + +# vxml.XenXML +Xen_kernel_path = os.path.join(_image_dir, 'default-xen-kernel') +Xen_init_path = os.path.join(_image_dir, 'default-xen-initrd') +Xen_disk_path = os.path.join(_image_dir, 'default-xen-dimage') +Xen_secondary_disk_path = os.path.join(_image_dir, 'default-xen-dimage.2ND') +Xen_default_disk_dev = 'xvda' +Xen_default_mac = '11:22:33:aa:bb:cc' +Xen_default_net_type = 'ethernet' + +# vxml.KVMXML +KVM_default_emulator = '/usr/bin/qemu' +KVM_disk_path = os.path.join(_image_dir, 'default-kvm-dimage') +KVM_secondary_disk_path = os.path.join(_image_dir, 'default-kvm-dimage.2ND') +KVM_default_disk_dev = 'hda' +KVM_default_mac = '11:22:33:aa:bb:cc' + +# vxml.XenFVXML +s, o = platform.architecture() +if o == '32bit': + arch = 'lib' +else: + arch = 'lib64' +XenFV_default_loader = '/usr/lib/xen/boot/hvmloader' +XenFV_default_emulator = '/usr/%s/xen/bin/qemu-dm' % arch +XenFV_disk_path = os.path.join(_image_dir, 'default-kvm-dimage') +XenFV_secondary_disk_path = os.path.join(_image_dir, 'default-kvm-dimage.2ND') +XenFV_default_disk_dev = 'hda' +XenFV_default_mac = '00:16:3e:5d:c7:9e' +XenFV_default_net_type = 'bridge' diff -r ef540cdd8bb4 -r 322f822fa9b6 suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Tue Apr 01 15:31:27 2008 +0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Tue Apr 01 15:31:36 2008 +0800 @@ -26,7 +26,7 @@ from CimTest.CimExt import CIMMethodClas from CimTest.CimExt import CIMMethodClass, CIMClassMOF from CimTest import Globals from VirtLib import live -from XenKvmLib import vxml +from XenKvmLib import const from XenKvmLib.classes import get_typed_class, get_class_type, virt_types RASD_TYPE_PROC = 3 @@ -102,8 +102,8 @@ class CIM_VirtualSystemSettingData(CIMCl else: self.Bootloader = live.bootloader(Globals.CIM_IP, 0) self.BootloaderArgs = '' - self.Kernel = vxml.XenXML.kernel_path - self.Ramdisk = vxml.XenXML.init_path + self.Kernel = const.Xen_kernel_path + self.Ramdisk = const.Xen_init_path class Xen_VirtualSystemSettingData(CIM_VirtualSystemSettingData): @@ -199,9 +199,9 @@ def get_masd_class(virt): def default_vssd_rasd_str(dom_name='test_domain', disk_dev='xvda', - disk_source=vxml.XenXML.disk_path, + disk_source=const.Xen_disk_path, net_type='ethernet', - net_mac=vxml.XenXML.default_mac, + net_mac=const.Xen_default_mac, proc_vcpu=1, mem_mb=512, virt='Xen'): @@ -211,19 +211,19 @@ def default_vssd_rasd_str(dom_name='test class_dasd = get_dasd_class(virt) if virt == 'KVM': disk_dev = 'hda' - disk_source = vxml.KVMXML.disk_path + disk_source = const.KVM_disk_path elif virt == 'XenFV': disk_dev = 'hda' - disk_source = vxml.XenFVXML.disk_path + disk_source = const.XenFV_disk_path d = class_dasd( dev=disk_dev, source=disk_source, name=dom_name) class_nasd = get_nasd_class(virt) if virt == 'KVM': - net_mac= vxml.KVMXML.default_mac + net_mac= const.KVM_default_mac elif virt == 'XenFV': - net_mac = vxml.XenFVXML.default_mac + net_mac = const.XenFV_default_mac n = class_nasd( type=net_type, mac=net_mac, diff -r ef540cdd8bb4 -r 322f822fa9b6 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Apr 01 15:31:27 2008 +0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Apr 01 15:31:36 2008 +0800 @@ -39,6 +39,7 @@ from VirtLib import utils, live from VirtLib import utils, live from XenKvmLib.test_doms import set_uuid, viruuid from XenKvmLib import vsms +from XenKvmLib import const from CimTest.Globals import logger, CIM_IP from CimTest.ReturnCodes import SKIP from XenKvmLib.classes import virt_types @@ -156,15 +157,12 @@ class Virsh: return s == 0 class NetXML(Virsh, XMLClass): - default_bridge_name = 'testbridge' - default_network_name = 'default-net' - vbr = '' net_name = '' server = '' - def __init__(self, server, bridgename=default_bridge_name, - networkname=default_network_name, + def __init__(self, server, bridgename=const.default_bridge_name, + networkname=const.default_network_name, virt='xen'): def get_valid_bridge_name(server): @@ -210,11 +208,6 @@ class VirtXML(Virsh, XMLClass): class VirtXML(Virsh, XMLClass): """Base class for all XML generation & operation""" dname = "" # domain name - - # default values - default_domname = 'domU1' - default_memory = 128 - default_vcpus = 1 def __init__(self, domain_type, name, uuid, mem, vcpu): XMLClass.__init__(self) @@ -424,32 +417,25 @@ class VirtCIM: class XenXML(VirtXML, VirtCIM): - - image_dir = "/tmp" - kernel_path = os.path.join(image_dir, 'default-xen-kernel') - init_path = os.path.join(image_dir, 'default-xen-initrd') - disk_path = os.path.join(image_dir, 'default-xen-dimage') - secondary_disk_path = os.path.join(image_dir, 'default-xen-dimage.2ND') - default_disk_dev = 'xvda' - default_mac = '11:22:33:aa:bb:cc' - default_net_type = 'ethernet' - - def __init__(self, test_dom=VirtXML.default_domname, \ - mem=VirtXML.default_memory, \ - vcpus=VirtXML.default_vcpus, \ - mac=default_mac, \ - disk_file_path=disk_path, \ - disk=default_disk_dev): - if not (os.path.exists(self.kernel_path) and os.path.exists(self.init_path)): + + secondary_disk_path = const.Xen_secondary_disk_path + + def __init__(self, test_dom=const.default_domname, \ + mem=const.default_memory, \ + vcpus=const.default_vcpus, \ + mac=const.Xen_default_mac, \ + disk_file_path=const.Xen_disk_path, \ + disk=const.Xen_default_disk_dev): + if not (os.path.exists(const.Xen_kernel_path) and os.path.exists(const.Xen_init_path)): logger.error('ERROR: ' + \ 'Either the kernel image or the init_path does not exist') sys.exit(1) VirtXML.__init__(self, 'xen', test_dom, set_uuid(), mem, vcpus) - self._os(self.kernel_path, self.init_path) - self._devices(disk_file_path, disk, self.default_net_type, mac) + self._os(const.Xen_kernel_path, const.Xen_init_path) + self._devices(disk_file_path, disk, const.Xen_default_net_type, mac) VirtCIM.__init__(self, 'Xen', test_dom, disk, disk_file_path, - self.default_net_type, mac, vcpus, mem) + const.Xen_default_net_type, mac, vcpus, mem) def _os(self, os_kernel, os_initrd): os = self.get_node('/domain/os') @@ -485,26 +471,21 @@ class XenXML(VirtXML, VirtCIM): class KVMXML(VirtXML): - - default_emulator = '/usr/bin/qemu' - image_dir = '/tmp' - disk_path = os.path.join(image_dir, 'default-kvm-dimage') - secondary_disk_path = os.path.join(image_dir, 'default-kvm-dimage.2ND') - default_disk_dev = 'hda' - default_mac = '11:22:33:aa:bb:cc' - - def __init__(self, test_dom=VirtXML.default_domname, \ - mem=VirtXML.default_memory, \ - vcpus=VirtXML.default_vcpus, \ - mac=default_mac, \ - disk_file_path=disk_path, \ - disk=default_disk_dev): + + secondary_disk_path = const.KVM_secondary_disk_path + + def __init__(self, test_dom=const.default_domname, \ + mem=const.default_memory, \ + vcpus=const.default_vcpus, \ + mac=const.KVM_default_mac, \ + disk_file_path=const.KVM_disk_path, \ + disk=const.KVM_default_disk_dev): if not os.path.exists(disk_file_path): logger.error('Error: Disk image does not exist') sys.exit(1) VirtXML.__init__(self, 'kvm', test_dom, set_uuid(), mem, vcpus) self._os() - self._devices(self.default_emulator, disk_file_path, disk, mac) + self._devices(const.KVM_default_emulator, disk_file_path, disk, mac) def _os(self): self.add_sub_node('/domain/os', 'type', 'hvm') @@ -532,31 +513,20 @@ class KVMXML(VirtXML): class XenFVXML(VirtXML): - s, o = platform.architecture() - if o == "32bit": - arch = 'lib' - else: - arch = 'lib64' - default_loader = '/usr/lib/xen/boot/hvmloader' - default_emulator = '/usr/%s/xen/bin/qemu-dm' % arch - image_dir = '/tmp' - disk_path = os.path.join(image_dir, 'default-kvm-dimage') - default_disk_dev = 'hda' - default_mac = '00:16:3e:5d:c7:9e' - default_net_type = 'bridge' - - def __init__(self, test_dom=VirtXML.default_domname, \ - mem=VirtXML.default_memory, \ - vcpus=VirtXML.default_vcpus, \ - mac=default_mac, \ - disk_file_path=disk_path, \ - disk=default_disk_dev): + secondary_disk_path = const.XenFV_secondary_disk_path + + def __init__(self, test_dom=const.default_domname, \ + mem=const.default_memory, \ + vcpus=const.default_vcpus, \ + mac=const.XenFV_default_mac, \ + disk_file_path=const.XenFV_disk_path, \ + disk=const.XenFV_default_disk_dev): if not os.path.exists(disk_file_path): logger.error('Error: Disk image does not exist') sys.exit(1) VirtXML.__init__(self, 'xen', test_dom, set_uuid(), mem, vcpus) - self._os(self.default_loader) - self._devices(self.default_emulator, self.default_net_type, mac, disk_file_path, disk) + self._os(const.XenFV_default_loader) + self._devices(const.XenFV_default_emulator, const.XenFV_default_net_type, mac, disk_file_path, disk) def _os(self, os_loader): os = self.get_node('/domain/os') From yunguol at cn.ibm.com Tue Apr 1 08:25:17 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 01 Apr 2008 01:25:17 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] HostedService.02 for XenFV support In-Reply-To: Message-ID: <4dcaa4a1c072b45a0bce.1207038317@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207038288 25200 # Node ID 4dcaa4a1c072b45a0bce823754b92b3958ffd4a7 # Parent 89c4783a0752cd032ce995a838eef561c358a12a [TEST] HostedService.02 for XenFV support Signed-off-by: Guolian Yun diff -r 89c4783a0752 -r 4dcaa4a1c072 suites/libvirt-cim/cimtest/HostedService/02_reverse.py --- a/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Tue Apr 01 01:21:06 2008 -0700 +++ b/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Tue Apr 01 01:24:48 2008 -0700 @@ -25,12 +25,13 @@ from VirtLib import utils from VirtLib import utils from XenKvmLib import assoc from XenKvmLib import hostsystem +from XenKvmLib.classes import get_typed_class from CimTest import Globals from CimTest.Globals import do_main from CimTest.Globals import log_param, logger from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['Xen', 'KVM'] +sup_types = ['Xen', 'XenFV', 'KVM'] @do_main(sup_types) def main(): @@ -52,7 +53,7 @@ def main(): k, options.virt, Name = v, - CreationClassName = "%s_%s" % (options.virt, k), + CreationClassName = get_typed_class(options.virt, k), SystemCreationClassName = host_sys.CreationClassName, SystemName = host_sys.Name) except Exception: @@ -66,7 +67,7 @@ def main(): ccn = assoc_host[0].keybindings['CreationClassName'] name = assoc_host[0].keybindings['Name'] - if ccn != "%s_HostSystem" % options.virt: + if ccn != get_typed_class(options.virt, "HostSystem"): logger.error("CreationClassName Error") return FAIL elif name != host_sys.Name: From yunguol at cn.ibm.com Tue Apr 1 08:25:16 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 01 Apr 2008 01:25:16 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] HostedService.01 for XenFV support In-Reply-To: Message-ID: <89c4783a0752cd032ce9.1207038316@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207038066 25200 # Node ID 89c4783a0752cd032ce995a838eef561c358a12a # Parent 5d47437104551b638aa75e2e525e49ec4b41e3ec [TEST] HostedService.01 for XenFV support Signed-off-by: Guolian Yun diff -r 5d4743710455 -r 89c4783a0752 suites/libvirt-cim/cimtest/HostedService/01_forward.py --- a/suites/libvirt-cim/cimtest/HostedService/01_forward.py Mon Mar 31 07:54:19 2008 -0700 +++ b/suites/libvirt-cim/cimtest/HostedService/01_forward.py Tue Apr 01 01:21:06 2008 -0700 @@ -25,12 +25,13 @@ from VirtLib import utils from VirtLib import utils from XenKvmLib import assoc from XenKvmLib import hostsystem +from XenKvmLib.classes import get_typed_class from CimTest import Globals from CimTest.Globals import do_main from CimTest.Globals import log_param, logger from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['Xen', 'KVM'] +sup_types = ['Xen', 'XenFV', 'KVM'] @do_main(sup_types) def main(): @@ -56,9 +57,9 @@ def main(): logger.error("No association return") return FAIL - valid_services = ["%s_ResourcePoolConfigurationService" % options.virt, - "%s_VirtualSystemManagementService" % options.virt, - "%s_VirtualSystemMigrationService" % options.virt] + valid_services = [get_typed_class(options.virt, "ResourcePoolConfigurationService"), + get_typed_class(options.virt, "VirtualSystemManagementService"), + get_typed_class(options.virt, "VirtualSystemMigrationService")] for item in service: ccn = item.keybindings["CreationClassName"] if ccn not in valid_services: From yunguol at cn.ibm.com Tue Apr 1 08:25:15 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 01 Apr 2008 01:25:15 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] HostedService tc for XenFV support Message-ID: Signed-off-by: Guolian Yun From yunguol at cn.ibm.com Tue Apr 1 08:38:58 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 01 Apr 2008 01:38:58 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] ResourcePoolConfigurationCapabilities.02 for XenFV and KVM support Message-ID: <0ade340e36829a6cbaac.1207039138@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207039131 25200 # Node ID 0ade340e36829a6cbaac60e9451cd02ccbd00816 # Parent 5d47437104551b638aa75e2e525e49ec4b41e3ec [TEST] ResourcePoolConfigurationCapabilities.02 for XenFV and KVM support Signed-off-by: Guolian Yun diff -r 5d4743710455 -r 0ade340e3682 suites/libvirt-cim/cimtest/ResourcePoolConfigurationCapabilities/02_rpcc_gi_errs.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationCapabilities/02_rpcc_gi_errs.py Mon Mar 31 07:54:19 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationCapabilities/02_rpcc_gi_errs.py Tue Apr 01 01:38:51 2008 -0700 @@ -4,7 +4,7 @@ # # Authors: # Deepti B. Kalakeri -# +# Guolian Yun # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public @@ -48,12 +48,13 @@ import sys import sys import pywbem from XenKvmLib import assoc +from XenKvmLib.classes import get_typed_class from CimTest.Globals import log_param, logger, CIM_USER, CIM_PASS, CIM_NS from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.common_util import try_getinstance -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] expr_values = { "invalid_instid" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND, \ @@ -66,7 +67,7 @@ def main(): log_param() status = PASS conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS) - classname = 'Xen_ResourcePoolConfigurationCapabilities' + classname = get_typed_class(options.virt, 'ResourcePoolConfigurationCapabilities') field = 'INVALID_Instid_KeyName' keys = { field : "RPCC" } From deeptik at linux.vnet.ibm.com Tue Apr 1 09:37:49 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 01 Apr 2008 15:07:49 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Addition] : Adding 01_forward.py tc to verify ReferencedProfile Message-ID: <560b0f60eaa938d4346d.1207042669@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207042611 -19800 # Node ID 560b0f60eaa938d4346d9019d9a71f8b35cd7dfa # Parent 9b12b065560215945ce8175fad6d34136069bd06 [TEST][Addition] : Adding 01_forward.py tc to verify ReferencedProfile. Signed-off-by: Deepti B. Kalakeri diff -r 9b12b0655602 -r 560b0f60eaa9 suites/libvirt-cim/cimtest/ReferencedProfile/01_forward.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ReferencedProfile/01_forward.py Tue Apr 01 15:06:51 2008 +0530 @@ -0,0 +1,159 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 +# +# The following test case is used to verify the ReferencedProfile provider. +# +#Ex Command: +#----------- +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1057-VirtualSystem-1.0.0a"' +# +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0"' +# +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1045-MemoryResourceVirtualization-1.0.0"' +# +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1081-VirtualSystemMigration-1.0"' +# +# Output: +# ------- +# All the above examples have the following as result. +# +# localhost:5988/root/interop:Xen_RegisteredProfile. +# InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0" +# ...... +# InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0" +# RegisteredOrganization=2 +# RegisteredName="System Virtualization" +# RegisteredVersion="1.0.0" +# .... +# +# Date : 31-03-2008 +import sys +from XenKvmLib import enumclass +from XenKvmLib.assoc import Associators +from CimTest import Globals +from CimTest.Globals import log_param, logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORS +from CimTest.Globals import do_main +from XenKvmLib.classes import get_typed_class +from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib.common_util import check_len + +sup_types = ['Xen', 'KVM', 'XenFV'] + + +def init_list(): + sys_prof_info = { + "InstanceID" : "CIM:DSP1042-SystemVirtualization-1.0.0", + "RegisteredOrganization" : 2, + "RegisteredName" : "System Virtualization", + "RegisteredVersion" : "1.0.0" + } + return sys_prof_info + +def print_field_error(fieldname, ret_value, exp_value): + logger.error("%s Mismatch", fieldname) + logger.error("Returned %s instead of %s", ret_value, exp_value) + +def get_proflist(): + proflist = [] + status = PASS + try: + key_list = ["InstanceID"] + proflist = enumclass.enumerate(server, eval('enumclass.' + reg_classname), key_list, virt) + status = check_len(reg_classname, proflist, 'Profile', crit='lt', exp_len=5) + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, reg_classname) + logger.error("Exception: %s", detail) + status = FAIL + if status != PASS: + return status, proflist + profiles_instid_list = [] + for profile in proflist: + if not ("DSP1042" in profile.InstanceID): + profiles_instid_list.append(profile.InstanceID) + return status, profiles_instid_list + +def verify_ref_assoc_info(assoc_info, sys_prof_info): + if assoc_info['InstanceID'] != sys_prof_info['InstanceID']: + print_field_error('InstanceID', assoc_info['InstanceID'], sys_prof_info['InstanceID']) + return FAIL + if assoc_info['RegisteredOrganization'] != sys_prof_info['RegisteredOrganization']: + print_field_error('RegisteredOrganization', assoc_info['RegisteredOrganization'], + sys_prof_info['RegisteredOrganization']) + return FAIL + if assoc_info['RegisteredName'] != sys_prof_info['RegisteredName']: + print_field_error('RegisteredName', assoc_info['RegisteredName'], + sys_prof_info['RegisteredName']) + return FAIL + if assoc_info['RegisteredVersion'] != sys_prof_info['RegisteredVersion']: + print_field_error('RegisteredVersion', assoc_info['RegisteredVersion'], + sys_prof_info['RegisteredVersion']) + return FAIL + return PASS + + + +def get_refprof_verify_info(proflist): + assoc_info = [] + assoc_name = get_typed_class(virt, 'ReferencedProfile') + sys_prof_info = init_list() + for instid in proflist: + try: + assoc_info = Associators(server, assoc_name, reg_classname, virt, InstanceID = instid, + CreationClassName = reg_classname) + status = check_len(assoc_name, assoc_info, 'SystemVirtualization', crit='ne', exp_len=1) + if status != PASS: + break + status = verify_ref_assoc_info(assoc_info[0], sys_prof_info) + if status != PASS: + break + except Exception, detail: + logger.error(CIM_ERROR_ASSOCIATORS, assoc_name) + logger.error("Exception: %s", detail) + status = FAIL + return status + + at do_main(sup_types) +def main(): + log_param() + options = main.options + global virt, server, reg_classname + virt = options.virt + server = options.ip + status = PASS + prev_namespace = Globals.CIM_NS + Globals.CIM_NS = 'root/interop' + reg_classname = get_typed_class(virt, 'RegisteredProfile') + + status, proflist = get_proflist() + if status != PASS : + Globals.CIM_NS = prev_namespace + return status + + status = get_refprof_verify_info(proflist) + Globals.CIM_NS = prev_namespace + return status + +if __name__ == "__main__": + sys.exit(main()) From yunguol at cn.ibm.com Tue Apr 1 09:17:24 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 01 Apr 2008 02:17:24 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] ElementCapabilities.02 for XenFV and KVM support Message-ID: # HG changeset patch # User Guolian Yun # Date 1207041438 25200 # Node ID e4dd979be474106453ad38fb4c22b508377dbbec # Parent 5d47437104551b638aa75e2e525e49ec4b41e3ec [TEST] ElementCapabilities.02 for XenFV and KVM support Signed-off-by: Guolian Yun diff -r 5d4743710455 -r e4dd979be474 suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py --- a/suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py Mon Mar 31 07:54:19 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py Tue Apr 01 02:17:18 2008 -0700 @@ -26,24 +26,26 @@ from VirtLib import live from VirtLib import live from XenKvmLib import assoc from XenKvmLib import hostsystem -from XenKvmLib import vsms +from XenKvmLib import vsms +from XenKvmLib.classes import get_typed_class from CimTest.Globals import log_param, logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORNAMES from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL, SKIP -sup_types = ['xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] -def call_assoc(ip, cn, id): +def call_assoc(ip, cn, id, virt="Xen"): status = PASS ec_ele = [] try: ec_ele = assoc.AssociatorNames(ip, - "Xen_ElementCapabilities", - cn, + "ElementCapabilities", + cn, + virt, InstanceID = id) except Exception: logger.error(CIM_ERROR_ASSOCIATORNAMES, - 'Xen_ElementCapabilities') + 'ElementCapabilities') status = FAIL return status, ec_ele @@ -55,16 +57,17 @@ def filter(list, cn, exp_result): return FAIL, new_list return PASS, new_list -def verify_host(inst_list, ip): - status, list = filter(inst_list, 'Xen_HostSystem', 1) +def verify_host(inst_list, ip, virt="Xen"): + hs = get_typed_class(virt, 'HostSystem') + status, list = filter(inst_list, hs, 1) if status != PASS: return status inst = list[0] try: - host_sys = hostsystem.enumerate(ip)[0] + host_sys = hostsystem.enumerate(ip, virt)[0] except Exception: - logger.error(CIM_ERROR_ENUMERATE, 'Xen_HostSystem') + logger.error(CIM_ERROR_ENUMERATE, 'HostSystem') return FAIL creationclassname = inst.keybindings['CreationClassName'] @@ -79,17 +82,18 @@ def verify_host(inst_list, ip): return PASS -def verify_service(inst_list, ip): - status, list = filter(inst_list, 'Xen_VirtualSystemManagementService', 1) +def verify_service(inst_list, ip, virt): + service = get_typed_class(virt, "VirtualSystemManagementService") + status, list = filter(inst_list, service, 1) if status != PASS: return status inst = list[0] try: - service = vsms.enumerate_instances(ip)[0] + service = vsms.enumerate_instances(ip, virt)[0] except Exception: logger.error(CIM_ERROR_ENUMERATE, - 'Xen_VirtualSystemManagementService') + 'VirtualSystemManagementService') return FAIL creationclassname = inst.keybindings['CreationClassName'] @@ -109,28 +113,30 @@ def main(): options = main.options log_param() - cap_list = {"Xen_VirtualSystemManagementCapabilities" : "ManagementCapabilities", - "Xen_VirtualSystemMigrationCapabilities" : "MigrationCapabilities"} - + cap_list = {"VirtualSystemManagementCapabilities" : "ManagementCapabilities", + "VirtualSystemMigrationCapabilities" : "MigrationCapabilities"} + import pdb + #pdb.set_trace() for k, v in cap_list.iteritems(): - status, ec_ele = call_assoc(options.ip, k, v) + status, ec_ele = call_assoc(options.ip, k, v, options.virt) if status != PASS: return - - status = verify_host(ec_ele, options.ip) + + status = verify_host(ec_ele, options.ip, options.virt) if status != PASS: return status if v == 'ManagementCapabilities': - status = verify_service(ec_ele, options.ip) + status = verify_service(ec_ele, options.ip, options.virt) if status != PASS: return status - cs = live.domain_list(options.ip) + cs = live.domain_list(options.ip, options.virt) for system in cs: status, elec_cs = call_assoc(options.ip, - "Xen_EnabledLogicalElementCapabilities", - system) + "EnabledLogicalElementCapabilities", + system, + options.virt) if status != PASS: return @@ -138,9 +144,9 @@ def main(): logger.error("No ELEC instances returned") return FAIL - if elec_cs[0].keybindings['CreationClassName'] != "Xen_ComputerSystem": + if elec_cs[0].keybindings['CreationClassName'] != get_typed_class(options.virt, "ComputerSystem"): logger.error("Excpeted CreationClassName %s, got %s" % - ("Xen_ComputerSystem", + ("ComputerSystem", elec_cs[0].keybindings['CreationClassName'])) return FAIL elif elec_cs[0].keybindings['Name'] != system: From deeptik at linux.vnet.ibm.com Tue Apr 1 09:38:39 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 01 Apr 2008 15:08:39 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Addition] : Adding 02_reverse.py tc to verify ReferencedProfile Message-ID: <78d46047fb435f32afc4.1207042719@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207042694 -19800 # Node ID 78d46047fb435f32afc4f1b913a4c90f83866d4c # Parent 560b0f60eaa938d4346d9019d9a71f8b35cd7dfa [TEST][Addition] : Adding 02_reverse.py tc to verify ReferencedProfile. Signed-off-by: Deepti B. Kalakeri diff -r 560b0f60eaa9 -r 78d46047fb43 suites/libvirt-cim/cimtest/ReferencedProfile/02_reverse.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ReferencedProfile/02_reverse.py Tue Apr 01 15:08:14 2008 +0530 @@ -0,0 +1,168 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 +# +# The following test case is used to verify the ReferencedProfile supported +# by the VSM providers. +# +# Command: +# ------- +# +# wbemcli ai -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0"' +# +# Output: +# ------- +# localhost:5988/root/interop:Xen_RegisteredProfile.InstanceID="CIM:DSP1057-VirtualSystem-1.0.0a" +# -InstanceID="CIM:DSP1057-VirtualSystem-1.0.0a" +# -RegisteredOrganization=2 +# -RegisteredName="Virtual System Profile" +# -RegisteredVersion="1.0.0a" +# +# localhost:5988/root/interop:Xen_RegisteredProfile. +# InstanceID="CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0" +# ..... +# localhost:5988/root/interop:Xen_RegisteredProfile. +# InstanceID="CIM:DSP1045-MemoryResourceVirtualization-1.0.0" +# ...... +# localhost:5988/root/interop:Xen_RegisteredProfile. +# InstanceID="CIM:DSP1081-VirtualSystemMigration-1.0" +# ...... +# Date : 31-03-2008 +import sys +from XenKvmLib.assoc import Associators +from CimTest import Globals +from CimTest.Globals import log_param, logger, CIM_ERROR_ASSOCIATORS +from CimTest.Globals import do_main +from XenKvmLib.classes import get_typed_class +from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib.common_util import check_len + +sup_types = ['Xen', 'KVM', 'XenFV'] + + +def init_list(): + vs_prof = { + "InstanceID" : "CIM:DSP1057-VirtualSystem-1.0.0a", + "RegisteredOrganization" : 2, + "RegisteredName" : "Virtual System Profile", + "RegisteredVersion" : "1.0.0a" + } + gen_dev_prof = { + "InstanceID" : + "CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0", + "RegisteredOrganization" : 2, + "RegisteredName" : "Generic Device Resource Virtualization", + "RegisteredVersion" : "1.0.0" + } + mem_res_prof = { + "InstanceID" : "CIM:DSP1045-MemoryResourceVirtualization-1.0.0", + "RegisteredOrganization" : 2, + "RegisteredName" : "Memory Resource Virtualization", + "RegisteredVersion" : "1.0.0" + } + vs_mig_prof = { + "InstanceID" : "CIM:DSP1081-VirtualSystemMigration-1.0", + "RegisteredOrganization" : 2, + "RegisteredName" : "Virtual System Migration", + "RegisteredVersion" : "1.0" + } + + return vs_prof, gen_dev_prof, mem_res_prof, vs_mig_prof + +def print_field_error(fieldname, ret_value, exp_value): + logger.error("%s Mismatch", fieldname) + logger.error("Returned '%s' instead of '%s'", ret_value, exp_value) + + +def verify_fields(assoc_info, prof_info): + if assoc_info['InstanceID'] != prof_info['InstanceID']: + print_field_error('InstanceID', assoc_info['InstanceID'], prof_info['InstanceID']) + return FAIL + if assoc_info['RegisteredOrganization'] != prof_info['RegisteredOrganization']: + print_field_error('RegisteredOrganization', assoc_info['RegisteredOrganization'], \ + prof_info['RegisteredOrganization']) + return FAIL + if assoc_info['RegisteredName'] != prof_info['RegisteredName']: + print_field_error('RegisteredName', assoc_info['RegisteredName'], \ + prof_info['RegisteredName']) + return FAIL + if assoc_info['RegisteredVersion'] != prof_info['RegisteredVersion']: + print_field_error('RegisteredVersion', assoc_info['RegisteredVersion'], \ + prof_info['RegisteredVersion']) + return FAIL + return PASS + + +def verify_ref_assoc_info(assoc_info): + status = PASS + vs_prof, gen_dev_prof, mem_res_prof, vs_mig_prof = init_list() + for i in range(len(assoc_info)): + instid = assoc_info[i]['InstanceID'] + if instid.find("DSP1045") >=0 : + status = verify_fields(assoc_info[i], mem_res_prof) + elif instid.find("DSP1057") >=0 : + status = verify_fields(assoc_info[i], vs_prof) + elif instid.find("DSP1059") >=0 : + status = verify_fields(assoc_info[i], gen_dev_prof) + elif instid.find("DSP1081") >=0 : + status = verify_fields(assoc_info[i], vs_mig_prof) + else: + status = FAIL + if status != PASS: + break + return status + +def get_refprof_verify_info(): + assoc_info = [] + assoc_name = get_typed_class(virt, 'ReferencedProfile') + instid = "CIM:DSP1042-SystemVirtualization-1.0.0" + try: + assoc_info = Associators(server, assoc_name, reg_classname, virt, InstanceID = instid, + CreationClassName = reg_classname) + status = check_len(assoc_name, assoc_info, 'Profile', crit='ne', exp_len=4) + if status != PASS: + return status + status = verify_ref_assoc_info(assoc_info) + except Exception, detail: + logger.error(CIM_ERROR_ASSOCIATORS, assoc_name) + logger.error("Exception: %s", detail) + status = FAIL + return status + + at do_main(sup_types) +def main(): + log_param() + options = main.options + global virt, server, reg_classname + virt = options.virt + server = options.ip + status = PASS + prev_namespace = Globals.CIM_NS + Globals.CIM_NS = 'root/interop' + + reg_classname = get_typed_class(virt, 'RegisteredProfile') + status = get_refprof_verify_info() + + Globals.CIM_NS = prev_namespace + return status + +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Tue Apr 1 09:40:22 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 01 Apr 2008 15:10:22 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Addition] : Adding 03_refprofile_errs.py tc to verify ReferencedProfile Message-ID: <60f6b8f32c9d56b16337.1207042822@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207042809 -19800 # Node ID 60f6b8f32c9d56b163377ec6447a6d21436021aa # Parent 78d46047fb435f32afc4f1b913a4c90f83866d4c [TEST][Addition] : Adding 03_refprofile_errs.py tc to verify ReferencedProfile. Signed-off-by: Deepti B. Kalakeri diff -r 78d46047fb43 -r 60f6b8f32c9d suites/libvirt-cim/cimtest/ReferencedProfile/03_refprofile_errs.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ReferencedProfile/03_refprofile_errs.py Tue Apr 01 15:10:09 2008 +0530 @@ -0,0 +1,148 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 +# +# +# Test Case Info: +# -------------- +# The following test case is used to verify the ReferencedProfile association supported +# returns exceptions when invalid values are passed to it. +# +# 1) Test by passing Invalid InstanceID Key Name +# Input: +# ------ +# wbemcli ai -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.Wrong="CIM:DSP1042-SystemVirtualization-1.0.0"' -nl +# +# Output: +# ------- +# error code : CIM_ERR_FAILED +# error desc : "No InstanceID specified" +# +# 2) Test by giving invalid Invalid InstanceID Key Value +# Input: +# ------ +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="Wrong"' -nl +# +# Output: +# ------- +# error code : CIM_ERR_NOT_FOUND +# error desc : "No such instance" +# +# +# Date : 31-03-2008 + +import sys +import pywbem +from XenKvmLib import enumclass +from XenKvmLib import assoc +from CimTest import Globals +from CimTest.Globals import log_param, logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORS +from CimTest.Globals import do_main, CIM_USER, CIM_PASS +from XenKvmLib.classes import get_typed_class +from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib.common_util import check_len +from XenKvmLib.common_util import try_assoc + +sup_types = ['Xen', 'KVM', 'XenFV'] +expr_values = { + 'INVALID_Instid_KeyName' : { + 'rc' : pywbem.CIM_ERR_FAILED, + 'desc' : "No InstanceID specified" + }, + 'INVALID_Instid_KeyValue' : { + 'rc' : pywbem.CIM_ERR_NOT_FOUND, + 'desc' : "No such instance" + } + } + + +def get_proflist(): + proflist = [] + status = PASS + try: + key_list = ["InstanceID"] + proflist = enumclass.enumerate(server, eval('enumclass.' + reg_classname), key_list, virt) + status = check_len(reg_classname, proflist, 'Profile', crit='lt', exp_len=5) + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, reg_classname) + logger.error("Exception: %s", detail) + status = FAIL + if status != PASS: + return status, proflist + profiles_instid_list = [] + for profile in proflist: + profiles_instid_list.append(profile.InstanceID) + return status, profiles_instid_list + + +def verify_prof_err(field, keys): + status = PASS + assoc_classname = get_typed_class(virt, 'ReferencedProfile') + try: + ret_value = try_assoc(conn, reg_classname, assoc_classname, keys, field_name=field, \ + expr_values=expr_values[field], bug_no="") + if ret_value != PASS: + logger.error("------ FAILED: to verify %s.------", field) + status = ret_value + except Exception, detail: + logger.error(CIM_ERROR_ASSOCIATORS, assoc_classname) + logger.error("Exception: %s", detail) + status = FAIL + return status + + + at do_main(sup_types) +def main(): + log_param() + options = main.options + global virt, server, reg_classname, conn + virt = options.virt + server = options.ip + status = PASS + prev_namespace = Globals.CIM_NS + Globals.CIM_NS = 'root/interop' + reg_classname = get_typed_class(virt, 'RegisteredProfile') + status, proflist = get_proflist() + if status != PASS : + Globals.CIM_NS = prev_namespace + return status + + conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), Globals.CIM_NS) + + for prof in sorted(proflist): + field = 'INVALID_Instid_KeyName' + keys = { field : prof } + status = verify_prof_err(field, keys) + if status != PASS: + break + + field = 'INVALID_Instid_KeyValue' + keys = { 'InstanceID' : field } + status = verify_prof_err(field, keys) + if status != PASS: + break + + Globals.CIM_NS = prev_namespace + return status + +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Tue Apr 1 13:08:21 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 01 Apr 2008 18:38:21 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Addition] Add cross-provider test case 06_hs_to_vsms.py Message-ID: <74a458de2c6ed158c83f.1207055301@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207055270 -19800 # Node ID 74a458de2c6ed158c83f0bf7e3687fc36f46b284 # Parent 60f6b8f32c9d56b163377ec6447a6d21436021aa [TEST][Addition] Add cross-provider test case 06_hs_to_vsms.py. It traverses the following path: {Hostsystem} --> [HostedService] {VirtualSystemMigrationService} --> [ElementCapabilities] {VirtualSystemMigrationCapabilities} --> [SettingsDefineCapabilities] {VirtualSystemMigrationSettingData} Verify the VirtualSystemMigrationSettingData. Signed-off-by: Deepti B. Kalakeri diff -r 60f6b8f32c9d -r 74a458de2c6e suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py Tue Apr 01 18:37:50 2008 +0530 @@ -0,0 +1,208 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 is a cross-provider testcase to +# Get the MigrationSettingData properties starting from the host +# +# It traverses the following path: +# {Hostsystem} --> [HostedService] {VirtualSystemMigrationService} --> +# [ElementCapabilities] {VirtualSystemMigrationCapabilities} --> +# [SettingsDefineCapabilities] {VirtualSystemMigrationSettingData} +# Verify the VirtualSystemMigrationSettingData. +# +# Steps: +# ------ +# 1) Get the hostname by enumerating the hostsystem. +# 2) Get the various service on the host by using the HostedService association by supplying +# the inputs obtained from querying the hostsystem. +# 4) Select the VirtualSystemMigrationService from the association returned. We should get only +# one record. +# 5) Use the VirtualSystemMigrationService information to query ElementCapabilities association +# Verify that we should get only one MigrationCapabilities record from the VSMS association. +# 6) Obtain the VSMigrationSettingData values by using the MigrationCapabilities output from the +# previous query and supplying it to the SettingsDefineCapabilities association. +# 7) Check, that we obtain only one VSMigrationSettingData data. +# Verify the VSMigrationSettingData values. +# Date : 28.03.2008 + +import sys +from CimTest.Globals import do_main +from XenKvmLib.classes import get_typed_class +from XenKvmLib.assoc import Associators, AssociatorNames +from XenKvmLib.common_util import get_host_info, check_len +from CimTest.Globals import log_param, logger, CIM_ERROR_ASSOCIATORNAMES, \ +CIM_ERROR_ASSOCIATORS +from CimTest.ReturnCodes import PASS, FAIL + +sup_types = ['Xen', 'KVM', 'XenFV'] + +def print_err(err, detail, cn): + logger.error(err % cn) + logger.error("Exception: %s", detail) + +def print_field_error(fieldname, ret_value, exp_value): + logger.error("%s Mismatch", fieldname) + logger.error("Returned %s instead of %s", ret_value, exp_value) + + +def get_inst_from_list(server, cn, assoc_info, filter_name, exp_val): + status = PASS + ret = -1 + inst = [] + for rec in assoc_info: + record = rec[filter_name['key']] + if record == exp_val: + inst.append(rec) + ret = PASS + + # When no records are found. + if ret != PASS: + logger.error("%s with %s was not returned" % (cn, exp_val)) + status = FAIL + + return status, inst + +def get_assocnames_info(server, cn, an, qcn, name): + status = PASS + assoc_info = [] + try: + assoc_info = AssociatorNames(server, an, cn, virt, Name = name, CreationClassName = cn) + status = check_len(an, assoc_info, qcn, crit='lt', exp_len=3) + except Exception, detail: + print_err(CIM_ERROR_ASSOCIATORNAMES, detail, an) + status = FAIL + + return status, assoc_info + + +def get_vsms_info(): + status, host_name, classname = get_host_info(server, virt) + if status != PASS: + return status, [] + status, service_assoc_info = get_assocnames_info(server, classname, + assoc_name, req_cn, host_name) + if status != PASS or len(service_assoc_info) == 0: + return status, service_assoc_info + filter_name = {"key" : "Name"} + filter_value = 'MigrationService' + cn = 'VirtualSystemMigrationService' + status, vsms_list = get_inst_from_list(server, cn, service_assoc_info, filter_name, + filter_value) + return status, vsms_list + +def get_vsmcap_from_ec(vsms_list): + vsms_info = vsms_list[0] + cn = vsms_info['CreationClassName'] + sn = vsms_info['SystemName'] + name = vsms_info['Name'] + sccn = vsms_info['SystemCreationClassName'] + assoc_info = [] + try: + assoc_info = AssociatorNames(server, assoc_name, cn, virt, CreationClassName = cn, + SystemName = sn, Name = name, SystemCreationClassName = sccn) + status = check_len(assoc_name, assoc_info, req_cn, crit='ne', exp_len=1) + + except Exception, detail: + print_err(CIM_ERROR_ASSOCIATORNAMES, detail, assoc_name) + status = FAIL + + return status, assoc_info + +def get_vsmsd_from_sdc(vsmsd_list): + vsmsd_info = vsmsd_list[0] + cn = vsmsd_info.classname + instid = vsmsd_info['InstanceID'] + assoc_info = [] + try: + assoc_info = Associators(server, assoc_name, cn, virt, CreationClassName = cn, + InstanceID = instid) + status = check_len(assoc_name, assoc_info, req_cn, crit='ne', exp_len=1) + + except Exception, detail: + print_err(CIM_ERROR_ASSOCIATORS, detail, assoc_name) + status = FAIL + + return status, assoc_info + +def verify_vsmsd_values(vsmsd_list): + + # Values to be used for comparison + cn = get_typed_class(virt, "VirtualSystemMigrationSettingData") + instid = 'MigrationSettingData' + MType = 2 #[CIM_MIGRATE_LIVE] + priority = 0 + + verify_vsmsd = vsmsd_list[0] + if verify_vsmsd.classname != cn: + print_field_error('ClassName', verify_vsmsd.classname, cn) + return FAIL + if verify_vsmsd['InstanceID'] != instid: + print_field_error('InstanceID', verify_vsmsd['InstanceID'], instid) + return FAIL + if verify_vsmsd['MigrationType'] != MType: + print_field_error('MigrationType', verify_vsmsd['MigrationType'], MType) + return FAIL + if verify_vsmsd['Priority'] != priority: + print_field_error('Priority', verify_vsmsd['Priority'], priority) + return FAIL + return PASS + + + at do_main(sup_types) +def main(): + global virt, server + global assoc_name, class_name, req_cn + options = main.options + log_param() + server = options.ip + status = PASS + virt = options.virt + + assoc_name = get_typed_class(virt, 'HostedService') + req_cn = 'Service' + status, vsms_list = get_vsms_info() + if status != PASS or len(vsms_list) == 0: + logger.error("Did not get the expected MigrationService record") + return status + status = check_len(assoc_name, vsms_list, req_cn, crit='ne', exp_len=1) + if status != PASS: + return status + + assoc_name = get_typed_class(virt, 'ElementCapabilities') + req_cn = 'MigrationCapabilities' + status, vsmscap = get_vsmcap_from_ec(vsms_list) + if status != PASS or len(vsmscap) == 0: + logger.error("Did not get the expected MigrationCapabilities record") + return status + + assoc_name = get_typed_class(virt, 'SettingsDefineCapabilities') + req_cn = 'MigrationSettingData' + status, vsmsd = get_vsmsd_from_sdc(vsmscap) + if status != PASS or len(vsmsd) == 0: + logger.error("Did not get the expected MigrationSettingData record") + return status + + status = verify_vsmsd_values(vsmsd) + + return status +if __name__ == "__main__": + sys.exit(main()) From danms at us.ibm.com Tue Apr 1 13:33:44 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 01 Apr 2008 06:33:44 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] bundles of ComputerSystemCreatedIndication tc In-Reply-To: (Guo Lian Yun's message of "Mon, 31 Mar 2008 19:38:09 -0700") References: Message-ID: <87ej9pog1z.fsf@caffeine.beaverton.ibm.com> Did you change this set or were you just resending because I didn't apply? I'm waiting for some review comments... -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From deeptik at linux.vnet.ibm.com Tue Apr 1 13:37:17 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 01 Apr 2008 19:07:17 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Addition] : Adding 02_enum.py tc to verify RASD properties Message-ID: <8f853c0a97356add8790.1207057037@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207057013 -19800 # Node ID 8f853c0a97356add879048a403dcad9b02d9e72f # Parent 74a458de2c6ed158c83f0bf7e3687fc36f46b284 [TEST][Addition] : Adding 02_enum.py tc to verify RASD properties. Signed-off-by: Deepti B. Kalakeri diff -r 74a458de2c6e -r 8f853c0a9735 suites/libvirt-cim/cimtest/RASD/02_enum.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/RASD/02_enum.py Tue Apr 01 19:06:53 2008 +0530 @@ -0,0 +1,201 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 ResourceAllocationSettingData +# properties in detail. +# +# Date : 26-03-2008 +# + + +import sys +import XenKvmLib +from XenKvmLib import enumclass +from CimTest.Globals import do_main, CIM_ERROR_ENUMERATE +from XenKvmLib.test_doms import destroy_and_undefine_all +from XenKvmLib.vxml import get_class +from XenKvmLib.classes import get_typed_class +from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \ +verify_diskrasd_values, verify_memrasd_values +from CimTest.Globals import log_param, logger +from CimTest.ReturnCodes import PASS, FAIL + +sup_types = ['Xen', 'KVM', 'XenFV'] + +test_dom = "VSSDC_dom" +test_vcpus = 1 +test_mem = 128 +test_mac = "00:11:22:33:44:aa" + +def init_list(virt="Xen"): + """ + Creating the lists that will be used for comparisons. + """ + procrasd = { + "InstanceID" : '%s/%s' %(test_dom,0),\ + "ResourceType" : 3,\ + "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') + } + + netrasd = { + "InstanceID" : '%s/%s' %(test_dom,test_mac), \ + "ResourceType" : 10 , \ + "ntype1": "bridge", \ + "ntype2": "ethernet", \ + "CreationClassName": get_typed_class(virt, 'NetResourceAllocationSettingData') + } + address = eval("%s.%s" % (get_class(virt), 'disk_path')) + diskrasd = { + "InstanceID" : '%s/%s' %(test_dom, test_disk), \ + "ResourceType" : 17, \ + "Address" : address, \ + "CreationClassName": get_typed_class(virt, 'DiskResourceAllocationSettingData') + } + memrasd = { + "InstanceID" : '%s/%s' %(test_dom, "mem"), \ + "ResourceType" : 4, \ + "AllocationUnits" : "MegaBytes",\ + "VirtualQuantity" : (test_mem * 1024), \ + "CreationClassName": get_typed_class(virt, 'MemResourceAllocationSettingData') + } + return procrasd, netrasd, diskrasd, memrasd + +def get_inst_from_list(classname, rasd_list, filter_name, exp_val): + status = PASS + ret = FAIL + inst = [] + for rec in rasd_list: + record = rec[filter_name['key']] + if exp_val in record : + inst.append(rec) + ret = PASS + if ret != PASS: + logger.error("%s with %s was not returned" % (classname, exp_val)) + vsxml.undefine(server) + status = FAIL + return status, inst + +def get_rasd_values(classname): + status = PASS + rasd_list = [] + try: + rasd_list = enumclass.enumerate_inst(server, eval('enumclass.' + classname), virt) + if len(rasd_list) < 1: + logger.error("%s returned %i instances, excepted atleast 1 instance", classname, \ + len(rasd_list)) + return FAIL, rasd_list + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, classname) + logger.error("Exception: %s", detail) + return FAIL, rasd_list + + # Get the RASD info related to the domain "ONLY". + # We should get atleast one record. + filter_name = {"key" : "InstanceID"} + status, rasd_values = get_inst_from_list(classname, rasd_list, filter_name, test_dom) + if status != PASS or len(rasd_values) == 0: + return status, rasd_values + + return status, rasd_values + + +def verify_rasd_values(rasd_values_info): + try: + for rasd_instance in rasd_values_info: + CCName = rasd_instance.classname + if 'ProcResourceAllocationSettingData' in CCName : + status = verify_procrasd_values(rasd_instance, procrasd,) + elif 'NetResourceAllocationSettingData' in CCName : + status = verify_netrasd_values(rasd_instance, netrasd) + elif 'DiskResourceAllocationSettingData' in CCName: + status = verify_diskrasd_values(rasd_instance, diskrasd) + elif 'MemResourceAllocationSettingData' in CCName : + status = verify_memrasd_values(rasd_instance, memrasd) + else: + status = FAIL + if status != PASS: + logger.error("Mistmatching %s values", CCName ) + break + except Exception, detail : + logger.error("Exception in verify_rasd_values function: %s" % detail) + status = FAIL + return status + + at do_main(sup_types) +def main(): + options = main.options + log_param() + destroy_and_undefine_all(options.ip) + global test_disk, vsxml + global virt, server + global procrasd, netrasd, diskrasd, memrasd + server = options.ip + virt = options.virt + if virt == "Xen": + test_disk = "xvda" + else: + test_disk = "hda" + vsxml = get_class(virt)(test_dom, mem=test_mem, vcpus = test_vcpus, mac = test_mac, + disk = test_disk) + try: + bridge = vsxml.set_vbridge(server) + ret = vsxml.define(options.ip) + if not ret: + logger.error("Failed to Define the domain: %s", test_dom) + return FAIL + except Exception, details: + logger.error("Exception : %s", details) + return FAIL + class_list = [ get_typed_class(virt, "DiskResourceAllocationSettingData"), + get_typed_class(virt, "MemResourceAllocationSettingData"), + get_typed_class(virt, "ProcResourceAllocationSettingData"), + get_typed_class(virt, "NetResourceAllocationSettingData") + ] + status = PASS + procrasd, netrasd, diskrasd, memrasd = init_list(virt) + + # For each loop + # 1) Enumerate one RASD type + # 2) Get the RASD info related to the domain "ONLY". + # 3) Verifies the RASD values with those supplied during defining the domain. + + for classname in sorted(class_list): + # Enumerate each RASD types + status, rasd_values = get_rasd_values(classname) + if status != PASS or len(rasd_values) ==0 : + break + + # Verify RASD values. + status = verify_rasd_values(rasd_values) + if status != PASS: + break + + try: + vsxml.undefine(server) + except Exception, detail: + logger.error("Failed to undefine domain %s", test_dom) + logger.error("Exception: %s", detail) + status = FAIL + return status + +if __name__ == "__main__": + sys.exit(main()) From danms at us.ibm.com Tue Apr 1 13:37:42 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 01 Apr 2008 06:37:42 -0700 Subject: [Libvirt-cim] [PATCH 2 of 5] [TEST] update RAFP.01 for XenFV and KVM support In-Reply-To: <47F19349.1030808@linux.vnet.ibm.com> (Zhengang Li's message of "Tue, 01 Apr 2008 09:43:37 +0800") References: <47F19349.1030808@linux.vnet.ibm.com> Message-ID: <87abkdofvd.fsf@caffeine.beaverton.ibm.com> >> # HG changeset patch >> # User Guolian Yun >> # Date 1206950184 25200 >> # Node ID e1cd8daac37d7ac78879912e4c635f1e9b17ed0f >> # Parent 41d06111a09a3f7542fab1cedfdba5bf0e87f6c8 >> [TEST] update RAFP.01 for XenFV and KVM support >> >> Signed-off-by: Guolian Yun ZL> +1 from me :) I've applied this patch from the series, so when you resubmit the others, be sure to leave it out. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From deeptik at linux.vnet.ibm.com Tue Apr 1 13:39:33 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 01 Apr 2008 19:09:33 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] [Addition] Add cross-provider test case 04_vssd_to_rasd.py Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207057156 -19800 # Node ID f04ed96435d9efdf0c3c95fe9b8c45f01906bc76 # Parent 8f853c0a97356add879048a403dcad9b02d9e72f [TEST] [Addition] Add cross-provider test case 04_vssd_to_rasd.py. It traverses the following path: {VSSD} --> [VirtualSystemSettingDataComponent](RASD) Verify the Device RASD returned with the values expected - those given in the xml description. Signed-off-by: Deepti B. Kalakeri diff -r 8f853c0a9735 -r f04ed96435d9 suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Tue Apr 01 19:09:16 2008 +0530 @@ -0,0 +1,234 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 is a cross-provider testcase to +# Get the setting data properties for the given guest. +# +# +# It traverses the following path: +# {VSSD} --> [VirtualSystemSettingDataComponent](RASD) +# (Verify the Device RASD returned with the values expected - those given in test_xml) +# +# Steps: +# ------ +# 1) Define a guest domain. +# 1) Get the VSSD info using enumeration. +# 2) From the VSSD output get the info related to the domain. We expect only one +# VSSD info related to the domain to be returned. +# 4) Get the various devices allocated to the domain by using the VirtualSystemSettingDataComponent +# association and giving the VSSD output from the previous VSSD enumeration as inputs. +# 5) Verify the Disk, Memory, Network, Processor RASD values. +# 7) Undefine the guest domain. +# +# Date : 26-03-2008 + + +import sys +import XenKvmLib +from XenKvmLib import enumclass +from XenKvmLib.common_util import check_len +from CimTest.Globals import do_main, CIM_ERROR_ASSOCIATORS, CIM_ERROR_ENUMERATE +from CimTest.Globals import log_param, logger +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.test_doms import destroy_and_undefine_all +from XenKvmLib import assoc +from XenKvmLib.vxml import get_class +from XenKvmLib.classes import get_typed_class +from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \ +verify_diskrasd_values, verify_memrasd_values + +sup_types = ['Xen', 'KVM', 'XenFV'] + +test_dom = "VSSDC_dom" +test_vcpus = 1 +test_mem = 128 +test_mac = "00:11:22:33:44:aa" + +def setup_env(): + vsxml_info = None + vsxml_info = get_class(virt)(test_dom, mem=test_mem, vcpus = test_vcpus, + mac = test_mac, disk = test_disk) + try: + bridge = vsxml_info.set_vbridge(server) + ret = vsxml_info.define(server) + if not ret: + logger.error("Failed to Define the domain: %s", test_dom) + return FAIL, vsxml_info + except Exception, details: + logger.error("Exception : %s", details) + return FAIL, vsxml_info + return PASS, vsxml_info + +def init_list(virt): + """ + Creating the lists that will be used for comparisons. + """ + procrasd = { + "InstanceID" : '%s/%s' %(test_dom,0),\ + "ResourceType" : 3,\ + "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') + } + + netrasd = { + "InstanceID" : '%s/%s' %(test_dom,test_mac), \ + "ResourceType" : 10 , \ + "ntype1": "bridge", \ + "ntype2": "ethernet", \ + "CreationClassName": get_typed_class(virt, 'NetResourceAllocationSettingData') + } + + address = eval("%s.%s" % (get_class(virt), 'disk_path')) + diskrasd = { + "InstanceID" : '%s/%s' %(test_dom, test_disk), \ + "ResourceType" : 17, \ + "Address" : address, \ + "CreationClassName": get_typed_class(virt, 'DiskResourceAllocationSettingData') + } + memrasd = { + "InstanceID" : '%s/%s' %(test_dom, "mem"), \ + "ResourceType" : 4, \ + "AllocationUnits" : "MegaBytes",\ + "VirtualQuantity" : (test_mem * 1024), \ + "CreationClassName": get_typed_class(virt, 'MemResourceAllocationSettingData') + } + return procrasd, netrasd, diskrasd, memrasd + +def get_inst_from_list(classname, vssd_list, filter_name, exp_val): + status = PASS + ret = -1 + inst = [] + for rec in vssd_list: + record = rec[filter_name['key']] + if record.find(exp_val) >=0 : + inst.append(rec) + ret = PASS + + # When no records are found. + if ret != PASS: + logger.error("%s with %s was not returned" % (classname, exp_val)) + status = FAIL + + # We expect only one record to be returned. + status = check_len(classname, inst, 'VSSD' , crit='ne', exp_len=1) + + if status != PASS: + vsxml.undefine(server) + + return status, inst + +def get_vssd_info(): + vssd = [] + try: + classname = get_typed_class(virt, 'VirtualSystemSettingData') + vssd = enumclass.enumerate_inst(server, eval('enumclass.' + classname), virt) + status = check_len(classname, vssd, 'VSSD' , crit='lt', exp_len=1) + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, classname) + logger.error("Exception: %s", detail) + status = FAIL + + if status != PASS: + return FAIL, vssd + + filter_name = {"key" : "InstanceID"} + # Get the info ONLY related to the domain. + status, vssd_values = get_inst_from_list(classname, vssd, filter_name, test_dom) + + return status, vssd_values + +def get_rasd_values_from_vssdc_assoc(vssd_values): + status = PASS + vssdc_assoc_info = [] + # We should have only one VSSD record, the check for this is already done in + # get_inst_from_list() function, hence can safely use index 0. + instIdval = vssd_values[0]['InstanceID'] + qcn = vssd_values[0].classname + assoc_cname = get_typed_class(virt, 'VirtualSystemSettingDataComponent') + try: + vssdc_assoc_info = assoc.Associators(server, assoc_cname, qcn, virt, InstanceID = instIdval) + status = check_len(assoc_cname, vssdc_assoc_info, qcn, crit='lt', exp_len=1) + except Exception, details: + logger.error(CIM_ERROR_ASSOCIATORS, assoc_cname) + logger.error("Exception : %s" % details) + status = FAIL + return status, vssdc_assoc_info + +def verify_rasd_values(rasd_values_info): + procrasd, netrasd, diskrasd, memrasd = init_list(virt) + try: + for rasd_instance in rasd_values_info: + CCName = rasd_instance.classname + if 'ProcResourceAllocationSettingData' in CCName: + status = verify_procrasd_values(rasd_instance, procrasd,) + elif 'NetResourceAllocationSettingData' in CCName : + status = verify_netrasd_values(rasd_instance, netrasd) + elif 'DiskResourceAllocationSettingData' in CCName: + status = verify_diskrasd_values(rasd_instance, diskrasd) + elif 'MemResourceAllocationSettingData' in CCName : + status = verify_memrasd_values(rasd_instance, memrasd) + else: + status = FAIL + if status != PASS: + logger.error("Mistmatching %s values", CCName ) + break + except Exception, detail : + logger.error("Exception in verify_rasd_values function: %s" % detail) + status = FAIL + return status + + at do_main(sup_types) +def main(): + options = main.options + log_param() + destroy_and_undefine_all(options.ip) + global test_disk, vsxml + global virt, server + server = options.ip + virt = options.virt + if virt == "Xen": + test_disk = "xvda" + else: + test_disk = "hda" + + status, vsxml = setup_env() + if status != PASS: + return status + + status, vssd_values = get_vssd_info() + if status != PASS or len(vssd_values) == 0: + return status + + status, rasd_values = get_rasd_values_from_vssdc_assoc(vssd_values) + if status != PASS or len(rasd_values) == 0: + vsxml.undefine(server) + return status + + status = verify_rasd_values(rasd_values) + try: + vsxml.undefine(server) + except Exception, detail: + logger.error("Failed to undefine domain %s", test_dom) + logger.error("Exception: %s", detail) + status = FAIL + return status + +if __name__ == "__main__": + sys.exit(main()) From danms at us.ibm.com Tue Apr 1 14:57:56 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 01 Apr 2008 07:57:56 -0700 Subject: [Libvirt-cim] [PATCH] [TEST][Addition] : Adding check_len() function to verify the lenght of the association, list etc In-Reply-To: <37958b18d9a91b23b833.1207032291@dkalaker> (Deepti B. Kalakeri's message of "Tue, 01 Apr 2008 12:14:51 +0530") References: <37958b18d9a91b23b833.1207032291@dkalaker> Message-ID: <87y77xmxl7.fsf@caffeine.beaverton.ibm.com> DK> +def check_len(an, assoc_list_info, qcn, crit='eq', exp_len=0): DK> + if crit == 'ne': DK> + expr = 'len(assoc_list_info) != exp_len' DK> + elif crit == 'eq': DK> + expr = 'len(assoc_list_info) == exp_len' DK> + elif crit == 'lt': DK> + expr = 'len(assoc_list_info) < exp_len' DK> + elif crit == 'gt': DK> + expr = 'len(assoc_list_info) > exp_len' DK> + elif crit == 'le': DK> + expr = 'len(assoc_list_info) <= exp_len' DK> + else: DK> + expr = 'len(assoc_list_info) <= exp_len' DK> + if eval(expr) : DK> + logger.error("%s returned %i %s objects, as compared with %i" % (an, len(assoc_list_info), qcn, exp_len)) DK> + return FAIL DK> + return PASS DK> + Sorry, but this will not go into the tree. Ever. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Apr 1 15:33:38 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 01 Apr 2008 08:33:38 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] ElementConforms.02 for XenFV and KVM support References: Message-ID: <87myodmvxp.fsf@caffeine.beaverton.ibm.com> GY> + vsxml = get_class(options.virt)(test_dom) As mentioned in regards to a previous patch by Zhen Gang, I'd like a temporary variable here to avoid confusion. I'll apply the other two patches in this set though. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From yunguol at cn.ibm.com Wed Apr 2 01:44:37 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 2 Apr 2008 09:44:37 +0800 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] bundles of ComputerSystemCreatedIndication tc In-Reply-To: <87ej9pog1z.fsf@caffeine.beaverton.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-04-01 21:33:44: > Did you change this set or were you just resending because I didn't > apply? I'm waiting for some review comments... > With the changed indication_tester, I think maybe it's better to resubmit this set. Of course, the same as former. > -- > Dan Smith > IBM Linux Technology Center > Open Hypervisor Team > email: danms at us.ibm.com > [attachment "atti4zoe.dat" deleted by Guo Lian Yun/China/IBM] > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From yunguol at cn.ibm.com Wed Apr 2 02:13:19 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 01 Apr 2008 19:13:19 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] ResourceAllocationFromPool.04 for XenFV and KVM support In-Reply-To: Message-ID: <4fe59e28f8ca31b614a3.1207102399@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207102363 25200 # Node ID 4fe59e28f8ca31b614a3e40874c81704d2fe3929 # Parent 75a8df2db061d1a3998e5c6f0528563563d28a93 [TEST] ResourceAllocationFromPool.04 for XenFV and KVM support Signed-off-by: Guolian Yun diff -r 75a8df2db061 -r 4fe59e28f8ca suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py Tue Apr 01 19:08:47 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py Tue Apr 01 19:12:43 2008 -0700 @@ -24,11 +24,12 @@ import pywbem import pywbem from pywbem.cim_obj import CIMInstanceName from XenKvmLib import assoc +from XenKvmLib.classes import get_typed_class from CimTest import Globals from CimTest.Globals import log_param, logger, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] exp_rc = 6 #CIM_ERR_NOT_FOUND exp_desc = "No such instance" @@ -41,7 +42,8 @@ def main(): status = FAIL - dataset = {"Xen_MemResourceAllocationSettingData" : "wrong", "Xen_ProcResourceAllocationSettingData" : "wrong"} + dataset = {get_typed_class(options.virt, "MemResourceAllocationSettingData") : "wrong", + get_typed_class(options.virt, "ProcResourceAllocationSettingData") : "wrong"} conn = assoc.myWBEMConnection('http://%s' % options.ip, (Globals.CIM_USER, Globals.CIM_PASS), Globals.CIM_NS) @@ -51,7 +53,8 @@ def main(): names = [] try: - names = conn.AssociatorNames(instanceref, AssocClass = "Xen_ResourceAllocationFromPool") + names = conn.AssociatorNames(instanceref, + AssocClass = get_typed_class(options.virt, "ResourceAllocationFromPool")) rc = 0 except pywbem.CIMError, (rc, desc): if rc == exp_rc and desc.find(exp_desc) >= 0: From yunguol at cn.ibm.com Wed Apr 2 02:13:17 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 01 Apr 2008 19:13:17 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] [TEST] ResourceAllocationFromPool.02 for XenFV and KVM support In-Reply-To: Message-ID: # HG changeset patch # User Guolian Yun # Date 1207101750 25200 # Node ID f382e463f2c4e33b2298ccc38df8ffebd298deca # Parent 2a4a86706ee4bdb3cf3d0c20d38718e9fb6bc74f [TEST] ResourceAllocationFromPool.02 for XenFV and KVM support Signed-off-by: Guolian Yun diff -r 2a4a86706ee4 -r f382e463f2c4 suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Tue Apr 01 19:06:53 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Tue Apr 01 19:02:30 2008 -0700 @@ -31,7 +31,7 @@ from CimTest.Globals import log_param, l from CimTest.Globals import log_param, logger, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] @do_main(sup_types) def main(): @@ -42,21 +42,22 @@ def main(): key_list = ["DeviceID", "CreationClassName", "SystemName", "SystemCreationClassName"] try: - mem = devices.enumerate(options.ip, 'Memory', key_list) + mem = devices.enumerate(options.ip, 'Memory', key_list, options.virt) except Exception: - logger.error(Globals.CIM_ERROR_ENUMERATE % devices.Xen_Memory) + logger.error(Globals.CIM_ERROR_ENUMERATE % 'Memory') return FAIL try: - proc = devices.enumerate(options.ip, 'Processor', key_list) + proc = devices.enumerate(options.ip, 'Processor', key_list, options.virt) except Exception: - logger.error(Globals.CIM_ERROR_ENUMERATE % devices.Xen_Processor) + logger.error(Globals.CIM_ERROR_ENUMERATE % 'Processor') return FAIL for i in range(len(mem)): try: - mempool = assoc.AssociatorNames(options.ip, "Xen_ResourceAllocationFromPool", - "Xen_MemResourceAllocationSettingData", + mempool = assoc.AssociatorNames(options.ip, "ResourceAllocationFromPool", + "MemResourceAllocationSettingData", + options.virt, InstanceID = mem[i].DeviceID) except Exception: logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % mem[i].DeviceID) @@ -72,8 +73,9 @@ def main(): for j in range(len(proc)): try: - procpool = assoc.AssociatorNames(options.ip, "Xen_ResourceAllocationFromPool", - "Xen_ProcResourceAllocationSettingData", + procpool = assoc.AssociatorNames(options.ip, "ResourceAllocationFromPool", + "ProcResourceAllocationSettingData", + options.virt, InstanceID = proc[j].DeviceID) except Exception: logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % proc[j].DeviceID) From yunguol at cn.ibm.com Wed Apr 2 02:13:16 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 01 Apr 2008 19:13:16 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] [TEST].2# ResourceAllocationFromPool 02~04 for XenFV and KVM support Message-ID: Signed-off-by: Guolian Yun From yunguol at cn.ibm.com Wed Apr 2 02:13:18 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 01 Apr 2008 19:13:18 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] ResourceAllocationFromPool.03 for XenFV and KVM support In-Reply-To: Message-ID: <75a8df2db061d1a3998e.1207102398@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207102127 25200 # Node ID 75a8df2db061d1a3998e5c6f0528563563d28a93 # Parent f382e463f2c4e33b2298ccc38df8ffebd298deca [TEST] ResourceAllocationFromPool.03 for XenFV and KVM support Signed-off-by: Guolian Yun diff -r f382e463f2c4 -r 75a8df2db061 suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py Tue Apr 01 19:02:30 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py Tue Apr 01 19:08:47 2008 -0700 @@ -24,11 +24,12 @@ import pywbem import pywbem from pywbem.cim_obj import CIMInstanceName from XenKvmLib import assoc +from XenKvmLib.classes import get_typed_class from CimTest import Globals from CimTest.Globals import log_param, logger, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] exp_rc = 6 #CIM_ERR_NOT_FOUND exp_desc = "No such instance (wrong) - resource pool type mismatch" @@ -42,7 +43,8 @@ def main(): status = FAIL - poollist = {"Xen_MemoryPool" : "wrong", "Xen_ProcessorPool" : "wrong"} + poollist = {get_typed_class(options.virt, "MemoryPool") : "wrong", + get_typed_class(options.virt, "ProcessorPool") : "wrong"} conn = assoc.myWBEMConnection('http://%s' % options.ip, (Globals.CIM_USER, Globals.CIM_PASS), Globals.CIM_NS) @@ -52,7 +54,8 @@ def main(): names = [] try: - names = conn.AssociatorNames(instanceref, AssocClass = "Xen_ResourceAllocationFromPool") + names = conn.AssociatorNames(instanceref, + AssocClass = get_typed_class(options.virt, "ResourceAllocationFromPool")) rc = 0 except pywbem.CIMError, (rc, desc): if rc == exp_rc and desc.find(exp_desc) >= 0: From yunguol at cn.ibm.com Wed Apr 2 02:33:18 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 01 Apr 2008 19:33:18 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] .2# ElementConforms.02 for XenFV and KVM support Message-ID: <1d7f014df23ecd5fa9cb.1207103598@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207103576 25200 # Node ID 1d7f014df23ecd5fa9cb44ebb936152608d6e744 # Parent 2a4a86706ee4bdb3cf3d0c20d38718e9fb6bc74f [TEST] .2# ElementConforms.02 for XenFV and KVM support Signed-off-by: Guolian Yun diff -r 2a4a86706ee4 -r 1d7f014df23e suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py --- a/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Tue Apr 01 19:06:53 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Tue Apr 01 19:32:56 2008 -0700 @@ -3,6 +3,7 @@ # Copyright 2008 IBM Corp. # # Authors: +# Guolian Yun # Kaitlin Rupert # Veerendra Chandrappa # @@ -45,11 +46,13 @@ from XenKvmLib import hostsystem from XenKvmLib import hostsystem from XenKvmLib import computersystem from XenKvmLib import assoc -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all +from XenKvmLib.test_doms import destroy_and_undefine_all +from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib import enumclass +from XenKvmLib.vxml import XenXML, KVMXML, get_class from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] test_dom = "domgst" @@ -83,9 +86,10 @@ def main(): status = FAIL log_param() destroy_and_undefine_all(options.ip) - test_xml = testxml(test_dom) + virt_xml = get_class(options.virt) + cxml = virt_xml(test_dom) - ret = test_domain_function(test_xml, options.ip, cmd = "create") + ret = cxml.create(options.ip) if not ret: logger.error("ERROR: Failed to Create the dom: %s" % test_dom) return status @@ -93,7 +97,7 @@ def main(): inst_list = [] try: - cs_list = computersystem.enumerate(options.ip) + cs_list = computersystem.enumerate(options.ip, options.virt) # The len should be atleast two, as the CS returns info # one regarding VS and the other one for Domain-0. if len(cs_list) < 1: @@ -109,7 +113,7 @@ def main(): return status #Getting the hostname, to verify with the value returned by the assoc. - host_sys = hostsystem.enumerate(options.ip) + host_sys = hostsystem.enumerate(options.ip, options.virt) if len(host_sys) < 1: logger.error("ERROR: Enumerate returned 0 host instances") @@ -130,11 +134,12 @@ def main(): try: key_list = ["InstanceID"] proflist = enumclass.enumerate(options.ip, \ - enumclass.Xen_RegisteredProfile, \ - key_list) + "RegisteredProfile", \ + key_list, + options.virt) except Exception, detail: logger.error(CIM_ERROR_ENUMERATE, \ - 'Xen_RegisteredProfile') + 'RegisteredProfile') logger.error("Exception: %s", detail) return status @@ -148,8 +153,9 @@ def main(): cn = item.CreationClassName name = item.Name profs = assoc.Associators(options.ip, - "Xen_ElementConformsToProfile", - cn, + "ElementConformsToProfile", + cn, + options.virt, CreationClassName=cn, Name=name) if len(profs) != 1: @@ -161,11 +167,12 @@ def main(): logger.error("Verification of profile instance failed") except Exception, detail: - logger.error(CIM_ERROR_ASSOCIATORS, 'Xen_RegisteredProfile') + logger.error(CIM_ERROR_ASSOCIATORS, 'RegisteredProfile') logger.error("Exception: %s", detail) status = FAIL - ret = test_domain_function(test_dom, options.ip, cmd = "destroy") + cxml.destroy(options.ip) + cxml.undefine(options.ip) return status if __name__ == "__main__": From yunguol at cn.ibm.com Wed Apr 2 02:55:11 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 2 Apr 2008 10:55:11 +0800 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] ElementConforms.02 for XenFV and KVM support In-Reply-To: <87myodmvxp.fsf@caffeine.beaverton.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-04-01 23:33:38: > GY> + vsxml = get_class(options.virt)(test_dom) > > As mentioned in regards to a previous patch by Zhen Gang, I'd like a > temporary variable here to avoid confusion. > Good catch, changes and resubmit. > I'll apply the other two patches in this set though. > Thanks! > Thanks! > > -- > Dan Smith > IBM Linux Technology Center > Open Hypervisor Team > email: danms at us.ibm.com > [attachment "attwmvi6.dat" deleted by Guo Lian Yun/China/IBM] > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From deeptik at linux.vnet.ibm.com Wed Apr 2 05:59:43 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 02 Apr 2008 11:29:43 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting: Addition] Add cross-provider test case 04_vssd_to_rasd.py Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207115950 -19800 # Node ID e2cd9e869996152255adcf54e4c4e38331fcf760 # Parent 2a4a86706ee4bdb3cf3d0c20d38718e9fb6bc74f [TEST][Resubmitting: Addition] Add cross-provider test case 04_vssd_to_rasd.py. 1) Removed the check_len() function and included the logic in the same file. 2) It traverses the following path: {VSSD} --> [VirtualSystemSettingDataComponent](RASD) Verify the Device RASD returned with the values expected - those given in the xml description. Signed-off-by: Deepti B. Kalakeri diff -r 2a4a86706ee4 -r e2cd9e869996 suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Wed Apr 02 11:29:10 2008 +0530 @@ -0,0 +1,242 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 is a cross-provider testcase to +# Get the setting data properties for the given guest. +# +# +# It traverses the following path: +# {VSSD} --> [VirtualSystemSettingDataComponent](RASD) +# (Verify the Device RASD returned with the values expected - those given in test_xml) +# +# Steps: +# ------ +# 1) Define a guest domain. +# 1) Get the VSSD info using enumeration. +# 2) From the VSSD output get the info related to the domain. We expect only one +# VSSD info related to the domain to be returned. +# 4) Get the various devices allocated to the domain by using the VirtualSystemSettingDataComponent +# association and giving the VSSD output from the previous VSSD enumeration as inputs. +# 5) Verify the Disk, Memory, Network, Processor RASD values. +# 7) Undefine the guest domain. +# +# Date : 26-03-2008 + + +import sys +import XenKvmLib +from XenKvmLib import enumclass +from CimTest.Globals import do_main, CIM_ERROR_ASSOCIATORS, CIM_ERROR_ENUMERATE +from CimTest.Globals import log_param, logger +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.test_doms import destroy_and_undefine_all +from XenKvmLib import assoc +from XenKvmLib.vxml import get_class +from XenKvmLib.classes import get_typed_class +from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \ +verify_diskrasd_values, verify_memrasd_values + +sup_types = ['Xen', 'KVM', 'XenFV'] + +test_dom = "VSSDC_dom" +test_vcpus = 1 +test_mem = 128 +test_mac = "00:11:22:33:44:aa" + +def setup_env(): + vsxml_info = None + vsxml_info = get_class(virt)(test_dom, mem=test_mem, vcpus = test_vcpus, + mac = test_mac, disk = test_disk) + try: + bridge = vsxml_info.set_vbridge(server) + ret = vsxml_info.define(server) + if not ret: + logger.error("Failed to Define the domain: %s", test_dom) + return FAIL, vsxml_info + except Exception, details: + logger.error("Exception : %s", details) + return FAIL, vsxml_info + return PASS, vsxml_info + +def init_list(virt): + """ + Creating the lists that will be used for comparisons. + """ + procrasd = { + "InstanceID" : '%s/%s' %(test_dom,0),\ + "ResourceType" : 3,\ + "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') + } + + netrasd = { + "InstanceID" : '%s/%s' %(test_dom,test_mac), \ + "ResourceType" : 10 , \ + "ntype1": "bridge", \ + "ntype2": "ethernet", \ + "CreationClassName": get_typed_class(virt, 'NetResourceAllocationSettingData') + } + + address = eval("%s.%s" % (get_class(virt), 'disk_path')) + diskrasd = { + "InstanceID" : '%s/%s' %(test_dom, test_disk), \ + "ResourceType" : 17, \ + "Address" : address, \ + "CreationClassName": get_typed_class(virt, 'DiskResourceAllocationSettingData') + } + memrasd = { + "InstanceID" : '%s/%s' %(test_dom, "mem"), \ + "ResourceType" : 4, \ + "AllocationUnits" : "MegaBytes",\ + "VirtualQuantity" : (test_mem * 1024), \ + "CreationClassName": get_typed_class(virt, 'MemResourceAllocationSettingData') + } + return procrasd, netrasd, diskrasd, memrasd + +def get_inst_from_list(classname, vssd_list, filter_name, exp_val): + status = PASS + ret = -1 + inst = [] + for rec in vssd_list: + record = rec[filter_name['key']] + if record.find(exp_val) >=0 : + inst.append(rec) + ret = PASS + + # When no records are found. + if ret != PASS: + logger.error("%s with %s was not returned" % (classname, exp_val)) + status = FAIL + + # We expect only one record to be returned. + if len(inst) != 1: + logger.error("%s returned %i %s objects, expected only 1" % (classname, len(inst), 'VSSD')) + status = FAIL + + if status != PASS: + vsxml.undefine(server) + + return status, inst + +def get_vssd_info(): + vssd = [] + status = PASS + try: + classname = get_typed_class(virt, 'VirtualSystemSettingData') + vssd = enumclass.enumerate_inst(server, eval('enumclass.' + classname), virt) + if len(vssd) < 1 : + logger.error("%s returned %i %s objects, expected atleast 1" % (classname, len(vssd), 'VSSD')) + status = FAIL + + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, classname) + logger.error("Exception: %s", detail) + status = FAIL + + if status != PASS: + return status, vssd + + filter_name = {"key" : "InstanceID"} + # Get the info ONLY related to the domain. + status, vssd_values = get_inst_from_list(classname, vssd, filter_name, test_dom) + + return status, vssd_values + +def get_rasd_values_from_vssdc_assoc(vssd_values): + status = PASS + vssdc_assoc_info = [] + # We should have only one VSSD record, the check for this is already done in + # get_inst_from_list() function, hence can safely use index 0. + instIdval = vssd_values[0]['InstanceID'] + qcn = vssd_values[0].classname + assoc_cname = get_typed_class(virt, 'VirtualSystemSettingDataComponent') + try: + vssdc_assoc_info = assoc.Associators(server, assoc_cname, qcn, virt, InstanceID = instIdval) + if len(vssdc_assoc_info) < 4: + logger.error("%s returned %i %s objects, expected 4" % (assoc_cname, len(vssdc_assoc_info), qcn)) + status = FAIL + + except Exception, details: + logger.error(CIM_ERROR_ASSOCIATORS, assoc_cname) + logger.error("Exception : %s" % details) + status = FAIL + return status, vssdc_assoc_info + +def verify_rasd_values(rasd_values_info): + procrasd, netrasd, diskrasd, memrasd = init_list(virt) + try: + for rasd_instance in rasd_values_info: + CCName = rasd_instance.classname + if 'ProcResourceAllocationSettingData' in CCName: + status = verify_procrasd_values(rasd_instance, procrasd,) + elif 'NetResourceAllocationSettingData' in CCName : + status = verify_netrasd_values(rasd_instance, netrasd) + elif 'DiskResourceAllocationSettingData' in CCName: + status = verify_diskrasd_values(rasd_instance, diskrasd) + elif 'MemResourceAllocationSettingData' in CCName : + status = verify_memrasd_values(rasd_instance, memrasd) + else: + status = FAIL + if status != PASS: + logger.error("Mistmatching %s values", CCName ) + break + except Exception, detail : + logger.error("Exception in verify_rasd_values function: %s" % detail) + status = FAIL + return status + + at do_main(sup_types) +def main(): + options = main.options + log_param() + destroy_and_undefine_all(options.ip) + global test_disk, vsxml + global virt, server + server = options.ip + virt = options.virt + if virt == "Xen": + test_disk = "xvda" + else: + test_disk = "hda" + + status, vsxml = setup_env() + if status != PASS: + return status + + status, vssd_values = get_vssd_info() + if status != PASS or len(vssd_values) == 0: + return status + + status, rasd_values = get_rasd_values_from_vssdc_assoc(vssd_values) + if status != PASS or len(rasd_values) == 0: + vsxml.undefine(server) + return status + + status = verify_rasd_values(rasd_values) + try: + vsxml.undefine(server) + except Exception, detail: + logger.error("Failed to undefine domain %s", test_dom) + logger.error("Exception: %s", detail) + status = FAIL + return status + +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Wed Apr 2 06:17:17 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 02 Apr 2008 11:47:17 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting: Addition] : Adding 01_forward.py tc to verify ReferencedProfile Message-ID: <57b84aa20438fe7f8b7f.1207117037@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207117030 -19800 # Node ID 57b84aa20438fe7f8b7f2fa5e0098e30e2198745 # Parent e2cd9e869996152255adcf54e4c4e38331fcf760 [TEST][Resubmitting: Addition] : Adding 01_forward.py tc to verify ReferencedProfile. Removed the check_len() function and included the logic to check the len of assoc, list in the same file. Signed-off-by: Deepti B. Kalakeri diff -r e2cd9e869996 -r 57b84aa20438 suites/libvirt-cim/cimtest/ReferencedProfile/01_forward.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ReferencedProfile/01_forward.py Wed Apr 02 11:47:10 2008 +0530 @@ -0,0 +1,172 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 +# +# The following test case is used to verify the ReferencedProfile provider. +# +#Ex Command: +#----------- +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1057-VirtualSystem-1.0.0a"' +# +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0"' +# +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1045-MemoryResourceVirtualization-1.0.0"' +# +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1081-VirtualSystemMigration-1.0"' +# +# Output: +# ------- +# All the above examples have the following as result. +# +# localhost:5988/root/interop:Xen_RegisteredProfile. +# InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0" +# ...... +# InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0" +# RegisteredOrganization=2 +# RegisteredName="System Virtualization" +# RegisteredVersion="1.0.0" +# .... +# +# Date : 31-03-2008 +import sys +from XenKvmLib import enumclass +from XenKvmLib.assoc import Associators +from CimTest import Globals +from CimTest.Globals import log_param, logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORS +from CimTest.Globals import do_main +from XenKvmLib.classes import get_typed_class +from CimTest.ReturnCodes import FAIL, PASS + +sup_types = ['Xen', 'KVM', 'XenFV'] + + +def init_list(): + sys_prof_info = { + "InstanceID" : "CIM:DSP1042-SystemVirtualization-1.0.0", + "RegisteredOrganization" : 2, + "RegisteredName" : "System Virtualization", + "RegisteredVersion" : "1.0.0" + } + return sys_prof_info + +def print_field_error(fieldname, ret_value, exp_value): + logger.error("%s Mismatch", fieldname) + logger.error("Returned %s instead of %s", ret_value, exp_value) + +def get_proflist(): + proflist = [] + status = PASS + try: + key_list = ["InstanceID"] + proflist = enumclass.enumerate(server, eval('enumclass.' + reg_classname), key_list, virt) + if len(proflist) < 5 : + logger.error("%s returned %i %s objects, expected atleast 5", + reg_classname, len(proflist), 'Profile') + status = FAIL + + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, reg_classname) + logger.error("Exception: %s", detail) + status = FAIL + + if status != PASS: + return status, proflist + + profiles_instid_list = [] + for profile in proflist: + if not ("DSP1042" in profile.InstanceID): + profiles_instid_list.append(profile.InstanceID) + + return status, profiles_instid_list + +def verify_ref_assoc_info(assoc_info, sys_prof_info): + if assoc_info['InstanceID'] != sys_prof_info['InstanceID']: + print_field_error('InstanceID', assoc_info['InstanceID'], sys_prof_info['InstanceID']) + return FAIL + if assoc_info['RegisteredOrganization'] != sys_prof_info['RegisteredOrganization']: + print_field_error('RegisteredOrganization', assoc_info['RegisteredOrganization'], + sys_prof_info['RegisteredOrganization']) + return FAIL + if assoc_info['RegisteredName'] != sys_prof_info['RegisteredName']: + print_field_error('RegisteredName', assoc_info['RegisteredName'], + sys_prof_info['RegisteredName']) + return FAIL + if assoc_info['RegisteredVersion'] != sys_prof_info['RegisteredVersion']: + print_field_error('RegisteredVersion', assoc_info['RegisteredVersion'], + sys_prof_info['RegisteredVersion']) + return FAIL + return PASS + + + +def get_refprof_verify_info(proflist): + assoc_info = [] + status = PASS + assoc_name = get_typed_class(virt, 'ReferencedProfile') + sys_prof_info = init_list() + for instid in proflist: + try: + assoc_info = Associators(server, assoc_name, reg_classname, virt, InstanceID = instid, + CreationClassName = reg_classname) + if len(assoc_info) != 1: + logger.error("%s returned %i %s objects, expected only 1", + assoc_name, len(assoc_info), 'SystemVirtualization') + status = FAIL + if status != PASS: + break + + status = verify_ref_assoc_info(assoc_info[0], sys_prof_info) + if status != PASS: + break + + except Exception, detail: + logger.error(CIM_ERROR_ASSOCIATORS, assoc_name) + logger.error("Exception: %s", detail) + status = FAIL + + return status + + at do_main(sup_types) +def main(): + log_param() + options = main.options + global virt, server, reg_classname + virt = options.virt + server = options.ip + status = PASS + prev_namespace = Globals.CIM_NS + Globals.CIM_NS = 'root/interop' + reg_classname = get_typed_class(virt, 'RegisteredProfile') + + status, proflist = get_proflist() + if status != PASS : + Globals.CIM_NS = prev_namespace + return status + + status = get_refprof_verify_info(proflist) + Globals.CIM_NS = prev_namespace + return status + +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Wed Apr 2 06:26:03 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 02 Apr 2008 11:56:03 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting: Addition] : Adding 02_reverse.py tc to verify ReferencedProfile Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207117559 -19800 # Node ID f3e2ef4edbb4ec299aaba8a9a6307e5b777a8712 # Parent 57b84aa20438fe7f8b7f2fa5e0098e30e2198745 [TEST][Resubmitting: Addition] : Adding 02_reverse.py tc to verify ReferencedProfile. Removed the check_len() function and included the logic to check the len of assoc, list in the same file. Signed-off-by: Deepti B. Kalakeri diff -r 57b84aa20438 -r f3e2ef4edbb4 suites/libvirt-cim/cimtest/ReferencedProfile/02_reverse.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ReferencedProfile/02_reverse.py Wed Apr 02 11:55:59 2008 +0530 @@ -0,0 +1,172 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 +# +# The following test case is used to verify the ReferencedProfile supported +# by the VSM providers. +# +# Command: +# ------- +# +# wbemcli ai -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0"' +# +# Output: +# ------- +# localhost:5988/root/interop:Xen_RegisteredProfile.InstanceID="CIM:DSP1057-VirtualSystem-1.0.0a" +# -InstanceID="CIM:DSP1057-VirtualSystem-1.0.0a" +# -RegisteredOrganization=2 +# -RegisteredName="Virtual System Profile" +# -RegisteredVersion="1.0.0a" +# +# localhost:5988/root/interop:Xen_RegisteredProfile. +# InstanceID="CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0" +# ..... +# localhost:5988/root/interop:Xen_RegisteredProfile. +# InstanceID="CIM:DSP1045-MemoryResourceVirtualization-1.0.0" +# ...... +# localhost:5988/root/interop:Xen_RegisteredProfile. +# InstanceID="CIM:DSP1081-VirtualSystemMigration-1.0" +# ...... +# Date : 31-03-2008 +import sys +from XenKvmLib.assoc import Associators +from CimTest import Globals +from CimTest.Globals import log_param, logger, CIM_ERROR_ASSOCIATORS +from CimTest.Globals import do_main +from XenKvmLib.classes import get_typed_class +from CimTest.ReturnCodes import FAIL, PASS + +sup_types = ['Xen', 'KVM', 'XenFV'] + + +def init_list(): + vs_prof = { + "InstanceID" : "CIM:DSP1057-VirtualSystem-1.0.0a", + "RegisteredOrganization" : 2, + "RegisteredName" : "Virtual System Profile", + "RegisteredVersion" : "1.0.0a" + } + gen_dev_prof = { + "InstanceID" : + "CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0", + "RegisteredOrganization" : 2, + "RegisteredName" : "Generic Device Resource Virtualization", + "RegisteredVersion" : "1.0.0" + } + mem_res_prof = { + "InstanceID" : "CIM:DSP1045-MemoryResourceVirtualization-1.0.0", + "RegisteredOrganization" : 2, + "RegisteredName" : "Memory Resource Virtualization", + "RegisteredVersion" : "1.0.0" + } + vs_mig_prof = { + "InstanceID" : "CIM:DSP1081-VirtualSystemMigration-1.0", + "RegisteredOrganization" : 2, + "RegisteredName" : "Virtual System Migration", + "RegisteredVersion" : "1.0" + } + + return vs_prof, gen_dev_prof, mem_res_prof, vs_mig_prof + +def print_field_error(fieldname, ret_value, exp_value): + logger.error("%s Mismatch", fieldname) + logger.error("Returned '%s' instead of '%s'", ret_value, exp_value) + + +def verify_fields(assoc_info, prof_info): + if assoc_info['InstanceID'] != prof_info['InstanceID']: + print_field_error('InstanceID', assoc_info['InstanceID'], prof_info['InstanceID']) + return FAIL + if assoc_info['RegisteredOrganization'] != prof_info['RegisteredOrganization']: + print_field_error('RegisteredOrganization', assoc_info['RegisteredOrganization'], \ + prof_info['RegisteredOrganization']) + return FAIL + if assoc_info['RegisteredName'] != prof_info['RegisteredName']: + print_field_error('RegisteredName', assoc_info['RegisteredName'], \ + prof_info['RegisteredName']) + return FAIL + if assoc_info['RegisteredVersion'] != prof_info['RegisteredVersion']: + print_field_error('RegisteredVersion', assoc_info['RegisteredVersion'], \ + prof_info['RegisteredVersion']) + return FAIL + return PASS + + +def verify_ref_assoc_info(assoc_info): + status = PASS + vs_prof, gen_dev_prof, mem_res_prof, vs_mig_prof = init_list() + for i in range(len(assoc_info)): + instid = assoc_info[i]['InstanceID'] + if instid.find("DSP1045") >=0 : + status = verify_fields(assoc_info[i], mem_res_prof) + elif instid.find("DSP1057") >=0 : + status = verify_fields(assoc_info[i], vs_prof) + elif instid.find("DSP1059") >=0 : + status = verify_fields(assoc_info[i], gen_dev_prof) + elif instid.find("DSP1081") >=0 : + status = verify_fields(assoc_info[i], vs_mig_prof) + else: + status = FAIL + if status != PASS: + break + return status + +def get_refprof_verify_info(): + assoc_info = [] + status = PASS + assoc_name = get_typed_class(virt, 'ReferencedProfile') + instid = "CIM:DSP1042-SystemVirtualization-1.0.0" + try: + assoc_info = Associators(server, assoc_name, reg_classname, virt, InstanceID = instid, + CreationClassName = reg_classname) + if len(assoc_info) < 4: + logger.error("%s returned %i %s objects, expected atleast 4", + assoc_name, len(assoc_info), 'Profile') + status = FAIL + + if status != PASS: + return status + status = verify_ref_assoc_info(assoc_info) + except Exception, detail: + logger.error(CIM_ERROR_ASSOCIATORS, assoc_name) + logger.error("Exception: %s", detail) + status = FAIL + return status + + at do_main(sup_types) +def main(): + log_param() + options = main.options + global virt, server, reg_classname + virt = options.virt + server = options.ip + status = PASS + prev_namespace = Globals.CIM_NS + Globals.CIM_NS = 'root/interop' + + reg_classname = get_typed_class(virt, 'RegisteredProfile') + status = get_refprof_verify_info() + + Globals.CIM_NS = prev_namespace + return status + +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Wed Apr 2 06:33:27 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 02 Apr 2008 12:03:27 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Addition] : Adding 03_refprofile_errs.py tc to verify ReferencedProfile Message-ID: <421fe4997e8b298bdbb7.1207118007@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207118004 -19800 # Node ID 421fe4997e8b298bdbb74280743e60e51226d16d # Parent f3e2ef4edbb4ec299aaba8a9a6307e5b777a8712 [TEST][Addition] : Adding 03_refprofile_errs.py tc to verify ReferencedProfile. Removed the check_len() function and included the logic to check the len of assoc, list in the same file. Signed-off-by: Deepti B. Kalakeri diff -r f3e2ef4edbb4 -r 421fe4997e8b suites/libvirt-cim/cimtest/ReferencedProfile/03_refprofile_errs.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ReferencedProfile/03_refprofile_errs.py Wed Apr 02 12:03:24 2008 +0530 @@ -0,0 +1,154 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 +# +# +# Test Case Info: +# -------------- +# The following test case is used to verify the ReferencedProfile association supported +# returns exceptions when invalid values are passed to it. +# +# 1) Test by passing Invalid InstanceID Key Name +# Input: +# ------ +# wbemcli ai -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.Wrong="CIM:DSP1042-SystemVirtualization-1.0.0"' -nl +# +# Output: +# ------- +# error code : CIM_ERR_FAILED +# error desc : "No InstanceID specified" +# +# 2) Test by giving invalid Invalid InstanceID Key Value +# Input: +# ------ +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="Wrong"' -nl +# +# Output: +# ------- +# error code : CIM_ERR_NOT_FOUND +# error desc : "No such instance" +# +# +# Date : 31-03-2008 + +import sys +import pywbem +from XenKvmLib import enumclass +from XenKvmLib import assoc +from CimTest import Globals +from CimTest.Globals import log_param, logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORS +from CimTest.Globals import do_main, CIM_USER, CIM_PASS +from XenKvmLib.classes import get_typed_class +from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib.common_util import try_assoc + +sup_types = ['Xen', 'KVM', 'XenFV'] +expr_values = { + 'INVALID_Instid_KeyName' : { + 'rc' : pywbem.CIM_ERR_FAILED, + 'desc' : "No InstanceID specified" + }, + 'INVALID_Instid_KeyValue' : { + 'rc' : pywbem.CIM_ERR_NOT_FOUND, + 'desc' : "No such instance" + } + } + + +def get_proflist(): + proflist = [] + status = PASS + try: + key_list = ["InstanceID"] + proflist = enumclass.enumerate(server, eval('enumclass.' + reg_classname), key_list, virt) + if len(proflist) < 5 : + logger.error("%s returned %i %s objects, expected atleast 5", + reg_classname, len(proflist), 'Profile') + status = FAIL + + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, reg_classname) + logger.error("Exception: %s", detail) + status = FAIL + + if status != PASS: + return status, proflist + + profiles_instid_list = [] + for profile in proflist: + profiles_instid_list.append(profile.InstanceID) + + return status, profiles_instid_list + + +def verify_prof_err(field, keys): + status = PASS + assoc_classname = get_typed_class(virt, 'ReferencedProfile') + try: + ret_value = try_assoc(conn, reg_classname, assoc_classname, keys, field_name=field, \ + expr_values=expr_values[field], bug_no="") + if ret_value != PASS: + logger.error("------ FAILED: to verify %s.------", field) + status = ret_value + except Exception, detail: + logger.error(CIM_ERROR_ASSOCIATORS, assoc_classname) + logger.error("Exception: %s", detail) + status = FAIL + return status + + + at do_main(sup_types) +def main(): + log_param() + options = main.options + global virt, server, reg_classname, conn + virt = options.virt + server = options.ip + status = PASS + prev_namespace = Globals.CIM_NS + Globals.CIM_NS = 'root/interop' + reg_classname = get_typed_class(virt, 'RegisteredProfile') + status, proflist = get_proflist() + if status != PASS : + Globals.CIM_NS = prev_namespace + return status + + conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), Globals.CIM_NS) + + for prof in sorted(proflist): + field = 'INVALID_Instid_KeyName' + keys = { field : prof } + status = verify_prof_err(field, keys) + if status != PASS: + break + + field = 'INVALID_Instid_KeyValue' + keys = { 'InstanceID' : field } + status = verify_prof_err(field, keys) + if status != PASS: + break + + Globals.CIM_NS = prev_namespace + return status + +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Wed Apr 2 06:53:40 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 02 Apr 2008 12:23:40 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting: Addition] Add cross-provider test case 06_hs_to_vsms.py Message-ID: <3ef227041d3ddb305dc9.1207119220@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207119213 -19800 # Node ID 3ef227041d3ddb305dc9568b838ae47644988389 # Parent 421fe4997e8b298bdbb74280743e60e51226d16d [TEST][Resubmitting: Addition] Add cross-provider test case 06_hs_to_vsms.py. 1) Removed the check_len() function and included the logic to check the len of assoc, list in the same file. 2) It traverses the following path: {Hostsystem} --> [HostedService] {VirtualSystemMigrationService} --> [ElementCapabilities] {VirtualSystemMigrationCapabilities} --> [SettingsDefineCapabilities] {VirtualSystemMigrationSettingData} Verify the VirtualSystemMigrationSettingData. Signed-off-by: Deepti B. Kalakeri diff -r 421fe4997e8b -r 3ef227041d3d suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py Wed Apr 02 12:23:33 2008 +0530 @@ -0,0 +1,216 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 is a cross-provider testcase to +# Get the MigrationSettingData properties starting from the host +# +# It traverses the following path: +# {Hostsystem} --> [HostedService] {VirtualSystemMigrationService} --> +# [ElementCapabilities] {VirtualSystemMigrationCapabilities} --> +# [SettingsDefineCapabilities] {VirtualSystemMigrationSettingData} +# Verify the VirtualSystemMigrationSettingData. +# +# Steps: +# ------ +# 1) Get the hostname by enumerating the hostsystem. +# 2) Get the various service on the host by using the HostedService association by supplying +# the inputs obtained from querying the hostsystem. +# 4) Select the VirtualSystemMigrationService from the association returned. We should get only +# one record. +# 5) Use the VirtualSystemMigrationService information to query ElementCapabilities association +# Verify that we should get only one MigrationCapabilities record from the VSMS association. +# 6) Obtain the VSMigrationSettingData values by using the MigrationCapabilities output from the +# previous query and supplying it to the SettingsDefineCapabilities association. +# 7) Check, that we obtain only one VSMigrationSettingData data. +# Verify the VSMigrationSettingData values. +# Date : 28.03.2008 + +import sys +from CimTest.Globals import do_main +from XenKvmLib.classes import get_typed_class +from XenKvmLib.assoc import Associators, AssociatorNames +from XenKvmLib.common_util import get_host_info +from CimTest.Globals import log_param, logger, CIM_ERROR_ASSOCIATORNAMES, \ +CIM_ERROR_ASSOCIATORS +from CimTest.ReturnCodes import PASS, FAIL + +sup_types = ['Xen', 'KVM', 'XenFV'] + +def print_err(err, detail, cn): + logger.error(err % cn) + logger.error("Exception: %s", detail) + +def print_field_error(fieldname, ret_value, exp_value): + logger.error("%s Mismatch", fieldname) + logger.error("Returned %s instead of %s", ret_value, exp_value) + + +def get_inst_from_list(server, cn, assoc_info, filter_name, exp_val): + status = PASS + ret = -1 + inst = [] + for rec in assoc_info: + record = rec[filter_name['key']] + if record == exp_val: + inst.append(rec) + ret = PASS + + # When no records are found. + if ret != PASS: + logger.error("%s with %s was not returned" % (cn, exp_val)) + status = FAIL + + return status, inst + +def get_assocnames_info(server, cn, an, qcn, name): + status = PASS + assoc_info = [] + try: + assoc_info = AssociatorNames(server, an, cn, virt, Name = name, CreationClassName = cn) + if len(assoc_info) < 3 : + logger.error("%s returned %i %s objects, expected atleast 3", an, len(assoc_info), qcn) + status = FAIL + except Exception, detail: + print_err(CIM_ERROR_ASSOCIATORNAMES, detail, an) + status = FAIL + + return status, assoc_info + + +def get_vsms_info(): + status, host_name, classname = get_host_info(server, virt) + if status != PASS: + return status, [] + status, service_assoc_info = get_assocnames_info(server, classname, + assoc_name, req_cn, host_name) + if status != PASS or len(service_assoc_info) == 0: + return status, service_assoc_info + filter_name = {"key" : "Name"} + filter_value = 'MigrationService' + cn = 'VirtualSystemMigrationService' + status, vsms_list = get_inst_from_list(server, cn, service_assoc_info, filter_name, + filter_value) + return status, vsms_list + +def get_vsmcap_from_ec(vsms_list): + status = PASS + vsms_info = vsms_list[0] + cn = vsms_info['CreationClassName'] + sn = vsms_info['SystemName'] + name = vsms_info['Name'] + sccn = vsms_info['SystemCreationClassName'] + assoc_info = [] + try: + assoc_info = AssociatorNames(server, assoc_name, cn, virt, CreationClassName = cn, + SystemName = sn, Name = name, SystemCreationClassName = sccn) + if len(assoc_info) != 1: + logger.error("%s returned %i %s objects, expected only 1", assoc_name, len(assoc_info), req_cn) + status = FAIL + + except Exception, detail: + print_err(CIM_ERROR_ASSOCIATORNAMES, detail, assoc_name) + status = FAIL + + return status, assoc_info + +def get_vsmsd_from_sdc(vsmsd_list): + status = PASS + vsmsd_info = vsmsd_list[0] + cn = vsmsd_info.classname + instid = vsmsd_info['InstanceID'] + assoc_info = [] + try: + assoc_info = Associators(server, assoc_name, cn, virt, CreationClassName = cn, + InstanceID = instid) + if len(assoc_info) != 1: + logger.error("%s returned %i %s objects, expected only 1", assoc_name, len(assoc_info), req_cn) + status = FAIL + + except Exception, detail: + print_err(CIM_ERROR_ASSOCIATORS, detail, assoc_name) + status = FAIL + + return status, assoc_info + +def verify_vsmsd_values(vsmsd_list): + + # Values to be used for comparison + cn = get_typed_class(virt, "VirtualSystemMigrationSettingData") + instid = 'MigrationSettingData' + MType = 2 #[CIM_MIGRATE_LIVE] + priority = 0 + + verify_vsmsd = vsmsd_list[0] + if verify_vsmsd.classname != cn: + print_field_error('ClassName', verify_vsmsd.classname, cn) + return FAIL + if verify_vsmsd['InstanceID'] != instid: + print_field_error('InstanceID', verify_vsmsd['InstanceID'], instid) + return FAIL + if verify_vsmsd['MigrationType'] != MType: + print_field_error('MigrationType', verify_vsmsd['MigrationType'], MType) + return FAIL + if verify_vsmsd['Priority'] != priority: + print_field_error('Priority', verify_vsmsd['Priority'], priority) + return FAIL + return PASS + + + at do_main(sup_types) +def main(): + global virt, server + global assoc_name, class_name, req_cn + options = main.options + log_param() + server = options.ip + status = PASS + virt = options.virt + + assoc_name = get_typed_class(virt, 'HostedService') + req_cn = 'Service' + status, vsms_list = get_vsms_info() + if status != PASS or len(vsms_list) == 0: + logger.error("Did not get the expected MigrationService record") + return status + if len(vsms_list) != 1: + logger.error("%s returned %i %s objects, expected only 1", assoc_name, len(vsms_list), req_cn) + return FAIL + + assoc_name = get_typed_class(virt, 'ElementCapabilities') + req_cn = 'MigrationCapabilities' + status, vsmscap = get_vsmcap_from_ec(vsms_list) + if status != PASS or len(vsmscap) == 0: + logger.error("Did not get the expected MigrationCapabilities record") + return status + + assoc_name = get_typed_class(virt, 'SettingsDefineCapabilities') + req_cn = 'MigrationSettingData' + status, vsmsd = get_vsmsd_from_sdc(vsmscap) + if status != PASS or len(vsmsd) == 0: + logger.error("Did not get the expected MigrationSettingData record") + return status + + status = verify_vsmsd_values(vsmsd) + + return status +if __name__ == "__main__": + sys.exit(main()) From yunguol at cn.ibm.com Wed Apr 2 07:12:33 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 02 Apr 2008 00:12:33 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] ElementConforms.04 for XenFV and KVM support Message-ID: <79575db14685b6b53ee3.1207120353@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207120345 25200 # Node ID 79575db14685b6b53ee3a9df1e9a8137a6b6e503 # Parent 2a4a86706ee4bdb3cf3d0c20d38718e9fb6bc74f [TEST] ElementConforms.04 for XenFV and KVM support Signed-off-by: Guolian Yun diff -r 2a4a86706ee4 -r 79575db14685 suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py --- a/suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py Tue Apr 01 19:06:53 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py Wed Apr 02 00:12:25 2008 -0700 @@ -4,6 +4,7 @@ # # Authors: # Anoop V Chakkalakkal +# Guolian Yun # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public @@ -83,29 +84,30 @@ from VirtLib import utils, live from VirtLib import utils, live from XenKvmLib import assoc from XenKvmLib.common_util import try_assoc +from XenKvmLib.classes import get_typed_class from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.vxml import XenXML, KVMXML, get_class from CimTest.Globals import log_param, logger, CIM_USER, CIM_PASS, CIM_NS, do_main -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] +test_dom = "domU" -ac_classname = 'Xen_ElementConformsToProfile' -bug = '92642' +bug = '92642' expr_values = { - "INVALID_CCName_Keyname" : { 'rc' : '' , 'desc' : '' }, \ - "INVALID_CCName_Keyvalue" : { 'rc' : '' , 'desc' : '' }, \ - "INVALID_Name_Keyname" : { 'rc' : '' , 'desc' : '' }, \ - "INVALID_Name_Keyvalue" : { 'rc' : '' , 'desc' : '' } + "INVALID_CCName_Keyname" : { 'rc' : 6 , 'desc' : 'No such instance' }, \ + "INVALID_CCName_Keyvalue" : { 'rc' : 6 , 'desc' : 'No such instance' }, \ } -def try_invalid_assoc(classname, name_val, i, field): +def try_invalid_assoc(classname, name_val, i, field, virt="Xen"): + ac_classname = get_typed_class(virt, "ElementConformsToProfile") j = 0 keys = {} temp = name_val[i] name_val[i] = field for j in range(len(name_val)/2): k = j * 2 - keys[name_val[k]] = name_val[k+1] + keys[name_val[k]] = name_val[k+1] ret_val = try_assoc(conn, classname, ac_classname, keys, field_name=field, \ expr_values=expr_values[field], bug_no=bug) if ret_val != PASS: @@ -120,38 +122,46 @@ def main(): log_param() status = PASS + + virt_xml = get_class(options.virt) + cxml = virt_xml(test_dom) + ret = cxml.define(options.ip) + if not ret: + logger.error("ERROR: Failed to Create the dom: %s" % test_dom) + return status global conn conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS) host_name = live.hostname(options.ip) + hs = get_typed_class(options.virt ,'HostSystem') + cs = get_typed_class(options.virt, 'ComputerSystem') host_name_val = [ - 'CreationClassName', 'Xen_HostSystem', \ + 'CreationClassName', hs, \ 'Name', host_name ] comp_name_val = [ - 'CreationClassName', 'Xen_ComputerSystem', \ - 'Name', 'Domain-0' + 'CreationClassName', cs, \ + 'Name', test_dom ] tc_scen = [ 'INVALID_CCName_Keyname', \ 'INVALID_CCName_Keyvalue', \ - 'INVALID_Name_Keyname', \ - 'INVALID_Name_Keyvalue' ] for i in range(len(tc_scen)): - retval = try_invalid_assoc('Xen_HostSystem', host_name_val, i, tc_scen[i]) + retval = try_invalid_assoc(hs, host_name_val, i, tc_scen[i], options.virt) if retval != PASS: status = retval for i in range(len(tc_scen)): - retval = try_invalid_assoc('Xen_ComputerSystem', comp_name_val, i, tc_scen[i]) + retval = try_invalid_assoc(cs, comp_name_val, i, tc_scen[i], options.virt) if retval != PASS: status = retval + cxml.undefine(options.ip) return status if __name__ == "__main__": sys.exit(main()) From yunguol at cn.ibm.com Wed Apr 2 07:52:32 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 02 Apr 2008 00:52:32 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] ElementCapabilities.05 for XenFV and KVM support Message-ID: <701b8b384b1c48f38758.1207122752@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207122743 25200 # Node ID 701b8b384b1c48f38758ab5d68e6b3f5d3e4317a # Parent 2a4a86706ee4bdb3cf3d0c20d38718e9fb6bc74f [TEST] ElementCapabilities.05 for XenFV and KVM support Signed-off-by: Guolian Yun diff -r 2a4a86706ee4 -r 701b8b384b1c suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py --- a/suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py Tue Apr 01 19:06:53 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py Wed Apr 02 00:52:23 2008 -0700 @@ -4,7 +4,8 @@ # # Authors: # Deepti B. Kalakeri -# +# Guolian Yun +# # 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 @@ -50,11 +51,12 @@ from VirtLib import utils from VirtLib import utils from XenKvmLib.assoc import AssociatorNames from XenKvmLib.common_util import get_host_info +from XenKvmLib.classes import get_typed_class from CimTest.Globals import log_param, logger, CIM_ERROR_ASSOCIATORNAMES from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] def print_err(err, detail, cn): logger.error(err % cn) @@ -79,15 +81,16 @@ def get_inst_from_list(cn, cs_list, filt return status, inst -def get_assoc_info(server, cn, an, qcn, name): +def get_assoc_info(server, cn, an, qcn, name, virt="Xen"): status = PASS assoc_info = [] try: assoc_info = AssociatorNames(server, an, cn, + virt, CreationClassName = cn, - Name = name) + Name = name,) if len(assoc_info) < 1: logger.error("%s returned %i %s objects" % (an, len(assoc_info), qcn)) status = FAIL @@ -96,10 +99,10 @@ def get_assoc_info(server, cn, an, qcn, status = FAIL return status, assoc_info -def get_association_info(server, service_fieldname, cn, an, qcn): +def get_association_info(server, service_fieldname, cn, an, qcn, virt="Xen"): status = PASS cn = service_list[service_fieldname]['CreationClassName'] - an = 'Xen_ElementCapabilities' + an = get_typed_class(virt, 'ElementCapabilities') qcn = 'Capabilities' name = service_list[service_fieldname]['Name'] sccname = service_list[service_fieldname]['SystemCreationClassName'] @@ -109,6 +112,7 @@ def get_association_info(server, service assoc_info = AssociatorNames(server, an, cn, + virt, CreationClassName = cn, Name = name, SystemCreationClassName=sccname, @@ -137,12 +141,12 @@ def get_values(cn, service_assoc_info, f service_list[fieldname] = service_info return status -def verify_cap_fields(server, service_fieldname, cap_key): +def verify_cap_fields(server, service_fieldname, cap_key, virt="Xen"): cn = service_list[service_fieldname]['CreationClassName'] - an = 'Xen_ElementCapabilities' + an = get_typed_class(virt, 'ElementCapabilities') qcn = 'Capabilities' status, cap_assoc_info = get_association_info(server, service_fieldname, \ - cn, an, qcn) + cn, an, qcn, virt) if status != PASS or len(cap_assoc_info) == 0: return status cn = cap_assoc_info[0].classname @@ -167,27 +171,27 @@ def main(): # initialising the list service_list = { 'ManagementService' : 'Management Service', \ - 'MigrationService' : 'MigrationService' + 'MigrationService' : 'MigrationService' } # This will be used for the comparison at the end. - mgtcap = { 'ClassName' : 'Xen_VirtualSystemManagementCapabilities', \ + mgtcap = { 'ClassName' : get_typed_class(options.virt, 'VirtualSystemManagementCapabilities'), \ 'InstanceID' : 'ManagementCapabilities' } - migcap = { 'ClassName' : 'Xen_VirtualSystemMigrationCapabilities', \ + migcap = { 'ClassName' : get_typed_class(options.virt, 'VirtualSystemMigrationCapabilities'), \ 'InstanceID' : 'MigrationCapabilities' } cap_list = { 'ManagementCapabilities' : mgtcap, \ 'MigrationCapabilities' : migcap } - + # Get the host info - status, host_name, classname = get_host_info(server) - if status != PASS: - return status - - an = 'Xen_HostedService' + status, host_name, classname = get_host_info(server, options.virt) + if status != PASS: + return status + + an = get_typed_class(options.virt, 'HostedService') cn = classname qcn = 'Service' name = host_name @@ -211,7 +215,7 @@ def main(): # Query ElementCapabilities and verify the ManagementCapabilities information. service_fieldname = 'ManagementService' cap_key = 'ManagementCapabilities' - status = verify_cap_fields(server, service_fieldname, cap_key) + status = verify_cap_fields(server, service_fieldname, cap_key, options.virt) if status != PASS: logger.error("ManagementCapabilities Verification failed") return status From danms at us.ibm.com Wed Apr 2 15:17:26 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Apr 2008 08:17:26 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add UUID workaround for python-2.4-based systems (i.e. RHEL5.x) In-Reply-To: (Dan Smith's message of "Mon, 31 Mar 2008 10:55:05 -0700") References: Message-ID: <877ifgmgl5.fsf@caffeine.beaverton.ibm.com> DS> # HG changeset patch DS> # User Dan Smith DS> # Date 1206986066 25200 DS> # Node ID ace377826c9c8f3b034f5c696ffb71dfb163d77b DS> # Parent 5d47437104551b638aa75e2e525e49ec4b41e3ec DS> [TEST] Add UUID workaround for python-2.4-based systems (i.e. RHEL5.x) Can someone ack this please? Preferably after testing it on their Python-2.5 system. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Apr 2 15:17:43 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Apr 2008 08:17:43 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Run basicConfig() on logger to make python-2.4 happy In-Reply-To: (Dan Smith's message of "Mon, 31 Mar 2008 10:55:12 -0700") References: Message-ID: <873aq4mgko.fsf@caffeine.beaverton.ibm.com> DS> # HG changeset patch DS> # User Dan Smith DS> # Date 1206986099 25200 DS> # Node ID bde349d23ce5320d7c593e57df45335dcae62df8 DS> # Parent ace377826c9c8f3b034f5c696ffb71dfb163d77b DS> [TEST] Run basicConfig() on logger to make python-2.4 happy Can someone ack this please? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Apr 2 16:34:25 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Apr 2008 09:34:25 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] bundles of ComputerSystemCreatedIndication tc In-Reply-To: (Guo Lian Yun's message of "Wed, 2 Apr 2008 09:44:37 +0800") References: Message-ID: <87prt8kyge.fsf@caffeine.beaverton.ibm.com> GY> With the changed indication_tester, I think maybe it's better to GY> resubmit this set. Of course, the same as former. Okay, I copied the indication_tester.py into the library and was able to run the indication test successfully. Very cool. What are your plans for other indication tests? We definitely need to test at least all three of the lifecycle indications in the positive case. How about a test that subscribes to a Xen indication and then creates a KVM guest to make sure that it doesn't get the KVM indication? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Apr 2 17:07:39 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Apr 2008 10:07:39 -0700 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting: Addition] Add cross-provider test case 04_vssd_to_rasd.py In-Reply-To: (Deepti B. Kalakeri's message of "Wed, 02 Apr 2008 11:29:43 +0530") References: Message-ID: <87ej9okwx0.fsf@caffeine.beaverton.ibm.com> DK> # HG changeset patch DK> # User Deepti B. Kalakeri DK> # Date 1207115950 -19800 DK> # Node ID e2cd9e869996152255adcf54e4c4e38331fcf760 DK> # Parent 2a4a86706ee4bdb3cf3d0c20d38718e9fb6bc74f DK> [TEST][Resubmitting: Addition] Add cross-provider test case DK> 04_vssd_to_rasd.py. DK> 1) Removed the check_len() function and included the logic in the DK> same file. Thanks! When I apply this and run it, I get the following error: Wed, 02 Apr 2008 10:00:39:TEST LOG:INFO - ====04_vssd_to_rasd.py Log==== Wed, 02 Apr 2008 10:00:43:TEST LOG:ERROR - AttributeError : class XenXML has no attribute 'disk_path' So, I've not pushed it out yet. Can you post a fixed version? Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Apr 2 17:18:39 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Apr 2008 10:18:39 -0700 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting: Addition] : Adding 01_forward.py tc to verify ReferencedProfile In-Reply-To: <57b84aa20438fe7f8b7f.1207117037@dkalaker> (Deepti B. Kalakeri's message of "Wed, 02 Apr 2008 11:47:17 +0530") References: <57b84aa20438fe7f8b7f.1207117037@dkalaker> Message-ID: <878wzwkweo.fsf@caffeine.beaverton.ibm.com> DK> # HG changeset patch DK> # User Deepti B. Kalakeri DK> # Date 1207117030 -19800 DK> # Node ID 57b84aa20438fe7f8b7f2fa5e0098e30e2198745 DK> # Parent e2cd9e869996152255adcf54e4c4e38331fcf760 DK> [TEST][Resubmitting: Addition] : Adding 01_forward.py tc to verify ReferencedProfile. This one ran fine when I tried it, but I have some comments. DK> + try: DK> + key_list = ["InstanceID"] DK> + proflist = enumclass.enumerate(server, eval('enumclass.' + reg_classname), key_list, virt) Doesn't enumclass.enumerate take a classname? We should avoid eval()'ing all over the place for no reason. DK> + if len(proflist) < 5 : This will break when we add one more profile. Please make sure this is >0 and then check that the proper profiles are returned somewhere else. DK> + profiles_instid_list = [] DK> + for profile in proflist: DK> + if not ("DSP1042" in profile.InstanceID): DK> + profiles_instid_list.append(profile.InstanceID) This is randomly filtering out DSP1042? Why? DK> +def verify_ref_assoc_info(assoc_info, sys_prof_info): DK> + if assoc_info['InstanceID'] != sys_prof_info['InstanceID']: DK> + print_field_error('InstanceID', assoc_info['InstanceID'], sys_prof_info['InstanceID']) DK> + return FAIL DK> + if assoc_info['RegisteredOrganization'] != sys_prof_info['RegisteredOrganization']: DK> + print_field_error('RegisteredOrganization', assoc_info['RegisteredOrganization'], DK> + sys_prof_info['RegisteredOrganization']) DK> + return FAIL DK> + if assoc_info['RegisteredName'] != sys_prof_info['RegisteredName']: DK> + print_field_error('RegisteredName', assoc_info['RegisteredName'], DK> + sys_prof_info['RegisteredName']) DK> + return FAIL DK> + if assoc_info['RegisteredVersion'] != sys_prof_info['RegisteredVersion']: DK> + print_field_error('RegisteredVersion', assoc_info['RegisteredVersion'], DK> + sys_prof_info['RegisteredVersion']) DK> + return FAIL DK> + return PASS The entire blob above can be replaced with this: for f in ["RegisteredOrganization", "RegisteredName", "RegisteredVersion"]: if assoc_info[f] != sys_prof_info[f]: print_field_error(f, assoc_info[f], sys_prof_info[f]) return FAIL return PASS Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Apr 2 17:29:45 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Apr 2008 10:29:45 -0700 Subject: [Libvirt-cim] [PATCH] [TEST][Addition] : Adding 03_refprofile_errs.py tc to verify ReferencedProfile In-Reply-To: <421fe4997e8b298bdbb7.1207118007@dkalaker> (Deepti B. Kalakeri's message of "Wed, 02 Apr 2008 12:03:27 +0530") References: <421fe4997e8b298bdbb7.1207118007@dkalaker> Message-ID: <87zlscjhbq.fsf@caffeine.beaverton.ibm.com> DK> # HG changeset patch DK> # User Deepti B. Kalakeri DK> # Date 1207118004 -19800 DK> # Node ID 421fe4997e8b298bdbb74280743e60e51226d16d DK> # Parent f3e2ef4edbb4ec299aaba8a9a6307e5b777a8712 DK> [TEST][Addition] : Adding 03_refprofile_errs.py tc to verify ^^^^^^^^^^ I think the [Addition] tag is superfluous and it results in a total of *four* such tags for each patch, which I think is a bit excessive... :) DK> + proflist = enumclass.enumerate(server, eval('enumclass.' + reg_classname), key_list, virt) DK> + if len(proflist) < 5 : Same comment as before for this as well. DK> + profiles_instid_list = [] DK> + for profile in proflist: DK> + profiles_instid_list.append(profile.InstanceID) Not that it matters, but the following is a shortcut for something like this: instid_list = [x.InstanceID for x in proflist] -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Apr 2 17:44:23 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Apr 2008 10:44:23 -0700 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting: Addition] : Adding 02_reverse.py tc to verify ReferencedProfile References: Message-ID: <87lk3wjgnc.fsf@caffeine.beaverton.ibm.com> DK> +def verify_fields(assoc_info, prof_info): DK> + if assoc_info['InstanceID'] != prof_info['InstanceID']: DK> + print_field_error('InstanceID', assoc_info['InstanceID'], prof_info['InstanceID']) DK> + return FAIL DK> + if assoc_info['RegisteredOrganization'] != prof_info['RegisteredOrganization']: DK> + print_field_error('RegisteredOrganization', assoc_info['RegisteredOrganization'], \ DK> + prof_info['RegisteredOrganization']) DK> + return FAIL DK> + if assoc_info['RegisteredName'] != prof_info['RegisteredName']: DK> + print_field_error('RegisteredName', assoc_info['RegisteredName'], \ DK> + prof_info['RegisteredName']) DK> + return FAIL DK> + if assoc_info['RegisteredVersion'] != prof_info['RegisteredVersion']: DK> + print_field_error('RegisteredVersion', assoc_info['RegisteredVersion'], \ DK> + prof_info['RegisteredVersion']) DK> + return FAIL DK> + return PASS Same comment as before for this as well. DK> +def verify_ref_assoc_info(assoc_info): DK> + status = PASS DK> + vs_prof, gen_dev_prof, mem_res_prof, vs_mig_prof = init_list() DK> + for i in range(len(assoc_info)): Please use the following syntax for for loops (unless you really need the index): for i in assoc_info: DK> + instid = assoc_info[i]['InstanceID'] DK> + if instid.find("DSP1045") >=0 : DK> + status = verify_fields(assoc_info[i], mem_res_prof) DK> + elif instid.find("DSP1057") >=0 : DK> + status = verify_fields(assoc_info[i], vs_prof) DK> + elif instid.find("DSP1059") >=0 : DK> + status = verify_fields(assoc_info[i], gen_dev_prof) DK> + elif instid.find("DSP1081") >=0 : DK> + status = verify_fields(assoc_info[i], vs_mig_prof) DK> + else: DK> + status = FAIL DK> + if status != PASS: DK> + break DK> + return status In the interest of making this more extensible in the future, why not embed the information you need in the profile information dictionary in some way to avoid this sort of static structure? Assuming the dict has a "profnum" field: profiles = init_list() for i in assoc_info: status = None for profile in profiles: if profile["profnum"] in i['InstanceID']: status = verify_fields(i, profile) break if status == FAIL: break You may need to rearrange your profile dict a little to make the key properties distinct from other bits, but the result will be that when we add a new supported profile, you can just add an entry to the top-level list of profiles and not have to modify lots of other bits in the code. Most of your other tests can probably be modified in this way as well, which leads me to ask: Why not define a single set of profiles in a common file and import them? That way, all of the profile tests will work against a single set of profiles, which I think makes a lot more sense. DK> +def get_refprof_verify_info(): DK> + assoc_info = [] DK> + status = PASS DK> + assoc_name = get_typed_class(virt, 'ReferencedProfile') DK> + instid = "CIM:DSP1042-SystemVirtualization-1.0.0" DK> + try: DK> + assoc_info = Associators(server, assoc_name, reg_classname, virt, InstanceID = instid, DK> + CreationClassName = reg_classname) DK> + if len(assoc_info) < 4: DK> + logger.error("%s returned %i %s objects, expected atleast 4", DK> + assoc_name, len(assoc_info), 'Profile') DK> + status = FAIL DK> + DK> + if status != PASS: DK> + return status DK> + status = verify_ref_assoc_info(assoc_info) DK> + except Exception, detail: DK> + logger.error(CIM_ERROR_ASSOCIATORS, assoc_name) DK> + logger.error("Exception: %s", detail) DK> + status = FAIL DK> + return status Perhaps you can explain the need for the repeated special case distinction for this profile? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Apr 2 18:15:32 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Apr 2008 11:15:32 -0700 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting: Addition] Add cross-provider test case 06_hs_to_vsms.py References: <3ef227041d3ddb305dc9.1207119220@dkalaker> Message-ID: <87abkcjf7f.fsf@caffeine.beaverton.ibm.com> DK> + if len(assoc_info) < 3 : DK> + logger.error("%s returned %i %s objects, expected atleast 3", an, len(assoc_info), qcn) DK> + status = FAIL DK> + except Exception, detail: DK> + print_err(CIM_ERROR_ASSOCIATORNAMES, detail, an) DK> + status = FAIL DK> + DK> + return status, assoc_info As with the others, I think checking that it's >0 is sufficient for validation (as long as you check that you get the expected instances back as well) and is less prone to breakage. DK> +def get_vsms_info(): DK> + status, host_name, classname = get_host_info(server, virt) DK> + if status != PASS: DK> + return status, [] DK> + status, service_assoc_info = get_assocnames_info(server, classname, DK> + assoc_name, req_cn, host_name) DK> + if status != PASS or len(service_assoc_info) == 0: DK> + return status, service_assoc_info DK> + filter_name = {"key" : "Name"} DK> + filter_value = 'MigrationService' DK> + cn = 'VirtualSystemMigrationService' DK> + status, vsms_list = get_inst_from_list(server, cn, service_assoc_info, filter_name, DK> + filter_value) As far as I can tell, get_inst_from_list() just uses the 'key' field of filter_name directly. Please just pass the name instead of a dict. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Apr 2 18:30:01 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Apr 2008 11:30:01 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] ElementConforms.04 for XenFV and KVM support In-Reply-To: <79575db14685b6b53ee3.1207120353@elm3b197.beaverton.ibm.com> (Guo Lian Yun's message of "Wed, 02 Apr 2008 00:12:33 -0700") References: <79575db14685b6b53ee3.1207120353@elm3b197.beaverton.ibm.com> Message-ID: <8763v0jeja.fsf@caffeine.beaverton.ibm.com> GY> -def try_invalid_assoc(classname, name_val, i, field): GY> +def try_invalid_assoc(classname, name_val, i, field, virt="Xen"): GY> + ac_classname = get_typed_class(virt, "ElementConformsToProfile") GY> j = 0 GY> keys = {} GY> temp = name_val[i] GY> name_val[i] = field GY> for j in range(len(name_val)/2): GY> k = j * 2 GY> - keys[name_val[k]] = name_val[k+1] GY> + keys[name_val[k]] = name_val[k+1] ^^^^^ You're adding trailing whitespace here. I know you didn't add the above loop (at least in this patch :D), but it's pretty silly to do that instead of this: for i in range(0, len(name_val), 2): keys[name_val[i]] = name_val[i+1] However, this looks like it only exists because of the following code further down: GY> host_name_val = [ GY> - 'CreationClassName', 'Xen_HostSystem', \ GY> + 'CreationClassName', hs, \ GY> 'Name', host_name GY> ] GY> comp_name_val = [ GY> - 'CreationClassName', 'Xen_ComputerSystem', \ GY> - 'Name', 'Domain-0' GY> + 'CreationClassName', cs, \ GY> + 'Name', test_dom GY> ] GY> tc_scen = [ GY> 'INVALID_CCName_Keyname', \ GY> 'INVALID_CCName_Keyvalue', \ GY> - 'INVALID_Name_Keyname', \ GY> - 'INVALID_Name_Keyvalue' GY> ] Is there a sane reason for not using a dict here? Seems pretty silly to me. Instead of modifying this (apparently) broken code, can we fix it up a bit in the process of converting it? Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From yunguol at cn.ibm.com Thu Apr 3 02:05:17 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 3 Apr 2008 10:05:17 +0800 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] bundles of ComputerSystemCreatedIndication tc In-Reply-To: <87prt8kyge.fsf@caffeine.beaverton.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-04-03 00:34:25: > GY> With the changed indication_tester, I think maybe it's better to > GY> resubmit this set. Of course, the same as former. > > Okay, I copied the indication_tester.py into the library and was able > to run the indication test successfully. Very cool. > > What are your plans for other indication tests? We definitely need to > test at least all three of the lifecycle indications in the positive > case. > As you said before, it's better to subscribe to a superclass and get all three of the lifecycle indications. So I prepare to change the test case do the setup for each type in a single file. Also, the superclass named "CIM_Indication", right? > How about a test that subscribes to a Xen indication and then creates > a KVM guest to make sure that it doesn't get the KVM indication? > You refer to the negative test case to Xen indication? > -- > Dan Smith > IBM Linux Technology Center > Open Hypervisor Team > email: danms at us.ibm.com > [attachment "attjivxz.dat" deleted by Guo Lian Yun/China/IBM] > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From yunguol at cn.ibm.com Thu Apr 3 02:25:44 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 3 Apr 2008 10:25:44 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] Add UUID workaround for python-2.4-based systems (i.e. RHEL5.x) In-Reply-To: Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-04-01 01:55:05: > # HG changeset patch > # User Dan Smith > # Date 1206986066 25200 > # Node ID ace377826c9c8f3b034f5c696ffb71dfb163d77b > # Parent 5d47437104551b638aa75e2e525e49ec4b41e3ec > [TEST] Add UUID workaround for python-2.4-based systems (i.e. RHEL5.x) > > Signed-off-by: Dan Smith > +1 from me. Test it on python-2.5.1-15.fc8. > diff -r 5d4743710455 -r ace377826c9c suites/libvirt- > cim/lib/XenKvmLib/test_doms.py > --- a/suites/libvirt-cim/lib/XenKvmLib/test_doms.py Mon Mar 31 07: > 54:19 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/test_doms.py Mon Mar 31 10: > 54:26 2008 -0700 > @@ -22,11 +22,23 @@ > # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > # > import tempfile > -import uuid > import os > from VirtLib import utils > from VirtLib import live > from CimTest.Globals import CIM_FUUID > + > +try: > + import uuid as _uuid > + def uuid(): > + return str(_uuid.uuid1()) > +except ImportError: > + def uuid(): > + from commands import getstatusoutput as run > + s, o = run('uuidgen') > + if s == 0: > + return o > + else: > + raise ImportError("Missing uuid library (and can't fake it)") > > def define_test_domain(xml, server, virt="Xen"): > name = tempfile.mktemp() > @@ -74,7 +86,7 @@ def set_uuid(myuuid=0): > """Generate a random uuid and record it into CIM_FUUID""" > > if myuuid == 0: > - myuuid = uuid.uuid1().urn[9:] > + myuuid = uuid() > > f = file(CIM_FUUID, 'a') > f.write('%s\n' % myuuid) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From deeptik at linux.vnet.ibm.com Thu Apr 3 06:30:02 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 03 Apr 2008 12:00:02 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting] Add cross-provider test case 04_vssd_to_rasd.py Message-ID: <104b65ee0d5f0bb2af8e.1207204202@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207204016 -19800 # Node ID 104b65ee0d5f0bb2af8e140b6b1e194d75bab44f # Parent bf376e97b3ea01ee72ce429ca5ecacb709aa6dae [TEST][Resubmitting] Add cross-provider test case 04_vssd_to_rasd.py. 1) Removed the check_len() function and included the logic in the same file. 2) Used xml_get_disk_source() to get the disk image path 3) It traverses the following path: {VSSD} --> [VirtualSystemSettingDataComponent](RASD) Verify the Device RASD returned with the values expected - those given in the xml description. Signed-off-by: Deepti B. Kalakeri diff -r bf376e97b3ea -r 104b65ee0d5f suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Thu Apr 03 11:56:56 2008 +0530 @@ -0,0 +1,242 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 is a cross-provider testcase to +# Get the setting data properties for the given guest. +# +# +# It traverses the following path: +# {VSSD} --> [VirtualSystemSettingDataComponent](RASD) +# (Verify the Device RASD returned with the values expected - those given in test_xml) +# +# Steps: +# ------ +# 1) Define a guest domain. +# 1) Get the VSSD info using enumeration. +# 2) From the VSSD output get the info related to the domain. We expect only one +# VSSD info related to the domain to be returned. +# 4) Get the various devices allocated to the domain by using the VirtualSystemSettingDataComponent +# association and giving the VSSD output from the previous VSSD enumeration as inputs. +# 5) Verify the Disk, Memory, Network, Processor RASD values. +# 7) Undefine the guest domain. +# +# Date : 26-03-2008 + + +import sys +import XenKvmLib +from XenKvmLib import enumclass +from CimTest.Globals import do_main, CIM_ERROR_ASSOCIATORS, CIM_ERROR_ENUMERATE +from CimTest.Globals import log_param, logger +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.test_doms import destroy_and_undefine_all +from XenKvmLib import assoc +from XenKvmLib.vxml import get_class +from XenKvmLib.classes import get_typed_class +from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \ +verify_diskrasd_values, verify_memrasd_values + +sup_types = ['Xen', 'KVM', 'XenFV'] + +test_dom = "VSSDC_dom" +test_vcpus = 1 +test_mem = 128 +test_mac = "00:11:22:33:44:aa" + +def setup_env(): + vsxml_info = None + vsxml_info = get_class(virt)(test_dom, mem=test_mem, vcpus = test_vcpus, + mac = test_mac, disk = test_disk) + try: + bridge = vsxml_info.set_vbridge(server) + ret = vsxml_info.define(server) + if not ret: + logger.error("Failed to Define the domain: %s", test_dom) + return FAIL, vsxml_info + except Exception, details: + logger.error("Exception : %s", details) + return FAIL, vsxml_info + return PASS, vsxml_info + +def init_list(virt): + """ + Creating the lists that will be used for comparisons. + """ + procrasd = { + "InstanceID" : '%s/%s' %(test_dom,0),\ + "ResourceType" : 3,\ + "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') + } + + netrasd = { + "InstanceID" : '%s/%s' %(test_dom,test_mac), \ + "ResourceType" : 10 , \ + "ntype1": "bridge", \ + "ntype2": "ethernet", \ + "CreationClassName": get_typed_class(virt, 'NetResourceAllocationSettingData') + } + + address = vsxml.xml_get_disk_source() + diskrasd = { + "InstanceID" : '%s/%s' %(test_dom, test_disk), \ + "ResourceType" : 17, \ + "Address" : address, \ + "CreationClassName": get_typed_class(virt, 'DiskResourceAllocationSettingData') + } + memrasd = { + "InstanceID" : '%s/%s' %(test_dom, "mem"), \ + "ResourceType" : 4, \ + "AllocationUnits" : "MegaBytes",\ + "VirtualQuantity" : (test_mem * 1024), \ + "CreationClassName": get_typed_class(virt, 'MemResourceAllocationSettingData') + } + return procrasd, netrasd, diskrasd, memrasd + +def get_inst_from_list(classname, vssd_list, filter_name, exp_val): + status = PASS + ret = -1 + inst = [] + for rec in vssd_list: + record = rec[filter_name['key']] + if record.find(exp_val) >=0 : + inst.append(rec) + ret = PASS + + # When no records are found. + if ret != PASS: + logger.error("%s with %s was not returned" % (classname, exp_val)) + status = FAIL + + # We expect only one record to be returned. + if len(inst) != 1: + logger.error("%s returned %i %s objects, expected only 1" % (classname, len(inst), 'VSSD')) + status = FAIL + + if status != PASS: + vsxml.undefine(server) + + return status, inst + +def get_vssd_info(): + vssd = [] + status = PASS + try: + classname = get_typed_class(virt, 'VirtualSystemSettingData') + vssd = enumclass.enumerate_inst(server, eval('enumclass.' + classname), virt) + if len(vssd) < 1 : + logger.error("%s returned %i %s objects, expected atleast 1" % (classname, len(vssd), 'VSSD')) + status = FAIL + + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, classname) + logger.error("Exception: %s", detail) + status = FAIL + + if status != PASS: + return status, vssd + + filter_name = {"key" : "InstanceID"} + # Get the info ONLY related to the domain. + status, vssd_values = get_inst_from_list(classname, vssd, filter_name, test_dom) + + return status, vssd_values + +def get_rasd_values_from_vssdc_assoc(vssd_values): + status = PASS + vssdc_assoc_info = [] + # We should have only one VSSD record, the check for this is already done in + # get_inst_from_list() function, hence can safely use index 0. + instIdval = vssd_values[0]['InstanceID'] + qcn = vssd_values[0].classname + assoc_cname = get_typed_class(virt, 'VirtualSystemSettingDataComponent') + try: + vssdc_assoc_info = assoc.Associators(server, assoc_cname, qcn, virt, InstanceID = instIdval) + if len(vssdc_assoc_info) < 4: + logger.error("%s returned %i %s objects, expected 4" % (assoc_cname, len(vssdc_assoc_info), qcn)) + status = FAIL + + except Exception, details: + logger.error(CIM_ERROR_ASSOCIATORS, assoc_cname) + logger.error("Exception : %s" % details) + status = FAIL + return status, vssdc_assoc_info + +def verify_rasd_values(rasd_values_info): + procrasd, netrasd, diskrasd, memrasd = init_list(virt) + try: + for rasd_instance in rasd_values_info: + CCName = rasd_instance.classname + if 'ProcResourceAllocationSettingData' in CCName: + status = verify_procrasd_values(rasd_instance, procrasd,) + elif 'NetResourceAllocationSettingData' in CCName : + status = verify_netrasd_values(rasd_instance, netrasd) + elif 'DiskResourceAllocationSettingData' in CCName: + status = verify_diskrasd_values(rasd_instance, diskrasd) + elif 'MemResourceAllocationSettingData' in CCName : + status = verify_memrasd_values(rasd_instance, memrasd) + else: + status = FAIL + if status != PASS: + logger.error("Mistmatching %s values", CCName ) + break + except Exception, detail : + logger.error("Exception in verify_rasd_values function: %s" % detail) + status = FAIL + return status + + at do_main(sup_types) +def main(): + options = main.options + log_param() + destroy_and_undefine_all(options.ip) + global test_disk, vsxml + global virt, server + server = options.ip + virt = options.virt + if virt == "Xen": + test_disk = "xvda" + else: + test_disk = "hda" + + status, vsxml = setup_env() + if status != PASS: + return status + + status, vssd_values = get_vssd_info() + if status != PASS or len(vssd_values) == 0: + return status + + status, rasd_values = get_rasd_values_from_vssdc_assoc(vssd_values) + if status != PASS or len(rasd_values) == 0: + vsxml.undefine(server) + return status + + status = verify_rasd_values(rasd_values) + try: + vsxml.undefine(server) + except Exception, detail: + logger.error("Failed to undefine domain %s", test_dom) + logger.error("Exception: %s", detail) + status = FAIL + return status + +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Thu Apr 3 07:15:02 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 03 Apr 2008 12:45:02 +0530 Subject: [Libvirt-cim] [PATCH] [TEST]Fixing the 01_verify_rasd_fields.py tc Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207206886 -19800 # Node ID a6d6b7807c9a4b3f76b310d049f61e2c67712bfc # Parent 104b65ee0d5f0bb2af8e140b6b1e194d75bab44f [TEST]Fixing the 01_verify_rasd_fields.py tc. diff -r 104b65ee0d5f -r a6d6b7807c9a suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py --- a/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Thu Apr 03 11:56:56 2008 +0530 +++ b/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Thu Apr 03 12:44:46 2008 +0530 @@ -86,7 +86,7 @@ def init_list(virt="Xen"): "CreationClassName": get_typed_class(virt, 'NetResourceAllocationSettingData') } - address = eval("%s.%s" % (get_class(virt), 'disk_path')) + address = vsxml.xml_get_disk_source() diskrasd = { "InstanceID" : '%s/%s' %(test_dom, test_disk), \ "ResourceType" : 17, \ @@ -133,6 +133,7 @@ def assoc_values(ip, assoc_info, virt="X @do_main(sup_types) def main(): + global vsxml options = main.options status = 0 rc = 1 @@ -171,7 +172,7 @@ def main(): status = assoc_values(options.ip, assoc_info, options.virt) except Exception, details: logger.error(Globals.CIM_ERROR_ASSOCIATORS, \ - get_typed_class('VirtualSystemSettingDataComponent', options.virt)) + get_typed_class(options.virt, 'VirtualSystemSettingDataComponent')) logger.error("Exception : %s" % details) status = 1 From deeptik at linux.vnet.ibm.com Thu Apr 3 07:26:13 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 03 Apr 2008 12:56:13 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing 02_enum.py tc of RASD Message-ID: <5171b45a180b122994d0.1207207573@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207207471 -19800 # Node ID 5171b45a180b122994d098a70d164cda8c302c4a # Parent a6d6b7807c9a4b3f76b310d049f61e2c67712bfc [TEST] Fixing 02_enum.py tc of RASD. Signed-off-by: Deepti B. Kalakeri diff -r a6d6b7807c9a -r 5171b45a180b suites/libvirt-cim/cimtest/RASD/02_enum.py --- a/suites/libvirt-cim/cimtest/RASD/02_enum.py Thu Apr 03 12:44:46 2008 +0530 +++ b/suites/libvirt-cim/cimtest/RASD/02_enum.py Thu Apr 03 12:54:31 2008 +0530 @@ -63,7 +63,7 @@ def init_list(virt="Xen"): "ntype2": "ethernet", \ "CreationClassName": get_typed_class(virt, 'NetResourceAllocationSettingData') } - address = eval("%s.%s" % (get_class(virt), 'disk_path')) + address = vsxml.xml_get_disk_source() diskrasd = { "InstanceID" : '%s/%s' %(test_dom, test_disk), \ "ResourceType" : 17, \ From deeptik at linux.vnet.ibm.com Thu Apr 3 07:48:09 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 03 Apr 2008 13:18:09 +0530 Subject: [Libvirt-cim] [PATCH] [TEST].2# Fixing the 01_verify_rasd_fields.py tc Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207208862 -19800 # Node ID cbadbbee26c59304d6ef6a46e94eeb9b5dbed26b # Parent bf376e97b3ea01ee72ce429ca5ecacb709aa6dae [TEST].2# Fixing the 01_verify_rasd_fields.py tc. Signed-off-by: Deepti B. Kalakeri diff -r bf376e97b3ea -r cbadbbee26c5 suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py --- a/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Wed Apr 02 00:52:23 2008 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Thu Apr 03 13:17:42 2008 +0530 @@ -86,7 +86,7 @@ def init_list(virt="Xen"): "CreationClassName": get_typed_class(virt, 'NetResourceAllocationSettingData') } - address = eval("%s.%s" % (get_class(virt), 'disk_path')) + address = vsxml.xml_get_disk_source() diskrasd = { "InstanceID" : '%s/%s' %(test_dom, test_disk), \ "ResourceType" : 17, \ @@ -133,6 +133,7 @@ def assoc_values(ip, assoc_info, virt="X @do_main(sup_types) def main(): + global vsxml options = main.options status = 0 rc = 1 @@ -171,7 +172,7 @@ def main(): status = assoc_values(options.ip, assoc_info, options.virt) except Exception, details: logger.error(Globals.CIM_ERROR_ASSOCIATORS, \ - get_typed_class('VirtualSystemSettingDataComponent', options.virt)) + get_typed_class(options.virt, 'VirtualSystemSettingDataComponent')) logger.error("Exception : %s" % details) status = 1 From yunguol at cn.ibm.com Thu Apr 3 08:53:14 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 3 Apr 2008 16:53:14 +0800 Subject: [Libvirt-cim] [TEST] CIMTest Failing Test Case Report (20080402) Message-ID: stro: Fedora8 Kernel: kernel-2.6.23.1-42.fc8 Xen: xen-3.1.2-2.fc9 Libvirt: libvirt-0.4.0-4.fc8 CIMOM: sblim-sfcb-1.2.5-0 PyWBEM: pywbem-0.6-1 LibCMPIutil: 72 LibVirtCIM: 528 CIM Schema: cimv216Experimental CIMTEST: 38 =============CIMTEST FAILING REPORT================== ElementConforms 04_ectp_rev_errs.py FAIL HostSystem 03_hs_to_settdefcap.py FAIL Profile 01_enum.py FAIL RASD RASD - 01_verify_rasd_fields.py: FAIL RASD - 02_enum.py: FAIL SettingsDefineCapabilities 04_forward_vsmsdata.py FAIL VirtualSystemManagementService 05_destroysystem_neg.py FAIL 06_addresource.py FAIL VirtualSystemMigrationService 01_migratable_host.py FAIL 02_host_migrate_type.py FAIL VirtualSystemMigrationSettingData 01_enum.py FAIL 02_vsmsd_gi_errs.py FAIL VirtualSystemSettingDataComponent 01_forward.py FAIL VirtualSystemSnapshotService 01_enum.py FAIL 02_vs_sservice_gi_errs.py FAIL VirtualSystemSnapshotServiceCapabilities 01_enum.py FAIL 02_vs_sservicecap_gi_errs.py FAIL ===================================================== Total: 17 Best, Regards Daisy Guo Lian Yun E-mail: yunguol at cn.ibm.com IBM China Development Lab, Shanghai, China TEL: (86)-21-61008057 -------------- next part -------------- An HTML attachment was scrubbed... URL: From deeptik at linux.vnet.ibm.com Thu Apr 3 08:59:01 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 03 Apr 2008 14:29:01 +0530 Subject: [Libvirt-cim] [TEST] CIMTest Failing Test Case Report (20080402) In-Reply-To: References: Message-ID: <47F49C55.6030000@linux.vnet.ibm.com> Guo Lian Yun wrote: > > stro: Fedora8 > Kernel: kernel-2.6.23.1-42.fc8 > Xen: xen-3.1.2-2.fc9 > Libvirt: libvirt-0.4.0-4.fc8 > CIMOM: sblim-sfcb-1.2.5-0 > PyWBEM: pywbem-0.6-1 > LibCMPIutil: 72 > LibVirtCIM: 528 > CIM Schema: cimv216Experimental > CIMTEST: 38 > > =============CIMTEST FAILING REPORT================== > ElementConforms > 04_ectp_rev_errs.py FAIL > > HostSystem > 03_hs_to_settdefcap.py FAIL > > Profile > 01_enum.py FAIL > > RASD > RASD - 01_verify_rasd_fields.py: FAIL > RASD - 02_enum.py: FAIL > I have fixed the above two. 01_verify_rasd_fields.py fails to start a domain for KVM and XenFV. > > SettingsDefineCapabilities > 04_forward_vsmsdata.py FAIL > > > VirtualSystemManagementService > 05_destroysystem_neg.py FAIL > 06_addresource.py FAIL > > VirtualSystemMigrationService > 01_migratable_host.py FAIL > 02_host_migrate_type.py FAIL > > VirtualSystemMigrationSettingData > 01_enum.py FAIL > 02_vsmsd_gi_errs.py FAIL > > VirtualSystemSettingDataComponent > 01_forward.py FAIL > > VirtualSystemSnapshotService > 01_enum.py FAIL > 02_vs_sservice_gi_errs.py FAIL > > VirtualSystemSnapshotServiceCapabilities > 01_enum.py FAIL > 02_vs_sservicecap_gi_errs.py FAIL > > > ===================================================== > Total: 17 > > > > Best, > Regards > > Daisy Guo Lian Yun > E-mail: yunguol at cn.ibm.com > IBM China Development Lab, Shanghai, China > TEL: (86)-21-61008057 > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim From deeptik at linux.vnet.ibm.com Thu Apr 3 12:31:49 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 03 Apr 2008 18:01:49 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Adding profile_init_list() in common_util.py to create a default profile list Message-ID: <4ae171df56c92ff442bb.1207225909@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207225887 -19800 # Node ID 4ae171df56c92ff442bbd098102779140f3c7ff1 # Parent cbadbbee26c59304d6ef6a46e94eeb9b5dbed26b [TEST] Adding profile_init_list() in common_util.py to create a default profile list. Signed-off-by: Deepti B. Kalakeri diff -r cbadbbee26c5 -r 4ae171df56c9 suites/libvirt-cim/lib/XenKvmLib/common_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Thu Apr 03 13:17:42 2008 +0530 +++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Thu Apr 03 18:01:27 2008 +0530 @@ -187,3 +187,46 @@ def try_getinstance(conn, classname, key '%s' passed.", classname, field_name) return XFAIL_RC(bug_no) +def profile_init_list(): + sys_prof_info = { + "InstanceID" : "CIM:DSP1042-SystemVirtualization-1.0.0", + "RegisteredOrganization" : 2, + "RegisteredName" : "System Virtualization", + "RegisteredVersion" : "1.0.0" + } + vs_prof = { + "InstanceID" : "CIM:DSP1057-VirtualSystem-1.0.0a", + "RegisteredOrganization" : 2, + "RegisteredName" : "Virtual System Profile", + "RegisteredVersion" : "1.0.0a" + } + gen_dev_prof = { + "InstanceID" : + "CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0", + "RegisteredOrganization" : 2, + "RegisteredName" : "Generic Device Resource Virtualization", + "RegisteredVersion" : "1.0.0" + } + mem_res_prof = { + "InstanceID" : "CIM:DSP1045-MemoryResourceVirtualization-1.0.0", + "RegisteredOrganization" : 2, + "RegisteredName" : "Memory Resource Virtualization", + "RegisteredVersion" : "1.0.0" + } + vs_mig_prof = { + "InstanceID" : "CIM:DSP1081-VirtualSystemMigration-1.0", + "RegisteredOrganization" : 2, + "RegisteredName" : "Virtual System Migration", + "RegisteredVersion" : "1.0" + } + + profiles = { + + 'DSP1042' : sys_prof_info, + 'DSP1045' : mem_res_prof, + 'DSP1057' : vs_prof, + 'DSP1059' : gen_dev_prof, + 'DSP1081' : vs_mig_prof + } + + return profiles From deeptik at linux.vnet.ibm.com Thu Apr 3 12:35:14 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 03 Apr 2008 18:05:14 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Adding 01_verify_refprof.py tc to verify the ReferencedProfile Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207226095 -19800 # Node ID f26165d0a996d3358d894b8c00efc0bd4fe625a4 # Parent 4ae171df56c92ff442bbd098102779140f3c7ff1 [TEST] Adding 01_verify_refprof.py tc to verify the ReferencedProfile. Signed-off-by: Deepti B. Kalakeri diff -r 4ae171df56c9 -r f26165d0a996 suites/libvirt-cim/cimtest/ReferencedProfile/01_verify_refprof.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ReferencedProfile/01_verify_refprof.py Thu Apr 03 18:04:55 2008 +0530 @@ -0,0 +1,183 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 +# +# The following test case is used to verify the ReferencedProfile provider. +# +#Ex Command: +#----------- +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1057-VirtualSystem-1.0.0a"' +# +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0"' +# +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1045-MemoryResourceVirtualization-1.0.0"' +# +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1081-VirtualSystemMigration-1.0"' +# +# All the above give the following Output: +# ---------------------------------------- +# All the above examples have the following as result. +# +# localhost:5988/root/interop:Xen_RegisteredProfile. +# InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0" +# ...... +# InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0" +# RegisteredOrganization=2 +# RegisteredName="System Virtualization" +# RegisteredVersion="1.0.0" +# .... +# +# wbemcli ai -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0"' +# +# Output: +# ------- +# localhost:5988/root/interop:Xen_RegisteredProfile.InstanceID="CIM:DSP1057-VirtualSystem-1.0.0a" +# -InstanceID="CIM:DSP1057-VirtualSystem-1.0.0a" +# -RegisteredOrganization=2 +# -RegisteredName="Virtual System Profile" +# -RegisteredVersion="1.0.0a" +# +# localhost:5988/root/interop:Xen_RegisteredProfile. +# InstanceID="CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0" +# ..... +# localhost:5988/root/interop:Xen_RegisteredProfile. +# InstanceID="CIM:DSP1045-MemoryResourceVirtualization-1.0.0" +# ...... +# localhost:5988/root/interop:Xen_RegisteredProfile. +# InstanceID="CIM:DSP1081-VirtualSystemMigration-1.0" +# ...... +# +# Date : 31-03-2008 +import sys +from XenKvmLib import enumclass +from XenKvmLib.assoc import Associators +from XenKvmLib.common_util import profile_init_list +from CimTest import Globals +from CimTest.Globals import log_param, logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORS +from CimTest.Globals import do_main +from XenKvmLib.classes import get_typed_class +from CimTest.ReturnCodes import FAIL, PASS + +sup_types = ['Xen', 'KVM', 'XenFV'] + +def print_field_error(fieldname, ret_value, exp_value): + logger.error("%s Mismatch", fieldname) + logger.error("Returned %s instead of %s", ret_value, exp_value) + +def get_proflist(): + proflist = [] + status = PASS + try: + key_list = ["InstanceID"] + proflist = enumclass.enumerate(server, reg_classname, key_list, virt) + if len(proflist) < 5: + logger.error("%s returned %i %s objects, expected atleast 5", + reg_classname, len(proflist), 'Profile') + status = FAIL + + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, reg_classname) + logger.error("Exception: %s", detail) + status = FAIL + + if status != PASS: + return status, proflist + + profiles_instid_list = [ profile.InstanceID for profile in proflist ] + + return status, profiles_instid_list + +def verify_fields(assoc_info, sys_prof_info): + fieldnames = ["InstanceID", "RegisteredOrganization", "RegisteredName", "RegisteredVersion"] + for f in fieldnames: + if assoc_info[f] != sys_prof_info[f]: + print_field_error(f, assoc_info[f], sys_prof_info[f]) + return FAIL + return PASS + +def verify_ref_assoc_info(assoc_info, profilename): + status = PASS + profiles = profile_init_list() + logger.info("Verifying profile: %s", profilename) + for inst in assoc_info: + for profnum, profinfo in profiles.items(): + if profnum in inst['InstanceID']: + status = verify_fields(inst, profinfo) + if status != PASS: + break + if status != PASS: + break + return status + + +def get_refprof_verify_info(proflist): + assoc_info = [] + status = PASS + assoc_name = get_typed_class(virt, 'ReferencedProfile') + for instid in proflist: + try: + assoc_info = Associators(server, assoc_name, reg_classname, virt, InstanceID = instid, + CreationClassName = reg_classname) + if len(assoc_info) < 1: + logger.error("%s returned %i %s objects, expected atleast 1", + assoc_name, len(assoc_info), 'Profiles') + status = FAIL + if status != PASS: + break + + status = verify_ref_assoc_info(assoc_info, instid) + if status != PASS: + break + + except Exception, detail: + logger.error(CIM_ERROR_ASSOCIATORS, assoc_name) + logger.error("Exception: %s", detail) + status = FAIL + + return status + + at do_main(sup_types) +def main(): + log_param() + options = main.options + global virt, server, reg_classname + virt = options.virt + server = options.ip + status = PASS + prev_namespace = Globals.CIM_NS + Globals.CIM_NS = 'root/interop' + reg_classname = get_typed_class(virt, 'RegisteredProfile') + + status, proflist = get_proflist() + if status != PASS : + Globals.CIM_NS = prev_namespace + return status + + status = get_refprof_verify_info(proflist) + Globals.CIM_NS = prev_namespace + return status + +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Thu Apr 3 12:37:08 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 03 Apr 2008 18:07:08 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Adding 02_refprofile_errs.py to verify the exception returned for ReferencedProfile when invalid values are passed Message-ID: <3129aaf0add9f197c05d.1207226228@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207226220 -19800 # Node ID 3129aaf0add9f197c05d19064668d02f5aea5d07 # Parent f26165d0a996d3358d894b8c00efc0bd4fe625a4 [TEST] Adding 02_refprofile_errs.py to verify the exception returned for ReferencedProfile when invalid values are passed. Signed-off-by: Deepti B. Kalakeri diff -r f26165d0a996 -r 3129aaf0add9 suites/libvirt-cim/cimtest/ReferencedProfile/02_refprofile_errs.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ReferencedProfile/02_refprofile_errs.py Thu Apr 03 18:07:00 2008 +0530 @@ -0,0 +1,152 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 +# +# +# Test Case Info: +# -------------- +# The following test case is used to verify the ReferencedProfile association supported +# returns exceptions when invalid values are passed to it. +# +# 1) Test by passing Invalid InstanceID Key Name +# Input: +# ------ +# wbemcli ai -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.Wrong="CIM:DSP1042-SystemVirtualization-1.0.0"' -nl +# +# Output: +# ------- +# error code : CIM_ERR_FAILED +# error desc : "No InstanceID specified" +# +# 2) Test by giving invalid Invalid InstanceID Key Value +# Input: +# ------ +# wbemcli ain -ac Xen_ReferencedProfile 'http://localhost:5988/root/interop: +# Xen_RegisteredProfile.InstanceID="Wrong"' -nl +# +# Output: +# ------- +# error code : CIM_ERR_NOT_FOUND +# error desc : "No such instance" +# +# +# Date : 31-03-2008 + +import sys +import pywbem +from XenKvmLib import enumclass +from XenKvmLib import assoc +from CimTest import Globals +from CimTest.Globals import log_param, logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORS +from CimTest.Globals import do_main, CIM_USER, CIM_PASS +from XenKvmLib.classes import get_typed_class +from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib.common_util import try_assoc + +sup_types = ['Xen', 'KVM', 'XenFV'] +expr_values = { + 'INVALID_Instid_KeyName' : { + 'rc' : pywbem.CIM_ERR_FAILED, + 'desc' : "No InstanceID specified" + }, + 'INVALID_Instid_KeyValue' : { + 'rc' : pywbem.CIM_ERR_NOT_FOUND, + 'desc' : "No such instance" + } + } + + +def get_proflist(): + proflist = [] + status = PASS + try: + key_list = ["InstanceID"] + proflist = enumclass.enumerate(server, reg_classname, key_list, virt) + if len(proflist) < 5 : + logger.error("%s returned %i %s objects, expected atleast 5", + reg_classname, len(proflist), 'Profile') + status = FAIL + + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, reg_classname) + logger.error("Exception: %s", detail) + status = FAIL + + if status != PASS: + return status, proflist + + profiles_instid_list = [ profile.InstanceID for profile in proflist ] + + return status, profiles_instid_list + + +def verify_prof_err(field, keys): + status = PASS + assoc_classname = get_typed_class(virt, 'ReferencedProfile') + try: + ret_value = try_assoc(conn, reg_classname, assoc_classname, keys, field_name=field, \ + expr_values=expr_values[field], bug_no="") + if ret_value != PASS: + logger.error("------ FAILED: to verify %s.------", field) + status = ret_value + except Exception, detail: + logger.error(CIM_ERROR_ASSOCIATORS, assoc_classname) + logger.error("Exception: %s", detail) + status = FAIL + return status + + + at do_main(sup_types) +def main(): + log_param() + options = main.options + global virt, server, reg_classname, conn + virt = options.virt + server = options.ip + status = PASS + prev_namespace = Globals.CIM_NS + Globals.CIM_NS = 'root/interop' + reg_classname = get_typed_class(virt, 'RegisteredProfile') + status, proflist = get_proflist() + if status != PASS : + Globals.CIM_NS = prev_namespace + return status + + conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), Globals.CIM_NS) + + for prof in sorted(proflist): + field = 'INVALID_Instid_KeyName' + keys = { field : prof } + status = verify_prof_err(field, keys) + if status != PASS: + break + + field = 'INVALID_Instid_KeyValue' + keys = { 'InstanceID' : field } + status = verify_prof_err(field, keys) + if status != PASS: + break + + Globals.CIM_NS = prev_namespace + return status + +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Thu Apr 3 12:51:43 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 03 Apr 2008 18:21:43 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Add cross-provider test case 06_hs_to_vsms.py Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207227092 -19800 # Node ID dbb701ed977395d064da465a17f69b8d86bf17c7 # Parent 3129aaf0add9f197c05d19064668d02f5aea5d07 [TEST] Add cross-provider test case 06_hs_to_vsms.py. 1) Removed the check_len() function and included the logic to check the len of assoc, list in the same file. 2) It traverses the following path: {Hostsystem} --> [HostedService] {VirtualSystemMigrationService} --> [ElementCapabilities] {VirtualSystemMigrationCapabilities} --> [SettingsDefineCapabilities] {VirtualSystemMigrationSettingData} Verify the VirtualSystemMigrationSettingData. Signed-off-by: Deepti B. Kalakeri diff -r 3129aaf0add9 -r dbb701ed9773 suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py Thu Apr 03 18:21:32 2008 +0530 @@ -0,0 +1,216 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 is a cross-provider testcase to +# Get the MigrationSettingData properties starting from the host +# +# It traverses the following path: +# {Hostsystem} --> [HostedService] {VirtualSystemMigrationService} --> +# [ElementCapabilities] {VirtualSystemMigrationCapabilities} --> +# [SettingsDefineCapabilities] {VirtualSystemMigrationSettingData} +# Verify the VirtualSystemMigrationSettingData. +# +# Steps: +# ------ +# 1) Get the hostname by enumerating the hostsystem. +# 2) Get the various service on the host by using the HostedService association by supplying +# the inputs obtained from querying the hostsystem. +# 4) Select the VirtualSystemMigrationService from the association returned. We should get only +# one record. +# 5) Use the VirtualSystemMigrationService information to query ElementCapabilities association +# Verify that we should get only one MigrationCapabilities record from the VSMS association. +# 6) Obtain the VSMigrationSettingData values by using the MigrationCapabilities output from the +# previous query and supplying it to the SettingsDefineCapabilities association. +# 7) Check, that we obtain only one VSMigrationSettingData data. +# Verify the VSMigrationSettingData values. +# Date : 28.03.2008 + +import sys +from CimTest.Globals import do_main +from XenKvmLib.classes import get_typed_class +from XenKvmLib.assoc import Associators, AssociatorNames +from XenKvmLib.common_util import get_host_info +from CimTest.Globals import log_param, logger, CIM_ERROR_ASSOCIATORNAMES, \ +CIM_ERROR_ASSOCIATORS +from CimTest.ReturnCodes import PASS, FAIL + +sup_types = ['Xen', 'KVM', 'XenFV'] + +def print_err(err, detail, cn): + logger.error(err % cn) + logger.error("Exception: %s", detail) + +def print_field_error(fieldname, ret_value, exp_value): + logger.error("%s Mismatch", fieldname) + logger.error("Returned %s instead of %s", ret_value, exp_value) + + +def get_inst_from_list(server, cn, assoc_info, filter_name, exp_val): + status = PASS + ret = -1 + inst = [] + for rec in assoc_info: + record = rec[filter_name] + if record == exp_val: + inst.append(rec) + ret = PASS + + # When no records are found. + if ret != PASS: + logger.error("%s with %s was not returned" % (cn, exp_val)) + status = FAIL + + return status, inst + +def get_assocnames_info(server, cn, an, qcn, name): + status = PASS + assoc_info = [] + try: + assoc_info = AssociatorNames(server, an, cn, virt, Name = name, CreationClassName = cn) + if len(assoc_info) < 0 : + logger.error("%s returned %i %s objects, expected atleast 3", an, len(assoc_info), qcn) + status = FAIL + except Exception, detail: + print_err(CIM_ERROR_ASSOCIATORNAMES, detail, an) + status = FAIL + + return status, assoc_info + + +def get_vsms_info(): + status, host_name, classname = get_host_info(server, virt) + if status != PASS: + return status, [] + status, service_assoc_info = get_assocnames_info(server, classname, + assoc_name, req_cn, host_name) + if status != PASS or len(service_assoc_info) == 0: + return status, service_assoc_info + filter_name = "Name" + filter_value = 'MigrationService' + cn = 'VirtualSystemMigrationService' + status, vsms_list = get_inst_from_list(server, cn, service_assoc_info, filter_name, + filter_value) + return status, vsms_list + +def get_vsmcap_from_ec(vsms_list): + status = PASS + vsms_info = vsms_list[0] + cn = vsms_info['CreationClassName'] + sn = vsms_info['SystemName'] + name = vsms_info['Name'] + sccn = vsms_info['SystemCreationClassName'] + assoc_info = [] + try: + assoc_info = AssociatorNames(server, assoc_name, cn, virt, CreationClassName = cn, + SystemName = sn, Name = name, SystemCreationClassName = sccn) + if len(assoc_info) != 1: + logger.error("%s returned %i %s objects, expected only 1", assoc_name, len(assoc_info), req_cn) + status = FAIL + + except Exception, detail: + print_err(CIM_ERROR_ASSOCIATORNAMES, detail, assoc_name) + status = FAIL + + return status, assoc_info + +def get_vsmsd_from_sdc(vsmsd_list): + status = PASS + vsmsd_info = vsmsd_list[0] + cn = vsmsd_info.classname + instid = vsmsd_info['InstanceID'] + assoc_info = [] + try: + assoc_info = Associators(server, assoc_name, cn, virt, CreationClassName = cn, + InstanceID = instid) + if len(assoc_info) != 1: + logger.error("%s returned %i %s objects, expected only 1", assoc_name, len(assoc_info), req_cn) + status = FAIL + + except Exception, detail: + print_err(CIM_ERROR_ASSOCIATORS, detail, assoc_name) + status = FAIL + + return status, assoc_info + +def verify_vsmsd_values(vsmsd_list): + + # Values to be used for comparison + cn = get_typed_class(virt, "VirtualSystemMigrationSettingData") + instid = 'MigrationSettingData' + MType = 2 #[CIM_MIGRATE_LIVE] + priority = 0 + + verify_vsmsd = vsmsd_list[0] + if verify_vsmsd.classname != cn: + print_field_error('ClassName', verify_vsmsd.classname, cn) + return FAIL + if verify_vsmsd['InstanceID'] != instid: + print_field_error('InstanceID', verify_vsmsd['InstanceID'], instid) + return FAIL + if verify_vsmsd['MigrationType'] != MType: + print_field_error('MigrationType', verify_vsmsd['MigrationType'], MType) + return FAIL + if verify_vsmsd['Priority'] != priority: + print_field_error('Priority', verify_vsmsd['Priority'], priority) + return FAIL + return PASS + + + at do_main(sup_types) +def main(): + global virt, server + global assoc_name, class_name, req_cn + options = main.options + log_param() + server = options.ip + status = PASS + virt = options.virt + + assoc_name = get_typed_class(virt, 'HostedService') + req_cn = 'Service' + status, vsms_list = get_vsms_info() + if status != PASS or len(vsms_list) == 0: + logger.error("Did not get the expected MigrationService record") + return status + if len(vsms_list) != 1: + logger.error("%s returned %i %s objects, expected only 1", assoc_name, len(vsms_list), req_cn) + return FAIL + + assoc_name = get_typed_class(virt, 'ElementCapabilities') + req_cn = 'MigrationCapabilities' + status, vsmscap = get_vsmcap_from_ec(vsms_list) + if status != PASS or len(vsmscap) == 0: + logger.error("Did not get the expected MigrationCapabilities record") + return status + + assoc_name = get_typed_class(virt, 'SettingsDefineCapabilities') + req_cn = 'MigrationSettingData' + status, vsmsd = get_vsmsd_from_sdc(vsmscap) + if status != PASS or len(vsmsd) == 0: + logger.error("Did not get the expected MigrationSettingData record") + return status + + status = verify_vsmsd_values(vsmsd) + + return status +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Thu Apr 3 12:52:13 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 03 Apr 2008 18:22:13 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting: Addition] : Adding 01_forward.py tc to verify ReferencedProfile In-Reply-To: <878wzwkweo.fsf@caffeine.beaverton.ibm.com> References: <57b84aa20438fe7f8b7f.1207117037@dkalaker> <878wzwkweo.fsf@caffeine.beaverton.ibm.com> Message-ID: <47F4D2FD.4060705@linux.vnet.ibm.com> Hi Dan, Please see my comments inline. Thanks and Regards, Deepti. Dan Smith wrote: > DK> # HG changeset patch > DK> # User Deepti B. Kalakeri > DK> # Date 1207117030 -19800 > DK> # Node ID 57b84aa20438fe7f8b7f2fa5e0098e30e2198745 > DK> # Parent e2cd9e869996152255adcf54e4c4e38331fcf760 > DK> [TEST][Resubmitting: Addition] : Adding 01_forward.py tc to verify ReferencedProfile. > > This one ran fine when I tried it, but I have some comments. > > DK> + try: > DK> + key_list = ["InstanceID"] > DK> + proflist = enumclass.enumerate(server, eval('enumclass.' + reg_classname), key_list, virt) > > Doesn't enumclass.enumerate take a classname? We should avoid > eval()'ing all over the place for no reason. > yes it does, I have changed this. > DK> + if len(proflist) < 5 : > > This will break when we add one more profile. Please make sure this > is >0 and then check that the proper profiles are returned somewhere > else. Well, if we add a new profile later then the len(proflist) will be 6 and the condition (6<5) will still hold good. Also, by explicitly verifying the len to be 5 makes sure that we dont get anything less than the previously implemented profiles. > DK> + profiles_instid_list = [] > DK> + for profile in proflist: > DK> + if not ("DSP1042" in profile.InstanceID): > DK> + profiles_instid_list.append(profile.InstanceID) > > This is randomly filtering out DSP1042? Why? Changed this. > DK> +def verify_ref_assoc_info(assoc_info, sys_prof_info): > DK> + if assoc_info['InstanceID'] != sys_prof_info['InstanceID']: > DK> + print_field_error('InstanceID', assoc_info['InstanceID'], sys_prof_info['InstanceID']) > DK> + return FAIL > DK> + if assoc_info['RegisteredOrganization'] != sys_prof_info['RegisteredOrganization']: > DK> + print_field_error('RegisteredOrganization', assoc_info['RegisteredOrganization'], > DK> + sys_prof_info['RegisteredOrganization']) > DK> + return FAIL > DK> + if assoc_info['RegisteredName'] != sys_prof_info['RegisteredName']: > DK> + print_field_error('RegisteredName', assoc_info['RegisteredName'], > DK> + sys_prof_info['RegisteredName']) > DK> + return FAIL > DK> + if assoc_info['RegisteredVersion'] != sys_prof_info['RegisteredVersion']: > DK> + print_field_error('RegisteredVersion', assoc_info['RegisteredVersion'], > DK> + sys_prof_info['RegisteredVersion']) > DK> + return FAIL > DK> + return PASS > > The entire blob above can be replaced with this: > > for f in ["RegisteredOrganization", "RegisteredName", "RegisteredVersion"]: > if assoc_info[f] != sys_prof_info[f]: > print_field_error(f, assoc_info[f], sys_prof_info[f]) > return FAIL > return PASS > This is better way, thanks I used this :). > Thanks! > > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim From deeptik at linux.vnet.ibm.com Thu Apr 3 12:52:34 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 03 Apr 2008 18:22:34 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting: Addition] : Adding 02_reverse.py tc to verify ReferencedProfile In-Reply-To: <87lk3wjgnc.fsf@caffeine.beaverton.ibm.com> References: <87lk3wjgnc.fsf@caffeine.beaverton.ibm.com> Message-ID: <47F4D312.5030002@linux.vnet.ibm.com> Hi Dan, Please see my replies inline. Thanks and Regards, Deepti. Dan Smith wrote: > DK> +def verify_fields(assoc_info, prof_info): > DK> + if assoc_info['InstanceID'] != prof_info['InstanceID']: > DK> + print_field_error('InstanceID', assoc_info['InstanceID'], prof_info['InstanceID']) > DK> + return FAIL > DK> + if assoc_info['RegisteredOrganization'] != prof_info['RegisteredOrganization']: > DK> + print_field_error('RegisteredOrganization', assoc_info['RegisteredOrganization'], \ > DK> + prof_info['RegisteredOrganization']) > DK> + return FAIL > DK> + if assoc_info['RegisteredName'] != prof_info['RegisteredName']: > DK> + print_field_error('RegisteredName', assoc_info['RegisteredName'], \ > DK> + prof_info['RegisteredName']) > DK> + return FAIL > DK> + if assoc_info['RegisteredVersion'] != prof_info['RegisteredVersion']: > DK> + print_field_error('RegisteredVersion', assoc_info['RegisteredVersion'], \ > DK> + prof_info['RegisteredVersion']) > DK> + return FAIL > DK> + return PASS > > Same comment as before for this as well. > Changed this. > DK> +def verify_ref_assoc_info(assoc_info): > DK> + status = PASS > DK> + vs_prof, gen_dev_prof, mem_res_prof, vs_mig_prof = init_list() > DK> + for i in range(len(assoc_info)): > > Please use the following syntax for for loops (unless you really need > the index): > > for i in assoc_info: > Done. > DK> + instid = assoc_info[i]['InstanceID'] > DK> + if instid.find("DSP1045") >=0 : > DK> + status = verify_fields(assoc_info[i], mem_res_prof) > DK> + elif instid.find("DSP1057") >=0 : > DK> + status = verify_fields(assoc_info[i], vs_prof) > DK> + elif instid.find("DSP1059") >=0 : > DK> + status = verify_fields(assoc_info[i], gen_dev_prof) > DK> + elif instid.find("DSP1081") >=0 : > DK> + status = verify_fields(assoc_info[i], vs_mig_prof) > DK> + else: > DK> + status = FAIL > DK> + if status != PASS: > DK> + break > DK> + return status > > In the interest of making this more extensible in the future, why not > embed the information you need in the profile information dictionary > in some way to avoid this sort of static structure? Assuming the dict > has a "profnum" field: > > Done. > profiles = init_list() > for i in assoc_info: > status = None > for profile in profiles: > if profile["profnum"] in i['InstanceID']: > status = verify_fields(i, profile) > break > if status == FAIL: > break > > You may need to rearrange your profile dict a little to make the key > properties distinct from other bits, but the result will be that when > we add a new supported profile, you can just add an entry to the > top-level list of profiles and not have to modify lots of other bits > in the code. > > Most of your other tests can probably be modified in this way as well, > which leads me to ask: Why not define a single set of profiles in a > common file and import them? That way, all of the profile tests will > work against a single set of profiles, which I think makes a lot more > sense. > Done. > > DK> +def get_refprof_verify_info(): > DK> + assoc_info = [] > DK> + status = PASS > DK> + assoc_name = get_typed_class(virt, 'ReferencedProfile') > DK> + instid = "CIM:DSP1042-SystemVirtualization-1.0.0" > DK> + try: > DK> + assoc_info = Associators(server, assoc_name, reg_classname, virt, InstanceID = instid, > DK> + CreationClassName = reg_classname) > DK> + if len(assoc_info) < 4: > DK> + logger.error("%s returned %i %s objects, expected atleast 4", > DK> + assoc_name, len(assoc_info), 'Profile') > DK> + status = FAIL > DK> + > DK> + if status != PASS: > DK> + return status > DK> + status = verify_ref_assoc_info(assoc_info) > DK> + except Exception, detail: > DK> + logger.error(CIM_ERROR_ASSOCIATORS, assoc_name) > DK> + logger.error("Exception: %s", detail) > DK> + status = FAIL > DK> + return status > > Perhaps you can explain the need for the repeated special case > distinction for this profile? > > Merged in this with the other tc. > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim From danms at us.ibm.com Thu Apr 3 16:16:30 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 03 Apr 2008 09:16:30 -0700 Subject: [Libvirt-cim] [PATCH] Returning 0 domains is not an error Message-ID: <589af2d7c4466eea7e75.1207239390@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1207239285 25200 # Node ID 589af2d7c4466eea7e75765222835db46772f1ac # Parent 1e1c2cd2ef0bff684df37d5c94d7b66b6189295c Returning 0 domains is not an error Signed-off-by: Dan Smith diff -r 1e1c2cd2ef0b -r 589af2d7c446 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Fri Mar 28 13:34:34 2008 -0700 +++ b/src/Virt_ComputerSystem.c Thu Apr 03 09:14:45 2008 -0700 @@ -400,7 +400,7 @@ CMPIStatus enum_domains(const CMPIBroker goto out; count = get_domain_list(conn, &list); - if (count <= 0) { + if (count < 0) { cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, "Failed to get domain list"); From danms at us.ibm.com Thu Apr 3 20:02:45 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 03 Apr 2008 13:02:45 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] bundles of ComputerSystemCreatedIndication tc In-Reply-To: (Guo Lian Yun's message of "Thu, 3 Apr 2008 10:05:17 +0800") References: Message-ID: <873aq2d7ve.fsf@caffeine.beaverton.ibm.com> GY> As you said before, it's better to subscribe to a superclass and GY> get all three of the lifecycle indications. So I prepare to GY> change the test case do the setup for each type in a single file. Okay. GY> Also, the superclass named "CIM_Indication", right? Yes, I think that's the only common superclass. >> How about a test that subscribes to a Xen indication and then creates >> a KVM guest to make sure that it doesn't get the KVM indication? >> GY> You refer to the negative test case to Xen indication? I'm not sure what you're asking here... -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Apr 3 20:04:57 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 03 Apr 2008 13:04:57 -0700 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting: Addition] : Adding 01_forward.py tc to verify ReferencedProfile In-Reply-To: <47F4D2FD.4060705@linux.vnet.ibm.com> (Deepti B. Kalakeri's message of "Thu, 03 Apr 2008 18:22:13 +0530") References: <57b84aa20438fe7f8b7f.1207117037@dkalaker> <878wzwkweo.fsf@caffeine.beaverton.ibm.com> <47F4D2FD.4060705@linux.vnet.ibm.com> Message-ID: <87y77ubt7a.fsf@caffeine.beaverton.ibm.com> DK> Well, if we add a new profile later then the len(proflist) will be DK> 6 and the condition (6<5) will still hold good. Also, by DK> explicitly verifying the len to be 5 makes sure that we dont get DK> anything less than the previously implemented profiles. Okay, that's fair :) DK> This is better way, thanks I used this :). Cool, thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Apr 3 20:07:17 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 03 Apr 2008 13:07:17 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Adding profile_init_list() in common_util.py to create a default profile list In-Reply-To: <4ae171df56c92ff442bb.1207225909@dkalaker> (Deepti B. Kalakeri's message of "Thu, 03 Apr 2008 18:01:49 +0530") References: <4ae171df56c92ff442bb.1207225909@dkalaker> Message-ID: <87tziibt3e.fsf@caffeine.beaverton.ibm.com> DK> # HG changeset patch DK> # User Deepti B. Kalakeri DK> # Date 1207225887 -19800 DK> # Node ID 4ae171df56c92ff442bbd098102779140f3c7ff1 DK> # Parent cbadbbee26c59304d6ef6a46e94eeb9b5dbed26b DK> [TEST] Adding profile_init_list() in common_util.py to create a default profile list. I like this a lot, thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Thu Apr 3 20:07:39 2008 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 03 Apr 2008 16:07:39 -0400 Subject: [Libvirt-cim] [PATCH] Toks noticed we have some consistency issues in terms of MB versus KB for memory. This should sort that out Message-ID: # HG changeset patch # User Jay Gagnon # Date 1207253245 14400 # Node ID dcf2ac998f1d1451ebbcd68c41ba317b345b01a8 # Parent c8c0e264c75cccccb40ff0de1cfdfc7a14c3d65a Toks noticed we have some consistency issues in terms of MB versus KB for memory. This should sort that out. Signed-off-by: Jay Gagnon diff -r c8c0e264c75c -r dcf2ac998f1d configure.ac --- a/configure.ac Thu Mar 20 10:47:48 2008 -0700 +++ b/configure.ac Thu Apr 03 16:07:25 2008 -0400 @@ -61,9 +61,9 @@ AC_ARG_WITH([diskconfig], [DEFINE_DISK_CONFIG(/tmp/diskpool.conf)] ) AC_ARG_WITH([maxmem], - [ --with-maxmem=FOO Set max memory (MB) for a guest.], + [ --with-maxmem=FOO Set max memory (KB) for a guest.], [DEFINE_MAXMEM($with_maxmem)], - [DEFINE_MAXMEM(4096)] + [DEFINE_MAXMEM(4194304)] ) AC_ARG_WITH(html-dir, diff -r c8c0e264c75c -r dcf2ac998f1d src/Virt_RASD.c --- a/src/Virt_RASD.c Thu Mar 20 10:47:48 2008 -0700 +++ b/src/Virt_RASD.c Thu Apr 03 16:07:25 2008 -0400 @@ -344,7 +344,7 @@ static CMPIInstance *rasd_from_vdev(cons (CMPIValue *)dev->dev.disk.type, CMPI_chars); } else if (dev->type == CIM_RES_TYPE_MEM) { - const char *units = "MegaBytes"; + const char *units = "KiloBytes"; CMSetProperty(inst, "AllocationUnits", (CMPIValue *)units, CMPI_chars); diff -r c8c0e264c75c -r dcf2ac998f1d src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Thu Mar 20 10:47:48 2008 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Thu Apr 03 16:07:25 2008 -0400 @@ -116,7 +116,7 @@ static struct sdc_rasd_prop *mem_max(con struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, - {"AllocationUnits", (CMPIValue *)"MegaBytes", CMPI_chars}, + {"AllocationUnits", (CMPIValue *)"KiloBytes", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&max_vq, CMPI_uint64}, PROP_END }; @@ -136,11 +136,11 @@ static struct sdc_rasd_prop *mem_min(con { bool ret; struct sdc_rasd_prop *rasd = NULL; - uint64_t min_vq = 64; + uint64_t min_vq = 64 << 10; struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Minimum", CMPI_chars}, - {"AllocationUnits", (CMPIValue *)"MegaBytes", CMPI_chars}, + {"AllocationUnits", (CMPIValue *)"KiloBytes", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&min_vq, CMPI_uint64}, PROP_END }; @@ -160,11 +160,11 @@ static struct sdc_rasd_prop *mem_def(con { bool ret; struct sdc_rasd_prop *rasd = NULL; - uint64_t def_vq = 256; + uint64_t def_vq = 256 << 10; struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, - {"AllocationUnits", (CMPIValue *)"MegaBytes", CMPI_chars}, + {"AllocationUnits", (CMPIValue *)"KiloBytes", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&def_vq, CMPI_uint64}, PROP_END }; @@ -184,11 +184,11 @@ static struct sdc_rasd_prop *mem_inc(con { bool ret; struct sdc_rasd_prop *rasd = NULL; - uint64_t inc_vq = 1; + uint64_t inc_vq = 1 << 10; struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Increment", CMPI_chars}, - {"AllocationUnits", (CMPIValue *)"MegaBytes", CMPI_chars}, + {"AllocationUnits", (CMPIValue *)"KiloBytes", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&inc_vq, CMPI_uint64}, PROP_END }; From danms at us.ibm.com Thu Apr 3 20:15:23 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 03 Apr 2008 13:15:23 -0700 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting] Add cross-provider test case 04_vssd_to_rasd.py In-Reply-To: <104b65ee0d5f0bb2af8e.1207204202@dkalaker> (Deepti B. Kalakeri's message of "Thu, 03 Apr 2008 12:00:02 +0530") References: <104b65ee0d5f0bb2af8e.1207204202@dkalaker> Message-ID: <87prt6bspw.fsf@caffeine.beaverton.ibm.com> DK> +def setup_env(): DK> + vsxml_info = None DK> + vsxml_info = get_class(virt)(test_dom, mem=test_mem, vcpus = test_vcpus, As discussed with Zhen Gang and Daisy's patches, please store the class in a temporary variable for clarity. DK> +def init_list(virt): DK> + """ DK> + Creating the lists that will be used for comparisons. DK> + """ DK> + procrasd = { DK> + "InstanceID" : '%s/%s' %(test_dom,0),\ DK> + "ResourceType" : 3,\ DK> + "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') DK> + } DK> + DK> + netrasd = { DK> + "InstanceID" : '%s/%s' %(test_dom,test_mac), \ DK> + "ResourceType" : 10 , \ DK> + "ntype1": "bridge", \ DK> + "ntype2": "ethernet", \ DK> + "CreationClassName": get_typed_class(virt, 'NetResourceAllocationSettingData') DK> + } DK> + DK> + address = vsxml.xml_get_disk_source() DK> + diskrasd = { DK> + "InstanceID" : '%s/%s' %(test_dom, test_disk), \ DK> + "ResourceType" : 17, \ DK> + "Address" : address, \ DK> + "CreationClassName": get_typed_class(virt, 'DiskResourceAllocationSettingData') DK> + } DK> + memrasd = { DK> + "InstanceID" : '%s/%s' %(test_dom, "mem"), \ DK> + "ResourceType" : 4, \ DK> + "AllocationUnits" : "MegaBytes",\ DK> + "VirtualQuantity" : (test_mem * 1024), \ DK> + "CreationClassName": get_typed_class(virt, 'MemResourceAllocationSettingData') DK> + } DK> + return procrasd, netrasd, diskrasd, memrasd You don't need the '\' characters at the ends of those lines. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From deeptik at linux.vnet.ibm.com Fri Apr 4 06:55:42 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 04 Apr 2008 12:25:42 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting]Add cross-provider test case 04_vssd_to_rasd.py Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207292102 -19800 # Node ID dce42f09c9c60c59e15db48882bc8fb68301238f # Parent aac3efb5fe308b2c381ef3e7671411cb7337008f [TEST][Resubmitting]Add cross-provider test case 04_vssd_to_rasd.py. 1) Removed the check_len() function and included the logic in the same file. 2) Used xml_get_disk_source() to get the disk image path 3) Used a variable to Store the class. 4) It traverses the following path: {VSSD} --> [VirtualSystemSettingDataComponent](RASD) Verify the Device RASD returned with the values expected - those given in the xml description. Signed-off-by: Deepti B. Kalakeri diff -r aac3efb5fe30 -r dce42f09c9c6 suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Fri Apr 04 12:25:02 2008 +0530 @@ -0,0 +1,243 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 is a cross-provider testcase to +# Get the setting data properties for the given guest. +# +# +# It traverses the following path: +# {VSSD} --> [VirtualSystemSettingDataComponent](RASD) +# (Verify the Device RASD returned with the values expected - those given in test_xml) +# +# Steps: +# ------ +# 1) Define a guest domain. +# 1) Get the VSSD info using enumeration. +# 2) From the VSSD output get the info related to the domain. We expect only one +# VSSD info related to the domain to be returned. +# 4) Get the various devices allocated to the domain by using the VirtualSystemSettingDataComponent +# association and giving the VSSD output from the previous VSSD enumeration as inputs. +# 5) Verify the Disk, Memory, Network, Processor RASD values. +# 7) Undefine the guest domain. +# +# Date : 26-03-2008 + + +import sys +import XenKvmLib +from XenKvmLib import enumclass +from CimTest.Globals import do_main, CIM_ERROR_ASSOCIATORS, CIM_ERROR_ENUMERATE +from CimTest.Globals import log_param, logger +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.test_doms import destroy_and_undefine_all +from XenKvmLib import assoc +from XenKvmLib.vxml import get_class +from XenKvmLib.classes import get_typed_class +from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \ +verify_diskrasd_values, verify_memrasd_values + +sup_types = ['Xen', 'KVM', 'XenFV'] + +test_dom = "VSSDC_dom" +test_vcpus = 1 +test_mem = 128 +test_mac = "00:11:22:33:44:aa" + +def setup_env(): + vsxml_info = None + virt_xml = get_class(virt) + vsxml_info = virt_xml(test_dom, mem=test_mem, vcpus = test_vcpus, + mac = test_mac, disk = test_disk) + try: + bridge = vsxml_info.set_vbridge(server) + ret = vsxml_info.define(server) + if not ret: + logger.error("Failed to Define the domain: %s", test_dom) + return FAIL, vsxml_info + except Exception, details: + logger.error("Exception : %s", details) + return FAIL, vsxml_info + return PASS, vsxml_info + +def init_list(virt): + """ + Creating the lists that will be used for comparisons. + """ + procrasd = { + "InstanceID" : '%s/%s' %(test_dom,0), + "ResourceType" : 3, + "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') + } + + netrasd = { + "InstanceID" : '%s/%s' %(test_dom,test_mac), + "ResourceType" : 10 , + "ntype1": "bridge", + "ntype2": "ethernet", + "CreationClassName": get_typed_class(virt, 'NetResourceAllocationSettingData') + } + + address = vsxml.xml_get_disk_source() + diskrasd = { + "InstanceID" : '%s/%s' %(test_dom, test_disk), + "ResourceType" : 17, + "Address" : address, + "CreationClassName": get_typed_class(virt, 'DiskResourceAllocationSettingData') + } + memrasd = { + "InstanceID" : '%s/%s' %(test_dom, "mem"), + "ResourceType" : 4, + "AllocationUnits" : "MegaBytes", + "VirtualQuantity" : (test_mem * 1024), + "CreationClassName": get_typed_class(virt, 'MemResourceAllocationSettingData') + } + return procrasd, netrasd, diskrasd, memrasd + +def get_inst_from_list(classname, vssd_list, filter_name, exp_val): + status = PASS + ret = -1 + inst = [] + for rec in vssd_list: + record = rec[filter_name['key']] + if record.find(exp_val) >=0 : + inst.append(rec) + ret = PASS + + # When no records are found. + if ret != PASS: + logger.error("%s with %s was not returned" % (classname, exp_val)) + status = FAIL + + # We expect only one record to be returned. + if len(inst) != 1: + logger.error("%s returned %i %s objects, expected only 1" % (classname, len(inst), 'VSSD')) + status = FAIL + + if status != PASS: + vsxml.undefine(server) + + return status, inst + +def get_vssd_info(): + vssd = [] + status = PASS + try: + classname = get_typed_class(virt, 'VirtualSystemSettingData') + vssd = enumclass.enumerate_inst(server, eval('enumclass.' + classname), virt) + if len(vssd) < 1 : + logger.error("%s returned %i %s objects, expected atleast 1" % (classname, len(vssd), 'VSSD')) + status = FAIL + + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, classname) + logger.error("Exception: %s", detail) + status = FAIL + + if status != PASS: + return status, vssd + + filter_name = {"key" : "InstanceID"} + # Get the info ONLY related to the domain. + status, vssd_values = get_inst_from_list(classname, vssd, filter_name, test_dom) + + return status, vssd_values + +def get_rasd_values_from_vssdc_assoc(vssd_values): + status = PASS + vssdc_assoc_info = [] + # We should have only one VSSD record, the check for this is already done in + # get_inst_from_list() function, hence can safely use index 0. + instIdval = vssd_values[0]['InstanceID'] + qcn = vssd_values[0].classname + assoc_cname = get_typed_class(virt, 'VirtualSystemSettingDataComponent') + try: + vssdc_assoc_info = assoc.Associators(server, assoc_cname, qcn, virt, InstanceID = instIdval) + if len(vssdc_assoc_info) < 4: + logger.error("%s returned %i %s objects, expected 4" % (assoc_cname, len(vssdc_assoc_info), qcn)) + status = FAIL + + except Exception, details: + logger.error(CIM_ERROR_ASSOCIATORS, assoc_cname) + logger.error("Exception : %s" % details) + status = FAIL + return status, vssdc_assoc_info + +def verify_rasd_values(rasd_values_info): + procrasd, netrasd, diskrasd, memrasd = init_list(virt) + try: + for rasd_instance in rasd_values_info: + CCName = rasd_instance.classname + if 'ProcResourceAllocationSettingData' in CCName: + status = verify_procrasd_values(rasd_instance, procrasd) + elif 'NetResourceAllocationSettingData' in CCName : + status = verify_netrasd_values(rasd_instance, netrasd) + elif 'DiskResourceAllocationSettingData' in CCName: + status = verify_diskrasd_values(rasd_instance, diskrasd) + elif 'MemResourceAllocationSettingData' in CCName : + status = verify_memrasd_values(rasd_instance, memrasd) + else: + status = FAIL + if status != PASS: + logger.error("Mistmatching %s values", CCName ) + break + except Exception, detail : + logger.error("Exception in verify_rasd_values function: %s" % detail) + status = FAIL + return status + + at do_main(sup_types) +def main(): + options = main.options + log_param() + destroy_and_undefine_all(options.ip) + global test_disk, vsxml + global virt, server + server = options.ip + virt = options.virt + if virt == "Xen": + test_disk = "xvda" + else: + test_disk = "hda" + + status, vsxml = setup_env() + if status != PASS: + return status + + status, vssd_values = get_vssd_info() + if status != PASS or len(vssd_values) == 0: + return status + + status, rasd_values = get_rasd_values_from_vssdc_assoc(vssd_values) + if status != PASS or len(rasd_values) == 0: + vsxml.undefine(server) + return status + + status = verify_rasd_values(rasd_values) + try: + vsxml.undefine(server) + except Exception, detail: + logger.error("Failed to undefine domain %s", test_dom) + logger.error("Exception: %s", detail) + status = FAIL + return status + +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Fri Apr 4 09:57:43 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 04 Apr 2008 15:27:43 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Adding 05_RAPF_err.py to verify RAPF Message-ID: <0142551c8d3cf5f2a3bb.1207303063@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207303009 -19800 # Node ID 0142551c8d3cf5f2a3bbdfe835d69c3880be395a # Parent dce42f09c9c60c59e15db48882bc8fb68301238f [TEST] Adding 05_RAPF_err.py to verify RAPF. The test : creates a guest with a network device that is not part of a known pool. Then call ResourceAllocatedFromPool with the reference to that device. Verifies for the error. Signed-off-by: Deepti B. Kalakeri diff -r dce42f09c9c6 -r 0142551c8d3c suites/libvirt-cim/cimtest/ResourceAllocationFromPool/05_RAPF_err.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/05_RAPF_err.py Fri Apr 04 15:26:49 2008 +0530 @@ -0,0 +1,204 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 tc is used to verify the that the +# ResourceAllocationFromPool asscoiation returns error +# when guest is associated to a non-existing virtual network pool. +# +# The does the following: +# 1) creates a guest with a network device that is not part of a known pool, +# 2) call ResourceAllocatedFromPool with the reference to that device. +# 3) Verifies for the following error: +# +# Command: +# -------- +# wbemcli ain -ac KVM_ResourceAllocationFromPool +# 'http://localhost:5988/root/virt:KVM_NetResourceAllocationSettingData. +# InstanceID="test-kvm/24:42:53:21:52:45"' +# +# +# Output: +# ------- +# error no : CIM_ERR_FAILED +# error desc : "Unable to determine pool of `test-kvm/24:42:53:21:52:45';" +# +# Date : 04-04-2008 +# +import sys +import pywbem +from VirtLib import live +from XenKvmLib import assoc, enumclass +from XenKvmLib.common_util import try_assoc +from XenKvmLib.test_doms import destroy_and_undefine_all +from CimTest import Globals +from CimTest.Globals import logger, CIM_ERROR_ENUMERATE +from CimTest.ReturnCodes import PASS, FAIL +from CimTest.Globals import do_main, platform_sup +from XenKvmLib.vxml import get_class +from XenKvmLib.classes import get_typed_class + +test_dom = "RAPF_domain" +test_mac = "00:11:22:33:44:aa" +test_vcpus = 1 + + +def check_bridge_name(bridgename): + bridge_list = live.available_bridges(server) + vbr = None + if bridgename in bridge_list: + import random + vbr = bridgename + str(random.randint(1, 100)) + if vbr in bridge_list: + logger.error('Need to give different bridge name since it already exists') + return None + else: + vbr = bridgename + return vbr + +def setup_env(): + vsxml = None + if virt == "Xen": + test_disk = "xvda" + else: + test_disk = "hda" + + virt_xml = get_class(virt) + vsxml = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, disk = test_disk) + if virt != 'XenFV': + bridge = vsxml.set_vbridge(server) + +# Get a bridge name that is not used by any of the virtual network pool on the machine. + bridge_name = check_bridge_name('invalid-bridge') + if bridge_name == None: + logger.error("Failed to get an invalid bridge name") + return FAIL, vsxml +# Assigning the bridge that does not belong to any networkpool. + vsxml.set_bridge_name(bridge_name) + + ret = vsxml.define(server) + if not ret: + Globals.logger.error("Failed to define the dom: %s", test_dom) + return FAIL, vsxml + + return PASS, vsxml + +def get_inst_from_list(classname, rasd_list, filter_name, exp_val): + status = PASS + ret = FAIL + inst = [] + + for rec in rasd_list: + record = rec[filter_name] + if exp_val in record: + inst.append(rec) + ret = PASS + + if ret != PASS: + logger.error("%s with %s was not returned" % (classname, exp_val)) + vsxml.undefine(server) + status = FAIL + + return status, inst + +def get_netrasd_instid(classname): + rasd_list = [] + status = PASS + try: + rasd_list = enumclass.enumerate_inst(server, classname, virt) + if len(rasd_list) < 1: + logger.error("%s returned %i instances, excepted atleast 1 instance", classname, + len(rasd_list)) + status = FAIL + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, classname) + logger.error("Exception: %s", detail) + status = FAIL + + if status != PASS: + return status, rasd_list + + # Get the RASD info related to the domain "ONLY". + # We should get ONLY one record. + rasd_info = [] + status, rasd_info = get_inst_from_list(classname, rasd_list, "InstanceID", test_dom) + + return status, rasd_info + +def verify_rapf_err(): + status = PASS + try: + + classname = get_typed_class(virt, 'NetResourceAllocationSettingData') + status, net_rasd_list = get_netrasd_instid(classname) + if status != PASS or len(net_rasd_list) == 0: + return status + if len(net_rasd_list) != 1: + logger.error("%s returned %i instances, excepted atleast 1 instance", classname, + len(net_rasd_list)) + return FAIL + + + conn = assoc.myWBEMConnection('http://%s' % server, + (Globals.CIM_USER, + Globals.CIM_PASS), + Globals.CIM_NS) + assoc_classname = get_typed_class(virt, "ResourceAllocationFromPool") + classname = net_rasd_list[0].classname + instid = net_rasd_list[0]['InstanceID'] + keys = { "InstanceID" : instid } + expr_values = { + 'rapf_err' : { + 'desc' : "Unable to determine pool of `%s'" %instid, + 'rc' : pywbem.CIM_ERR_FAILED + } + } + status = try_assoc(conn, classname, assoc_classname, keys, field_name="InstanceID", + expr_values=expr_values['rapf_err'], bug_no="") + + except Exception, detail: + logger.error("Exception: %s", detail) + status = FAIL + + return status + + at do_main(platform_sup) +def main(): + global virt, vsxml, server + Globals.log_param() + options = main.options + server = options.ip + virt = options.virt + destroy_and_undefine_all(server) + + status, vsxml = setup_env() + if status != PASS: + logger.error("Failed to setup the domain") + return status + + ret = verify_rapf_err() + if ret: + logger.error("------FAILED: to verify the RAFP.------") + status = ret + + vsxml.undefine(server) + return status +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Fri Apr 4 10:05:27 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 04 Apr 2008 15:35:27 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Modifying vxml.py to include set_bridge_name() Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207303516 -19800 # Node ID ee93a545e27b467ac3cf473ace7ffdfd1930d880 # Parent 0142551c8d3cf5f2a3bbdfe835d69c3880be395a [TEST] Modifying vxml.py to include set_bridge_name(). set_bridge_name() can be used to modify the bridge associated with a domain. Needed by the 05_RAPF_err.py tc. Signed-off-by: Deepti B. Kalakeri diff -r 0142551c8d3c -r ee93a545e27b suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Fri Apr 04 15:26:49 2008 +0530 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Fri Apr 04 15:35:16 2008 +0530 @@ -253,6 +253,9 @@ class VirtXML(Virsh, XMLClass): def set_mac(self, mac): self.set_attributes('/domain/devices/interface/mac', address=mac) + def set_bridge_name(self, bridgename): + self.set_attributes('/domain/devices/interface/source', bridge=bridgename) + def set_diskimg(self, diskimg): self.set_attributes('/domain/devices/disk/source', file=diskimg) From deeptik at linux.vnet.ibm.com Fri Apr 4 11:55:40 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 04 Apr 2008 17:25:40 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Modifying 02_profile_to_elec.py tc to: Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207310123 -19800 # Node ID e9825a1d392c5b70d5d58675b240f3a1a70ce102 # Parent ee93a545e27b467ac3cf473ace7ffdfd1930d880 [TEST] Modifying 02_profile_to_elec.py tc to: 1) Use the cim_define() function 2) Fixed the tc. Signed-off-by: Deepti B. Kalakeri diff -r ee93a545e27b -r e9825a1d392c suites/libvirt-cim/cimtest/Profile/02_profile_to_elec.py --- a/suites/libvirt-cim/cimtest/Profile/02_profile_to_elec.py Fri Apr 04 15:35:16 2008 +0530 +++ b/suites/libvirt-cim/cimtest/Profile/02_profile_to_elec.py Fri Apr 04 17:25:23 2008 +0530 @@ -38,11 +38,10 @@ # ComputerSystem instance of the guest. import sys -import pywbem from XenKvmLib import enumclass from XenKvmLib.assoc import Associators -from XenKvmLib.common_util import create_using_definesystem -from XenKvmLib.test_doms import undefine_test_domain, destroy_and_undefine_all +from XenKvmLib.vxml import get_class +from XenKvmLib.test_doms import destroy_and_undefine_all from CimTest import Globals from CimTest.Globals import log_param, logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORNAMES from CimTest.Globals import do_main @@ -55,14 +54,15 @@ def setup_env(server): def setup_env(server): rc = -1 status = PASS - + csxml_info = None try: destroy_and_undefine_all(server) - rc = create_using_definesystem(test_dom, server) + virt_xml = get_class(virt) + csxml_info = virt_xml(test_dom) + rc = csxml_info.cim_define(server) - if rc != 0: - logger.error("Unable define domain %s using DefineSystem() %s" \ - % test_dom) + if not rc: + logger.error("Unable define domain %s using DefineSystem() " % test_dom) status = FAIL except Exception, detail: @@ -70,31 +70,31 @@ def setup_env(server): logger.error("Exception: %s", detail) status = FAIL - return status + return status, csxml_info def print_err(err, detail, cn): - logger.error(err % cn) - logger.error("Exception: %s", detail) + logger.error(err % cn) + logger.error("Exception: %s", detail) def get_inst_from_list(server, cn, qcn, list, filter, exp_val): - status = PASS - ret = -1 - inst = None + status = PASS + ret = -1 + inst = None - if len(list) < 1: - logger.error("%s returned %i %s objects" % (qcn, len(list), cn)) - return FAIL, None + if len(list) < 1: + logger.error("%s returned %i %s objects" % (qcn, len(list), cn)) + return FAIL, None - for inst in list: - if inst[filter['key']] == exp_val: - ret = PASS - break; + for inst in list: + if inst[filter['key']] == exp_val: + ret = PASS + break - if ret != PASS: - status = FAIL - logger.error("%s with %s was not returned" % (cn, exp_val)) - - return PASS, inst + if ret != PASS: + status = FAIL + logger.error("%s with %s was not returned" % (cn, exp_val)) + + return PASS, inst def get_profile(server): registeredname = 'Virtual System Profile' @@ -178,32 +178,39 @@ def get_elec(server, cs): @do_main(sup_types) def main(): + global virt + global csxml options = main.options + virt = options.virt + server = options.ip log_param() status = PASS - status = setup_env(options.ip) + status, csxml = setup_env(server) if status != PASS: return status prev_namespace = Globals.CIM_NS Globals.CIM_NS = 'root/interop' - status, prof = get_profile(options.ip) + status, prof = get_profile(server) if status != PASS or prof == None: + csxml.undefine(server) return status - status, cs = get_cs(options.ip, prof) + status, cs = get_cs(server, prof) if status != PASS or cs == None: + csxml.undefine(server) return status Globals.CIM_NS = prev_namespace - status, elec = get_elec(options.ip, cs) + status, elec = get_elec(server, cs) if status != PASS or elec == None: return status + csxml.undefine(server) return status From danms at us.ibm.com Fri Apr 4 14:48:04 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 04 Apr 2008 07:48:04 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Adding 05_RAPF_err.py to verify RAPF In-Reply-To: <0142551c8d3cf5f2a3bb.1207303063@dkalaker> (Deepti B. Kalakeri's message of "Fri, 04 Apr 2008 15:27:43 +0530") References: <0142551c8d3cf5f2a3bb.1207303063@dkalaker> Message-ID: <87fxu1ad7f.fsf@caffeine.beaverton.ibm.com> DK> +def check_bridge_name(bridgename): DK> + bridge_list = live.available_bridges(server) DK> + vbr = None DK> + if bridgename in bridge_list: DK> + import random DK> + vbr = bridgename + str(random.randint(1, 100)) DK> + if vbr in bridge_list: DK> + logger.error('Need to give different bridge name since it already exists') DK> + return None DK> + else: DK> + vbr = bridgename DK> + return vbr I think this would make a lot more sense as: def get_unique_bridge(): bridge = "invalid-bridge" while bridge not in live.available_bridges(): bridge += str(random.randint(1,100)) return bridge DK> + if virt != 'XenFV': DK> + bridge = vsxml.set_vbridge(server) Can you explain why this special case exists? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Fri Apr 4 19:13:24 2008 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Fri, 04 Apr 2008 15:13:24 -0400 Subject: [Libvirt-cim] [PATCH] Returning 0 domains is not an error In-Reply-To: <589af2d7c4466eea7e75.1207239390@guaranine.danplanet.com> References: <589af2d7c4466eea7e75.1207239390@guaranine.danplanet.com> Message-ID: <47F67DD4.5020700@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1207239285 25200 > # Node ID 589af2d7c4466eea7e75765222835db46772f1ac > # Parent 1e1c2cd2ef0bff684df37d5c94d7b66b6189295c > Returning 0 domains is not an error > > Signed-off-by: Dan Smith > > > Woo one-character diffs! +1 -- -Jay From danms at us.ibm.com Fri Apr 4 20:59:59 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 04 Apr 2008 13:59:59 -0700 Subject: [Libvirt-cim] Test report on KVM Message-ID: <87myo98hf4.fsf@caffeine.beaverton.ibm.com> Hi all, Today I ran a full test run against my local machine in KVM mode (with "-v KVM"). Things look pretty good, and I think most of the failures are likely to be test-related and not necessarily provider-related. For those of you working on the test suite, I'd appreciate it if you could look through these and figure out what the issues are. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com > ElementCapabilities - 01_forward.py: FAIL > CIM_ERR_NOT_FOUND: The requested object could not be found: "No such instance (CreationClassName)" > ElementCapabilities - 05_hostsystem_cap.py: FAIL > CIM_ERR_NOT_FOUND: The requested object could not be found: "No such instance" This looks like a test case error that is failing to provide a key > ElementConforms - 01_forward.py: FAIL > ElementConforms - 02_reverse.py: FAIL The log: > ====01_forward.py Log==== > 1. Property values for CIM:DSP1057-VirtualSystem-1.0.0a and domain Domain-0 is > EnabState = 2 EnabDefault = 2 ReqSt = 12 > 2. Values for CIM:DSP1042-SystemVirtualization-1.0.0 and host guaranine.danplanet.com is > EnabState = 5 EnabDefault = 2 ReqSt = 12 > ====02_reverse.py Log==== The lack of a log for 02 is troubling. > HostSystem - 02_hostsystem_to_rasd.py: FAIL > Traceback (most recent call last): > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > msg = self.format(record) > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > return fmt.format(record) > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > record.message = record.getMessage() > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage > msg = msg % self.args > TypeError: not enough arguments for format string Looks like a testcase error. > RASD - 01_verify_rasd_fields.py: FAIL No log for this one either. > RASD - 02_enum.py: FAIL > Traceback (most recent call last): > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > msg = self.format(record) > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > return fmt.format(record) > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > record.message = record.getMessage() > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage > msg = msg % self.args > TypeError: not enough arguments for format string Same as above. > SettingsDefine - 01_forward.py: FAIL > SettingsDefine - 02_reverse.py: FAIL > SettingsDefine - 03_sds_fwd_errs.py: FAIL No log. > SystemDevice - 01_forward.py: FAIL Log: > ====01_forward.py Log==== > Examined test_domain/00:11:22:33:44:55 > Examined test_domain/mem > Examined test_domain/xvdb > Examined test_domain/0 > SystemDevice - 03_fwderrs.py: FAIL > Traceback (most recent call last): > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > msg = self.format(record) > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > return fmt.format(record) > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > record.message = record.getMessage() > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage > msg = msg % self.args > TypeError: not all arguments converted during string formatting This is repeated a bunch of times, but I've snipped them out. > VSSD - 04_vssd_to_rasd.py: FAIL > Traceback (most recent call last): > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > msg = self.format(record) > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > return fmt.format(record) > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > record.message = record.getMessage() > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage > msg = msg % self.args > TypeError: not enough arguments for format string Seems to be a common issue. > VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL Log: > destroy_fail>>nonexistent: Got expected return code 4 > destroy_fail>>nonexistent: Got expected return code 4 > VirtualSystemMigrationSettingData - 01_enum.py: FAIL No log. > VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL No log. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From yunguol at cn.ibm.com Mon Apr 7 08:15:13 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 07 Apr 2008 01:15:13 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] fix missing argument in 05_hostsystem_cap.py Message-ID: <2c5375b6b0e80e41d719.1207556113@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207556107 25200 # Node ID 2c5375b6b0e80e41d719aaf152f965480facb294 # Parent bedc7fc28125f9d6cc21f7a6752b479313f070e5 [TEST] fix missing argument in 05_hostsystem_cap.py Signed-off-by: Guolian Yun diff -r bedc7fc28125 -r 2c5375b6b0e8 suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py --- a/suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py Fri Apr 04 12:25:02 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py Mon Apr 07 01:15:07 2008 -0700 @@ -196,7 +196,7 @@ def main(): qcn = 'Service' name = host_name # Get the service available on the host - status, service_assoc_info = get_assoc_info(server, cn, an, qcn, name) + status, service_assoc_info = get_assoc_info(server, cn, an, qcn, name, options.virt) if status != PASS or len(service_assoc_info) == 0: return status @@ -223,7 +223,7 @@ def main(): # Query ElementCapabilities and verify the MigrationCapabilities information. service_fieldname = 'MigrationService' cap_key = 'MigrationCapabilities' - status = verify_cap_fields(server, service_fieldname, cap_key) + status = verify_cap_fields(server, service_fieldname, cap_key, options.virt) if status != PASS: logger.error("MigrationCapabilities Verification failed") return status From yunguol at cn.ibm.com Mon Apr 7 08:43:27 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 7 Apr 2008 16:43:27 +0800 Subject: [Libvirt-cim] Test report on KVM In-Reply-To: <87myo98hf4.fsf@caffeine.beaverton.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-04-05 04:59:59: > Hi all, > > Today I ran a full test run against my local machine in KVM mode (with > "-v KVM"). Things look pretty good, and I think most of the failures > are likely to be test-related and not necessarily provider-related. > Did you run it on elm3b197.beaverton.ibm.com in KVM mode? I ran it on your machine(elm3b197.beaverton.ibm.com) in KVM mode and add comments inline. > For those of you working on the test suite, I'd appreciate it if you > could look through these and figure out what the issues are. > > Thanks! > > -- > Dan Smith > IBM Linux Technology Center > Open Hypervisor Team > email: danms at us.ibm.com > > > ElementCapabilities - 01_forward.py: FAIL > > CIM_ERR_NOT_FOUND: The requested object could not be found: "No > such instance (CreationClassName)" It passed during my test. > > ElementCapabilities - 05_hostsystem_cap.py: FAIL > > CIM_ERR_NOT_FOUND: The requested object could not be found: "No > such instance" > It fails because of missing argument, I fixed it already. > This looks like a test case error that is failing to provide a key > > > ElementConforms - 01_forward.py: FAIL > > ElementConforms - 02_reverse.py: FAIL > > The log: > > > ====01_forward.py Log==== > > 1. Property values for CIM:DSP1057-VirtualSystem-1.0.0a and domain > Domain-0 is > > EnabState = 2 EnabDefault = 2 ReqSt = 12 > > 2. Values for CIM:DSP1042-SystemVirtualization-1.0.0 and host > guaranine.danplanet.com is > > EnabState = 5 EnabDefault = 2 ReqSt = 12 > > ====02_reverse.py Log==== > > The lack of a log for 02 is troubling. > > > HostSystem - 02_hostsystem_to_rasd.py: FAIL > > Traceback (most recent call last): > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > msg = self.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > return fmt.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > record.message = record.getMessage() > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage > > msg = msg % self.args > > TypeError: not enough arguments for format string > Also passed during my test. > Looks like a testcase error. > > > RASD - 01_verify_rasd_fields.py: FAIL > > No log for this one either. > > > RASD - 02_enum.py: FAIL > > Traceback (most recent call last): > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > msg = self.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > return fmt.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > record.message = record.getMessage() > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage > > msg = msg % self.args > > TypeError: not enough arguments for format string > > Same as above. Also passed during my running test. > > > SettingsDefine - 01_forward.py: FAIL > > SettingsDefine - 02_reverse.py: FAIL > > SettingsDefine - 03_sds_fwd_errs.py: FAIL > > No log. > > > SystemDevice - 01_forward.py: FAIL > > Log: > > > ====01_forward.py Log==== > > Examined test_domain/00:11:22:33:44:55 > > Examined test_domain/mem > > Examined test_domain/xvdb > > Examined test_domain/0 > > > SystemDevice - 03_fwderrs.py: FAIL > > Traceback (most recent call last): > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > msg = self.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > return fmt.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > record.message = record.getMessage() > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage > > msg = msg % self.args > > TypeError: not all arguments converted during string formatting > > This is repeated a bunch of times, but I've snipped them out. > > > VSSD - 04_vssd_to_rasd.py: FAIL > > Traceback (most recent call last): > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > msg = self.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > return fmt.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > record.message = record.getMessage() > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage > > msg = msg % self.args > > TypeError: not enough arguments for format string > > Seems to be a common issue. > > > VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL > > Log: > > > destroy_fail>>nonexistent: Got expected return code 4 > > destroy_fail>>nonexistent: Got expected return code 4 > > > VirtualSystemMigrationSettingData - 01_enum.py: FAIL > > No log. > > > VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL > > No log. > [attachment "att9euba.dat" deleted by Guo Lian Yun/China/IBM] > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From yunguol at cn.ibm.com Mon Apr 7 09:26:18 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 07 Apr 2008 02:26:18 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix domain created error in RASD.01 Message-ID: <4578382726b1d2099c9b.1207560378@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207560373 25200 # Node ID 4578382726b1d2099c9b467a0532052b67af42e9 # Parent bedc7fc28125f9d6cc21f7a6752b479313f070e5 [TEST] Fix domain created error in RASD.01 Signed-off-by: Guolian Yun diff -r bedc7fc28125 -r 4578382726b1 suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py --- a/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Fri Apr 04 12:25:02 2008 +0530 +++ b/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Mon Apr 07 02:26:13 2008 -0700 @@ -54,11 +54,12 @@ from XenKvmLib.test_doms import destroy_ from XenKvmLib.test_doms import destroy_and_undefine_all import XenKvmLib from XenKvmLib import assoc -from XenKvmLib.vxml import XenXML, KVMXML, get_class +from XenKvmLib import vxml from XenKvmLib.classes import get_typed_class from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \ verify_diskrasd_values, verify_memrasd_values from CimTest.Globals import log_param, logger +from CimTest.ReturnCodes import PASS, FAIL sup_types = ['Xen', 'KVM', 'XenFV'] @@ -66,7 +67,6 @@ test_vcpus = 1 test_vcpus = 1 test_mem = 128 test_mac = "00:11:22:33:44:aa" -test_disk = 'xvda' def init_list(virt="Xen"): """ @@ -86,7 +86,7 @@ def init_list(virt="Xen"): "CreationClassName": get_typed_class(virt, 'NetResourceAllocationSettingData') } - address = vsxml.xml_get_disk_source() + address = cxml.xml_get_disk_source() diskrasd = { "InstanceID" : '%s/%s' %(test_dom, test_disk), \ "ResourceType" : 17, \ @@ -133,28 +133,24 @@ def assoc_values(ip, assoc_info, virt="X @do_main(sup_types) def main(): - global vsxml + global cxml options = main.options status = 0 rc = 1 log_param() destroy_and_undefine_all(options.ip) - vsxml = get_class(options.virt)(test_dom, \ - mem=test_mem, \ - vcpus = test_vcpus, \ - mac = test_mac, \ - disk = test_disk) - try: - rc = vsxml.define(options.ip) - sc = vsxml.start(options.ip) - if rc == 0 or sc == 0: - logger.error("Define or start domain failed") - status = 1 - except Exception, details: - logger.error("Unknonw exception happened") - logger.error("Exception : %s" % details) - status = 1 - + global test_disk + if options.virt == 'Xen': + test_disk = 'xvda' + else: + test_disk = 'hda' + + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom, mem=test_mem, vcpus = test_vcpus, mac = test_mac, disk = test_disk) + ret = cxml.define(options.ip) + if not ret: + logger.error('Unable to create domain %s' % test_dom) + return FAIL if status == 1: destroy_and_undefine_all(options.ip) return 1 @@ -177,8 +173,8 @@ def main(): status = 1 try: - vsxml.destroy(options.ip) - vsxml.undefine(options.ip) + cxml.destroy(options.ip) + cxml.undefine(options.ip) except Exception: logger.error("Destroy or undefine domain failed") return status From yunguol at cn.ibm.com Mon Apr 7 09:49:45 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 7 Apr 2008 17:49:45 +0800 Subject: [Libvirt-cim] Test report on KVM In-Reply-To: <87myo98hf4.fsf@caffeine.beaverton.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-04-05 04:59:59: > Hi all, > > Today I ran a full test run against my local machine in KVM mode (with > "-v KVM"). Things look pretty good, and I think most of the failures > are likely to be test-related and not necessarily provider-related. > > For those of you working on the test suite, I'd appreciate it if you > could look through these and figure out what the issues are. > > Thanks! > > -- > Dan Smith > IBM Linux Technology Center > Open Hypervisor Team > email: danms at us.ibm.com > > > ElementCapabilities - 01_forward.py: FAIL > > CIM_ERR_NOT_FOUND: The requested object could not be found: "No > such instance (CreationClassName)" > > ElementCapabilities - 05_hostsystem_cap.py: FAIL > > CIM_ERR_NOT_FOUND: The requested object could not be found: "No > such instance" > > This looks like a test case error that is failing to provide a key > > > ElementConforms - 01_forward.py: FAIL > > ElementConforms - 02_reverse.py: FAIL > > The log: > > > ====01_forward.py Log==== > > 1. Property values for CIM:DSP1057-VirtualSystem-1.0.0a and domain > Domain-0 is > > EnabState = 2 EnabDefault = 2 ReqSt = 12 > > 2. Values for CIM:DSP1042-SystemVirtualization-1.0.0 and host > guaranine.danplanet.com is > > EnabState = 5 EnabDefault = 2 ReqSt = 12 > > ====02_reverse.py Log==== > > The lack of a log for 02 is troubling. > > > HostSystem - 02_hostsystem_to_rasd.py: FAIL > > Traceback (most recent call last): > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > msg = self.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > return fmt.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > record.message = record.getMessage() > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage > > msg = msg % self.args > > TypeError: not enough arguments for format string > > Looks like a testcase error. > > > RASD - 01_verify_rasd_fields.py: FAIL > > No log for this one either. > The failing because of domain created error, fixed it! > > RASD - 02_enum.py: FAIL > > Traceback (most recent call last): > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > msg = self.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > return fmt.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > record.message = record.getMessage() > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage > > msg = msg % self.args > > TypeError: not enough arguments for format string > > Same as above. > > > SettingsDefine - 01_forward.py: FAIL > > SettingsDefine - 02_reverse.py: FAIL > > SettingsDefine - 03_sds_fwd_errs.py: FAIL > > No log. > > > SystemDevice - 01_forward.py: FAIL > > Log: > > > ====01_forward.py Log==== > > Examined test_domain/00:11:22:33:44:55 > > Examined test_domain/mem > > Examined test_domain/xvdb > > Examined test_domain/0 > > > SystemDevice - 03_fwderrs.py: FAIL > > Traceback (most recent call last): > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > msg = self.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > return fmt.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > record.message = record.getMessage() > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage > > msg = msg % self.args > > TypeError: not all arguments converted during string formatting > > This is repeated a bunch of times, but I've snipped them out. > > > VSSD - 04_vssd_to_rasd.py: FAIL > > Traceback (most recent call last): > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > msg = self.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > return fmt.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > record.message = record.getMessage() > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage > > msg = msg % self.args > > TypeError: not enough arguments for format string > > Seems to be a common issue. > > > VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL > > Log: > > > destroy_fail>>nonexistent: Got expected return code 4 > > destroy_fail>>nonexistent: Got expected return code 4 > > > VirtualSystemMigrationSettingData - 01_enum.py: FAIL > > No log. > > > VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL > > No log. > [attachment "attt9gwv.dat" deleted by Guo Lian Yun/China/IBM] > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From danms at us.ibm.com Mon Apr 7 14:09:09 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 07 Apr 2008 07:09:09 -0700 Subject: [Libvirt-cim] Test report on KVM In-Reply-To: (Guo Lian Yun's message of "Mon, 7 Apr 2008 16:43:27 +0800") References: Message-ID: <871w5hdaey.fsf@caffeine.beaverton.ibm.com> GY> Did you run it on elm3b197.beaverton.ibm.com in KVM mode? I ran GY> it on your machine(elm3b197.beaverton.ibm.com) in KVM mode and GY> add comments inline. No, this was on my own machine. >> > ElementCapabilities - 05_hostsystem_cap.py: FAIL >> > CIM_ERR_NOT_FOUND: The requested object could not be found: "No >> such instance" >> GY> It fails because of missing argument, I fixed it already. Where/when was it fixed? This was with the latest tree at the time. >> > HostSystem - 02_hostsystem_to_rasd.py: FAIL >> > Traceback (most recent call last): >> > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit >> > msg = self.format(record) >> > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format >> > return fmt.format(record) >> > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format >> > record.message = record.getMessage() >> > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage >> > msg = msg % self.args >> > TypeError: not enough arguments for format string >> GY> Also passed during my test. Well, this is clearly a syntax bug of some kind that is in need of some additional exception handling. It happens a *lot*, so it should be easy to track down. This was on a F9 beta machine, so perhaps a new version of Python is causing some differing behavior. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Apr 7 15:27:39 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 07 Apr 2008 08:27:39 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix domain created error in RASD.01 In-Reply-To: <4578382726b1d2099c9b.1207560378@elm3b197.beaverton.ibm.com> (Guo Lian Yun's message of "Mon, 07 Apr 2008 02:26:18 -0700") References: <4578382726b1d2099c9b.1207560378@elm3b197.beaverton.ibm.com> Message-ID: <87wsn9bs7o.fsf@caffeine.beaverton.ibm.com> GY> # HG changeset patch GY> # User Guolian Yun GY> # Date 1207560373 25200 GY> # Node ID 4578382726b1d2099c9b467a0532052b67af42e9 GY> # Parent bedc7fc28125f9d6cc21f7a6752b479313f070e5 GY> [TEST] Fix domain created error in RASD.01 When I run the test suite with this patch applied, I get the following stack trace for this test (which I didn't get before): RASD - 01_verify_rasd_fields.py: FAIL Traceback (most recent call last): File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit msg = self.format(record) File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format return fmt.format(record) File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format record.message = record.getMessage() File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage msg = msg % self.args TypeError: not enough arguments for format string -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Mon Apr 7 23:35:41 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 07 Apr 2008 16:35:41 -0700 Subject: [Libvirt-cim] Test report on KVM In-Reply-To: References: Message-ID: <47FAAFCD.4060803@linux.vnet.ibm.com> Dan, I see basically the same results you see. Except I see log entries for the failing tests. This is on a system with the following: F8 xen-3.1.0-13.fc8 libvirt-0.4.1-3.fc9 I did a clone of the cimtest tree and the provider tree. I also have a KVM guest defined. > > > ElementCapabilities - 01_forward.py: FAIL > > > CIM_ERR_NOT_FOUND: The requested object could not be found: "No > > such instance (CreationClassName)" > It passed during my test. This failed for me. There's definitely a test case problem. The offending code: elec = assoc.AssociatorNames(options.ip, "ElementCapabilities", "ComputerSystem", options.virt, Name = system, CreationClassName = "Xen_ComputerSystem") The CreationClassName shouldn't be hardcoded to Xen_ComputerSystem. > > > > ElementCapabilities - 05_hostsystem_cap.py: FAIL > > > CIM_ERR_NOT_FOUND: The requested object could not be found: "No > > such instance" > > > It fails because of missing argument, I fixed it already. This test passes for me. It looks like Daisy's fix for this went into the tree sometime earlier today. > > > > > ElementConforms - 01_forward.py: FAIL > > > ElementConforms - 02_reverse.py: FAIL > > > > The log: > > > > > ====01_forward.py Log==== > > > 1. Property values for CIM:DSP1057-VirtualSystem-1.0.0a and domain > > Domain-0 is > > > EnabState = 2 EnabDefault = 2 ReqSt = 12 > > > 2. Values for CIM:DSP1042-SystemVirtualization-1.0.0 and host > > guaranine.danplanet.com is > > > EnabState = 5 EnabDefault = 2 ReqSt = 12 > > > ====02_reverse.py Log==== > > > > The lack of a log for 02 is troubling. I get a log here. I see: Mon, 24 Mar 2008 14:51:57:TEST LOG:INFO - ====02_reverse.py Log==== Mon, 24 Mar 2008 14:51:59:TEST LOG:ERROR - Failed to get associators information for RegisteredProfile Mon, 24 Mar 2008 14:51:59:TEST LOG:ERROR - Exception: u'KVM_ComputerSystem' It is troubling that you didn't see any log output during your run. > > > > > HostSystem - 02_hostsystem_to_rasd.py: FAIL > > > Traceback (most recent call last): > > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > > msg = self.format(record) > > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > > return fmt.format(record) > > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > > record.message = record.getMessage() > > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in > getMessage > > > msg = msg % self.args > > > TypeError: not enough arguments for format string > > > Also passed during my test. This fails for me. In addition to the python errors, I see the following in the log: ERROR:TEST LOG:AllocationUnits Mismatch ERROR:TEST LOG:Mistmatching association values I think there's a few testcase issues here: 1) In XenKvmLib/rasd.py: Globals.logger.error("Returned %s instead of %s or %s", \ assoc_info['AllocationUnits'], memrasd_list['AllocationUnits']) The string takes 3 arguments, but only 2 are given. The third argument should be removed. 2) I think HostSystem - 02_hostsystem_to_rasd.py needs to be updated to reflect the recent provider change. The provider returns KiloBytes as the unit, but the test is expecting MegaBytes. > > > Looks like a testcase error. > > > > > RASD - 01_verify_rasd_fields.py: FAIL > > > > No log for this one either. I see the following in the log: TEST LOG:ERROR - Define or start domain failed > > > > > RASD - 02_enum.py: FAIL > > > Traceback (most recent call last): > > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > > msg = self.format(record) > > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > > return fmt.format(record) > > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > > record.message = record.getMessage() > > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in > getMessage > > > msg = msg % self.args > > > TypeError: not enough arguments for format string > > > > Same as above. > Also passed during my running test. This failed for me. > > > > > SettingsDefine - 01_forward.py: FAIL > > > SettingsDefine - 02_reverse.py: FAIL > > > SettingsDefine - 03_sds_fwd_errs.py: FAIL > > > > No log. I got log messages for these 3 tests. > > > > > SystemDevice - 01_forward.py: FAIL > > > > Log: > > > > > ====01_forward.py Log==== > > > Examined test_domain/00:11:22:33:44:55 > > > Examined test_domain/mem > > > Examined test_domain/xvdb > > > Examined test_domain/0 > > > > > SystemDevice - 03_fwderrs.py: FAIL > > > Traceback (most recent call last): > > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > > msg = self.format(record) > > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > > return fmt.format(record) > > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > > record.message = record.getMessage() > > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in > getMessage > > > msg = msg % self.args > > > TypeError: not all arguments converted during string formatting > > > > This is repeated a bunch of times, but I've snipped them out. > > > > > VSSD - 04_vssd_to_rasd.py: FAIL > > > Traceback (most recent call last): > > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > > msg = self.format(record) > > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > > return fmt.format(record) > > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > > record.message = record.getMessage() > > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in > getMessage > > > msg = msg % self.args > > > TypeError: not enough arguments for format string > > > > Seems to be a common issue. > > > > > VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL > > > > Log: > > > > > destroy_fail>>nonexistent: Got expected return code 4 > > > destroy_fail>>nonexistent: Got expected return code 4 > > > > > VirtualSystemMigrationSettingData - 01_enum.py: FAIL > > > > No log. ERROR:TEST LOG:ClassName Mismatch ERROR:TEST LOG:Returned Xen_VirtualSystemMigrationSettingData instead of KVM_VirtualSystemMigrationSettingData > > > > > VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL > > > > No log. ERROR:TEST LOG:ClassName Mismatch ERROR:TEST LOG:Returned Xen_VirtualSystemSnapshotServiceCapabilities instead of KVM_VirtualSystemSnapshotServiceCapabilities -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From yunguol at cn.ibm.com Tue Apr 8 02:02:26 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 07 Apr 2008 19:02:26 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] fix hardcode key in ElementCapabilities.01 Message-ID: <2e9e53bc63a24cb1bbad.1207620146@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207620138 25200 # Node ID 2e9e53bc63a24cb1bbadac51d09c7c14832bad38 # Parent 851b6729397e782b7ac6fbadee849ee7da9b16d3 [TEST] fix hardcode key in ElementCapabilities.01 Signed-off-by: Guolian Yun diff -r 851b6729397e -r 2e9e53bc63a2 suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py Mon Apr 07 08:27:46 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py Mon Apr 07 19:02:18 2008 -0700 @@ -80,7 +80,7 @@ def main(): "ComputerSystem", options.virt, Name = system, - CreationClassName = "Xen_ComputerSystem") + CreationClassName = get_typed_class(options.virt, "ComputerSystem")) except Exception: Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % system) return FAIL From yunguol at cn.ibm.com Tue Apr 8 02:17:57 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 07 Apr 2008 19:17:57 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] fix argument error in VirtualSystemSnapshotService.01, update to reflect the recent lib changes Message-ID: <0b6d22b9d4b6d32e1298.1207621077@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207621070 25200 # Node ID 0b6d22b9d4b6d32e129893c96132a5f1a7489ffd # Parent 851b6729397e782b7ac6fbadee849ee7da9b16d3 [TEST] fix argument error in VirtualSystemSnapshotService.01, update to reflect the recent lib changes Signed-off-by: Guolian Yun diff -r 851b6729397e -r 0b6d22b9d4b6 suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py Mon Apr 07 08:27:46 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py Mon Apr 07 19:17:50 2008 -0700 @@ -45,9 +45,8 @@ def main(): return status try: vs_sservice = enumclass.enumerate_inst(options.ip, - eval('enumclass.' + \ - get_typed_class(options.virt, \ - "VirtualSystemSnapshotService"))) + "VirtualSystemSnapshotService", + options.virt) except Exception, detail: logger.error(CIM_ERROR_ENUMERATE, cn) logger.error("Exception: %s", detail) From yunguol at cn.ibm.com Tue Apr 8 02:54:46 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 8 Apr 2008 10:54:46 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] Fix domain created error in RASD.01 In-Reply-To: <87wsn9bs7o.fsf@caffeine.beaverton.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-04-07 23:27:39: > GY> # HG changeset patch > GY> # User Guolian Yun > GY> # Date 1207560373 25200 > GY> # Node ID 4578382726b1d2099c9b467a0532052b67af42e9 > GY> # Parent bedc7fc28125f9d6cc21f7a6752b479313f070e5 > GY> [TEST] Fix domain created error in RASD.01 > > When I run the test suite with this patch applied, I get the following > stack trace for this test (which I didn't get before): > > RASD - 01_verify_rasd_fields.py: FAIL > Traceback (most recent call last): > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > msg = self.format(record) > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > return fmt.format(record) > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > record.message = record.getMessage() > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage > msg = msg % self.args > TypeError: not enough arguments for format string > This test with the patch pass for me. The TypeError seems to be a common issue, which repeated several times in cimtest running. I will try to track down. Also, the patch fix the domain created error, maybe you can apply it firstly. > -- > Dan Smith > IBM Linux Technology Center > Open Hypervisor Team > email: danms at us.ibm.com > [attachment "attld5ar.dat" deleted by Guo Lian Yun/China/IBM] > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From yunguol at cn.ibm.com Tue Apr 8 05:02:16 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 07 Apr 2008 22:02:16 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] fix ElementConforms.01 tc error, define a domain for both Xen and KVM support Message-ID: <5ea1e67b44af3077c3e2.1207630936@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207630929 25200 # Node ID 5ea1e67b44af3077c3e229f64e5d0ce4969e14d1 # Parent 851b6729397e782b7ac6fbadee849ee7da9b16d3 [TEST] fix ElementConforms.01 tc error, define a domain for both Xen and KVM support Signed-off-by: Guolian Yun diff -r 851b6729397e -r 5ea1e67b44af suites/libvirt-cim/cimtest/ElementConforms/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Mon Apr 07 08:27:46 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Mon Apr 07 22:02:09 2008 -0700 @@ -37,11 +37,13 @@ from XenKvmLib import assoc from XenKvmLib import assoc from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib.classes import get_typed_class +from XenKvmLib import vxml from CimTest.Globals import log_param, logger, CIM_ERROR_ASSOCIATORS, do_main from CimTest import Globals from CimTest.ReturnCodes import PASS, FAIL sup_types = ['Xen', 'XenFV', 'KVM'] +test_dom = "domU" def verify_cs(item, id): if item['EnabledState'] != 2 and \ @@ -83,6 +85,13 @@ def main(): status = PASS destroy_and_undefine_all(options.ip, options.virt) + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom) + ret = cxml.define(options.ip) + if not ret: + logger.error('Unable to define domain %s' % test_dom) + return FAIL + prev_namespace = Globals.CIM_NS Globals.CIM_NS = 'root/interop' host = live.hostname(options.ip) @@ -115,8 +124,7 @@ def main(): count = 0 for info in assoc_info: if info['CreationClassName'] == cs : - if options.virt == "Xen" or options.virt == "XenFV": - if info['Name'] == 'Domain-0' : + if info['Name'] == 'domU' : count = count + 1 verify_cs(info, devid) @@ -143,6 +151,7 @@ def main(): logger.error("Exception: %s" % detail) status = FAIL + cxml.undefine(options.ip) Globals.CIM_NS = prev_namespace return status From yunguol at cn.ibm.com Tue Apr 8 05:45:00 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 07 Apr 2008 22:45:00 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] fix hardcode in ElementConforms.02 tc Message-ID: <345186013001e3e3290c.1207633500@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207633493 25200 # Node ID 345186013001e3e3290c0a85c3fdffe65d7d02a0 # Parent 851b6729397e782b7ac6fbadee849ee7da9b16d3 [TEST] fix hardcode in ElementConforms.02 tc Signed-off-by: Guolian Yun diff -r 851b6729397e -r 345186013001 suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py --- a/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Mon Apr 07 08:27:46 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Mon Apr 07 22:44:53 2008 -0700 @@ -50,20 +50,21 @@ from XenKvmLib.test_doms import destroy_ from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib import enumclass from XenKvmLib.vxml import XenXML, KVMXML, get_class +from XenKvmLib.classes import get_typed_class from CimTest.ReturnCodes import PASS, FAIL sup_types = ['Xen', 'XenFV', 'KVM'] test_dom = "domgst" -def build_exp_prof_list(proflist): +def build_exp_prof_list(proflist, virt="Xen"): list = {} - + for item in proflist: if item.InstanceID.find('-VirtualSystem-') >= 0: - list['Xen_ComputerSystem'] = item + list[get_typed_class(virt, 'ComputerSystem')] = item elif item.InstanceID.find('-SystemVirtualization-') >= 0: - list['Xen_HostSystem'] = item + list[get_typed_class(virt, 'HostSystem')] = item return list @@ -89,9 +90,9 @@ def main(): virt_xml = get_class(options.virt) cxml = virt_xml(test_dom) - ret = cxml.create(options.ip) + ret = cxml.define(options.ip) if not ret: - logger.error("ERROR: Failed to Create the dom: %s" % test_dom) + logger.error("ERROR: Failed to Define the dom: %s" % test_dom) return status inst_list = [] @@ -145,7 +146,7 @@ def main(): Globals.CIM_NS = prev_namespace - exp_list = build_exp_prof_list(proflist) + exp_list = build_exp_prof_list(proflist, options.virt) # Loop through the assoc results returned on test_dom and hostsystem try: @@ -171,7 +172,6 @@ def main(): logger.error("Exception: %s", detail) status = FAIL - cxml.destroy(options.ip) cxml.undefine(options.ip) return status From yunguol at cn.ibm.com Tue Apr 8 06:09:59 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 07 Apr 2008 23:09:59 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] fix argument to reflect the lib changes Message-ID: # HG changeset patch # User Guolian Yun # Date 1207634991 25200 # Node ID e18737bad0e695f010045c5ed44ff36f6fb03ec4 # Parent 851b6729397e782b7ac6fbadee849ee7da9b16d3 [TEST] fix argument to reflect the lib changes Signed-off-by: Guolian Yun diff -r 851b6729397e -r e18737bad0e6 suites/libvirt-cim/cimtest/VirtualSystemMigrationSettingData/01_enum.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationSettingData/01_enum.py Mon Apr 07 08:27:46 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationSettingData/01_enum.py Mon Apr 07 23:09:51 2008 -0700 @@ -45,9 +45,8 @@ def main(): try: vsmsd = enumclass.enumerate_inst(options.ip, - eval('enumclass.' + \ - get_typed_class(options.virt, \ - "VirtualSystemMigrationSettingData"))) + "VirtualSystemMigrationSettingData", + options.virt) except Exception, detail: logger.error(CIM_ERROR_ENUMERATE, cn) logger.error("Exception: %s", detail) From deeptik at linux.vnet.ibm.com Tue Apr 8 06:39:32 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 08 Apr 2008 12:09:32 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Adding 05_RAPF_err.py to verify RAPF In-Reply-To: <87fxu1ad7f.fsf@caffeine.beaverton.ibm.com> References: <0142551c8d3cf5f2a3bb.1207303063@dkalaker> <87fxu1ad7f.fsf@caffeine.beaverton.ibm.com> Message-ID: <47FB1324.7000307@linux.vnet.ibm.com> Dan Smith wrote: > DK> +def check_bridge_name(bridgename): > DK> + bridge_list = live.available_bridges(server) > DK> + vbr = None > DK> + if bridgename in bridge_list: > DK> + import random > DK> + vbr = bridgename + str(random.randint(1, 100)) > DK> + if vbr in bridge_list: > DK> + logger.error('Need to give different bridge name since it already exists') > DK> + return None > DK> + else: > DK> + vbr = bridgename > DK> + return vbr > > I think this would make a lot more sense as: > > def get_unique_bridge(): > bridge = "invalid-bridge" > > while bridge not in live.available_bridges(): > bridge += str(random.randint(1,100)) > > return bridge > > Ok , will modify this. > DK> + if virt != 'XenFV': > DK> + bridge = vsxml.set_vbridge(server) > > Can you explain why this special case exists? > > The network information for the XenFV is getting assigned by default. The def _devices(): section of the XenFV is calling the self.set_bridge(CIM_IP) and hence the bridge information is getting assigned by default. While this is not the case with the Xen and KVM. > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim From yunguol at cn.ibm.com Tue Apr 8 07:06:09 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 8 Apr 2008 15:06:09 +0800 Subject: [Libvirt-cim] Test report on KVM] In-Reply-To: <47FB1802.1020902@linux.vnet.ibm.com> Message-ID: > > > -------- Original Message -------- > > Subject: > > Re: [Libvirt-cim] Test report on KVM > > Date: > > Mon, 07 Apr 2008 16:35:41 -0700 > > From: > > Kaitlin Rupert > > Reply-To: > > List for discussion and development of libvirt CIM > > To: > > List for discussion and development of libvirt CIM > > References: > > > > > Dan, I see basically the same results you see. Except I see log entries > for the failing tests. > > This is on a system with the following: > > F8 > xen-3.1.0-13.fc8 > libvirt-0.4.1-3.fc9 > > I did a clone of the cimtest tree and the provider tree. I also have a > KVM guest defined. > > > > > ElementCapabilities - 01_forward.py: FAIL > > > > CIM_ERR_NOT_FOUND: The requested object could not be found: "No > > > such instance (CreationClassName)" > > It passed during my test. > > This failed for me. There's definitely a test case problem. The > offending code: > > elec = assoc.AssociatorNames(options.ip, > "ElementCapabilities", > "ComputerSystem", > options.virt, > Name = system, > CreationClassName = > "Xen_ComputerSystem") > > The CreationClassName shouldn't be hardcoded to Xen_ComputerSystem. Good catch, I fix it today. > > > > > > > ElementCapabilities - 05_hostsystem_cap.py: FAIL > > > > CIM_ERR_NOT_FOUND: The requested object could not be found: "No > > > such instance" > > > > > It fails because of missing argument, I fixed it already. > > This test passes for me. It looks like Daisy's fix for this went into > the tree sometime earlier today. Yup, fixed yesterady and Dan applied it already. > > > > > > > > ElementConforms - 01_forward.py: FAIL > > > > ElementConforms - 02_reverse.py: FAIL > > > > > > The log: > > > > > > > ====01_forward.py Log==== > > > > 1. Property values for CIM:DSP1057-VirtualSystem-1.0.0a and domain > > > Domain-0 is > > > > EnabState = 2 EnabDefault = 2 ReqSt = 12 > > > > 2. Values for CIM:DSP1042-SystemVirtualization-1.0.0 and host > > > guaranine.danplanet.com is > > > > EnabState = 5 EnabDefault = 2 ReqSt = 12 > > > > ====02_reverse.py Log==== > > > > > > The lack of a log for 02 is troubling. > > I get a log here. I see: > > Mon, 24 Mar 2008 14:51:57:TEST LOG:INFO - ====02_reverse.py Log==== > Mon, 24 Mar 2008 14:51:59:TEST LOG:ERROR - Failed to get > associators information for RegisteredProfile > Mon, 24 Mar 2008 14:51:59:TEST LOG:ERROR - Exception: > u'KVM_ComputerSystem' > > It is troubling that you didn't see any log output during your run. Fix them today. > > > > > > > > HostSystem - 02_hostsystem_to_rasd.py: FAIL > > > > Traceback (most recent call last): > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > > > msg = self.format(record) > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > > > return fmt.format(record) > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > > > record.message = record.getMessage() > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in > > getMessage > > > > msg = msg % self.args > > > > TypeError: not enough arguments for format string > > > > > Also passed during my test. > > This fails for me. In addition to the python errors, I see the > following in the log: > > ERROR:TEST LOG:AllocationUnits Mismatch > ERROR:TEST LOG:Mistmatching association values > > I think there's a few testcase issues here: > > 1) In XenKvmLib/rasd.py: > > Globals.logger.error("Returned %s instead of %s or %s", \ > assoc_info['AllocationUnits'], > memrasd_list['AllocationUnits']) > > The string takes 3 arguments, but only 2 are given. The third argument > should be removed. > > 2) I think HostSystem - 02_hostsystem_to_rasd.py needs to be updated to > reflect the recent provider change. The provider returns KiloBytes as > the unit, but the test is expecting MegaBytes. > > > > > > Looks like a testcase error. > > > > > > > RASD - 01_verify_rasd_fields.py: FAIL > > > > > > No log for this one either. > > I see the following in the log: > > TEST LOG:ERROR - Define or start domain failed > > > > > > > > RASD - 02_enum.py: FAIL > > > > Traceback (most recent call last): > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > > > msg = self.format(record) > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > > > return fmt.format(record) > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > > > record.message = record.getMessage() > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in > > getMessage > > > > msg = msg % self.args > > > > TypeError: not enough arguments for format string > > > > > > Same as above. > > Also passed during my running test. > > This failed for me. > > > > > > > > SettingsDefine - 01_forward.py: FAIL > > > > SettingsDefine - 02_reverse.py: FAIL > > > > SettingsDefine - 03_sds_fwd_errs.py: FAIL > > > > > > No log. > > I got log messages for these 3 tests. > > > > > > > > SystemDevice - 01_forward.py: FAIL > > > > > > Log: > > > > > > > ====01_forward.py Log==== > > > > Examined test_domain/00:11:22:33:44:55 > > > > Examined test_domain/mem > > > > Examined test_domain/xvdb > > > > Examined test_domain/0 > > > > > > > SystemDevice - 03_fwderrs.py: FAIL > > > > Traceback (most recent call last): > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > > > msg = self.format(record) > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > > > return fmt.format(record) > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > > > record.message = record.getMessage() > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in > > getMessage > > > > msg = msg % self.args > > > > TypeError: not all arguments converted during string formatting > > > > > > This is repeated a bunch of times, but I've snipped them out. > > > > > > > VSSD - 04_vssd_to_rasd.py: FAIL > > > > Traceback (most recent call last): > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > > > msg = self.format(record) > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > > > return fmt.format(record) > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > > > record.message = record.getMessage() > > > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in > > getMessage > > > > msg = msg % self.args > > > > TypeError: not enough arguments for format string > > > > > > Seems to be a common issue. > > > > > > > VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL > > > > > > Log: > > > > > > > destroy_fail>>nonexistent: Got expected return code 4 > > > > destroy_fail>>nonexistent: Got expected return code 4 > > > > > > > VirtualSystemMigrationSettingData - 01_enum.py: FAIL > > > > > > No log. > > ERROR:TEST LOG:ClassName Mismatch > ERROR:TEST LOG:Returned Xen_VirtualSystemMigrationSettingData instead of > KVM_VirtualSystemMigrationSettingData > The fails because of enumclass call, fix and update to reflect the recent lib changes > > > > > > > VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL > > > > > > No log. > > ERROR:TEST LOG:ClassName Mismatch > ERROR:TEST LOG:Returned Xen_VirtualSystemSnapshotServiceCapabilities > instead of KVM_VirtualSystemSnapshotServiceCapabilities > Same as above, fix also. > -- > Kaitlin Rupert > IBM Linux Technology Center > kaitlin at linux.vnet.ibm.com > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > > > -- > - Zhengang -------------- next part -------------- An HTML attachment was scrubbed... URL: From deeptik at linux.vnet.ibm.com Tue Apr 8 09:28:57 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 08 Apr 2008 14:58:57 +0530 Subject: [Libvirt-cim] Test report on KVM In-Reply-To: <47FAAFCD.4060803@linux.vnet.ibm.com> References: <47FAAFCD.4060803@linux.vnet.ibm.com> Message-ID: <47FB3AD9.9050504@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Dan, I see basically the same results you see. Except I see log > entries for the failing tests. > > This is on a system with the following: > > F8 > xen-3.1.0-13.fc8 > libvirt-0.4.1-3.fc9 > > I did a clone of the cimtest tree and the provider tree. I also have > a KVM guest defined. > >> > > ElementCapabilities - 01_forward.py: FAIL >> > > CIM_ERR_NOT_FOUND: The requested object could not be found: "No >> > such instance (CreationClassName)" >> It passed during my test. > > This failed for me. There's definitely a test case problem. The > offending code: > > elec = assoc.AssociatorNames(options.ip, > "ElementCapabilities", > "ComputerSystem", > options.virt, > Name = system, > CreationClassName = > "Xen_ComputerSystem") > > The CreationClassName shouldn't be hardcoded to Xen_ComputerSystem. > >> > > ElementCapabilities - 05_hostsystem_cap.py: FAIL >> > > CIM_ERR_NOT_FOUND: The requested object could not be found: "No >> > such instance" >> > >> It fails because of missing argument, I fixed it already. > > This test passes for me. It looks like Daisy's fix for this went into > the tree sometime earlier today. > >> > >> > > ElementConforms - 01_forward.py: FAIL >> > > ElementConforms - 02_reverse.py: FAIL >> > >> > The log: >> > >> > > ====01_forward.py Log==== >> > > 1. Property values for CIM:DSP1057-VirtualSystem-1.0.0a and domain >> > Domain-0 is >> > > EnabState = 2 EnabDefault = 2 ReqSt = 12 >> > > 2. Values for CIM:DSP1042-SystemVirtualization-1.0.0 and host >> > guaranine.danplanet.com is >> > > EnabState = 5 EnabDefault = 2 ReqSt = 12 >> > > ====02_reverse.py Log==== >> > >> > The lack of a log for 02 is troubling. > > I get a log here. I see: > > Mon, 24 Mar 2008 14:51:57:TEST LOG:INFO - ====02_reverse.py > Log==== > Mon, 24 Mar 2008 14:51:59:TEST LOG:ERROR - Failed to get > associators information for RegisteredProfile > Mon, 24 Mar 2008 14:51:59:TEST LOG:ERROR - Exception: > u'KVM_ComputerSystem' > > It is troubling that you didn't see any log output during your run. > >> > >> > > HostSystem - 02_hostsystem_to_rasd.py: FAIL >> > > Traceback (most recent call last): >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in >> emit >> > > msg = self.format(record) >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in >> format >> > > return fmt.format(record) >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in >> format >> > > record.message = record.getMessage() >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in >> getMessage >> > > msg = msg % self.args >> > > TypeError: not enough arguments for format string >> > >> Also passed during my test. > > This fails for me. In addition to the python errors, I see the > following in the log: > > ERROR:TEST LOG:AllocationUnits Mismatch > ERROR:TEST LOG:Mistmatching association values > > I think there's a few testcase issues here: > > 1) In XenKvmLib/rasd.py: > > Globals.logger.error("Returned %s instead of %s or %s", \ > assoc_info['AllocationUnits'], > memrasd_list['AllocationUnits']) > > The string takes 3 arguments, but only 2 are given. The third > argument should be removed. I had sent a patch for this On March26 *"Fixing: The syntax error and the removing the extra parameter in certain functions"* , for the arguments problem. I dont find this in the tree yet. > > 2) I think HostSystem - 02_hostsystem_to_rasd.py needs to be updated > to reflect the recent provider change. The provider returns KiloBytes > as the unit, but the test is expecting MegaBytes. > >> >> > Looks like a testcase error. >> > >> > > RASD - 01_verify_rasd_fields.py: FAIL >> > >> > No log for this one either. > > I see the following in the log: > > TEST LOG:ERROR - Define or start domain failed > >> > >> > > RASD - 02_enum.py: FAIL >> > > Traceback (most recent call last): >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in >> emit >> > > msg = self.format(record) >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in >> format >> > > return fmt.format(record) >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in >> format >> > > record.message = record.getMessage() >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in >> getMessage >> > > msg = msg % self.args >> > > TypeError: not enough arguments for format string >> > >> > Same as above. >> Also passed during my running test. > > This failed for me. > >> > >> > > SettingsDefine - 01_forward.py: FAIL >> > > SettingsDefine - 02_reverse.py: FAIL >> > > SettingsDefine - 03_sds_fwd_errs.py: FAIL >> > >> > No log. > > I got log messages for these 3 tests. > >> > >> > > SystemDevice - 01_forward.py: FAIL >> > >> > Log: >> > > > ====01_forward.py Log==== >> > > Examined test_domain/00:11:22:33:44:55 >> > > Examined test_domain/mem >> > > Examined test_domain/xvdb >> > > Examined test_domain/0 >> > >> > > SystemDevice - 03_fwderrs.py: FAIL >> > > Traceback (most recent call last): >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in >> emit >> > > msg = self.format(record) >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in >> format >> > > return fmt.format(record) >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in >> format >> > > record.message = record.getMessage() >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in >> getMessage >> > > msg = msg % self.args >> > > TypeError: not all arguments converted during string formatting >> > >> > This is repeated a bunch of times, but I've snipped them out. >> > >> > > VSSD - 04_vssd_to_rasd.py: FAIL >> > > Traceback (most recent call last): >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in >> emit >> > > msg = self.format(record) >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in >> format >> > > return fmt.format(record) >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in >> format >> > > record.message = record.getMessage() >> > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in >> getMessage >> > > msg = msg % self.args >> > > TypeError: not enough arguments for format string >> > >> > Seems to be a common issue. >> > >> > > VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL >> > >> > Log: >> > >> > > destroy_fail>>nonexistent: Got expected return code 4 >> > > destroy_fail>>nonexistent: Got expected return code 4 >> > >> > > VirtualSystemMigrationSettingData - 01_enum.py: FAIL >> > >> > No log. > > ERROR:TEST LOG:ClassName Mismatch > ERROR:TEST LOG:Returned Xen_VirtualSystemMigrationSettingData instead > of KVM_VirtualSystemMigrationSettingData > >> > >> > > VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL >> > >> > No log. > > ERROR:TEST LOG:ClassName Mismatch > ERROR:TEST LOG:Returned Xen_VirtualSystemSnapshotServiceCapabilities > instead of KVM_VirtualSystemSnapshotServiceCapabilities > From yunguol at cn.ibm.com Tue Apr 8 09:38:20 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 08 Apr 2008 02:38:20 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Change KVM default network type to bridge Message-ID: <6ec8fdc414f8c86160a8.1207647500@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207647488 25200 # Node ID 6ec8fdc414f8c86160a8c578465901c77e8cfcc0 # Parent 851b6729397e782b7ac6fbadee849ee7da9b16d3 [TEST] Change KVM default network type to bridge The original 'user' is not listed in provider code for valid check. (Consider update provider, too?) This fix the SettingsDefine failure on recent KVM run. Signed-off-by: Guolian Yun diff -r 851b6729397e -r 6ec8fdc414f8 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Apr 07 08:27:46 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Apr 08 02:38:08 2008 -0700 @@ -501,9 +501,10 @@ class KVMXML(VirtXML): self.add_sub_node(disk, 'source', file=disk_img) self.add_sub_node(disk, 'target', dev=disk_dev) - interface = self.add_sub_node(devices, 'interface', type='user') + interface = self.add_sub_node(devices, 'interface', type='bridge') self.add_sub_node(interface, 'mac', address=net_mac) - + self.set_bridge(CIM_IP) + def set_emulator(self, emu): return self._set_emulator(emu) From deeptik at linux.vnet.ibm.com Tue Apr 8 10:50:29 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 08 Apr 2008 16:20:29 +0530 Subject: [Libvirt-cim] [PATCH] [TEST]Removing the set_bridge() function from the XenFVXML file Message-ID: <7b3c5acdddf0cb83c813.1207651829@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207651811 -19800 # Node ID 7b3c5acdddf0cb83c8135903b5148962a32cab81 # Parent 851b6729397e782b7ac6fbadee849ee7da9b16d3 [TEST]Removing the set_bridge() function from the XenFVXML file. This is not required as set_vbridge() of XenFVXML can be used for the same. Signed-off-by: Deepti B. Kalakeri diff -r 851b6729397e -r 7b3c5acdddf0 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Apr 07 08:27:46 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Apr 08 16:20:11 2008 +0530 @@ -544,7 +544,6 @@ class XenFVXML(VirtXML): interface = self.add_sub_node(devices, 'interface', type=net_type) self.add_sub_node(interface, 'mac', address=net_mac) - self.set_bridge(CIM_IP) disk = self.add_sub_node(devices, 'disk', type='file') self.add_sub_node(disk, 'source', file=disk_img) From deeptik at linux.vnet.ibm.com Tue Apr 8 10:53:19 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 08 Apr 2008 16:23:19 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting]Adding 05_RAPF_err.py to verify RAPF Message-ID: <6e8932e6628a5475b39e.1207651999@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207651996 -19800 # Node ID 6e8932e6628a5475b39e196bb8b5182b5c5a3f11 # Parent 7b3c5acdddf0cb83c8135903b5148962a32cab81 [TEST][Resubmitting]Adding 05_RAPF_err.py to verify RAPF. 1) The test : creates a guest with a network device that is not part of a known pool. Then call ResourceAllocatedFromPool with the reference to that device. Verifies for the error. 2) Addressed the comments. 3) Made the set_bridge_name() common to all virt types. Signed-off-by: Deepti B. Kalakeri diff -r 7b3c5acdddf0 -r 6e8932e6628a suites/libvirt-cim/cimtest/ResourceAllocationFromPool/05_RAPF_err.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/05_RAPF_err.py Tue Apr 08 16:23:16 2008 +0530 @@ -0,0 +1,196 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 tc is used to verify the that the +# ResourceAllocationFromPool asscoiation returns error +# when guest is associated to a non-existing virtual network pool. +# +# The does the following: +# 1) creates a guest with a network device that is not part of a known pool, +# 2) call ResourceAllocatedFromPool with the reference to that device. +# 3) Verifies for the following error: +# +# Command: +# -------- +# wbemcli ain -ac KVM_ResourceAllocationFromPool +# 'http://localhost:5988/root/virt:KVM_NetResourceAllocationSettingData. +# InstanceID="test-kvm/24:42:53:21:52:45"' +# +# +# Output: +# ------- +# error no : CIM_ERR_FAILED +# error desc : "Unable to determine pool of `test-kvm/24:42:53:21:52:45';" +# +# Date : 04-04-2008 +# +import sys +import pywbem +import random +from VirtLib import live +from XenKvmLib import assoc, enumclass +from XenKvmLib.common_util import try_assoc +from XenKvmLib.test_doms import destroy_and_undefine_all +from CimTest import Globals +from CimTest.Globals import logger, CIM_ERROR_ENUMERATE +from CimTest.ReturnCodes import PASS, FAIL +from CimTest.Globals import do_main, platform_sup +from XenKvmLib.vxml import get_class +from XenKvmLib.classes import get_typed_class + +test_dom = "RAPF_domain" +test_mac = "00:11:22:33:44:aa" +test_vcpus = 1 + +def get_unique_bridge(): + bridge = "invalid-bridge" + bridge_list = live.available_bridges(server) + while bridge in bridge_list: + bridge = bridge + str(random.randint(1, 100)) + + return bridge + +def setup_env(): + vsxml_info = None + if virt == "Xen": + test_disk = "xvda" + else: + test_disk = "hda" + + virt_xml = get_class(virt) + vsxml_info = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, disk = test_disk) + bridge = vsxml_info.set_vbridge(server) + +# Get a bridge name that is not used by any of the virtual network pool on the machine. + bridge_name = get_unique_bridge() + +# Assigning the bridge that does not belong to any networkpool. + vsxml_info.set_bridge_name(bridge_name) + + ret = vsxml_info.define(server) + if not ret: + Globals.logger.error("Failed to define the dom: %s", test_dom) + return FAIL, vsxml_info + + return PASS, vsxml_info + +def get_inst_from_list(classname, rasd_list, filter_name, exp_val): + status = PASS + ret = FAIL + inst = [] + + for rec in rasd_list: + record = rec[filter_name] + if exp_val in record: + inst.append(rec) + ret = PASS + + if ret != PASS: + logger.error("%s with %s was not returned" % (classname, exp_val)) + vsxml.undefine(server) + status = FAIL + + return status, inst + +def get_netrasd_instid(classname): + rasd_list = [] + status = PASS + try: + rasd_list = enumclass.enumerate_inst(server, classname, virt) + if len(rasd_list) < 1: + logger.error("%s returned %i instances, excepted atleast 1 instance", classname, + len(rasd_list)) + status = FAIL + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, classname) + logger.error("Exception: %s", detail) + status = FAIL + + if status != PASS: + return status, rasd_list + + # Get the RASD info related to the domain "ONLY". + # We should get ONLY one record. + rasd_info = [] + status, rasd_info = get_inst_from_list(classname, rasd_list, "InstanceID", test_dom) + + return status, rasd_info + +def verify_rapf_err(): + status = PASS + try: + + classname = get_typed_class(virt, 'NetResourceAllocationSettingData') + status, net_rasd_list = get_netrasd_instid(classname) + if status != PASS or len(net_rasd_list) == 0: + return status + if len(net_rasd_list) != 1: + logger.error("%s returned %i instances, excepted atleast 1 instance", classname, + len(net_rasd_list)) + return FAIL + + + conn = assoc.myWBEMConnection('http://%s' % server, + (Globals.CIM_USER, + Globals.CIM_PASS), + Globals.CIM_NS) + assoc_classname = get_typed_class(virt, "ResourceAllocationFromPool") + classname = net_rasd_list[0].classname + instid = net_rasd_list[0]['InstanceID'] + keys = { "InstanceID" : instid } + expr_values = { + 'rapf_err' : { + 'desc' : "Unable to determine pool of `%s'" %instid, + 'rc' : pywbem.CIM_ERR_FAILED + } + } + status = try_assoc(conn, classname, assoc_classname, keys, field_name="InstanceID", + expr_values=expr_values['rapf_err'], bug_no="") + + except Exception, detail: + logger.error("Exception: %s", detail) + status = FAIL + + return status + + at do_main(platform_sup) +def main(): + global virt, vsxml, server + Globals.log_param() + options = main.options + server = options.ip + virt = options.virt + destroy_and_undefine_all(server) + + status, vsxml = setup_env() + if status != PASS: + logger.error("Failed to setup the domain") + return status + + ret = verify_rapf_err() + if ret: + logger.error("------FAILED: to verify the RAFP.------") + status = ret + + vsxml.undefine(server) + return status +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Tue Apr 8 11:47:54 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 08 Apr 2008 17:17:54 +0530 Subject: [Libvirt-cim] Test report on KVM In-Reply-To: <47FB3AD9.9050504@linux.vnet.ibm.com> References: <47FAAFCD.4060803@linux.vnet.ibm.com> <47FB3AD9.9050504@linux.vnet.ibm.com> Message-ID: <47FB5B6A.8080808@linux.vnet.ibm.com> sorry, my mistake. I did not have the latest cimtest tree on my machine. I see the rasd.py changes in after using the latest changes. Thanks and Regards, Deepti. Deepti B Kalakeri wrote: > > > Kaitlin Rupert wrote: >> Dan, I see basically the same results you see. Except I see log >> entries for the failing tests. >> >> This is on a system with the following: >> >> F8 >> xen-3.1.0-13.fc8 >> libvirt-0.4.1-3.fc9 >> >> I did a clone of the cimtest tree and the provider tree. I also have >> a KVM guest defined. >> >>> > > ElementCapabilities - 01_forward.py: FAIL >>> > > CIM_ERR_NOT_FOUND: The requested object could not be found: "No >>> > such instance (CreationClassName)" >>> It passed during my test. >> >> This failed for me. There's definitely a test case problem. The >> offending code: >> >> elec = assoc.AssociatorNames(options.ip, >> "ElementCapabilities", >> "ComputerSystem", >> options.virt, >> Name = system, >> CreationClassName = >> "Xen_ComputerSystem") >> >> The CreationClassName shouldn't be hardcoded to Xen_ComputerSystem. >> >>> > > ElementCapabilities - 05_hostsystem_cap.py: FAIL >>> > > CIM_ERR_NOT_FOUND: The requested object could not be found: "No >>> > such instance" >>> > >>> It fails because of missing argument, I fixed it already. >> >> This test passes for me. It looks like Daisy's fix for this went >> into the tree sometime earlier today. >> >>> > >>> > > ElementConforms - 01_forward.py: FAIL >>> > > ElementConforms - 02_reverse.py: FAIL >>> > >>> > The log: >>> > >>> > > ====01_forward.py Log==== >>> > > 1. Property values for CIM:DSP1057-VirtualSystem-1.0.0a and domain >>> > Domain-0 is >>> > > EnabState = 2 EnabDefault = 2 ReqSt = 12 >>> > > 2. Values for CIM:DSP1042-SystemVirtualization-1.0.0 and host >>> > guaranine.danplanet.com is >>> > > EnabState = 5 EnabDefault = 2 ReqSt = 12 >>> > > ====02_reverse.py Log==== >>> > >>> > The lack of a log for 02 is troubling. >> >> I get a log here. I see: >> >> Mon, 24 Mar 2008 14:51:57:TEST LOG:INFO - ====02_reverse.py >> Log==== >> Mon, 24 Mar 2008 14:51:59:TEST LOG:ERROR - Failed to get >> associators information for RegisteredProfile >> Mon, 24 Mar 2008 14:51:59:TEST LOG:ERROR - Exception: >> u'KVM_ComputerSystem' >> >> It is troubling that you didn't see any log output during your run. >> >>> > >>> > > HostSystem - 02_hostsystem_to_rasd.py: FAIL >>> > > Traceback (most recent call last): >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in >>> emit >>> > > msg = self.format(record) >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in >>> format >>> > > return fmt.format(record) >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in >>> format >>> > > record.message = record.getMessage() >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in >>> getMessage >>> > > msg = msg % self.args >>> > > TypeError: not enough arguments for format string >>> > >>> Also passed during my test. >> >> This fails for me. In addition to the python errors, I see the >> following in the log: >> >> ERROR:TEST LOG:AllocationUnits Mismatch >> ERROR:TEST LOG:Mistmatching association values >> >> I think there's a few testcase issues here: >> >> 1) In XenKvmLib/rasd.py: >> >> Globals.logger.error("Returned %s instead of %s or %s", \ >> assoc_info['AllocationUnits'], >> memrasd_list['AllocationUnits']) >> >> The string takes 3 arguments, but only 2 are given. The third >> argument should be removed. > I had sent a patch for this On March26 *"Fixing: The syntax error and > the removing the extra parameter in certain functions"* , for the > arguments problem. > I dont find this in the tree yet. >> >> 2) I think HostSystem - 02_hostsystem_to_rasd.py needs to be updated >> to reflect the recent provider change. The provider returns >> KiloBytes as the unit, but the test is expecting MegaBytes. >> >>> >>> > Looks like a testcase error. >>> > >>> > > RASD - 01_verify_rasd_fields.py: FAIL >>> > >>> > No log for this one either. >> >> I see the following in the log: >> >> TEST LOG:ERROR - Define or start domain failed >> >>> > >>> > > RASD - 02_enum.py: FAIL >>> > > Traceback (most recent call last): >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in >>> emit >>> > > msg = self.format(record) >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in >>> format >>> > > return fmt.format(record) >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in >>> format >>> > > record.message = record.getMessage() >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in >>> getMessage >>> > > msg = msg % self.args >>> > > TypeError: not enough arguments for format string >>> > >>> > Same as above. >>> Also passed during my running test. >> >> This failed for me. >> >>> > >>> > > SettingsDefine - 01_forward.py: FAIL >>> > > SettingsDefine - 02_reverse.py: FAIL >>> > > SettingsDefine - 03_sds_fwd_errs.py: FAIL >>> > >>> > No log. >> >> I got log messages for these 3 tests. >> >>> > >>> > > SystemDevice - 01_forward.py: FAIL >>> > >>> > Log: >>> > > > ====01_forward.py Log==== >>> > > Examined test_domain/00:11:22:33:44:55 >>> > > Examined test_domain/mem >>> > > Examined test_domain/xvdb >>> > > Examined test_domain/0 >>> > >>> > > SystemDevice - 03_fwderrs.py: FAIL >>> > > Traceback (most recent call last): >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in >>> emit >>> > > msg = self.format(record) >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in >>> format >>> > > return fmt.format(record) >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in >>> format >>> > > record.message = record.getMessage() >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in >>> getMessage >>> > > msg = msg % self.args >>> > > TypeError: not all arguments converted during string formatting >>> > >>> > This is repeated a bunch of times, but I've snipped them out. >>> > >>> > > VSSD - 04_vssd_to_rasd.py: FAIL >>> > > Traceback (most recent call last): >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in >>> emit >>> > > msg = self.format(record) >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in >>> format >>> > > return fmt.format(record) >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in >>> format >>> > > record.message = record.getMessage() >>> > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in >>> getMessage >>> > > msg = msg % self.args >>> > > TypeError: not enough arguments for format string >>> > >>> > Seems to be a common issue. >>> > >>> > > VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL >>> > >>> > Log: >>> > >>> > > destroy_fail>>nonexistent: Got expected return code 4 >>> > > destroy_fail>>nonexistent: Got expected return code 4 >>> > >>> > > VirtualSystemMigrationSettingData - 01_enum.py: FAIL >>> > >>> > No log. >> >> ERROR:TEST LOG:ClassName Mismatch >> ERROR:TEST LOG:Returned Xen_VirtualSystemMigrationSettingData instead >> of KVM_VirtualSystemMigrationSettingData >> >>> > >>> > > VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL >>> > >>> > No log. >> >> ERROR:TEST LOG:ClassName Mismatch >> ERROR:TEST LOG:Returned Xen_VirtualSystemSnapshotServiceCapabilities >> instead of KVM_VirtualSystemSnapshotServiceCapabilities >> > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim From deeptik at linux.vnet.ibm.com Tue Apr 8 12:24:18 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 08 Apr 2008 17:54:18 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing the 02_hostsystem_to_rasd.py tc Message-ID: <4b2bfa729df71d618e7b.1207657458@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207657455 -19800 # Node ID 4b2bfa729df71d618e7bc8e3b1b89eacf86c419b # Parent 6e8932e6628a5475b39e196bb8b5182b5c5a3f11 [TEST] Fixing the 02_hostsystem_to_rasd.py tc. 1) Fixed the tc failure. 2) Removed ununsed import stmt. 3) updated it to use the xml_get_disk_source() to get disk info. Signed-off-by: Deepti B. Kalakeri diff -r 6e8932e6628a -r 4b2bfa729df7 suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py --- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Tue Apr 08 16:23:16 2008 +0530 +++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Tue Apr 08 17:54:15 2008 +0530 @@ -47,10 +47,8 @@ # Date : 29.01.2008 import sys -from VirtLib import utils -from CimTest import Globals from CimTest.Globals import do_main -from XenKvmLib.vxml import XenXML, KVMXML, get_class +from XenKvmLib.vxml import get_class from XenKvmLib.classes import get_typed_class from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all from XenKvmLib.assoc import Associators, AssociatorNames @@ -73,34 +71,35 @@ def init_list(virt="Xen"): """ Creating the lists that will be used for comparisons. """ - disk_path = "/tmp/default-%s-dimage" % virt.lower() + disk_path = vsxml.xml_get_disk_source() rasd_values = {"%s_Processor" % virt : { - "InstanceID" : '%s/%s' %(test_dom,0),\ - "ResourceType" : 3,\ - }, \ + "InstanceID" : '%s/%s' %(test_dom,0), + "ResourceType" : 3, + }, "%s_LogicalDisk" % virt: { - "InstanceID" : '%s/%s' %(test_dom, test_disk), \ - "ResourceType" : 17, \ - "Address" : disk_path, \ - }, \ + "InstanceID" : '%s/%s' %(test_dom, test_disk), + "ResourceType" : 17, + "Address" : disk_path, + }, "%s_NetworkPort" % virt: { - "InstanceID" : '%s/%s' %(test_dom,test_mac), \ - "ResourceType" : 10 , \ - "ntype1": "bridge", \ - "ntype2": "ethernet", \ - }, \ + "InstanceID" : '%s/%s' %(test_dom,test_mac), + "ResourceType" : 10 , + "ntype1": "bridge", + "ntype2": "ethernet", + }, "%s_Memory"% virt: { - "InstanceID" : '%s/%s' %(test_dom, "mem"), \ - "ResourceType" : 4, \ - "AllocationUnits" : "MegaBytes",\ - "VirtualQuantity" : (test_mem * 1024), \ + "InstanceID" : '%s/%s' %(test_dom, "mem"), + "ResourceType" : 4, + "AllocationUnits" : "KiloBytes", + "VirtualQuantity" : (test_mem * 1024), } } return rasd_values def setup_env(server, virt="Xen"): + vsxml_info = None status = PASS destroy_and_undefine_all(server) global test_disk @@ -108,17 +107,18 @@ def setup_env(server, virt="Xen"): test_disk = "xvda" else: test_disk = "hda" - - vsxml = get_class(virt)(test_dom, mem = test_mem, + virt_xml = get_class(virt) + vsxml_info = virt_xml(test_dom, mem = test_mem, vcpus=test_vcpus, mac = test_mac, disk = test_disk) - ret = vsxml.define(server) + ret = vsxml_info.define(server) if not ret: logger.error("Failed to define the dom: %s", test_dom) status = FAIL - return status + + return status, vsxml_info def print_err(err, detail, cn): logger.error(err % cn) @@ -214,15 +214,16 @@ def main(): def main(): options = main.options log_param() + global vsxml server = options.ip status = PASS status, host_name, classname = get_host_info(server, options.virt) if status != PASS: return status if options.virt == "XenFV": - options.virt = "Xen" - status = setup_env(server, options.virt) - if status != PASS: + options.virt = "Xen" + status, vsxml = setup_env(server, options.virt) + if status != PASS or vsxml == None: return status cn = classname an = get_typed_class(options.virt, 'HostedDependency') From deeptik at linux.vnet.ibm.com Tue Apr 8 12:28:55 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 08 Apr 2008 17:58:55 +0530 Subject: [Libvirt-cim] [PATCH] [TEST]Fixing verify_memrasd_values() of rasd.py Message-ID: <37016dd67bef77cc50d1.1207657735@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207657724 -19800 # Node ID 37016dd67bef77cc50d114578c239d8197d4de84 # Parent 4b2bfa729df71d618e7bc8e3b1b89eacf86c419b [TEST]Fixing verify_memrasd_values() of rasd.py. Removed the extra format string in the log stmt. Signed-off-by: Deepti B. Kalakeri diff -r 4b2bfa729df7 -r 37016dd67bef suites/libvirt-cim/lib/XenKvmLib/rasd.py --- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Tue Apr 08 17:54:15 2008 +0530 +++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Tue Apr 08 17:58:44 2008 +0530 @@ -92,7 +92,7 @@ def verify_memrasd_values(assoc_info, me status = FAIL if assoc_info['AllocationUnits'] != memrasd_list['AllocationUnits']: Globals.logger.error("%s Mismatch", 'AllocationUnits') - Globals.logger.error("Returned %s instead of %s or %s", \ + Globals.logger.error("Returned %s instead of %s ", \ assoc_info['AllocationUnits'], memrasd_list['AllocationUnits']) status = FAIL if assoc_info['VirtualQuantity'] != memrasd_list['VirtualQuantity']: From danms at us.ibm.com Tue Apr 8 14:58:51 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 08 Apr 2008 07:58:51 -0700 Subject: [Libvirt-cim] Test report on KVM References: <47FAAFCD.4060803@linux.vnet.ibm.com> Message-ID: <87ej9gbdg4.fsf@caffeine.beaverton.ibm.com> KR> Dan, I see basically the same results you see. Except I see log KR> entries for the failing tests. That's good. Consistency is good :) KR> 2) I think HostSystem - 02_hostsystem_to_rasd.py needs to be KR> updated to reflect the recent provider change. The provider KR> returns KiloBytes as the unit, but the test is expecting KR> MegaBytes. Ah, yeah, that's right. KR> ERROR:TEST LOG:ClassName Mismatch KR> ERROR:TEST LOG:Returned Xen_VirtualSystemMigrationSettingData instead KR> of KVM_VirtualSystemMigrationSettingData Wow, really? That's interesting. On my system: wbemcli ein http://root:password at localhost/root/virt:KVM_VirtualSystemMigrationSettingData localhost:5988/root/virt:KVM_VirtualSystemMigrationSettingData.InstanceID="MigrationSettingData" Which looks right to me. The test does the silly eval() thing in the enumclass call, so maybe something is getting defaulted back to the Xen_ type. KR> ERROR:TEST LOG:ClassName Mismatch KR> ERROR:TEST LOG:Returned Xen_VirtualSystemSnapshotServiceCapabilities KR> instead of KVM_VirtualSystemSnapshotServiceCapabilities This works for me as well. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Tue Apr 8 16:44:30 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 08 Apr 2008 09:44:30 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix domain created error in RASD.01 In-Reply-To: References: Message-ID: <47FBA0EE.2050103@linux.vnet.ibm.com> Guo Lian Yun wrote: > libvirt-cim-bounces at redhat.com wrote on 2008-04-07 23:27:39: > > > GY> # HG changeset patch > > GY> # User Guolian Yun > > GY> # Date 1207560373 25200 > > GY> # Node ID 4578382726b1d2099c9b467a0532052b67af42e9 > > GY> # Parent bedc7fc28125f9d6cc21f7a6752b479313f070e5 > > GY> [TEST] Fix domain created error in RASD.01 > > > > When I run the test suite with this patch applied, I get the following > > stack trace for this test (which I didn't get before): > > > > RASD - 01_verify_rasd_fields.py: FAIL > > Traceback (most recent call last): > > File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit > > msg = self.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format > > return fmt.format(record) > > File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format > > record.message = record.getMessage() > > File "/usr/lib64/python2.5/logging/__init__.py", line 288, in > getMessage > > msg = msg % self.args > > TypeError: not enough arguments for format string > > > > This test with the patch pass for me. The TypeError seems to be a common > issue, which repeated several times in cimtest running. I will try to > track down. > Also, the patch fix the domain created error, maybe you can apply it > firstly. > - global vsxml + global cxml + global test_disk + if options.virt == 'Xen': + test_disk = 'xvda' + else: + test_disk = 'hda' I think avoiding globals when possible is a good idea. I realize that the test already used a global vsxml, but I think it'd be cleaner to see these variables passed in as arguments instead. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 8 17:21:06 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 08 Apr 2008 10:21:06 -0700 Subject: [Libvirt-cim] Test report on KVM] In-Reply-To: References: Message-ID: <47FBA982.8010901@linux.vnet.ibm.com> > > > > The CreationClassName shouldn't be hardcoded to Xen_ComputerSystem. > Good catch, I fix it today. > > Mon, 24 Mar 2008 14:51:57:TEST LOG:INFO - ====02_reverse.py > Log==== > > Mon, 24 Mar 2008 14:51:59:TEST LOG:ERROR - Failed to get > > associators information for RegisteredProfile > > Mon, 24 Mar 2008 14:51:59:TEST LOG:ERROR - Exception: > > u'KVM_ComputerSystem' > > > > It is troubling that you didn't see any log output during your run. > Fix them today. Thanks for fixing these! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 8 17:35:04 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 08 Apr 2008 10:35:04 -0700 Subject: [Libvirt-cim] Test report on KVM In-Reply-To: <47FB3AD9.9050504@linux.vnet.ibm.com> References: <47FAAFCD.4060803@linux.vnet.ibm.com> <47FB3AD9.9050504@linux.vnet.ibm.com> Message-ID: <47FBACC8.3070003@linux.vnet.ibm.com> >> >> I think there's a few testcase issues here: >> >> 1) In XenKvmLib/rasd.py: >> >> Globals.logger.error("Returned %s instead of %s or %s", \ >> assoc_info['AllocationUnits'], >> memrasd_list['AllocationUnits']) >> >> The string takes 3 arguments, but only 2 are given. The third >> argument should be removed. > I had sent a patch for this On March26 *"Fixing: The syntax error and > the removing the extra parameter in certain functions"* , for the > arguments problem. > I dont find this in the tree yet. >> The patch you're referring to is in the tree. However, the patch only fixed the issue with the "VirtualQuantity" error message in verify_memrasd_values(). verify_memrasd_values() still has an issue with the "AllocationUnits" related error message. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 8 17:47:14 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 08 Apr 2008 10:47:14 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Change KVM default network type to bridge In-Reply-To: <6ec8fdc414f8c86160a8.1207647500@elm3b197.beaverton.ibm.com> References: <6ec8fdc414f8c86160a8.1207647500@elm3b197.beaverton.ibm.com> Message-ID: <47FBAFA2.6090802@linux.vnet.ibm.com> Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1207647488 25200 > # Node ID 6ec8fdc414f8c86160a8c578465901c77e8cfcc0 > # Parent 851b6729397e782b7ac6fbadee849ee7da9b16d3 > [TEST] Change KVM default network type to bridge > > The original 'user' is not listed in provider code for valid check. > (Consider update provider, too?) This is a good change, but it would also be good to have a separate test case that uses "user" as the network type. The test case will fail for now, which will allow us to keep track of the issue. Would you be interested in writing such a case? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 8 17:48:43 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 08 Apr 2008 10:48:43 -0700 Subject: [Libvirt-cim] Test report on KVM In-Reply-To: <47FB5B6A.8080808@linux.vnet.ibm.com> References: <47FAAFCD.4060803@linux.vnet.ibm.com> <47FB3AD9.9050504@linux.vnet.ibm.com> <47FB5B6A.8080808@linux.vnet.ibm.com> Message-ID: <47FBAFFB.2070407@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > sorry, my mistake. I did not have the latest cimtest tree on my machine. > I see the rasd.py changes in after using the latest changes. > > Thanks and Regards, > Deepti. > Sorry Deepti - I didn't see this mail. I replied to your previous one. =) -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 8 18:10:51 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 08 Apr 2008 11:10:51 -0700 Subject: [Libvirt-cim] [PATCH] [TEST]Removing the set_bridge() function from the XenFVXML file In-Reply-To: <7b3c5acdddf0cb83c813.1207651829@dkalaker> References: <7b3c5acdddf0cb83c813.1207651829@dkalaker> Message-ID: <47FBB52B.1030903@linux.vnet.ibm.com> Deepti B. Kalakeri wrote: > # HG changeset patch > # User Deepti B. Kalakeri > # Date 1207651811 -19800 > # Node ID 7b3c5acdddf0cb83c8135903b5148962a32cab81 > # Parent 851b6729397e782b7ac6fbadee849ee7da9b16d3 > [TEST]Removing the set_bridge() function from the XenFVXML file. > > This is not required as set_vbridge() of XenFVXML can be used for the same. > > Signed-off-by: Deepti B. Kalakeri > > diff -r 851b6729397e -r 7b3c5acdddf0 suites/libvirt-cim/lib/XenKvmLib/vxml.py > --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Apr 07 08:27:46 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Apr 08 16:20:11 2008 +0530 > @@ -544,7 +544,6 @@ class XenFVXML(VirtXML): > > interface = self.add_sub_node(devices, 'interface', type=net_type) > self.add_sub_node(interface, 'mac', address=net_mac) > - self.set_bridge(CIM_IP) > > disk = self.add_sub_node(devices, 'disk', type='file') > self.add_sub_node(disk, 'source', file=disk_img) > I don't understand the need for this change. _devices() gets called as part of the __init__ for the class. It generates the source tag in for the guest's XML. Removing this would mean the interface type is set to bridge, but then the bridge isn't set properly. Here's the difference in XML generated: With the patch: Without the patch: I am able to define both XMLs just fine. Here's the values returned from dumpxml: With the patch: Without the patch: For the sake of consistency, since we define the interface type as bridge, I think we should set the bridge. Otherwise, the interface is really just an ethernet type interface since we don't specify the bridge properly. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 8 18:38:51 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 08 Apr 2008 11:38:51 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Adding 05_RAPF_err.py to verify RAPF In-Reply-To: <47FB1324.7000307@linux.vnet.ibm.com> References: <0142551c8d3cf5f2a3bb.1207303063@dkalaker> <87fxu1ad7f.fsf@caffeine.beaverton.ibm.com> <47FB1324.7000307@linux.vnet.ibm.com> Message-ID: <47FBBBBB.3030408@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > > > Dan Smith wrote: >> DK> +def check_bridge_name(bridgename): >> DK> + bridge_list = live.available_bridges(server) >> DK> + vbr = None DK> + if bridgename in bridge_list: >> DK> + import random >> DK> + vbr = bridgename + str(random.randint(1, 100)) >> DK> + if vbr in bridge_list: >> DK> + logger.error('Need to give different bridge name >> since it already exists') >> DK> + return None >> DK> + else: >> DK> + vbr = bridgename >> DK> + return vbr >> >> I think this would make a lot more sense as: >> >> def get_unique_bridge(): >> bridge = "invalid-bridge" >> while bridge not in live.available_bridges(): >> bridge += str(random.randint(1,100)) >> return bridge >> >> > Ok , will modify this. >> DK> + if virt != 'XenFV': >> DK> + bridge = vsxml.set_vbridge(server) >> >> Can you explain why this special case exists? >> >> > The network information for the XenFV is getting assigned by default. > The def _devices(): section of the XenFV is calling the > > self.set_bridge(CIM_IP) and hence the bridge information is getting > assigned by default. > While this is not the case with the Xen and KVM. KVM also calls set_bridge() in the _devices() call. Xen does not, but the _devices() call for Xen sets the interface as an ethernet type. So there's no need to set a bridge for the Xen case. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From grendel at linux.vnet.ibm.com Tue Apr 8 19:00:11 2008 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 08 Apr 2008 15:00:11 -0400 Subject: [Libvirt-cim] [PATCH 2 of 2] Change how processors are represented using RASD In-Reply-To: Message-ID: # HG changeset patch # User Jay Gagnon # Date 1207668726 14400 # Node ID ddbd91b1f796acc59db18997ded9faf8ebf14006 # Parent ade926a6ad096be7c1bebab3eb7ac4080aac9088 Change how processors are represented using RASD. We currently do one RASD per processor per domain, but it looks like that isn't going to work very well with how we do scheduling, so this switches the "read" representation over to one RASD per domain, with VirtualQuantity set appropriately. Signed-off-by: Jay Gagnon diff -r ade926a6ad09 -r ddbd91b1f796 libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Mon Apr 07 14:31:06 2008 -0400 +++ b/libxkutil/device_parsing.c Tue Apr 08 11:32:06 2008 -0400 @@ -337,7 +337,6 @@ static int parse_vcpu_device(xmlNode *no struct virt_device *list = NULL; char *count_str; int count; - int i; count_str = get_node_content(node); if (count_str == NULL) @@ -347,24 +346,15 @@ static int parse_vcpu_device(xmlNode *no free(count_str); - list = calloc(count, sizeof(*list)); + list = calloc(1, sizeof(*list)); if (list == NULL) goto err; - - for (i = 0; i < count; i++) { - struct virt_device *vdev = &list[i]; - struct vcpu_device *cdev = &vdev->dev.vcpu; - - cdev->number = i; - - vdev->type = CIM_RES_TYPE_PROC; - if (asprintf(&vdev->id, "%i", i) == -1) - vdev->id = NULL; - } + + list->dev.vcpu.quantity = count; *vdevs = list; - return count; + return 1; err: free(list); @@ -620,7 +610,7 @@ struct virt_device *virt_device_dup(stru dev->dev.mem.size = _dev->dev.mem.size; dev->dev.mem.maxsize = _dev->dev.mem.maxsize; } else if (dev->type == CIM_RES_TYPE_PROC) { - dev->dev.vcpu.number = _dev->dev.vcpu.number; + dev->dev.vcpu.quantity = _dev->dev.vcpu.quantity; } else if (dev->type == CIM_RES_TYPE_EMU) { DUP_FIELD(dev, _dev, dev.emu.path); } else if (dev->type == CIM_RES_TYPE_GRAPHICS) { @@ -672,6 +662,32 @@ static int _get_mem_device(const char *x return 1; } +static int _get_proc_device(const char *xml, struct virt_device **list) +{ + struct virt_device *proc_devs = NULL; + struct virt_device *proc_dev = NULL; + int ret; + + ret = parse_devices(xml, &proc_devs, CIM_RES_TYPE_PROC); + if (ret <= 0) + return ret; + + proc_dev = malloc(sizeof(*proc_dev)); + if (proc_dev == NULL) + return 0; + + memset(proc_dev, 0, sizeof(*proc_dev)); + + proc_dev->type = CIM_RES_TYPE_PROC; + proc_dev->id = strdup("proc"); + proc_dev->dev.vcpu.quantity = proc_devs[0].dev.vcpu.quantity; + *list = proc_dev; + + cleanup_virt_devices(&proc_devs, ret); + + return 1; +}; + int get_devices(virDomainPtr dom, struct virt_device **list, int type) { char *xml; @@ -683,6 +699,8 @@ int get_devices(virDomainPtr dom, struct if (type == CIM_RES_TYPE_MEM) ret = _get_mem_device(xml, list); + else if (type == CIM_RES_TYPE_PROC) + ret = _get_proc_device(xml, list); else ret = parse_devices(xml, list, type); diff -r ade926a6ad09 -r ddbd91b1f796 libxkutil/device_parsing.h --- a/libxkutil/device_parsing.h Mon Apr 07 14:31:06 2008 -0400 +++ b/libxkutil/device_parsing.h Tue Apr 08 11:32:06 2008 -0400 @@ -50,7 +50,7 @@ struct mem_device { }; struct vcpu_device { - uint32_t number; + uint32_t quantity; }; struct emu_device { diff -r ade926a6ad09 -r ddbd91b1f796 src/Virt_RASD.c --- a/src/Virt_RASD.c Mon Apr 07 14:31:06 2008 -0400 +++ b/src/Virt_RASD.c Tue Apr 08 11:32:06 2008 -0400 @@ -168,6 +168,9 @@ static CMPIInstance *rasd_from_vdev(cons (CMPIValue *)&dev->dev.mem.size, CMPI_uint64); CMSetProperty(inst, "Limit", (CMPIValue *)&dev->dev.mem.maxsize, CMPI_uint64); + } else if (dev->type == CIM_RES_TYPE_PROC) { + CMSetProperty(inst, "VirtualQuantity", + (CMPIValue *)&dev->dev.vcpu.quantity, CMPI_uint32); } /* FIXME: Put the HostResource in place */ From grendel at linux.vnet.ibm.com Tue Apr 8 19:00:09 2008 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 08 Apr 2008 15:00:09 -0400 Subject: [Libvirt-cim] [PATCH 0 of 2] [RFC] First steps in new processor RASD behavior Message-ID: Just want to get this out before I start in on the resource add/mod/del stuff, to see if I'm on the right track. The idea here is that we are not supporting processor pinning, will support scheduling (weight/limit attributes), and are making Processor RASDs one-per-domain. Does this look sane? From grendel at linux.vnet.ibm.com Tue Apr 8 19:00:10 2008 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 08 Apr 2008 15:00:10 -0400 Subject: [Libvirt-cim] [PATCH 1 of 2] Remove processor pinning RASD code In-Reply-To: Message-ID: # HG changeset patch # User Jay Gagnon # Date 1207593066 14400 # Node ID ade926a6ad096be7c1bebab3eb7ac4080aac9088 # Parent 707113ae82b8cff34acaa1808c0ddb89237e3d31 Remove processor pinning RASD code We have decided to support domain scheduling but not CPU pinning, since it's a nightmare CIM-wise, and not exactly fun elsewise. This means we need to take the pinnning representation support out of the tree. Signed-off-by: Jay Gagnon diff -r 707113ae82b8 -r ade926a6ad09 src/Virt_RASD.c --- a/src/Virt_RASD.c Fri Apr 04 08:58:29 2008 -0700 +++ b/src/Virt_RASD.c Mon Apr 07 14:31:06 2008 -0400 @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -93,191 +92,6 @@ char *rasd_to_xml(CMPIInstance *rasd) { /* FIXME: Remove this */ return NULL; -} - -static bool proc_get_physical_ref(const CMPIBroker *broker, - uint32_t physnum, - struct inst_list *list) -{ - CMPIObjectPath *op = NULL; - CMPIStatus s; - char hostname[255]; - char *devid = NULL; - CMPIInstance *inst; - bool result = false; - - if (asprintf(&devid, "%i", physnum) == -1) { - CU_DEBUG("Failed to create DeviceID string"); - goto out; - } - - if (gethostname(hostname, sizeof(hostname)) == -1) { - CU_DEBUG("Hostname overflow"); - goto out; - } - - op = CMNewObjectPath(broker, "root/cimv2", "Linux_Processor", &s); - if ((op == NULL) || (s.rc != CMPI_RC_OK)) { - CU_DEBUG("Failed to get ObjectPath for processor"); - goto out; - } - - inst = CMNewInstance(broker, op, &s); - if ((inst == NULL) || (s.rc != CMPI_RC_OK)) { - CU_DEBUG("Failed to make instance"); - goto out; - } - - CMSetProperty(inst, "CreationClassName", - (CMPIValue *)"Linux_Processor", CMPI_chars); - CMSetProperty(inst, "SystemName", - (CMPIValue *)hostname, CMPI_chars); - CMSetProperty(inst, "SystemCreationClassName", - (CMPIValue *)"Linux_ComputerSystem", CMPI_chars); - CMSetProperty(inst, "DeviceID", - (CMPIValue *)devid, CMPI_chars); - - inst_list_add(list, inst); - - result = true; - out: - free(devid); - - return result; -} - -static uint32_t proc_set_cpu(const CMPIBroker *broker, - virNodeInfoPtr node, - virDomainPtr dom, - struct virt_device *dev, - struct inst_list *list) -{ - virVcpuInfoPtr vinfo = NULL; - virDomainInfo info; - uint8_t *cpumaps = NULL; - int ret; - int i; - int vcpu = dev->dev.vcpu.number; - int maplen = VIR_CPU_MAPLEN(VIR_NODEINFO_MAXCPUS(*node)); - - ret = virDomainGetInfo(dom, &info); - if (ret == -1) { - CU_DEBUG("Failed to get info for domain `%s'", - virDomainGetName(dom)); - goto out; - } - - if (dev->dev.vcpu.number >= info.nrVirtCpu) { - CU_DEBUG("VCPU %i higher than max of %i for %s", - dev->dev.vcpu.number, - info.nrVirtCpu, - virDomainGetName(dom)); - goto out; - } - - vinfo = calloc(info.nrVirtCpu, sizeof(*vinfo)); - if (vinfo == NULL) { - CU_DEBUG("Failed to allocate memory for %i virVcpuInfo", - info.nrVirtCpu); - goto out; - } - - cpumaps = calloc(info.nrVirtCpu, maplen); - if (cpumaps == NULL) { - CU_DEBUG("Failed to allocate memory for %ix%i maps", - info.nrVirtCpu, maplen); - goto out; - } - - ret = virDomainGetVcpus(dom, vinfo, info.nrVirtCpu, cpumaps, maplen); - if (ret < info.nrVirtCpu) { - CU_DEBUG("Failed to get VCPU info for %s", - virDomainGetName(dom)); - goto out; - } - - for (i = 0; i < VIR_NODEINFO_MAXCPUS(*node); i++) { - if (VIR_CPU_USABLE(cpumaps, maplen, vcpu, i)) { - CU_DEBUG("VCPU %i pinned to physical %i", - vcpu, i); - proc_get_physical_ref(broker, i, list); - } else { - CU_DEBUG("VCPU %i not pinned to physical %i", - vcpu, i); - } - } - out: - free(vinfo); - free(cpumaps); - - return 0; -} - -static CMPIStatus proc_rasd_from_vdev(const CMPIBroker *broker, - struct virt_device *dev, - const char *host, - const CMPIObjectPath *ref, - CMPIInstance *inst) -{ - virConnectPtr conn = NULL; - virDomainPtr dom = NULL; - virNodeInfo node; - CMPIStatus s; - CMPIArray *array; - struct inst_list list; - - inst_list_init(&list); - - conn = connect_by_classname(broker, CLASSNAME(ref), &s); - if (conn == NULL) { - cu_statusf(broker, &s, - CMPI_RC_ERR_FAILED, - "Failed to connect for ProcRASD (%s)", - CLASSNAME(ref)); - goto out; - } - - dom = virDomainLookupByName(conn, host); - if (dom == NULL) { - cu_statusf(broker, &s, - CMPI_RC_ERR_NOT_FOUND, - "Unable to get domain for ProcRASD: %s", host); - goto out; - } - - if (virNodeGetInfo(virDomainGetConnect(dom), &node) == -1) { - cu_statusf(broker, &s, - CMPI_RC_ERR_FAILED, - "Unable to get node info"); - goto out; - } - - proc_set_cpu(broker, &node, dom, dev, &list); - - if (list.cur > 0) { - int i; - - array = CMNewArray(broker, - list.cur, - CMPI_instance, - &s); - for (i = 0; i < list.cur; i++) { - CMSetArrayElementAt(array, - i, - (CMPIValue *)&list.list[i], - CMPI_instance); - } - - CMSetProperty(inst, "HostResource", - (CMPIValue *)&array, CMPI_instanceA); - } - - out: - inst_list_free(&list); - virDomainFree(dom); - virConnectClose(conn); - - return s; } static CMPIInstance *rasd_from_vdev(const CMPIBroker *broker, @@ -354,8 +168,6 @@ static CMPIInstance *rasd_from_vdev(cons (CMPIValue *)&dev->dev.mem.size, CMPI_uint64); CMSetProperty(inst, "Limit", (CMPIValue *)&dev->dev.mem.maxsize, CMPI_uint64); - } else if (dev->type == CIM_RES_TYPE_PROC) { - proc_rasd_from_vdev(broker, dev, host, ref, inst); } /* FIXME: Put the HostResource in place */ From kaitlin at linux.vnet.ibm.com Tue Apr 8 19:49:28 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 08 Apr 2008 12:49:28 -0700 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting]Adding 05_RAPF_err.py to verify RAPF In-Reply-To: <6e8932e6628a5475b39e.1207651999@dkalaker> References: <6e8932e6628a5475b39e.1207651999@dkalaker> Message-ID: <47FBCC48.9040404@linux.vnet.ibm.com> > +def setup_env(): > + vsxml_info = None > + if virt == "Xen": > + test_disk = "xvda" > + else: > + test_disk = "hda" > + > + virt_xml = get_class(virt) > + vsxml_info = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, disk = test_disk) > + bridge = vsxml_info.set_vbridge(server) I agree with Dan's comment on the first version of this patch: + if virt != 'XenFV': + bridge = vsxml.set_vbridge(server) Having this as a special case is confusing. However, the new version of the patch has a bug. This test works fine for Xen, but it does not work for KVM or XenFV. Please be sure to run the test against all of the platforms the test supports before submitting. The reason this fails for KVM and XenFV is because the bridge is already defined, and the call to set_vbridge() adds another bridge tag to the XML. The XML ends up looking something like: I'd recommend adding a function to vxml.py that allows you to check whether the bridge value is already set. There's a fair number of set_ functions in vxml.py, so I think it would make sense to add this as a get_ function. You can probably utilize get_node() and toprettyxml() to return the value of the bridge. If a bridge isn't set, you could return None. Thoughts? Also, instead of using [Resubmitting] in the subject, please use a version number. The libvirt-cim project uses this convention - it's helpful in determining which patch is the most recent version. The subject of the next revision of this patch could be "[TEST] #3 Adding 05_RAPF_err.py to verify RAPF". Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 8 19:56:59 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 08 Apr 2008 12:56:59 -0700 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting]Adding 05_RAPF_err.py to verify RAPF In-Reply-To: <47FBCC48.9040404@linux.vnet.ibm.com> References: <6e8932e6628a5475b39e.1207651999@dkalaker> <47FBCC48.9040404@linux.vnet.ibm.com> Message-ID: <47FBCE0B.5010203@linux.vnet.ibm.com> > > I'd recommend adding a function to vxml.py that allows you to check > whether the bridge value is already set. There's a fair number of set_ > functions in vxml.py, so I think it would make sense to add this as a > get_ function. > > You can probably utilize get_node() and toprettyxml() to return the > value of the bridge. If a bridge isn't set, you could return None. > Thoughts? > Oops - my mistake. There's a xml_get_net_type() function that would probably work well for this. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 8 20:03:15 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 08 Apr 2008 13:03:15 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing the 02_hostsystem_to_rasd.py tc In-Reply-To: <4b2bfa729df71d618e7b.1207657458@dkalaker> References: <4b2bfa729df71d618e7b.1207657458@dkalaker> Message-ID: <47FBCF83.9090407@linux.vnet.ibm.com> > def main(): > options = main.options > log_param() > + global vsxml It's probably a good idea to pass vsxml in as an argument than to declare it as a global. It can be unclear when the value gets set; passing the value in as an argument helps cleanup up this confusion. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 8 20:11:01 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 08 Apr 2008 13:11:01 -0700 Subject: [Libvirt-cim] [PATCH] [TEST]Fixing verify_memrasd_values() of rasd.py In-Reply-To: <37016dd67bef77cc50d1.1207657735@dkalaker> References: <37016dd67bef77cc50d1.1207657735@dkalaker> Message-ID: <47FBD155.3050908@linux.vnet.ibm.com> Deepti B. Kalakeri wrote: > # HG changeset patch > # User Deepti B. Kalakeri > # Date 1207657724 -19800 > # Node ID 37016dd67bef77cc50d114578c239d8197d4de84 > # Parent 4b2bfa729df71d618e7bc8e3b1b89eacf86c419b > [TEST]Fixing verify_memrasd_values() of rasd.py. > > Removed the extra format string in the log stmt. > > Signed-off-by: Deepti B. Kalakeri > Thanks Deepti - this resolved all of the python interpreter related issues I was seeing (which Dan also saw during his run). -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 8 20:12:46 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 08 Apr 2008 13:12:46 -0700 Subject: [Libvirt-cim] Test report on KVM In-Reply-To: <87ej9gbdg4.fsf@caffeine.beaverton.ibm.com> References: <47FAAFCD.4060803@linux.vnet.ibm.com> <87ej9gbdg4.fsf@caffeine.beaverton.ibm.com> Message-ID: <47FBD1BE.1070001@linux.vnet.ibm.com> > KR> ERROR:TEST LOG:ClassName Mismatch > KR> ERROR:TEST LOG:Returned Xen_VirtualSystemMigrationSettingData instead > KR> of KVM_VirtualSystemMigrationSettingData > > Wow, really? That's interesting. On my system: > > wbemcli ein http://root:password at localhost/root/virt:KVM_VirtualSystemMigrationSettingData > localhost:5988/root/virt:KVM_VirtualSystemMigrationSettingData.InstanceID="MigrationSettingData" > > Which looks right to me. > > The test does the silly eval() thing in the enumclass call, so maybe > something is getting defaulted back to the Xen_ type. Yes, I think this is a test case error. The above wbemcli command works for me as well. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Tue Apr 8 21:38:50 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 08 Apr 2008 14:38:50 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [RFC] First steps in new processor RASD behavior In-Reply-To: (Jay Gagnon's message of "Tue, 08 Apr 2008 15:00:09 -0400") References: Message-ID: <878wzo3u39.fsf@caffeine.beaverton.ibm.com> JG> Just want to get this out before I start in on the resource JG> add/mod/del stuff, to see if I'm on the right track. The idea JG> here is that we are not supporting processor pinning, will support JG> scheduling (weight/limit attributes), and are making Processor JG> RASDs one-per-domain. Does this look sane? I haven't tested it yet (I can tomorrow), but this looks sane to me. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Tue Apr 8 23:19:13 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 08 Apr 2008 16:19:13 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [RFC] First steps in new processor RASD behavior In-Reply-To: References: Message-ID: <47FBFD71.4020103@linux.vnet.ibm.com> Jay Gagnon wrote: > Just want to get this out before I start in on the resource add/mod/del stuff, to see if I'm on the right track. The idea here is that we are not supporting processor pinning, will support scheduling (weight/limit attributes), and are making Processor RASDs one-per-domain. Does this look sane? > This looks good to me. +1 Some of the Processor and EAFP tests fail due to these changes, but this is because the tests are expecting the InstanceID for the device to be / instead of /proc. The commit log for the second patch is a bit misleading, since you're changing device_parsing.c which also impacts Virt_Device. But otherwise, this tests fine for me. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From yunguol at cn.ibm.com Wed Apr 9 02:19:56 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 08 Apr 2008 19:19:56 -0700 Subject: [Libvirt-cim] [PATCH] [TEST].2# fix domain created error in RASD.01 Message-ID: # HG changeset patch # User Guolian Yun # Date 1207707589 25200 # Node ID bee8c36f919afa0c9e82f747f5b7cd2c0e596858 # Parent 262153788503c8b10c76c77719bba081df9a7b88 [TEST].2# fix domain created error in RASD.01 Signed-off-by: Guolian Yun diff -r 262153788503 -r bee8c36f919a suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py --- a/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Tue Apr 08 17:58:44 2008 +0530 +++ b/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Tue Apr 08 19:19:49 2008 -0700 @@ -54,11 +54,13 @@ from XenKvmLib.test_doms import destroy_ from XenKvmLib.test_doms import destroy_and_undefine_all import XenKvmLib from XenKvmLib import assoc +from XenKvmLib import vxml from XenKvmLib.vxml import XenXML, KVMXML, get_class from XenKvmLib.classes import get_typed_class from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \ verify_diskrasd_values, verify_memrasd_values from CimTest.Globals import log_param, logger +from CimTest.ReturnCodes import PASS, FAIL sup_types = ['Xen', 'KVM', 'XenFV'] @@ -66,9 +68,8 @@ test_vcpus = 1 test_vcpus = 1 test_mem = 128 test_mac = "00:11:22:33:44:aa" -test_disk = 'xvda' -def init_list(virt="Xen"): +def init_list(xml, disk, virt="Xen"): """ Creating the lists that will be used for comparisons. """ @@ -86,9 +87,9 @@ def init_list(virt="Xen"): "CreationClassName": get_typed_class(virt, 'NetResourceAllocationSettingData') } - address = vsxml.xml_get_disk_source() + address = xml.xml_get_disk_source() diskrasd = { - "InstanceID" : '%s/%s' %(test_dom, test_disk), \ + "InstanceID" : '%s/%s' %(test_dom, disk), \ "ResourceType" : 17, \ "Address" : address, \ "CreationClassName": get_typed_class(virt, 'DiskResourceAllocationSettingData') @@ -102,8 +103,8 @@ def init_list(virt="Xen"): } return procrasd, netrasd, diskrasd, memrasd -def assoc_values(ip, assoc_info, virt="Xen"): - procrasd, netrasd, diskrasd, memrasd = init_list(virt) +def assoc_values(ip, assoc_info, xml, disk, virt="Xen"): + procrasd, netrasd, diskrasd, memrasd = init_list(xml, disk, virt) proc_status = 1 net_status = 0 disk_status = 1 @@ -133,28 +134,22 @@ def assoc_values(ip, assoc_info, virt="X @do_main(sup_types) def main(): - global vsxml options = main.options status = 0 rc = 1 log_param() destroy_and_undefine_all(options.ip) - vsxml = get_class(options.virt)(test_dom, \ - mem=test_mem, \ - vcpus = test_vcpus, \ - mac = test_mac, \ - disk = test_disk) - try: - rc = vsxml.define(options.ip) - sc = vsxml.start(options.ip) - if rc == 0 or sc == 0: - logger.error("Define or start domain failed") - status = 1 - except Exception, details: - logger.error("Unknonw exception happened") - logger.error("Exception : %s" % details) - status = 1 - + if options.virt == 'Xen': + test_disk = 'xvda' + else: + test_disk = 'hda' + + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom, mem=test_mem, vcpus = test_vcpus, mac = test_mac, disk = test_disk) + ret = cxml.create(options.ip) + if not ret: + logger.error('Unable to create domain %s' % test_dom) + return FAIL if status == 1: destroy_and_undefine_all(options.ip) return 1 @@ -169,7 +164,7 @@ def main(): 'VirtualSystemSettingData', \ options.virt, \ InstanceID = instIdval) - status = assoc_values(options.ip, assoc_info, options.virt) + status = assoc_values(options.ip, assoc_info, cxml, test_disk, options.virt) except Exception, details: logger.error(Globals.CIM_ERROR_ASSOCIATORS, \ get_typed_class(options.virt, 'VirtualSystemSettingDataComponent')) @@ -177,8 +172,8 @@ def main(): status = 1 try: - vsxml.destroy(options.ip) - vsxml.undefine(options.ip) + cxml.destroy(options.ip) + cxml.undefine(options.ip) except Exception: logger.error("Destroy or undefine domain failed") return status From zli at linux.vnet.ibm.com Wed Apr 9 02:57:39 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Tue, 08 Apr 2008 19:57:39 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Change default KVM emulator to qemu-kvm Message-ID: # HG changeset patch # User Zhengang Li # Date 1207709819 25200 # Node ID b5857217c64a081450cd21219035084eac455d85 # Parent 262153788503c8b10c76c77719bba081df9a7b88 [TEST] Change default KVM emulator to qemu-kvm We're more close to KVM full coverage support. It makes sense to set the default emulator to a real one instead of a pure-qemu version. Signed-off-by: Zhengang Li diff -r 262153788503 -r b5857217c64a suites/libvirt-cim/lib/XenKvmLib/const.py --- a/suites/libvirt-cim/lib/XenKvmLib/const.py Tue Apr 08 17:58:44 2008 +0530 +++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Tue Apr 08 19:56:59 2008 -0700 @@ -43,7 +43,7 @@ Xen_default_net_type = 'ethernet' # vxml.KVMXML -KVM_default_emulator = '/usr/bin/qemu' +KVM_default_emulator = '/usr/bin/qemu-kvm' KVM_disk_path = os.path.join(_image_dir, 'default-kvm-dimage') KVM_secondary_disk_path = os.path.join(_image_dir, 'default-kvm-dimage.2ND') KVM_default_disk_dev = 'hda' From yunguol at cn.ibm.com Wed Apr 9 05:14:33 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 08 Apr 2008 22:14:33 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] [TEST] fix RASD.01 AllocationUnits Mismatch In-Reply-To: Message-ID: <9d4ae22e0a0895b87e9b.1207718073@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207717805 25200 # Node ID 9d4ae22e0a0895b87e9b068b41970eee8999dbb1 # Parent 262153788503c8b10c76c77719bba081df9a7b88 [TEST] fix RASD.01 AllocationUnits Mismatch Signed-off-by: Guolian Yun diff -r 262153788503 -r 9d4ae22e0a08 suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py --- a/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Tue Apr 08 17:58:44 2008 +0530 +++ b/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Tue Apr 08 22:10:05 2008 -0700 @@ -96,7 +96,7 @@ def init_list(virt="Xen"): memrasd = { "InstanceID" : '%s/%s' %(test_dom, "mem"), \ "ResourceType" : 4, \ - "AllocationUnits" : "MegaBytes",\ + "AllocationUnits" : "KiloBytes",\ "VirtualQuantity" : (test_mem * 1024), \ "CreationClassName": get_typed_class(virt, 'MemResourceAllocationSettingData') } From yunguol at cn.ibm.com Wed Apr 9 05:14:35 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 08 Apr 2008 22:14:35 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] fix AllocationUnits Mismatch in VSSD.04 In-Reply-To: Message-ID: <8751a1a252ef81ddd69e.1207718075@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207718023 25200 # Node ID 8751a1a252ef81ddd69e7a256ab1dad4b27e66b6 # Parent 4e4f7f4bdd5028720f16dec6bed005f5239ab0d6 [TEST] fix AllocationUnits Mismatch in VSSD.04 Signed-off-by: Guolian Yun diff -r 4e4f7f4bdd50 -r 8751a1a252ef suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py --- a/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Tue Apr 08 22:11:54 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Tue Apr 08 22:13:43 2008 -0700 @@ -105,7 +105,7 @@ def init_list(virt): memrasd = { "InstanceID" : '%s/%s' %(test_dom, "mem"), "ResourceType" : 4, - "AllocationUnits" : "MegaBytes", + "AllocationUnits" : "KiloBytes", "VirtualQuantity" : (test_mem * 1024), "CreationClassName": get_typed_class(virt, 'MemResourceAllocationSettingData') } From yunguol at cn.ibm.com Wed Apr 9 05:14:32 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 08 Apr 2008 22:14:32 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] [TEST] fix memory AllocationUnits Mismatch Message-ID: Signed-off-by: Guolian Yun From yunguol at cn.ibm.com Wed Apr 9 05:14:34 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 08 Apr 2008 22:14:34 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] fix AllocationUnits Mismatch in RASD.02 In-Reply-To: Message-ID: <4e4f7f4bdd5028720f16.1207718074@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207717914 25200 # Node ID 4e4f7f4bdd5028720f16dec6bed005f5239ab0d6 # Parent 9d4ae22e0a0895b87e9b068b41970eee8999dbb1 [TEST] fix AllocationUnits Mismatch in RASD.02 Signed-off-by: Guolian Yun diff -r 9d4ae22e0a08 -r 4e4f7f4bdd50 suites/libvirt-cim/cimtest/RASD/02_enum.py --- a/suites/libvirt-cim/cimtest/RASD/02_enum.py Tue Apr 08 22:10:05 2008 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/02_enum.py Tue Apr 08 22:11:54 2008 -0700 @@ -73,7 +73,7 @@ def init_list(virt="Xen"): memrasd = { "InstanceID" : '%s/%s' %(test_dom, "mem"), \ "ResourceType" : 4, \ - "AllocationUnits" : "MegaBytes",\ + "AllocationUnits" : "KiloBytes",\ "VirtualQuantity" : (test_mem * 1024), \ "CreationClassName": get_typed_class(virt, 'MemResourceAllocationSettingData') } From yunguol at cn.ibm.com Wed Apr 9 05:44:40 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 08 Apr 2008 22:44:40 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] fix VirtualSystemSnapshotServiceCapabilities.02 to reflect the recent lib changes Message-ID: <23b6feafdf89d992a636.1207719880@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207719860 25200 # Node ID 23b6feafdf89d992a636793bf6ec9d0c621bf69c # Parent 262153788503c8b10c76c77719bba081df9a7b88 [TEST] fix VirtualSystemSnapshotServiceCapabilities.02 to reflect the recent lib changes Signed-off-by: Guolian Yun diff -r 262153788503 -r 23b6feafdf89 suites/libvirt-cim/cimtest/VirtualSystemSnapshotServiceCapabilities/01_enum.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSnapshotServiceCapabilities/01_enum.py Tue Apr 08 17:58:44 2008 +0530 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSnapshotServiceCapabilities/01_enum.py Tue Apr 08 22:44:20 2008 -0700 @@ -42,9 +42,8 @@ def main(): try: vs_sservicecap = enumclass.enumerate_inst(options.ip, - eval('enumclass.' + \ - get_typed_class(options.virt, \ - "VirtualSystemSnapshotServiceCapabilities"))) + "VirtualSystemSnapshotServiceCapabilities", + options.virt) except Exception, detail: logger.error(CIM_ERROR_ENUMERATE, cn) logger.error("Exception: %s", detail) From deeptik at linux.vnet.ibm.com Wed Apr 9 07:17:54 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 09 Apr 2008 12:47:54 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fixing 02_hostsystem_to_rasd.py tc Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207725464 -19800 # Node ID cc4020f5ed18fa1134b8c63c3c9f9f828d3df23f # Parent 262153788503c8b10c76c77719bba081df9a7b88 [TEST] #2 Fixing 02_hostsystem_to_rasd.py tc. 1) Fixed the tc failure. 2) Removed ununsed import stmt. 3) updated it to use the xml_get_disk_source() to get disk info. 4) Removed the global declaration of the vsxml and passed it as arguement where req. 5) changed the init_list() to use get_typed_class(). Signed-off-by: Deepti B. Kalakeri diff -r 262153788503 -r cc4020f5ed18 suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py --- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Tue Apr 08 17:58:44 2008 +0530 +++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Wed Apr 09 12:47:44 2008 +0530 @@ -47,12 +47,10 @@ # Date : 29.01.2008 import sys -from VirtLib import utils -from CimTest import Globals from CimTest.Globals import do_main -from XenKvmLib.vxml import XenXML, KVMXML, get_class +from XenKvmLib.vxml import get_class from XenKvmLib.classes import get_typed_class -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all +from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib.assoc import Associators, AssociatorNames from XenKvmLib.common_util import get_host_info from CimTest.Globals import log_param, logger, CIM_ERROR_ASSOCIATORNAMES, \ @@ -69,38 +67,44 @@ test_mem = 128 test_mem = 128 test_mac = "00:11:22:33:44:aa" -def init_list(virt="Xen"): +def init_list(vsxml, virt="Xen"): """ Creating the lists that will be used for comparisons. """ - disk_path = "/tmp/default-%s-dimage" % virt.lower() + disk_path = vsxml.xml_get_disk_source() + proc_cn = get_typed_class(virt, "Processor") + mem_cn = get_typed_class(virt, "Memory") + net_cn = get_typed_class(virt, "NetworkPort") + disk_cn = get_typed_class(virt, "LogicalDisk") - rasd_values = {"%s_Processor" % virt : { - "InstanceID" : '%s/%s' %(test_dom,0),\ - "ResourceType" : 3,\ - }, \ - "%s_LogicalDisk" % virt: { - "InstanceID" : '%s/%s' %(test_dom, test_disk), \ - "ResourceType" : 17, \ - "Address" : disk_path, \ - }, \ - "%s_NetworkPort" % virt: { - "InstanceID" : '%s/%s' %(test_dom,test_mac), \ - "ResourceType" : 10 , \ - "ntype1": "bridge", \ - "ntype2": "ethernet", \ - }, \ - "%s_Memory"% virt: { - "InstanceID" : '%s/%s' %(test_dom, "mem"), \ - "ResourceType" : 4, \ - "AllocationUnits" : "MegaBytes",\ - "VirtualQuantity" : (test_mem * 1024), \ - } + rasd_values = { + proc_cn : { + "InstanceID" : '%s/%s' %(test_dom,0), + "ResourceType" : 3, + }, + disk_cn : { + "InstanceID" : '%s/%s' %(test_dom, test_disk), + "ResourceType" : 17, + "Address" : disk_path, + }, + net_cn : { + "InstanceID" : '%s/%s' %(test_dom,test_mac), + "ResourceType" : 10 , + "ntype1": "bridge", + "ntype2": "ethernet", + }, + mem_cn : { + "InstanceID" : '%s/%s' %(test_dom, "mem"), + "ResourceType" : 4, + "AllocationUnits" : "KiloBytes", + "VirtualQuantity" : (test_mem * 1024), + } } return rasd_values def setup_env(server, virt="Xen"): + vsxml_info = None status = PASS destroy_and_undefine_all(server) global test_disk @@ -108,23 +112,24 @@ def setup_env(server, virt="Xen"): test_disk = "xvda" else: test_disk = "hda" - - vsxml = get_class(virt)(test_dom, mem = test_mem, + virt_xml = get_class(virt) + vsxml_info = virt_xml(test_dom, mem = test_mem, vcpus=test_vcpus, mac = test_mac, disk = test_disk) - ret = vsxml.define(server) + ret = vsxml_info.define(server) if not ret: logger.error("Failed to define the dom: %s", test_dom) status = FAIL - return status + + return status, vsxml_info def print_err(err, detail, cn): logger.error(err % cn) logger.error("Exception: %s", detail) -def get_inst_from_list(server, cn, cs_list, filter_name, exp_val): +def get_inst_from_list(server, cn, cs_list, filter_name, exp_val, vsxml): status = PASS ret = -1 inst = [] @@ -135,12 +140,12 @@ def get_inst_from_list(server, cn, cs_li if ret != PASS: logger.error("%s with %s was not returned" % (cn, exp_val)) - test_domain_function(test_dom, server, "undefine") + vsxml.undefine(server) status = FAIL return status, inst -def get_assoc_info(server, cn, an, qcn, name, virt="Xen"): +def get_assoc_info(server, cn, an, qcn, name, vsxml, virt="Xen"): status = PASS assoc_info = [] try: @@ -159,11 +164,11 @@ def get_assoc_info(server, cn, an, qcn, status = FAIL if status != PASS: - test_domain_function(test_dom, server, "undefine") + vsxml.undefine(server) return status, assoc_info -def verify_RASD_values(server, sd_assoc_info, virt="Xen"): +def verify_RASD_values(server, sd_assoc_info, vsxml, virt="Xen"): in_setting_define_state = {} status = PASS try: @@ -172,7 +177,7 @@ def verify_RASD_values(server, sd_assoc_ classname_keyvalue = sd_assoc_info[i]['CreationClassName'] deviceid = sd_assoc_info[i]['DeviceID'] in_setting_define_state[classname_keyvalue] = deviceid - rasd_values = init_list(virt) + rasd_values = init_list(vsxml, virt) an = get_typed_class(virt, 'SettingsDefineState') sccn = get_typed_class(virt, 'ComputerSystem') for cn, devid in sorted(in_setting_define_state.items()): @@ -192,13 +197,13 @@ def verify_RASD_values(server, sd_assoc_ index = (len(assoc_info) - 1) rasd = rasd_values[cn] CCName = assoc_info[index].classname - if CCName == get_typed_class(virt, 'ProcResourceAllocationSettingData'): + if 'ProcResourceAllocationSettingData' in CCName: status = verify_procrasd_values(assoc_info[index], rasd) - elif CCName == get_typed_class(virt, 'NetResourceAllocationSettingData'): + elif 'NetResourceAllocationSettingData' in CCName: status = verify_netrasd_values(assoc_info[index], rasd) - elif CCName == get_typed_class(virt, 'DiskResourceAllocationSettingData'): + elif 'DiskResourceAllocationSettingData' in CCName: status = verify_diskrasd_values(assoc_info[index], rasd) - elif CCName == get_typed_class(virt, 'MemResourceAllocationSettingData'): + elif 'MemResourceAllocationSettingData' in CCName: status = verify_memrasd_values(assoc_info[index], rasd) else: status = FAIL @@ -219,16 +224,14 @@ def main(): status, host_name, classname = get_host_info(server, options.virt) if status != PASS: return status - if options.virt == "XenFV": - options.virt = "Xen" - status = setup_env(server, options.virt) - if status != PASS: + status, vsxml = setup_env(server, options.virt) + if status != PASS or vsxml == None: return status cn = classname an = get_typed_class(options.virt, 'HostedDependency') qcn = get_typed_class(options.virt, 'ComputerSystem') name = host_name - status, cs_assoc_info = get_assoc_info(server, cn, an, qcn, name, options.virt) + status, cs_assoc_info = get_assoc_info(server, cn, an, qcn, name, vsxml, options.virt) if status != PASS or len(cs_assoc_info) == 0: return status filter_name = {"key" : "Name"} @@ -236,18 +239,19 @@ def main(): cn, cs_assoc_info, filter_name, - test_dom) + test_dom, + vsxml) if status != PASS or len(cs_dom) == 0: return status cn = cs_dom['CreationClassName'] - an = '%s_SystemDevice' % options.virt + an = get_typed_class(options.virt, 'SystemDevice') qcn = 'Devices' name = test_dom - status, sd_assoc_info = get_assoc_info(server, cn, an, qcn, name, options.virt) + status, sd_assoc_info = get_assoc_info(server, cn, an, qcn, name, vsxml, options.virt) if status != PASS or len(sd_assoc_info) == 0: return status - status = verify_RASD_values(server, sd_assoc_info, options.virt) - test_domain_function(test_dom, server, "undefine") + status = verify_RASD_values(server, sd_assoc_info, vsxml, options.virt) + vsxml.undefine(server) return status if __name__ == "__main__": sys.exit(main()) From zli at linux.vnet.ibm.com Wed Apr 9 07:57:14 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Wed, 09 Apr 2008 00:57:14 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] redirect logging to /dev/null instead of stderr Message-ID: # HG changeset patch # User Zhengang Li # Date 1207727823 25200 # Node ID f58194a3271fe20b19894c9f3472164316e1ee4c # Parent b5857217c64a081450cd21219035084eac455d85 [TEST] redirect logging to /dev/null instead of stderr The original default basicConfig() added a stderr Streamhandler. The log is duplicated to both the stderr and the file log 'vsmtest.log'. Outputting all the log to the screen makes the test less easier to read. Signed-off-by: Zhengang Li diff -r b5857217c64a -r f58194a3271f lib/CimTest/Globals.py --- a/lib/CimTest/Globals.py Tue Apr 08 19:56:59 2008 -0700 +++ b/lib/CimTest/Globals.py Wed Apr 09 00:57:03 2008 -0700 @@ -50,7 +50,7 @@ CIM_PORT = "5988" NM = "TEST LOG" platform_sup = ["Xen", "KVM", "XenFV"] -logging.basicConfig() +logging.basicConfig(filename='/dev/null') logger = logging.getLogger(NM) logging.PRINT = logging.DEBUG + 50 logging.addLevelName(logging.PRINT, "PRINT") From zli at linux.vnet.ibm.com Wed Apr 9 08:05:18 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Wed, 09 Apr 2008 01:05:18 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] change AllocationCapabilities expected error string Message-ID: # HG changeset patch # User Zhengang Li # Date 1207728305 25200 # Node ID be122f36acaa24527bdc6339ed16b80526b5fcb7 # Parent f58194a3271fe20b19894c9f3472164316e1ee4c [TEST] change AllocationCapabilities expected error string On FC8 it was 'Instance not found'. Now FC9 expects 'Requested Object could not be found'. This is only a string returned from CIMOM, I'm changing this to a word used in both messages. What we really expect is the CIM_ERR_NOT_FOUND. The rc code are identical on FC8 and FC9. This fixes AllocationCapabilities.02 failures on a pegasus 2.7 CIMOM. Signed-off-by: Zhengang Li diff -r f58194a3271f -r be122f36acaa suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py --- a/suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py Wed Apr 09 00:57:03 2008 -0700 +++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py Wed Apr 09 01:05:05 2008 -0700 @@ -73,7 +73,7 @@ "invalid_instid_keyname" : { 'rc' : pywbem.CIM_ERR_FAILED, \ 'desc' : 'No InstanceID specified' }, \ "invalid_instid_keyvalue" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND, \ - 'desc' : 'Instance not found' } + 'desc' : 'found' } } def conf_file(): """ From zli at linux.vnet.ibm.com Wed Apr 9 08:18:02 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Wed, 09 Apr 2008 16:18:02 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] fix VirtualSystemSnapshotServiceCapabilities.02 to reflect the recent lib changes In-Reply-To: <23b6feafdf89d992a636.1207719880@elm3b197.beaverton.ibm.com> References: <23b6feafdf89d992a636.1207719880@elm3b197.beaverton.ibm.com> Message-ID: <47FC7BBA.3000401@linux.vnet.ibm.com> Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1207719860 25200 > # Node ID 23b6feafdf89d992a636793bf6ec9d0c621bf69c > # Parent 262153788503c8b10c76c77719bba081df9a7b88 > [TEST] fix VirtualSystemSnapshotServiceCapabilities.02 to reflect the recent lib changes > > Signed-off-by: Guolian Yun > > diff -r 262153788503 -r 23b6feafdf89 suites/libvirt-cim/cimtest/VirtualSystemSnapshotServiceCapabilities/01_enum.py > --- a/suites/libvirt-cim/cimtest/VirtualSystemSnapshotServiceCapabilities/01_enum.py Tue Apr 08 17:58:44 2008 +0530 > +++ b/suites/libvirt-cim/cimtest/VirtualSystemSnapshotServiceCapabilities/01_enum.py Tue Apr 08 22:44:20 2008 -0700 > @@ -42,9 +42,8 @@ def main(): > > try: > vs_sservicecap = enumclass.enumerate_inst(options.ip, > - eval('enumclass.' + \ > - get_typed_class(options.virt, \ > - "VirtualSystemSnapshotServiceCapabilities"))) > + "VirtualSystemSnapshotServiceCapabilities", > + options.virt) > except Exception, detail: > logger.error(CIM_ERROR_ENUMERATE, cn) > logger.error("Exception: %s", detail) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > +1. -- - Zhengang From zli at linux.vnet.ibm.com Wed Apr 9 08:22:55 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Wed, 09 Apr 2008 16:22:55 +0800 Subject: [Libvirt-cim] [PATCH 0 of 3] [TEST] fix memory AllocationUnits Mismatch In-Reply-To: References: Message-ID: <47FC7CDF.7020202@linux.vnet.ibm.com> Guo Lian Yun wrote: > Signed-off-by: Guolian Yun > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > ./cimtest/ComputerSystem/41_cs_to_settingdefinestate.py:105: "AllocationUnits" : "MegaBytes",\ ./cimtest/HostSystem/02_hostsystem_to_rasd.py:96: "AllocationUnits" : "MegaBytes",\ ./cimtest/VSSD/04_vssd_to_rasd.py:108: "AllocationUnits" : "MegaBytes", ./cimtest/RASD/02_enum.py:76: "AllocationUnits" : "MegaBytes",\ ./cimtest/RASD/01_verify_rasd_fields.py:99: "AllocationUnits" : "MegaBytes",\ HostSystem.02 is covered by a recent patch by Deepti. We still need to change ComputerSystem.41. +1 for the 3 changes Daisy made. -- - Zhengang From yunguol at cn.ibm.com Wed Apr 9 08:02:32 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 09 Apr 2008 01:02:32 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] add a tc that uses 'user' as network type, fais now, also keep track of issue In-Reply-To: Message-ID: <9fec39e06a000701e7f6.1207728152@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207728133 25200 # Node ID 9fec39e06a000701e7f6f1393fcfdffc353498c3 # Parent ca5633160e1cf78353d7b892a480f6fb5833e028 [TEST] add a tc that uses 'user' as network type, fais now, also keep track of issue Signed-off-by: Guolian Yun diff -r ca5633160e1c -r 9fec39e06a00 suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py Wed Apr 09 01:02:13 2008 -0700 @@ -0,0 +1,93 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Guolian Yun +# +# 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 tc is used to verify the properties returned by the CIM_NetworkPort +# class. +# +# Date : 09-04-2008 + +import sys +import pywbem +from XenKvmLib import const +from XenKvmLib import devices +from XenKvmLib.vxml import KVMXML +from CimTest.Globals import log_param, logger +from CimTest.Globals import do_main +from CimTest.ReturnCodes import PASS, FAIL + +sup_types = ['KVM'] + +test_dom = "test_domain" +test_mac = "00:11:22:33:44:55" + + at do_main(sup_types) +def main(): + options = main.options + log_param() + const.KVM_default_net_type = 'user' + cxml = KVMXML(test_dom, mac = test_mac) + ret = cxml.define(options.ip) + if not ret: + logger.error('Unable to define domain %s' % test_dom) + return FAIL + + devid = "%s/%s" % (test_dom, test_mac) + key_list = { 'DeviceID' : devid, + 'CreationClassName' : "KVM_NetworkPort", + 'SystemName' : test_dom, + 'SystemCreationClassName' : "KVM_ComputerSystem" + } + dev = None + + try: + dev = eval('devices.' + "KVM_NetworkPort")(options.ip, key_list) + except Exception, detail: + logger.error("Exception: %s" % detail) + cxml.undefine(options.ip) + return FAIL + + if dev == None: + logger.error("Error retrieving instance for devid %s" % devid) + cxml.undefine(options.ip) + return FAIL + + status = PASS + + addrs = dev.NetworkAddresses + if len(addrs) != 1: + logger.error("Too many NetworkAddress entries (%i instead of %i)" % \ + (len(addrs), 1)) + status = FAIL + + if addrs[0] != test_mac: + logger.error("MAC address reported incorrectly (%s instead of %s)" % \ + (addrs[0], test_mac)) + status = FAIL + + if status == FAIL: + logger.error("Checked interface %s" % test_mac) + + cxml.undefine(options.ip) + return status + +if __name__ == "__main__": + sys.exit(main()) From yunguol at cn.ibm.com Wed Apr 9 08:02:29 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 09 Apr 2008 01:02:29 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] [TEST] Add one tc using 'user' as network type Message-ID: Signed-off-by: Guolian Yun From yunguol at cn.ibm.com Wed Apr 9 08:02:31 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 09 Apr 2008 01:02:31 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] add net_type setting in device node for KVM In-Reply-To: Message-ID: # HG changeset patch # User Guolian Yun # Date 1207726933 25200 # Node ID ca5633160e1cf78353d7b892a480f6fb5833e028 # Parent e72f3a8d54c5f9e6b895f4930126acca1c97e380 [TEST] add net_type setting in device node for KVM Signed-off-by: Guolian Yun diff -r e72f3a8d54c5 -r ca5633160e1c suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 00:37:33 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 00:42:13 2008 -0700 @@ -488,12 +488,12 @@ class KVMXML(VirtXML): sys.exit(1) VirtXML.__init__(self, 'kvm', test_dom, set_uuid(), mem, vcpus) self._os() - self._devices(const.KVM_default_emulator, disk_file_path, disk, mac) + self._devices(const.KVM_default_emulator, const.KVM_default_net_type, disk_file_path, disk, mac) def _os(self): self.add_sub_node('/domain/os', 'type', 'hvm') - def _devices(self, emu, disk_img, disk_dev, net_mac): + def _devices(self, emu, net_type, disk_img, disk_dev, net_mac): devices = self.get_node('/domain/devices') self.add_sub_node(devices, 'emulator', emu) @@ -501,9 +501,10 @@ class KVMXML(VirtXML): self.add_sub_node(disk, 'source', file=disk_img) self.add_sub_node(disk, 'target', dev=disk_dev) - interface = self.add_sub_node(devices, 'interface', type='bridge') + interface = self.add_sub_node(devices, 'interface', type=net_type) self.add_sub_node(interface, 'mac', address=net_mac) - self.set_bridge(CIM_IP) + if net_type == 'bridge': + self.set_bridge(CIM_IP) def set_emulator(self, emu): return self._set_emulator(emu) From yunguol at cn.ibm.com Wed Apr 9 08:02:30 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 09 Apr 2008 01:02:30 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] [TEST] add KVM_default_net_type in const.py In-Reply-To: Message-ID: # HG changeset patch # User Guolian Yun # Date 1207726653 25200 # Node ID e72f3a8d54c5f9e6b895f4930126acca1c97e380 # Parent 262153788503c8b10c76c77719bba081df9a7b88 [TEST] add KVM_default_net_type in const.py Signed-off-by: Guolian Yun diff -r 262153788503 -r e72f3a8d54c5 suites/libvirt-cim/lib/XenKvmLib/const.py --- a/suites/libvirt-cim/lib/XenKvmLib/const.py Tue Apr 08 17:58:44 2008 +0530 +++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Wed Apr 09 00:37:33 2008 -0700 @@ -48,6 +48,7 @@ KVM_secondary_disk_path = os.path.join(_ KVM_secondary_disk_path = os.path.join(_image_dir, 'default-kvm-dimage.2ND') KVM_default_disk_dev = 'hda' KVM_default_mac = '11:22:33:aa:bb:cc' +KVM_default_net_type = 'bridge' # vxml.XenFVXML s, o = platform.architecture() From yunguol at cn.ibm.com Wed Apr 9 08:30:46 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 9 Apr 2008 16:30:46 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] Change KVM default network type to bridge In-Reply-To: <47FBAFA2.6090802@linux.vnet.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-04-09 01:47:14: > Guo Lian Yun wrote: > > # HG changeset patch > > # User Guolian Yun > > # Date 1207647488 25200 > > # Node ID 6ec8fdc414f8c86160a8c578465901c77e8cfcc0 > > # Parent 851b6729397e782b7ac6fbadee849ee7da9b16d3 > > [TEST] Change KVM default network type to bridge > > > > The original 'user' is not listed in provider code for valid check. > > (Consider update provider, too?) > > This is a good change, but it would also be good to have a separate test > case that uses "user" as the network type. The test case will fail for > now, which will allow us to keep track of the issue. > > Would you be interested in writing such a case? > I've sent a patch for this, which includes a separate test case that uses 'user' as network type and related helper functions. > -- > Kaitlin Rupert > IBM Linux Technology Center > kaitlin at linux.vnet.ibm.com > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From zli at linux.vnet.ibm.com Wed Apr 9 08:38:05 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Wed, 09 Apr 2008 16:38:05 +0800 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] add a tc that uses 'user' as network type, fais now, also keep track of issue In-Reply-To: <9fec39e06a000701e7f6.1207728152@elm3b197.beaverton.ibm.com> References: <9fec39e06a000701e7f6.1207728152@elm3b197.beaverton.ibm.com> Message-ID: <47FC806D.8050403@linux.vnet.ibm.com> Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1207728133 25200 > # Node ID 9fec39e06a000701e7f6f1393fcfdffc353498c3 > # Parent ca5633160e1cf78353d7b892a480f6fb5833e028 > [TEST] add a tc that uses 'user' as network type, fais now, also keep track of issue > > Signed-off-by: Guolian Yun > > diff -r ca5633160e1c -r 9fec39e06a00 suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py Wed Apr 09 01:02:13 2008 -0700 > @@ -0,0 +1,93 @@ > +#!/usr/bin/python > +# > +# Copyright 2008 IBM Corp. > +# > +# Authors: > +# Guolian Yun > +# > +# 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 tc is used to verify the properties returned by the CIM_NetworkPort > +# class. > +# > +# Date : 09-04-2008 > + > +import sys > +import pywbem > +from XenKvmLib import const > +from XenKvmLib import devices > +from XenKvmLib.vxml import KVMXML > +from CimTest.Globals import log_param, logger > +from CimTest.Globals import do_main > +from CimTest.ReturnCodes import PASS, FAIL > + > +sup_types = ['KVM'] > + > +test_dom = "test_domain" > +test_mac = "00:11:22:33:44:55" > + > + at do_main(sup_types) > +def main(): > + options = main.options > + log_param() > + const.KVM_default_net_type = 'user' > + cxml = KVMXML(test_dom, mac = test_mac) > + ret = cxml.define(options.ip) > + if not ret: > + logger.error('Unable to define domain %s' % test_dom) > + return FAIL > + > + devid = "%s/%s" % (test_dom, test_mac) > + key_list = { 'DeviceID' : devid, > + 'CreationClassName' : "KVM_NetworkPort", > + 'SystemName' : test_dom, > + 'SystemCreationClassName' : "KVM_ComputerSystem" > + } > + dev = None > + > + try: > + dev = eval('devices.' + "KVM_NetworkPort")(options.ip, key_list) Because this test case is limited to KVM, how about: dev = devices.KVM_NetworkPort(options.ip, key_list) +1 for the rest of the patch. > + except Exception, detail: > + logger.error("Exception: %s" % detail) > + cxml.undefine(options.ip) > + return FAIL > + > + if dev == None: > + logger.error("Error retrieving instance for devid %s" % devid) > + cxml.undefine(options.ip) > + return FAIL > + > + status = PASS > + > + addrs = dev.NetworkAddresses > + if len(addrs) != 1: > + logger.error("Too many NetworkAddress entries (%i instead of %i)" % \ > + (len(addrs), 1)) > + status = FAIL > + > + if addrs[0] != test_mac: > + logger.error("MAC address reported incorrectly (%s instead of %s)" % \ > + (addrs[0], test_mac)) > + status = FAIL > + > + if status == FAIL: > + logger.error("Checked interface %s" % test_mac) > + > + cxml.undefine(options.ip) > + return status > + > +if __name__ == "__main__": > + sys.exit(main()) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- - Zhengang From yunguol at cn.ibm.com Wed Apr 9 08:16:36 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 09 Apr 2008 01:16:36 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] fix AllocationUnits Mismatch in 41_cs_to_settingdefinestate.py Message-ID: <1cc1342a903c152e6986.1207728996@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207728990 25200 # Node ID 1cc1342a903c152e698609753317981cd07deb15 # Parent 262153788503c8b10c76c77719bba081df9a7b88 [TEST] fix AllocationUnits Mismatch in 41_cs_to_settingdefinestate.py Signed-off-by: Guolian Yun diff -r 262153788503 -r 1cc1342a903c suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Tue Apr 08 17:58:44 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Wed Apr 09 01:16:30 2008 -0700 @@ -102,7 +102,7 @@ def rasd_init_list(): mem_rasd = { "InstanceID" : '%s/%s' %(test_dom, "mem"), \ "ResourceType" : 4, \ - "AllocationUnits" : "MegaBytes",\ + "AllocationUnits" : "KiloBytes",\ "VirtualQuantity" : (test_mem * 1024), \ } rasd_values = { "Xen_Processor" : proc_rasd, \ From zli at linux.vnet.ibm.com Wed Apr 9 08:46:36 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Wed, 09 Apr 2008 16:46:36 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] fix AllocationUnits Mismatch in 41_cs_to_settingdefinestate.py In-Reply-To: <1cc1342a903c152e6986.1207728996@elm3b197.beaverton.ibm.com> References: <1cc1342a903c152e6986.1207728996@elm3b197.beaverton.ibm.com> Message-ID: <47FC826C.9030503@linux.vnet.ibm.com> Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1207728990 25200 > # Node ID 1cc1342a903c152e698609753317981cd07deb15 > # Parent 262153788503c8b10c76c77719bba081df9a7b88 > [TEST] fix AllocationUnits Mismatch in 41_cs_to_settingdefinestate.py > > Signed-off-by: Guolian Yun > > diff -r 262153788503 -r 1cc1342a903c suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py > --- a/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Tue Apr 08 17:58:44 2008 +0530 > +++ b/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Wed Apr 09 01:16:30 2008 -0700 > @@ -102,7 +102,7 @@ def rasd_init_list(): > mem_rasd = { > "InstanceID" : '%s/%s' %(test_dom, "mem"), \ > "ResourceType" : 4, \ > - "AllocationUnits" : "MegaBytes",\ > + "AllocationUnits" : "KiloBytes",\ > "VirtualQuantity" : (test_mem * 1024), \ > } > rasd_values = { "Xen_Processor" : proc_rasd, \ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > +1 ! -- - Zhengang From deeptik at linux.vnet.ibm.com Wed Apr 9 09:04:33 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 09 Apr 2008 14:34:33 +0530 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] add net_type setting in device node for KVM In-Reply-To: References: Message-ID: <47FC86A1.6070504@linux.vnet.ibm.com> Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1207726933 25200 > # Node ID ca5633160e1cf78353d7b892a480f6fb5833e028 > # Parent e72f3a8d54c5f9e6b895f4930126acca1c97e380 > [TEST] add net_type setting in device node for KVM > > Signed-off-by: Guolian Yun > > diff -r e72f3a8d54c5 -r ca5633160e1c suites/libvirt-cim/lib/XenKvmLib/vxml.py > --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 00:37:33 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 00:42:13 2008 -0700 > @@ -488,12 +488,12 @@ class KVMXML(VirtXML): > sys.exit(1) > VirtXML.__init__(self, 'kvm', test_dom, set_uuid(), mem, vcpus) > self._os() > - self._devices(const.KVM_default_emulator, disk_file_path, disk, mac) > + self._devices(const.KVM_default_emulator, const.KVM_default_net_type, disk_file_path, disk, mac) > > def _os(self): > self.add_sub_node('/domain/os', 'type', 'hvm') > > - def _devices(self, emu, disk_img, disk_dev, net_mac): > + def _devices(self, emu, net_type, disk_img, disk_dev, net_mac): > devices = self.get_node('/domain/devices') > > self.add_sub_node(devices, 'emulator', emu) > @@ -501,9 +501,10 @@ class KVMXML(VirtXML): > self.add_sub_node(disk, 'source', file=disk_img) > self.add_sub_node(disk, 'target', dev=disk_dev) > > - interface = self.add_sub_node(devices, 'interface', type='bridge') > + interface = self.add_sub_node(devices, 'interface', type=net_type) > self.add_sub_node(interface, 'mac', address=net_mac) > - self.set_bridge(CIM_IP) > + if net_type == 'bridge': > + self.set_bridge(CIM_IP) > I think we should make use of the set_vbridge() instead of set_bridge(). set_bridge() sets the first bridge available on the machine. This might not be useful in case there are more than one bridge that are available on the machine, and the virtual network present on the machine is not associated with the first bridge on the machine every time. Though the domain gets created with no problem, the tc which uses NetRASD will fail since it wont be able to associate with the virtual Network to which the domain belongs. > > def set_emulator(self, emu): > return self._set_emulator(emu) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From zli at linux.vnet.ibm.com Wed Apr 9 09:23:39 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Wed, 09 Apr 2008 17:23:39 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] add a try..except to get_value_xpath() Message-ID: <87913147308d5075130d.1207733019@zeit.cn.ibm.com> # HG changeset patch # User Zhengang Li # Date 1207733009 -28800 # Node ID 87913147308d5075130dcae5b5648cc3f0158681 # Parent 262153788503c8b10c76c77719bba081df9a7b88 [TEST] add a try..except to get_value_xpath() A 'None' return is more elegant than a pure exception error. Signed-off-by: Zhengang Li diff -r 262153788503 -r 87913147308d suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Apr 08 17:58:44 2008 +0530 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 17:23:29 2008 +0800 @@ -115,7 +115,12 @@ class XMLClass: return self.xdoc.toprettyxml() def get_value_xpath(self, xpathStr): - node = self.get_node(xpathStr) + try: + node = self.get_node(xpathStr) + except LoopUpError: + raise Exception('Zero or multiple node found') + return None + if node.nodeType == Node.ATTRIBUTE_NODE: return node.value if node.nodeType == Node.TEXT_NODE: From yunguol at cn.ibm.com Wed Apr 9 09:06:42 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 09 Apr 2008 02:06:42 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST].2# add a tc that uses 'user' as network type, fais now, also keep track of issue In-Reply-To: Message-ID: <742b6f226bd7edad544f.1207732002@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207731971 25200 # Node ID 742b6f226bd7edad544fa1fa44130fa19abb1c57 # Parent 769e4c7af2e850055b0aa536e696f677ea204357 [TEST].2# add a tc that uses 'user' as network type, fais now, also keep track of issue Signed-off-by: Guolian Yun diff -r 769e4c7af2e8 -r 742b6f226bd7 suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py Wed Apr 09 02:06:11 2008 -0700 @@ -0,0 +1,93 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Guolian Yun +# +# 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 tc is used to verify the properties returned by the CIM_NetworkPort +# class. +# +# Date : 09-04-2008 + +import sys +import pywbem +from XenKvmLib import const +from XenKvmLib import devices +from XenKvmLib.vxml import KVMXML +from CimTest.Globals import log_param, logger +from CimTest.Globals import do_main +from CimTest.ReturnCodes import PASS, FAIL + +sup_types = ['KVM'] + +test_dom = "test_domain" +test_mac = "00:11:22:33:44:55" + + at do_main(sup_types) +def main(): + options = main.options + log_param() + const.KVM_default_net_type = 'user' + cxml = KVMXML(test_dom, mac = test_mac) + ret = cxml.define(options.ip) + if not ret: + logger.error('Unable to define domain %s' % test_dom) + return FAIL + + devid = "%s/%s" % (test_dom, test_mac) + key_list = { 'DeviceID' : devid, + 'CreationClassName' : "KVM_NetworkPort", + 'SystemName' : test_dom, + 'SystemCreationClassName' : "KVM_ComputerSystem" + } + + dev = None + try: + dev = devices.KVM_NetworkPort(options.ip, key_list) + except Exception, detail: + logger.error("Exception: %s" % detail) + cxml.undefine(options.ip) + return FAIL + + if dev == None: + logger.error("Error retrieving instance for devid %s" % devid) + cxml.undefine(options.ip) + return FAIL + + status = PASS + + addrs = dev.NetworkAddresses + if len(addrs) != 1: + logger.error("Too many NetworkAddress entries (%i instead of %i)" % \ + (len(addrs), 1)) + status = FAIL + + if addrs[0] != test_mac: + logger.error("MAC address reported incorrectly (%s instead of %s)" % \ + (addrs[0], test_mac)) + status = FAIL + + if status == FAIL: + logger.error("Checked interface %s" % test_mac) + + cxml.undefine(options.ip) + return status + +if __name__ == "__main__": + sys.exit(main()) From yunguol at cn.ibm.com Wed Apr 9 09:06:40 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 09 Apr 2008 02:06:40 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] [TEST].2# add KVM_default_net_type in const.py In-Reply-To: Message-ID: # HG changeset patch # User Guolian Yun # Date 1207731221 25200 # Node ID cc4dc206699ce32f35a68996d43c2b7fbd00abdd # Parent 262153788503c8b10c76c77719bba081df9a7b88 [TEST].2# add KVM_default_net_type in const.py Signed-off-by: Guolian Yun diff -r 262153788503 -r cc4dc206699c suites/libvirt-cim/lib/XenKvmLib/const.py --- a/suites/libvirt-cim/lib/XenKvmLib/const.py Tue Apr 08 17:58:44 2008 +0530 +++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Wed Apr 09 01:53:41 2008 -0700 @@ -48,6 +48,7 @@ KVM_secondary_disk_path = os.path.join(_ KVM_secondary_disk_path = os.path.join(_image_dir, 'default-kvm-dimage.2ND') KVM_default_disk_dev = 'hda' KVM_default_mac = '11:22:33:aa:bb:cc' +KVM_default_net_type = 'bridge' # vxml.XenFVXML s, o = platform.architecture() From yunguol at cn.ibm.com Wed Apr 9 09:06:39 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 09 Apr 2008 02:06:39 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] [TEST].2# Add one tc using 'user' as network type Message-ID: Signed-off-by: Guolian Yun From yunguol at cn.ibm.com Wed Apr 9 09:06:41 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 09 Apr 2008 02:06:41 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST].2# add net_type setting in device node for KVM In-Reply-To: Message-ID: <769e4c7af2e850055b0a.1207732001@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207731406 25200 # Node ID 769e4c7af2e850055b0aa536e696f677ea204357 # Parent cc4dc206699ce32f35a68996d43c2b7fbd00abdd [TEST].2# add net_type setting in device node for KVM Signed-off-by: Guolian Yun diff -r cc4dc206699c -r 769e4c7af2e8 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 01:53:41 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 01:56:46 2008 -0700 @@ -488,12 +488,12 @@ class KVMXML(VirtXML): sys.exit(1) VirtXML.__init__(self, 'kvm', test_dom, set_uuid(), mem, vcpus) self._os() - self._devices(const.KVM_default_emulator, disk_file_path, disk, mac) + self._devices(const.KVM_default_emulator, const.KVM_default_net_type, disk_file_path, disk, mac) def _os(self): self.add_sub_node('/domain/os', 'type', 'hvm') - def _devices(self, emu, disk_img, disk_dev, net_mac): + def _devices(self, emu, net_type, disk_img, disk_dev, net_mac): devices = self.get_node('/domain/devices') self.add_sub_node(devices, 'emulator', emu) @@ -501,9 +501,10 @@ class KVMXML(VirtXML): self.add_sub_node(disk, 'source', file=disk_img) self.add_sub_node(disk, 'target', dev=disk_dev) - interface = self.add_sub_node(devices, 'interface', type='bridge') + interface = self.add_sub_node(devices, 'interface', type=net_type) self.add_sub_node(interface, 'mac', address=net_mac) - self.set_bridge(CIM_IP) + if net_type == 'bridge': + self.set_vbridge(CIM_IP) def set_emulator(self, emu): return self._set_emulator(emu) From deeptik at linux.vnet.ibm.com Wed Apr 9 09:45:12 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 09 Apr 2008 15:15:12 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] add a try..except to get_value_xpath() In-Reply-To: <87913147308d5075130d.1207733019@zeit.cn.ibm.com> References: <87913147308d5075130d.1207733019@zeit.cn.ibm.com> Message-ID: <47FC9028.8020302@linux.vnet.ibm.com> zli at linux.vnet.ibm.com wrote: > # HG changeset patch > # User Zhengang Li > # Date 1207733009 -28800 > # Node ID 87913147308d5075130dcae5b5648cc3f0158681 > # Parent 262153788503c8b10c76c77719bba081df9a7b88 > [TEST] add a try..except to get_value_xpath() > > A 'None' return is more elegant than a pure exception error. > > Signed-off-by: Zhengang Li > > diff -r 262153788503 -r 87913147308d suites/libvirt-cim/lib/XenKvmLib/vxml.py > --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Apr 08 17:58:44 2008 +0530 > +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 17:23:29 2008 +0800 > @@ -115,7 +115,12 @@ class XMLClass: > return self.xdoc.toprettyxml() > > def get_value_xpath(self, xpathStr): > - node = self.get_node(xpathStr) > + try: > + node = self.get_node(xpathStr) > + except LoopUpError: > I think this should be *LookUpError.* > + raise Exception('Zero or multiple node found') > And can we use logger.error instead, I guess using raise statement does not proceed with the execution of the next stmt after it, right ?? In that case the return None wont be of much use. ** > + return None > + > if node.nodeType == Node.ATTRIBUTE_NODE: > return node.value > if node.nodeType == Node.TEXT_NODE: > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From zli at linux.vnet.ibm.com Wed Apr 9 10:37:19 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Wed, 09 Apr 2008 18:37:19 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] add a try..except to get_value_xpath() In-Reply-To: <47FC9028.8020302@linux.vnet.ibm.com> References: <87913147308d5075130d.1207733019@zeit.cn.ibm.com> <47FC9028.8020302@linux.vnet.ibm.com> Message-ID: <47FC9C5F.7040609@linux.vnet.ibm.com> Deepti B Kalakeri wrote: >> >> def get_value_xpath(self, xpathStr): >> - node = self.get_node(xpathStr) >> + try: >> + node = self.get_node(xpathStr) >> + except LoopUpError: >> > I think this should be *LookUpError.* >> + raise Exception('Zero or multiple node found') >> > And can we use logger.error instead, I guess using raise statement does > not proceed with the execution of the next stmt after it, right ?? > In that case the return None wont be of much use. > ** Agree. Logger is better. -- - Zhengang From zli at linux.vnet.ibm.com Wed Apr 9 10:36:32 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Wed, 09 Apr 2008 18:36:32 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] .#2 add a try..except to get_value_xpath() Message-ID: # HG changeset patch # User Zhengang Li # Date 1207737380 -28800 # Node ID fb3e043e7425a319730e6e11d05ee031ce4ab1ca # Parent 262153788503c8b10c76c77719bba081df9a7b88 [TEST] .#2 add a try..except to get_value_xpath() A 'None' return is more elegant than a pure exception error. Use logger.error typo fix. :) Signed-off-by: Zhengang Li diff -r 262153788503 -r fb3e043e7425 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Apr 08 17:58:44 2008 +0530 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 18:36:20 2008 +0800 @@ -115,7 +115,12 @@ class XMLClass: return self.xdoc.toprettyxml() def get_value_xpath(self, xpathStr): - node = self.get_node(xpathStr) + try: + node = self.get_node(xpathStr) + except LookUpError: + logger.error('Zero or multiple node found') + return None + if node.nodeType == Node.ATTRIBUTE_NODE: return node.value if node.nodeType == Node.TEXT_NODE: From deeptik at linux.vnet.ibm.com Wed Apr 9 11:31:16 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 09 Apr 2008 17:01:16 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Adding 05_RAPF_err.py to verify RAPF In-Reply-To: <47FBBBBB.3030408@linux.vnet.ibm.com> References: <0142551c8d3cf5f2a3bb.1207303063@dkalaker> <87fxu1ad7f.fsf@caffeine.beaverton.ibm.com> <47FB1324.7000307@linux.vnet.ibm.com> <47FBBBBB.3030408@linux.vnet.ibm.com> Message-ID: <47FCA904.106@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Deepti B Kalakeri wrote: >> >> >> Dan Smith wrote: >>> DK> +def check_bridge_name(bridgename): >>> DK> + bridge_list = live.available_bridges(server) >>> DK> + vbr = None DK> + if bridgename in bridge_list: >>> DK> + import random >>> DK> + vbr = bridgename + str(random.randint(1, 100)) >>> DK> + if vbr in bridge_list: >>> DK> + logger.error('Need to give different bridge name >>> since it already exists') >>> DK> + return None >>> DK> + else: >>> DK> + vbr = bridgename >>> DK> + return vbr >>> >>> I think this would make a lot more sense as: >>> >>> def get_unique_bridge(): >>> bridge = "invalid-bridge" >>> while bridge not in live.available_bridges(): >>> bridge += str(random.randint(1,100)) >>> return bridge >>> >>> >> Ok , will modify this. >>> DK> + if virt != 'XenFV': >>> DK> + bridge = vsxml.set_vbridge(server) >>> >>> Can you explain why this special case exists? >>> >>> >> The network information for the XenFV is getting assigned by default. >> The def _devices(): section of the XenFV is calling the >> >> self.set_bridge(CIM_IP) and hence the bridge information is getting >> assigned by default. >> While this is not the case with the Xen and KVM. > > KVM also calls set_bridge() in the _devices() call. > > Xen does not, but the _devices() call for Xen sets the interface as an > ethernet type. So there's no need to set a bridge for the Xen case. Wrt to the tc when working with NetRASD requires the domain to be created with interface type as bridge. NetRASD lists the domains which are created with bridge as the network type. Please correct me if I am wrong. I suggest we keep the default network type for all the three Virtual types to be bridge and the give another function which allows to add network type other than bridge to the domain when required From deeptik at linux.vnet.ibm.com Wed Apr 9 11:32:03 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 09 Apr 2008 17:02:03 +0530 Subject: [Libvirt-cim] [PATCH] [TEST][Resubmitting]Adding 05_RAPF_err.py to verify RAPF In-Reply-To: <47FBCC48.9040404@linux.vnet.ibm.com> References: <6e8932e6628a5475b39e.1207651999@dkalaker> <47FBCC48.9040404@linux.vnet.ibm.com> Message-ID: <47FCA933.5090206@linux.vnet.ibm.com> Hi Kaitlin, Please see my comments inline. Thanks and Regards, Deepti. Kaitlin Rupert wrote: >> +def setup_env(): >> + vsxml_info = None >> + if virt == "Xen": >> + test_disk = "xvda" >> + else: + test_disk = "hda" >> + >> + virt_xml = get_class(virt) >> + vsxml_info = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, >> disk = test_disk) >> + bridge = vsxml_info.set_vbridge(server) > > I agree with Dan's comment on the first version of this patch: > > + if virt != 'XenFV': > + bridge = vsxml.set_vbridge(server) > > Having this as a special case is confusing. However, the new version > of the patch has a bug. This test works fine for Xen, but it does not > work for KVM or XenFV. Please be sure to run the test against all of > the platforms the test supports before submitting. I had verified the test case that I had submitted yesterday with Xen , XenFV, KVM. > > The reason this fails for KVM and XenFV is because the bridge is > already defined, and the call to set_vbridge() adds another bridge tag > to the XML. The XML ends up looking something like: > > > > > > > > I'd recommend adding a function to vxml.py that allows you to check > whether the bridge value is already set. There's a fair number of set_ > functions in vxml.py, so I think it would make sense to add this as a > get_ function. > > You can probably utilize get_node() and toprettyxml() to return the > value of the bridge. If a bridge isn't set, you could return None. > Thoughts? > I have added a new function xml_get_net_bridge() which is gets the bridge information if any with the domain. > Also, instead of using [Resubmitting] in the subject, please use a > version number. The libvirt-cim project uses this convention - it's > helpful in determining which patch is the most recent version. The > subject of the next revision of this patch could be "[TEST] #3 Adding > 05_RAPF_err.py to verify RAPF". > ok I will take care of this. > Thanks! From zli at linux.vnet.ibm.com Wed Apr 9 11:31:34 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Wed, 09 Apr 2008 19:31:34 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] .#3 add a try..except to get_value_xpath() Message-ID: <74f907a44c1d7d764aa0.1207740694@zeit.cn.ibm.com> # HG changeset patch # User Zhengang Li # Date 1207740687 -28800 # Node ID 74f907a44c1d7d764aa06a388ae40b5d078c2b6a # Parent 262153788503c8b10c76c77719bba081df9a7b88 [TEST] .#3 add a try..except to get_value_xpath() A 'None' return is more elegant than a pure exception error. Changed to use logger.info Signed-off-by: Zhengang Li diff -r 262153788503 -r 74f907a44c1d suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Apr 08 17:58:44 2008 +0530 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 19:31:27 2008 +0800 @@ -115,7 +115,12 @@ class XMLClass: return self.xdoc.toprettyxml() def get_value_xpath(self, xpathStr): - node = self.get_node(xpathStr) + try: + node = self.get_node(xpathStr) + except Exception: + logger.info('Zero or multiple node found') + return None + if node.nodeType == Node.ATTRIBUTE_NODE: return node.value if node.nodeType == Node.TEXT_NODE: From deeptik at linux.vnet.ibm.com Wed Apr 9 12:10:05 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 09 Apr 2008 17:40:05 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing the tc 03_proc_gi_errs.py Message-ID: <11b2cbd3aaac45ccedf7.1207743005@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207742984 -19800 # Node ID 11b2cbd3aaac45ccedf7619d390c236014fd7690 # Parent cc4020f5ed18fa1134b8c63c3c9f9f828d3df23f [TEST] Fixing the tc 03_proc_gi_errs.py. It was failing with XenFV. Signed-off-by: Deepti B. Kalakeri diff -r cc4020f5ed18 -r 11b2cbd3aaac suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py --- a/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py Wed Apr 09 12:47:44 2008 +0530 +++ b/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py Wed Apr 09 17:39:44 2008 +0530 @@ -5,6 +5,7 @@ # Authors: # Anoop V Chakkalakkal # Guolian Yun +# Deepti B. kalakeri # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public @@ -123,11 +124,10 @@ import sys import pywbem -from VirtLib import utils from XenKvmLib import assoc from XenKvmLib.common_util import try_getinstance from XenKvmLib.classes import get_typed_class -from XenKvmLib.vxml import XenXML, KVMXML, get_class +from XenKvmLib.vxml import get_class from XenKvmLib.test_doms import destroy_and_undefine_all from CimTest.ReturnCodes import PASS, FAIL from CimTest.Globals import log_param, logger, CIM_USER @@ -137,15 +137,15 @@ 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 (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)" } } @@ -185,27 +185,26 @@ def main(): if not ret: logger.error("Failed to Create the dom: %s", test_dom) return FAIL - global conn conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS) global name_val global classname - classname = '%s_Processor' % options.virt + classname = get_typed_class(options.virt, 'Processor') name_val = [ - 'CreationClassName', classname, \ - 'DeviceID', devid, \ - 'SystemCreationClassName', get_typed_class(options.virt, 'ComputerSystem'), \ + 'CreationClassName', classname, + 'DeviceID', devid, + 'SystemCreationClassName', get_typed_class(options.virt, 'ComputerSystem'), 'SystemName', test_dom ] - 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' } From deeptik at linux.vnet.ibm.com Wed Apr 9 12:24:11 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 09 Apr 2008 17:54:11 +0530 Subject: [Libvirt-cim] [PATCH] [TEST]Adding xml_get_net_bridge() function which returns the bridge info associated with domain Message-ID: <55d6e89ebb1ad9ae0638.1207743851@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207743568 -19800 # Node ID 55d6e89ebb1ad9ae063814807a8ee8a20cb13656 # Parent c1d26f7e6a2223d995264d7cc3f43ec9327b753e [TEST]Adding xml_get_net_bridge() function which returns the bridge info associated with domain. This is required by the 05_RAPF_err.py tc. Signed-off-by: Deepti B. Kalakeri diff -r c1d26f7e6a22 -r 55d6e89ebb1a suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 17:45:41 2008 +0530 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 17:49:28 2008 +0530 @@ -342,7 +342,11 @@ class VirtXML(Virsh, XMLClass): @_x2str('/domain/devices/interface/mac/@address') def xml_get_net_mac(self): pass - + + def xml_get_net_bridge(self): + bridgeStr = self.get_value_xpath('/domain/devices/interface/source/@bridge') + return bridgeStr + def dumpxml(self, ip): cmd = 'virsh -c %s dumpxml %s' % (self.vuri, self.dname) s, o = utils.run_remote(ip, cmd) From deeptik at linux.vnet.ibm.com Wed Apr 9 12:30:51 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 09 Apr 2008 18:00:51 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #3 Adding 05_RAPF_err.py to verify RAPF Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207744214 -19800 # Node ID bbd146681ade6826d2df00853750ea9eac03d6d4 # Parent 55d6e89ebb1ad9ae063814807a8ee8a20cb13656 [TEST] #3 Adding 05_RAPF_err.py to verify RAPF. 1) The test : creates a guest with a network device that is not part of a known pool. Then call ResourceAllocatedFromPool with the reference to that device. Verifies for the error. 2) Used the xml_get_net_bridge() function to verify for the bridge info if already present. 3) Made the set_bridge_name() common to all virt types. 4) Addressed the comments. Signed-off-by: Deepti B. Kalakeri diff -r 55d6e89ebb1a -r bbd146681ade suites/libvirt-cim/cimtest/ResourceAllocationFromPool/05_RAPF_err.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/05_RAPF_err.py Wed Apr 09 18:00:14 2008 +0530 @@ -0,0 +1,198 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# 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 tc is used to verify the that the +# ResourceAllocationFromPool asscoiation returns error +# when guest is associated to a non-existing virtual network pool. +# +# The does the following: +# 1) creates a guest with a network device that is not part of a known pool, +# 2) call ResourceAllocatedFromPool with the reference to that device. +# 3) Verifies for the following error: +# +# Command: +# -------- +# wbemcli ain -ac KVM_ResourceAllocationFromPool +# 'http://localhost:5988/root/virt:KVM_NetResourceAllocationSettingData. +# InstanceID="test-kvm/24:42:53:21:52:45"' +# +# +# Output: +# ------- +# error no : CIM_ERR_FAILED +# error desc : "Unable to determine pool of `test-kvm/24:42:53:21:52:45';" +# +# Date : 04-04-2008 +# +import sys +import pywbem +import random +from VirtLib import live +from XenKvmLib import assoc, enumclass +from XenKvmLib.common_util import try_assoc +from XenKvmLib.test_doms import destroy_and_undefine_all +from CimTest import Globals +from CimTest.Globals import logger, CIM_ERROR_ENUMERATE +from CimTest.ReturnCodes import PASS, FAIL +from CimTest.Globals import do_main, platform_sup +from XenKvmLib.vxml import get_class +from XenKvmLib.classes import get_typed_class + +test_dom = "RAPF_domain" +test_mac = "00:11:22:33:44:aa" +test_vcpus = 1 + +def get_unique_bridge(): + bridge = "invalid-bridge" + bridge_list = live.available_bridges(server) + while bridge in bridge_list: + bridge = bridge + str(random.randint(1, 100)) + + return bridge + +def setup_env(): + vsxml_info = None + if virt == "Xen": + test_disk = "xvda" + else: + test_disk = "hda" + + virt_xml = get_class(virt) + vsxml_info = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, disk = test_disk) + + bridge = vsxml_info.xml_get_net_bridge() + if bridge == None: + bridge = vsxml_info.set_vbridge(server) + +# Get a bridge name that is not used by any of the virtual network pool on the machine. + bridge_name = get_unique_bridge() + +# Assigning the bridge that does not belong to any networkpool. + vsxml_info.set_bridge_name(bridge_name) + ret = vsxml_info.define(server) + if not ret: + Globals.logger.error("Failed to define the dom: %s", test_dom) + return FAIL, vsxml_info + + return PASS, vsxml_info + +def get_inst_from_list(vsxml, classname, rasd_list, filter_name, exp_val): + status = PASS + ret = FAIL + inst = [] + + for rec in rasd_list: + record = rec[filter_name] + if exp_val in record: + inst.append(rec) + ret = PASS + + if ret != PASS: + logger.error("%s with %s was not returned" % (classname, exp_val)) + vsxml.undefine(server) + status = FAIL + + return status, inst + +def get_netrasd_instid(vsxml, classname): + rasd_list = [] + status = PASS + try: + rasd_list = enumclass.enumerate_inst(server, classname, virt) + if len(rasd_list) < 1: + logger.error("%s returned %i instances, excepted atleast 1 instance", classname, + len(rasd_list)) + status = FAIL + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, classname) + logger.error("Exception: %s", detail) + status = FAIL + + if status != PASS: + return status, rasd_list + + # Get the RASD info related to the domain "ONLY". + # We should get ONLY one record. + rasd_info = [] + status, rasd_info = get_inst_from_list(vsxml, classname, rasd_list, "InstanceID", test_dom) + + return status, rasd_info + +def verify_rapf_err(vsxml): + status = PASS + try: + + classname = get_typed_class(virt, 'NetResourceAllocationSettingData') + status, net_rasd_list = get_netrasd_instid(vsxml, classname) + if status != PASS or len(net_rasd_list) == 0: + return status + if len(net_rasd_list) != 1: + logger.error("%s returned %i instances, excepted atleast 1 instance", classname, + len(net_rasd_list)) + return FAIL + + + conn = assoc.myWBEMConnection('http://%s' % server, + (Globals.CIM_USER, + Globals.CIM_PASS), + Globals.CIM_NS) + assoc_classname = get_typed_class(virt, "ResourceAllocationFromPool") + classname = net_rasd_list[0].classname + instid = net_rasd_list[0]['InstanceID'] + keys = { "InstanceID" : instid } + expr_values = { + 'rapf_err' : { + 'desc' : "Unable to determine pool of `%s'" %instid, + 'rc' : pywbem.CIM_ERR_FAILED + } + } + status = try_assoc(conn, classname, assoc_classname, keys, field_name="InstanceID", + expr_values=expr_values['rapf_err'], bug_no="") + + except Exception, detail: + logger.error("Exception: %s", detail) + status = FAIL + + return status + + at do_main(platform_sup) +def main(): + global virt, server + Globals.log_param() + options = main.options + server = options.ip + virt = options.virt + destroy_and_undefine_all(server) + + status, vsxml = setup_env() + if status != PASS: + logger.error("Failed to setup the domain") + return status + + ret = verify_rapf_err(vsxml) + if ret: + logger.error("------FAILED: to verify the RAFP.------") + status = ret + + vsxml.undefine(server) + return status +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Wed Apr 9 12:31:03 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 09 Apr 2008 18:01:03 +0530 Subject: [Libvirt-cim] [PATCH] [TEST]Adding xml_get_net_bridge() function which returns the bridge info associated with domain In-Reply-To: <55d6e89ebb1ad9ae0638.1207743851@dkalaker> References: <55d6e89ebb1ad9ae0638.1207743851@dkalaker> Message-ID: <47FCB707.200@linux.vnet.ibm.com> This patch should be applied after applying the patch submitted by Zhen Gang, with the subject line ".#3 add a try..except to get_value_xpath()". Thanks and Regards, Deepti. Deepti B. Kalakeri wrote: > # HG changeset patch > # User Deepti B. Kalakeri > # Date 1207743568 -19800 > # Node ID 55d6e89ebb1ad9ae063814807a8ee8a20cb13656 > # Parent c1d26f7e6a2223d995264d7cc3f43ec9327b753e > [TEST]Adding xml_get_net_bridge() function which returns the bridge info associated with domain. > > This is required by the 05_RAPF_err.py tc. > > Signed-off-by: Deepti B. Kalakeri > > diff -r c1d26f7e6a22 -r 55d6e89ebb1a suites/libvirt-cim/lib/XenKvmLib/vxml.py > --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 17:45:41 2008 +0530 > +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 17:49:28 2008 +0530 > @@ -342,7 +342,11 @@ class VirtXML(Virsh, XMLClass): > @_x2str('/domain/devices/interface/mac/@address') > def xml_get_net_mac(self): > pass > - > + > + def xml_get_net_bridge(self): > + bridgeStr = self.get_value_xpath('/domain/devices/interface/source/@bridge') > + return bridgeStr > + > def dumpxml(self, ip): > cmd = 'virsh -c %s dumpxml %s' % (self.vuri, self.dname) > s, o = utils.run_remote(ip, cmd) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From danms at us.ibm.com Wed Apr 9 14:22:25 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 09 Apr 2008 07:22:25 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Change default KVM emulator to qemu-kvm In-Reply-To: (zli@linux.vnet.ibm.com's message of "Tue, 08 Apr 2008 19:57:39 -0700") References: Message-ID: <87r6df2jmm.fsf@caffeine.beaverton.ibm.com> ZL> # vxml.KVMXML ZL> -KVM_default_emulator = '/usr/bin/qemu' ZL> +KVM_default_emulator = '/usr/bin/qemu-kvm' I'd like this to be more intelligent. I'd like to be able to continue to run the suite on a machine that doesn't have VT, using a QEMU domain without KVM support. Setting this based on the presence of 'vmx' or 'svm' in /proc/cpuinfo seems like a reasonable way, and provides the most flexibility. We can even log which we're using so that any report that differs because of the emulator type (which I think is unlikely) will be marked as such. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Wed Apr 9 14:28:58 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 09 Apr 2008 07:28:58 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Change default KVM emulator to qemu-kvm In-Reply-To: References: Message-ID: <47FCD2AA.70405@linux.vnet.ibm.com> zli at linux.vnet.ibm.com wrote: > # HG changeset patch > # User Zhengang Li > # Date 1207709819 25200 > # Node ID b5857217c64a081450cd21219035084eac455d85 > # Parent 262153788503c8b10c76c77719bba081df9a7b88 > [TEST] Change default KVM emulator to qemu-kvm > > We're more close to KVM full coverage support. It makes > sense to set the default emulator to a real one instead > of a pure-qemu version. > > Signed-off-by: Zhengang Li Good catch - thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Apr 9 14:40:46 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 09 Apr 2008 07:40:46 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Change default KVM emulator to qemu-kvm In-Reply-To: <87r6df2jmm.fsf@caffeine.beaverton.ibm.com> References: <87r6df2jmm.fsf@caffeine.beaverton.ibm.com> Message-ID: <47FCD56E.3060900@linux.vnet.ibm.com> Dan Smith wrote: > ZL> # vxml.KVMXML > ZL> -KVM_default_emulator = '/usr/bin/qemu' > ZL> +KVM_default_emulator = '/usr/bin/qemu-kvm' > > I'd like this to be more intelligent. I'd like to be able to continue > to run the suite on a machine that doesn't have VT, using a QEMU > domain without KVM support. Sorry Dan, I missed your response here and pushed this patch in. I think this is a good idea. Zhengang - can you work on a follow up patch since I already did a push on this? Thanks! > > Setting this based on the presence of 'vmx' or 'svm' in /proc/cpuinfo > seems like a reasonable way, and provides the most flexibility. We > can even log which we're using so that any report that differs because > of the emulator type (which I think is unlikely) will be marked as > such. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Wed Apr 9 14:46:10 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 09 Apr 2008 07:46:10 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] add a tc that uses 'user' as network type, fais now, also keep track of issue In-Reply-To: <47FC806D.8050403@linux.vnet.ibm.com> (Zhengang Li's message of "Wed, 09 Apr 2008 16:38:05 +0800") References: <9fec39e06a000701e7f6.1207728152@elm3b197.beaverton.ibm.com> <47FC806D.8050403@linux.vnet.ibm.com> Message-ID: <87myo32ij1.fsf@caffeine.beaverton.ibm.com> ZL> Because this test case is limited to KVM, how about: ZL> dev = devices.KVM_NetworkPort(options.ip, key_list) Agreed! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Apr 9 14:50:41 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 09 Apr 2008 07:50:41 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] add a try..except to get_value_xpath() In-Reply-To: <47FC9028.8020302@linux.vnet.ibm.com> (Deepti B. Kalakeri's message of "Wed, 09 Apr 2008 15:15:12 +0530") References: <87913147308d5075130d.1207733019@zeit.cn.ibm.com> <47FC9028.8020302@linux.vnet.ibm.com> Message-ID: <87iqyr2ibi.fsf@caffeine.beaverton.ibm.com> >> + raise Exception('Zero or multiple node found') >> DK> And can we use logger.error instead, I guess using raise statement DK> does not proceed with the execution of the next stmt after it, DK> right ?? In that case the return None wont be of much use. This is correct, the "return None" statement never gets executed. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Wed Apr 9 15:38:15 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 09 Apr 2008 08:38:15 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] change AllocationCapabilities expected error string In-Reply-To: References: Message-ID: <47FCE2E7.2030105@linux.vnet.ibm.com> zli at linux.vnet.ibm.com wrote: > # HG changeset patch > # User Zhengang Li > # Date 1207728305 25200 > # Node ID be122f36acaa24527bdc6339ed16b80526b5fcb7 > # Parent f58194a3271fe20b19894c9f3472164316e1ee4c > [TEST] change AllocationCapabilities expected error string > > On FC8 it was 'Instance not found'. Now FC9 expects 'Requested > Object could not be found'. This is only a string returned from > CIMOM, I'm changing this to a word used in both messages. What > we really expect is the CIM_ERR_NOT_FOUND. The rc code are identical > on FC8 and FC9. > > This fixes AllocationCapabilities.02 failures on a pegasus 2.7 CIMOM. > > Signed-off-by: Zhengang Li > > diff -r f58194a3271f -r be122f36acaa suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py > --- a/suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py Wed Apr 09 00:57:03 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py Wed Apr 09 01:05:05 2008 -0700 > @@ -73,7 +73,7 @@ > "invalid_instid_keyname" : { 'rc' : pywbem.CIM_ERR_FAILED, \ > 'desc' : 'No InstanceID specified' }, \ > "invalid_instid_keyvalue" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND, \ > - 'desc' : 'Instance not found' } > + 'desc' : 'found' } > } > def conf_file(): > """ > While this makes the test pass, I think there's potential for a false positive here. Some providers return messages like: "System Name not found" and "CreationClassName not found." Using just "found" would cause the test to pass in both cases, even though we really only want to pass if we get "System Name not found." A suggestion is to have the ability to check multiple descriptions. So then you could check against the expected error messages for both F8 and F9. The hope here is that the error messages don't change often. Thoughts? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Apr 9 15:54:06 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 09 Apr 2008 08:54:06 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] redirect logging to /dev/null instead of stderr In-Reply-To: References: Message-ID: <47FCE69E.1050804@linux.vnet.ibm.com> zli at linux.vnet.ibm.com wrote: > # HG changeset patch > # User Zhengang Li > # Date 1207727823 25200 > # Node ID f58194a3271fe20b19894c9f3472164316e1ee4c > # Parent b5857217c64a081450cd21219035084eac455d85 > [TEST] redirect logging to /dev/null instead of stderr > > The original default basicConfig() added a stderr Streamhandler. > The log is duplicated to both the stderr and the file log 'vsmtest.log'. > Outputting all the log to the screen makes the test less easier to read. > > Signed-off-by: Zhengang Li Thanks Zhengang for this patch - I've applied this. I'd noticed the output of the suite had changed, but wasn't sure what the cause was. Agreed - the output is much easier to read with this patch applied. However, I could see why duplicating the log to stderr might be useful in some cases. Does anyone see value in this? We could add an option that allows to user to enable logging to stderr. Although, if we decide to do this, some of the tests will need to be cleaned up. Some tests are quite verbose, which might need to be pared down. Thoughts? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Apr 9 16:31:04 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 09 Apr 2008 09:31:04 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Adding 05_RAPF_err.py to verify RAPF In-Reply-To: <47FCA904.106@linux.vnet.ibm.com> References: <0142551c8d3cf5f2a3bb.1207303063@dkalaker> <87fxu1ad7f.fsf@caffeine.beaverton.ibm.com> <47FB1324.7000307@linux.vnet.ibm.com> <47FBBBBB.3030408@linux.vnet.ibm.com> <47FCA904.106@linux.vnet.ibm.com> Message-ID: <47FCEF48.80602@linux.vnet.ibm.com> >>> Ok , will modify this. >>>> DK> + if virt != 'XenFV': >>>> DK> + bridge = vsxml.set_vbridge(server) >>>> >>>> Can you explain why this special case exists? >>>> >>>> >>> The network information for the XenFV is getting assigned by default. >>> The def _devices(): section of the XenFV is calling the >>> >>> self.set_bridge(CIM_IP) and hence the bridge information is getting >>> assigned by default. >>> While this is not the case with the Xen and KVM. >> >> KVM also calls set_bridge() in the _devices() call. >> >> Xen does not, but the _devices() call for Xen sets the interface as an >> ethernet type. So there's no need to set a bridge for the Xen case. > Wrt to the tc when working with NetRASD requires the domain to be > created with interface type as bridge. > NetRASD lists the domains which are created with bridge as the network > type. Please correct me if I am wrong. You'll only get a NetRASD instance if the guest has an interface that is tied to a virtual network. That is - if the guest's bridge belongs to a defined virtual network. > I suggest we keep the default network type for all the three Virtual > types to be bridge and the give > another function which allows to add network type other than bridge to > the domain when required > The original Xen XML used an ethernet style network as the default. Can you verify which (if any) test cases will be affected if we change Xen to use a bridge style network as the default? In general, I'd like to see the default XML for all three types be as similar as possible (where it makes sense). So I think this is a sound idea. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Wed Apr 9 17:57:17 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 09 Apr 2008 10:57:17 -0700 Subject: [Libvirt-cim] [PATCH] Fix xml_parse_test to work with new definition of struct vcpu_device Message-ID: # HG changeset patch # User Dan Smith # Date 1207763825 25200 # Node ID f0efb24ba68e89847815b6bf2cfa89dea0330398 # Parent 6cddb842645dcf42c5780c38c3d38785f00f0de4 Fix xml_parse_test to work with new definition of struct vcpu_device ...also print out the 'source' field of network devices Signed-off-by: Dan Smith diff -r 6cddb842645d -r f0efb24ba68e libxkutil/xml_parse_test.c --- a/libxkutil/xml_parse_test.c Wed Apr 09 10:38:58 2008 -0700 +++ b/libxkutil/xml_parse_test.c Wed Apr 09 10:57:05 2008 -0700 @@ -78,6 +78,7 @@ static void print_dev_net(struct virt_de { print_value(d, "Type", dev->dev.net.type); print_value(d, "MAC", dev->dev.net.mac); + print_value(d, "Source", dev->dev.net.source); } static void print_dev_disk(struct virt_device *dev, @@ -93,7 +94,7 @@ static void print_dev_vcpu(struct virt_d static void print_dev_vcpu(struct virt_device *dev, FILE *d) { - print_u32(d, "Virtual CPU", dev->dev.vcpu.number); + print_u32(d, "Virtual CPUs", dev->dev.vcpu.quantity); } static void print_dev_emu(struct virt_device *dev, From danms at us.ibm.com Wed Apr 9 20:49:17 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 09 Apr 2008 13:49:17 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] change AllocationCapabilities expected error string In-Reply-To: <47FCE2E7.2030105@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Wed, 09 Apr 2008 08:38:15 -0700") References: <47FCE2E7.2030105@linux.vnet.ibm.com> Message-ID: <87abk23gaa.fsf@caffeine.beaverton.ibm.com> KR> The hope here is that the error messages don't change often. KR> Thoughts? I think the only thing you should depend on is the return code. Interpreting the error string is likely to break. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Apr 9 21:31:40 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 09 Apr 2008 14:31:40 -0700 Subject: [Libvirt-cim] [PATCH 0 of 6] Fix up handling of NetRASD-related define path Message-ID: This patch set attempts to close the gap between what a client expects to be able to discover and what we allow. After this, the client should be able to use the default NetRASDs exposed from AllocationCapabilities as templates for a DefineSystem operation with proper pool (i.e. Virtual Network) membership maintained and unique MACs assigned. Comments and thorough review appreciated :) From danms at us.ibm.com Wed Apr 9 21:31:41 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 09 Apr 2008 14:31:41 -0700 Subject: [Libvirt-cim] [PATCH 1 of 6] Make the 'default' NetRASD allocation include a randomly-generated MAC In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1207776499 25200 # Node ID d297967bad1fb290230fa9f42dee9a4e5e68f7bb # Parent ad9a40f4e04defe60897169cd7b93ef115bfcaf8 Make the 'default' NetRASD allocation include a randomly-generated MAC Signed-off-by: Dan Smith diff -r ad9a40f4e04d -r d297967bad1f src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Wed Apr 09 14:28:18 2008 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Wed Apr 09 14:28:19 2008 -0700 @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -52,6 +53,8 @@ const static CMPIBroker *_BROKER; #define SDC_DISK_MIN 2000 #define SDC_DISK_DEF 5000 #define SDC_DISK_INC 250 + +#define DEFAULT_MAC_PREFIX "00:16:3e" static bool rasd_prop_copy_value(struct sdc_rasd_prop src, struct sdc_rasd_prop *dest) @@ -430,6 +433,45 @@ static struct sdc_rasd_prop *net_max(con return rasd; } +static const char *_net_rand_mac(void) +{ + int r; + int ret; + unsigned int s; + char *mac = NULL; + CMPIString *str = NULL; + CMPIStatus status; + + srand(time(NULL)); + r = rand_r(&s); + + ret = asprintf(&mac, + "%s:%02x:%02x:%02x", + DEFAULT_MAC_PREFIX, + r & 0xFF, + (r & 0xFF00) >> 8, + (r & 0xFF0000) >> 16); + + if (ret == -1) + goto out; + + str = CMNewString(_BROKER, mac, &status); + if ((str == NULL) || (status.rc != CMPI_RC_OK)) { + str = NULL; + CU_DEBUG("Failed to create string"); + goto out; + } + out: + free(mac); + + if (str != NULL) + mac = CMGetCharPtr(str); + else + mac = NULL; + + return mac; +} + static struct sdc_rasd_prop *net_def(const CMPIObjectPath *ref, CMPIStatus *s) { @@ -440,6 +482,7 @@ static struct sdc_rasd_prop *net_def(con struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, + {"Address", (CMPIValue *)_net_rand_mac(), CMPI_chars}, PROP_END }; From danms at us.ibm.com Wed Apr 9 21:31:42 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 09 Apr 2008 14:31:42 -0700 Subject: [Libvirt-cim] [PATCH 2 of 6] Set PoolID on all allocated RASD objects for later correlation in DefineSystem In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1207776520 25200 # Node ID fae3c71425bf5d5adc01a6de1005c87b8726916c # Parent d297967bad1fb290230fa9f42dee9a4e5e68f7bb Set PoolID on all allocated RASD objects for later correlation in DefineSystem Signed-off-by: Dan Smith diff -r d297967bad1f -r fae3c71425bf src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Wed Apr 09 14:28:19 2008 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Wed Apr 09 14:28:40 2008 -0700 @@ -829,6 +829,7 @@ static CMPIStatus alloc_cap_to_rasd(cons CMPIStatus s = {CMPI_RC_OK}; uint16_t type; const char *id = NULL; + int i; if (!match_hypervisor_prefix(ref, info)) return s; @@ -850,6 +851,10 @@ static CMPIStatus alloc_cap_to_rasd(cons } s = sdc_rasds_for_type(ref, list, type); + + for (i = 0; i < list->cur; i++) + CMSetProperty(list->list[i], "PoolID", + (CMPIValue *)id, CMPI_chars); out: return s; From danms at us.ibm.com Wed Apr 9 21:31:43 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 09 Apr 2008 14:31:43 -0700 Subject: [Libvirt-cim] [PATCH 3 of 6] Fix typo in NetRASD creation that could have caused a break if we rearrange things In-Reply-To: Message-ID: <17f2f0d424887bc0c510.1207776703@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1207776529 25200 # Node ID 17f2f0d424887bc0c51037a3bbc7fd665938e8ba # Parent fae3c71425bf5d5adc01a6de1005c87b8726916c Fix typo in NetRASD creation that could have caused a break if we rearrange things Signed-off-by: Dan Smith diff -r fae3c71425bf -r 17f2f0d42488 src/Virt_RASD.c --- a/src/Virt_RASD.c Wed Apr 09 14:28:40 2008 -0700 +++ b/src/Virt_RASD.c Wed Apr 09 14:28:49 2008 -0700 @@ -155,7 +155,7 @@ static CMPIInstance *rasd_from_vdev(cons } else if (dev->type == CIM_RES_TYPE_NET) { CMSetProperty(inst, "NetworkType", - (CMPIValue *)dev->dev.disk.type, + (CMPIValue *)dev->dev.net.type, CMPI_chars); } else if (dev->type == CIM_RES_TYPE_MEM) { const char *units = "KiloBytes"; From danms at us.ibm.com Wed Apr 9 21:31:44 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 09 Apr 2008 14:31:44 -0700 Subject: [Libvirt-cim] [PATCH 4 of 6] Make NetRASD expose its MAC in the Address field In-Reply-To: Message-ID: <0314f5ce51d0d8ba4d51.1207776704@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1207776541 25200 # Node ID 0314f5ce51d0d8ba4d518c0a7a22c43e03be4dec # Parent 17f2f0d424887bc0c51037a3bbc7fd665938e8ba Make NetRASD expose its MAC in the Address field Signed-off-by: Dan Smith diff -r 17f2f0d42488 -r 0314f5ce51d0 src/Virt_RASD.c --- a/src/Virt_RASD.c Wed Apr 09 14:28:49 2008 -0700 +++ b/src/Virt_RASD.c Wed Apr 09 14:29:01 2008 -0700 @@ -157,6 +157,10 @@ static CMPIInstance *rasd_from_vdev(cons "NetworkType", (CMPIValue *)dev->dev.net.type, CMPI_chars); + CMSetProperty(inst, + "Address", + (CMPIValue *)dev->dev.net.mac, + CMPI_chars); } else if (dev->type == CIM_RES_TYPE_MEM) { const char *units = "KiloBytes"; From danms at us.ibm.com Wed Apr 9 21:31:46 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 09 Apr 2008 14:31:46 -0700 Subject: [Libvirt-cim] [PATCH 6 of 6] Make VSMS not parse the InstanceID of a RASD, but rather use the proper fields In-Reply-To: Message-ID: <01e5b1388ee7604332c4.1207776706@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1207776680 25200 # Node ID 01e5b1388ee7604332c442cba79c39ac3cca0b6f # Parent 3d143b851ee9201986ce8d0e6656cc313d361866 Make VSMS not parse the InstanceID of a RASD, but rather use the proper fields For Network, grab the Address for the MAC and then also try to extract the PoolID for the network name. I left it split between KVM and Xen, because I think as we expand the supported network types, we'll still need to differentiate in the code. This means that we no longer examine the InstanceID of the incoming RASDs for a DefineSystem operation (which is correct). The test suite will need to change to use these values correctly instead of generating the InstanceID and should also have a test that verifies that the InstanceID is not honored. I think that the InstanceID should be ignored if specified, although discussion of this point is certainly welcomed. Signed-off-by: Dan Smith diff -r 3d143b851ee9 -r 01e5b1388ee7 src/Makefile.am --- a/src/Makefile.am Wed Apr 09 14:29:08 2008 -0700 +++ b/src/Makefile.am Wed Apr 09 14:31:20 2008 -0700 @@ -75,9 +75,9 @@ libVirt_ComputerSystemMigrationIndicatio libVirt_ComputerSystemMigrationIndication_la_SOURCES = Virt_ComputerSystemMigrationIndication.c libVirt_ComputerSystemMigrationIndication_la_LIBADD = -lVirt_ComputerSystem -libVirt_VirtualSystemManagementService_la_DEPENDENCIES = libVirt_ComputerSystem.la libVirt_ComputerSystemIndication.la libVirt_RASD.la libVirt_HostSystem.la +libVirt_VirtualSystemManagementService_la_DEPENDENCIES = libVirt_ComputerSystem.la libVirt_ComputerSystemIndication.la libVirt_RASD.la libVirt_HostSystem.la libVirt_DevicePool.la libVirt_VirtualSystemManagementService_la_SOURCES = Virt_VirtualSystemManagementService.c -libVirt_VirtualSystemManagementService_la_LIBADD = -lVirt_ComputerSystem -lVirt_ComputerSystemIndication -lVirt_RASD -lVirt_HostSystem +libVirt_VirtualSystemManagementService_la_LIBADD = -lVirt_ComputerSystem -lVirt_ComputerSystemIndication -lVirt_RASD -lVirt_HostSystem -lVirt_DevicePool libVirt_VirtualSystemManagementCapabilities_la_DEPENDENCIES = libVirt_HostSystem.la libVirt_VirtualSystemManagementCapabilities_la_SOURCES = Virt_VirtualSystemManagementCapabilities.c diff -r 3d143b851ee9 -r 01e5b1388ee7 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Apr 09 14:29:08 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Wed Apr 09 14:31:20 2008 -0700 @@ -47,6 +47,7 @@ #include "Virt_ComputerSystemIndication.h" #include "Virt_RASD.h" #include "Virt_HostSystem.h" +#include "Virt_DevicePool.h" #include "svpc_types.h" const static CMPIBroker *_BROKER; @@ -202,8 +203,16 @@ static int xen_net_rasd_to_vdev(CMPIInst static int xen_net_rasd_to_vdev(CMPIInstance *inst, struct virt_device *dev) { + const char *val = NULL; + free(dev->dev.net.type); - dev->dev.net.type = strdup("bridge"); + dev->dev.net.type = strdup("network"); + + if (cu_get_str_prop(inst, "PoolID", &val) != CMPI_RC_OK) + val = "NetworkPool/default"; + + free(dev->dev.net.source); + dev->dev.net.source = name_from_pool_id(val); return 1; } @@ -211,11 +220,78 @@ static int kvm_net_rasd_to_vdev(CMPIInst static int kvm_net_rasd_to_vdev(CMPIInstance *inst, struct virt_device *dev) { + const char *val = NULL; + free(dev->dev.net.type); dev->dev.net.type = strdup("network"); + if (cu_get_str_prop(inst, "PoolID", &val) != CMPI_RC_OK) + val = "NetworkPool/default"; + free(dev->dev.net.source); - dev->dev.net.source = strdup("default"); + dev->dev.net.source = name_from_pool_id(val); + + return 1; +} + +static int net_rasd_to_vdev(CMPIInstance *inst, + struct virt_device *dev) +{ + const char *val = NULL; + CMPIObjectPath *op; + + if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) + val = "00:00:00:00:00:00"; + + free(dev->dev.net.mac); + dev->dev.net.mac = strdup(val); + + op = CMGetObjectPath(inst, NULL); + if (op == NULL) + goto out; + + if (STARTS_WITH(CLASSNAME(op), "Xen")) + xen_net_rasd_to_vdev(inst, dev); + else if (STARTS_WITH(CLASSNAME(op), "KVM")) + kvm_net_rasd_to_vdev(inst, dev); + else + CU_DEBUG("Unknown class type for net device: %s", + CLASSNAME(op)); + + out: + return 1; +} + +static int disk_rasd_to_vdev(CMPIInstance *inst, + struct virt_device *dev) +{ + const char *val = NULL; + + if (cu_get_str_prop(inst, "VirtualDevice", &val) != CMPI_RC_OK) + val = "hda"; + + free(dev->dev.disk.virtual_dev); + dev->dev.disk.virtual_dev = strdup(val); + + if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) + val = "/dev/null"; + + free(dev->dev.disk.source); + dev->dev.disk.source = strdup(val); + dev->dev.disk.disk_type = disk_type_from_file(val); + + return 1; +} + +static int mem_rasd_to_vdev(CMPIInstance *inst, + struct virt_device *dev) +{ + cu_get_u64_prop(inst, "VirtualQuantity", &dev->dev.mem.size); + cu_get_u64_prop(inst, "Reservation", &dev->dev.mem.size); + dev->dev.mem.maxsize = dev->dev.mem.size; + cu_get_u64_prop(inst, "Limit", &dev->dev.mem.maxsize); + dev->dev.mem.size <<= 10; + dev->dev.mem.maxsize <<= 10; return 1; } @@ -224,11 +300,8 @@ static int rasd_to_vdev(CMPIInstance *in struct virt_device *dev) { uint16_t type; - const char *id = NULL; - const char *val = NULL; - char *name = NULL; - char *devid = NULL; CMPIObjectPath *op; + int ret = 0; op = CMGetObjectPath(inst, NULL); if (op == NULL) @@ -239,50 +312,16 @@ static int rasd_to_vdev(CMPIInstance *in dev->type = (int)type; - if (cu_get_str_prop(inst, "InstanceID", &id) != CMPI_RC_OK) - goto err; - - if (!parse_fq_devid(id, &name, &devid)) - goto err; - if (type == CIM_RES_TYPE_DISK) { - free(dev->dev.disk.virtual_dev); - dev->dev.disk.virtual_dev = devid; - - if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) - val = "/dev/null"; - - free(dev->dev.disk.source); - dev->dev.disk.source = strdup(val); - dev->dev.disk.disk_type = disk_type_from_file(val); + ret = disk_rasd_to_vdev(inst, dev); } else if (type == CIM_RES_TYPE_NET) { - free(dev->dev.net.mac); - dev->dev.net.mac = devid; - - if (STARTS_WITH(CLASSNAME(op), "Xen")) - xen_net_rasd_to_vdev(inst, dev); - else if (STARTS_WITH(CLASSNAME(op), "KVM")) - kvm_net_rasd_to_vdev(inst, dev); - else - CU_DEBUG("Unknown class type for net device: %s", - CLASSNAME(op)); - + ret = net_rasd_to_vdev(inst, dev); } else if (type == CIM_RES_TYPE_MEM) { - cu_get_u64_prop(inst, "VirtualQuantity", &dev->dev.mem.size); - cu_get_u64_prop(inst, "Reservation", &dev->dev.mem.size); - dev->dev.mem.maxsize = dev->dev.mem.size; - cu_get_u64_prop(inst, "Limit", &dev->dev.mem.maxsize); - dev->dev.mem.size <<= 10; - dev->dev.mem.maxsize <<= 10; - } - - free(name); - - return 1; + ret = mem_rasd_to_vdev(inst, dev); + } + + return ret; err: - free(name); - free(devid); - return 0; } From danms at us.ibm.com Wed Apr 9 21:31:45 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 09 Apr 2008 14:31:45 -0700 Subject: [Libvirt-cim] [PATCH 5 of 6] Add function to parse out pool name from InstanceID In-Reply-To: Message-ID: <3d143b851ee9201986ce.1207776705@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1207776548 25200 # Node ID 3d143b851ee9201986ce8d0e6656cc313d361866 # Parent 0314f5ce51d0d8ba4d518c0a7a22c43e03be4dec Add function to parse out pool name from InstanceID Signed-off-by: Dan Smith diff -r 0314f5ce51d0 -r 3d143b851ee9 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Wed Apr 09 14:29:01 2008 -0700 +++ b/src/Virt_DevicePool.c Wed Apr 09 14:29:08 2008 -0700 @@ -500,6 +500,17 @@ uint16_t res_type_from_pool_id(const cha return CIM_RES_TYPE_UNKNOWN; } +char *name_from_pool_id(const char *id) +{ + char *s; + + s = strchr(id, '/'); + if (s == NULL) + return NULL; + + return strdup((char *)s+1); +} + static bool mempool_set_total(CMPIInstance *inst, virConnectPtr conn) { virNodeInfo info; diff -r 0314f5ce51d0 -r 3d143b851ee9 src/Virt_DevicePool.h --- a/src/Virt_DevicePool.h Wed Apr 09 14:29:01 2008 -0700 +++ b/src/Virt_DevicePool.h Wed Apr 09 14:29:08 2008 -0700 @@ -58,6 +58,14 @@ uint16_t res_type_from_pool_id(const cha uint16_t res_type_from_pool_id(const char *id); /** + * Get the pool name from a given pool's InstanceID + * + * @param id The InstanceID of the pool + * @returns the name (must be free'd by the caller) + */ +char *name_from_pool_id(const char *id); + +/** * Get all device pools on the system for the given type * * From zli at linux.vnet.ibm.com Wed Apr 9 23:22:23 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Thu, 10 Apr 2008 07:22:23 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] redirect logging to /dev/null instead of stderr In-Reply-To: <47FCE69E.1050804@linux.vnet.ibm.com> References: <47FCE69E.1050804@linux.vnet.ibm.com> Message-ID: <47FD4FAF.8080409@linux.vnet.ibm.com> Kaitlin Rupert wrote: > zli at linux.vnet.ibm.com wrote: >> # HG changeset patch >> # User Zhengang Li >> # Date 1207727823 25200 >> # Node ID f58194a3271fe20b19894c9f3472164316e1ee4c >> # Parent b5857217c64a081450cd21219035084eac455d85 >> [TEST] redirect logging to /dev/null instead of stderr >> >> The original default basicConfig() added a stderr Streamhandler. >> The log is duplicated to both the stderr and the file log 'vsmtest.log'. >> Outputting all the log to the screen makes the test less easier to read. >> >> Signed-off-by: Zhengang Li > > Thanks Zhengang for this patch - I've applied this. I'd noticed the > output of the suite had changed, but wasn't sure what the cause was. > > Agreed - the output is much easier to read with this patch applied. > However, I could see why duplicating the log to stderr might be useful > in some cases. > > Does anyone see value in this? We could add an option that allows to > user to enable logging to stderr. Although, if we decide to do this, > some of the tests will need to be cleaned up. Some tests are quite > verbose, which might need to be pared down. > > Thoughts? I was going for '-v' for 'verbose'. But we already have a '-v' for 'virt'. How about '-d' for 'debug output'? And I'd like this '-d' disabled by default. Ideas? -- - Zhengang From kaitlin at linux.vnet.ibm.com Wed Apr 9 23:30:30 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 09 Apr 2008 16:30:30 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] change AllocationCapabilities expected error string In-Reply-To: <87abk23gaa.fsf@caffeine.beaverton.ibm.com> References: <47FCE2E7.2030105@linux.vnet.ibm.com> <87abk23gaa.fsf@caffeine.beaverton.ibm.com> Message-ID: <47FD5196.5050609@linux.vnet.ibm.com> Dan Smith wrote: > KR> The hope here is that the error messages don't change often. > KR> Thoughts? > > I think the only thing you should depend on is the return code. > Interpreting the error string is likely to break. > Agreed - verifying the strings has been an upkeep headache. However, a provider can fail for a number of reasons and return the same error code for each one. Unfortunately (in the case anyway), CIM has such a small subset of return codes. So you can't accurately confirm that the test failed for the proper reason. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Wed Apr 9 23:48:59 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 09 Apr 2008 16:48:59 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] change AllocationCapabilities expected error string In-Reply-To: <47FD5196.5050609@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Wed, 09 Apr 2008 16:30:30 -0700") References: <47FCE2E7.2030105@linux.vnet.ibm.com> <87abk23gaa.fsf@caffeine.beaverton.ibm.com> <47FD5196.5050609@linux.vnet.ibm.com> Message-ID: <8763uq37ys.fsf@caffeine.beaverton.ibm.com> KR> However, a provider can fail for a number of reasons and return the KR> same error code for each one. Unfortunately (in the case anyway), CIM KR> has such a small subset of return codes. So you can't accurately KR> confirm that the test failed for the proper reason. Well, we can return provider-specific error codes in addition to the CIM-standard ones. We could conceivably add those into places where we need a more information about a particular failure case. Also, if we're not expecting an error, we should be sure to FAIL if the return is not CMPI_RC_OK, and then try to resolve the error code/message to a specific case if possible. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Wed Apr 9 23:55:51 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 09 Apr 2008 16:55:51 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] change AllocationCapabilities expected error string In-Reply-To: <8763uq37ys.fsf@caffeine.beaverton.ibm.com> References: <47FCE2E7.2030105@linux.vnet.ibm.com> <87abk23gaa.fsf@caffeine.beaverton.ibm.com> <47FD5196.5050609@linux.vnet.ibm.com> <8763uq37ys.fsf@caffeine.beaverton.ibm.com> Message-ID: <47FD5787.1070308@linux.vnet.ibm.com> Dan Smith wrote: > KR> However, a provider can fail for a number of reasons and return the > KR> same error code for each one. Unfortunately (in the case anyway), CIM > KR> has such a small subset of return codes. So you can't accurately > KR> confirm that the test failed for the proper reason. > > Well, we can return provider-specific error codes in addition to the > CIM-standard ones. We could conceivably add those into places where > we need a more information about a particular failure case. > > Also, if we're not expecting an error, we should be sure to FAIL if > the return is not CMPI_RC_OK, and then try to resolve the error > code/message to a specific case if possible. That would be useful, but also sounds like a fair bit of work. I see how it'd be useful for testing, but I'm not sure how useful it is for a regular consumer. I suppose for error reporting, users would then be able to supply the provider specific error code, which would be more meaningful to use than CMPI_RC_ERR_FAILED. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Apr 10 00:02:21 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 09 Apr 2008 17:02:21 -0700 Subject: [Libvirt-cim] [PATCH] Fix xml_parse_test to work with new definition of struct vcpu_device In-Reply-To: References: Message-ID: <47FD590D.6010301@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1207763825 25200 > # Node ID f0efb24ba68e89847815b6bf2cfa89dea0330398 > # Parent 6cddb842645dcf42c5780c38c3d38785f00f0de4 > Fix xml_parse_test to work with new definition of struct vcpu_device > > ...also print out the 'source' field of network devices > > Signed-off-by: Dan Smith > +1 =) -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From yunguol at cn.ibm.com Thu Apr 10 03:07:14 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 10 Apr 2008 11:07:14 +0800 Subject: [Libvirt-cim] libvirt-cim rpm for Fedora 9 versus recent provider repository Message-ID: Hi, The processor id changed to domanin_name/proc, then does the libvirt-cim rpm for Fedora 9 will reflect this recent changes? If so, when is it time to replace? Also the same issues in terms of MB versus KB for memory. I'm not sure if libvirt-cim rpm freezed, then how cimtest are represent? Do we have to branch cimtest into two parts, one for libvirt-cim rpm, the other for recent provider changes? Thanks! Best, Regards Daisy Guo Lian Yun E-mail: yunguol at cn.ibm.com IBM China Development Lab, Shanghai, China TEL: (86)-21-61008057 -------------- next part -------------- An HTML attachment was scrubbed... URL: From yunguol at cn.ibm.com Thu Apr 10 05:16:41 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 09 Apr 2008 22:16:41 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] fix verification error in 01_netport.py Message-ID: # HG changeset patch # User Guolian Yun # Date 1207804593 25200 # Node ID c24b13077839fd7cfb2313357a8ea695539b61bc # Parent 19ff9c851ed8cb76b74d158a4c439dfa5f4ccb50 [TEST] fix verification error in 01_netport.py Signed-off-by: Guolian Yun diff -r 19ff9c851ed8 -r c24b13077839 suites/libvirt-cim/cimtest/NetworkPort/01_netport.py --- a/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Wed Apr 09 18:00:14 2008 +0530 +++ b/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Wed Apr 09 22:16:33 2008 -0700 @@ -72,7 +72,7 @@ def main(): vsxml.undefine(options.ip) return XFAIL_RC(bug) - if dev == None: + if dev.DeviceID == None: logger.error("Error retrieving instance for devid %s" % devid) vsxml.undefine(options.ip) return FAIL From zli at linux.vnet.ibm.com Thu Apr 10 07:10:06 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Thu, 10 Apr 2008 15:10:06 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] Add -d to duplicate error output to stderr Message-ID: <28d173f24fb60cbbe230.1207811406@zeit.cn.ibm.com> # HG changeset patch # User Zhengang Li # Date 1207811341 -28800 # Node ID 28d173f24fb60cbbe230b7a67de97cb26aaa95dc # Parent 19ff9c851ed8cb76b74d158a4c439dfa5f4ccb50 [TEST] Add -d to duplicate error output to stderr This gives us the capability to output the error messages to screen. The default value is set to false, where error messages will only be saved in the 'vsmtest.log' file. Signed-off-by: Zhengang Li diff -r 19ff9c851ed8 -r 28d173f24fb6 lib/CimTest/Globals.py --- a/lib/CimTest/Globals.py Wed Apr 09 18:00:14 2008 +0530 +++ b/lib/CimTest/Globals.py Thu Apr 10 15:09:01 2008 +0800 @@ -68,6 +68,8 @@ parser.add_option("-v", "--virt", dest=" parser.add_option("-v", "--virt", dest="virt", type="choice", choices=platform_sup, default="Xen", help="Virt type, select from: 'Xen' & 'KVM' & 'XenFV', default: Xen") +parser.add_option("-d", "--debug-output", action="store_true", dest="debug", + help="Print the output to stderr") if not CIM_NS: CIM_NS = "root/cimv2" @@ -85,11 +87,14 @@ if not CIM_IP: if not CIM_IP: CIM_IP = "localhost" -def log_param(): +def log_param(debug=False): logger.setLevel(logging.DEBUG) #create console handler and set level to debug ch = logging.StreamHandler() - ch.setLevel(int(CIM_LEVEL)) + if debug: + ch.setLevel(logging.ERROR) + else: + ch.setLevel(int(CIM_LEVEL)) #create file handler and set level to debug fh = logging.FileHandler("vsmtest.log") fh.setLevel(logging.DEBUG) @@ -98,6 +103,7 @@ def log_param(): \t- %(message)s", datefmt="%a, %d %b %Y %H:%M:%S") #add formatter to handlers fh.setFormatter(formatter) + formatter = logging.Formatter("%(levelname)s \t- %(message)s") ch.setFormatter(formatter) #add handlers to logger logger.addHandler(fh) @@ -119,6 +125,7 @@ def do_main(types=['Xen'], p=parser): else: def do_try(): try: + log_param(options.debug) from VirtLib.utils import setup_ssh_key from XenKvmLib.test_doms import destroy_and_undefine_all setup_ssh_key() diff -r 19ff9c851ed8 -r 28d173f24fb6 suites/libvirt-cim/main.py --- a/suites/libvirt-cim/main.py Wed Apr 09 18:00:14 2008 +0530 +++ b/suites/libvirt-cim/main.py Thu Apr 10 15:09:01 2008 +0800 @@ -49,6 +49,9 @@ parser.add_option("-v", "--virt", dest=" parser.add_option("-v", "--virt", dest="virt", type="choice", choices=platform_sup, default="Xen", help="Virt type, select from 'Xen' & 'KVM' & 'XenFV'(default: Xen). ") +parser.add_option("-d", "--debug-output", action="store_true", dest="debug", + help="Print the output to stderr") + TEST_SUITE = 'cimtest' @@ -110,14 +113,19 @@ def main(): if options.clean: remove_old_logs(options.group) + if options.debug: + debug_param = "-d" + else: + debug_param = "" + print "Testing " + options.virt + " hypervisor" for test in test_list: t_path = os.path.join(TEST_SUITE, test['group']) os.environ['CIM_TC'] = test['test'] - cmd = "cd %s && python %s -i %s -v %s" % \ - (t_path, test['test'], options.ip, options.virt) + cmd = "cd %s && python %s -i %s -v %s %s" % \ + (t_path, test['test'], options.ip, options.virt, debug_param) status, output = commands.getstatusoutput(cmd) os_status = os.WEXITSTATUS(status) From zli at linux.vnet.ibm.com Thu Apr 10 07:15:23 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Thu, 10 Apr 2008 15:15:23 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] Add -d to duplicate error output to stderr In-Reply-To: <28d173f24fb60cbbe230.1207811406@zeit.cn.ibm.com> References: <28d173f24fb60cbbe230.1207811406@zeit.cn.ibm.com> Message-ID: <47FDBE8B.7040705@linux.vnet.ibm.com> zli at linux.vnet.ibm.com wrote: > @@ -119,6 +125,7 @@ def do_main(types=['Xen'], p=parser): > else: > def do_try(): > try: > + log_param(options.debug) log_param() is invoked here. It doesn't hurt to leave the invoke in every test cases. But we don't have to add that in future test cases. > from VirtLib.utils import setup_ssh_key > from XenKvmLib.test_doms import destroy_and_undefine_all > setup_ssh_key() -- - Zhengang From deeptik at linux.vnet.ibm.com Thu Apr 10 11:03:40 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 10 Apr 2008 16:33:40 +0530 Subject: [Libvirt-cim] CimTest Report on XenFV 10-04-2008 Message-ID: <47FDF40C.1010202@linux.vnet.ibm.com> Hi, Please find the test case list that are failing for the XenFV below: Please see the attachment for the complete result. Total FAIL : 14 ComputerSystem - 04_defineStartVS.py: FAIL Thu, 10 Apr 2008 12:42:52:TEST LOG:INFO - ====04_defineStartVS.py Log==== Thu, 10 Apr 2008 12:42:53:TEST LOG:ERROR - Error: property values are not set for VS domguest ComputerSystem - 06_paused_active_suspend.py: FAIL Thu, 10 Apr 2008 12:42:58:TEST LOG:INFO - ====06_paused_active_suspend.py Log==== Thu, 10 Apr 2008 12:42:59:TEST LOG:ERROR - Exception: (1, u'CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Domain not running"') Thu, 10 Apr 2008 12:42:59:TEST LOG:ERROR - Unable to suspend dom DomST1 using RequestedStateChange() ComputerSystem - 23_suspend_suspend.py: FAIL Thu, 10 Apr 2008 12:43:03:TEST LOG:INFO - ====23_suspend_suspend.py Log==== Thu, 10 Apr 2008 12:43:04:TEST LOG:ERROR - Unexpected rc code 1 and description: CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" Thu, 10 Apr 2008 12:43:04:TEST LOG:ERROR - Unable to define domain test_domain using DefineSystem() ComputerSystem - 27_define_suspend_errs.py: FAIL Thu, 10 Apr 2008 12:43:05:TEST LOG:INFO - ====27_define_suspend_errs.py Log==== Thu, 10 Apr 2008 12:43:05:TEST LOG:ERROR - Unexpected rc code 1 and description: CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" Thu, 10 Apr 2008 12:43:05:TEST LOG:ERROR - Unable to define domain test_domain using DefineSystem() ComputerSystem - 32_start_reboot.py: FAIL Thu, 10 Apr 2008 12:43:06:TEST LOG:INFO - ====32_start_reboot.py Log==== Thu, 10 Apr 2008 12:43:06:TEST LOG:ERROR - Unexpected rc code 1 and description: CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" Thu, 10 Apr 2008 12:43:06:TEST LOG:ERROR - Unable to define domain test_domain using DefineSystem() ComputerSystem - 33_suspend_reboot.py: FAIL Thu, 10 Apr 2008 12:43:08:TEST LOG:INFO - ====33_suspend_reboot.py Log==== Thu, 10 Apr 2008 12:43:08:TEST LOG:ERROR - Unexpected rc code 1 and description: CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" Thu, 10 Apr 2008 12:43:08:TEST LOG:ERROR - Unable to define domain test_domain using DefineSystem() ComputerSystem - 35_start_reset.py: FAIL Thu, 10 Apr 2008 12:43:09:TEST LOG:INFO - ====35_start_reset.py Log==== Thu, 10 Apr 2008 12:43:09:TEST LOG:ERROR - Unexpected rc code 1 and description: CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" Thu, 10 Apr 2008 12:43:09:TEST LOG:ERROR - Unable to define domain test_domain using DefineSystem() ComputerSystem - 40_RSC_start.py: FAIL Thu, 10 Apr 2008 12:43:10:TEST LOG:INFO - ====40_RSC_start.py Log==== Thu, 10 Apr 2008 12:43:11:TEST LOG:ERROR - Unexpected rc code 1 and description: CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" Thu, 10 Apr 2008 12:43:11:TEST LOG:ERROR - Exception: ('Unable create domain %s using DefineSystem()', 'test_domain') ComputerSystemIndication - 01_created_indication.py: FAIL Thu, 10 Apr 2008 12:43:14:TEST LOG:INFO - ====01_created_indication.py Log==== Thu, 10 Apr 2008 12:46:23:TEST LOG:ERROR - error : (110, 'Connection timed out') Memory - 02_defgetmem.py: FAIL Thu, 10 Apr 2008 12:47:30:TEST LOG:INFO - ====02_defgetmem.py Log==== Thu, 10 Apr 2008 12:47:30:TEST LOG:ERROR - Unexpected rc code 1 and description: CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" Thu, 10 Apr 2008 12:47:30:TEST LOG:ERROR - Exception: Unable to create domain domu using DefineSys() NetworkPort - 01_netport.py: FAIL Thu, 10 Apr 2008 12:47:35:TEST LOG:INFO - ====01_netport.py Log==== Thu, 10 Apr 2008 12:47:36:TEST LOG:ERROR - KeyError : '__eq__' Processor - 02_definesys_get_procs.py: FAIL Thu, 10 Apr 2008 12:47:45:TEST LOG:INFO - ====02_definesys_get_procs.py Log==== Thu, 10 Apr 2008 12:47:45:TEST LOG:ERROR - Unexpected rc code 1 and description: CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" Thu, 10 Apr 2008 12:47:45:TEST LOG:ERROR - Exception: Unable create domain test_domain using DefineSystem() VirtualSystemManagementService - 01_definesystem_name.py: FAIL Thu, 10 Apr 2008 12:49:09:TEST LOG:INFO - ====01_definesystem_name.py Log==== Thu, 10 Apr 2008 12:49:09:TEST LOG:ERROR - Unexpected rc code 1 and description: CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL Thu, 10 Apr 2008 12:49:17:TEST LOG:INFO - ====05_destroysystem_neg.py Log==== Thu, 10 Apr 2008 12:49:17:TEST LOG:ERROR - destroy_fail>>nonexistent: Got rc: 2, but we expect 4 Thu, 10 Apr 2008 12:49:17:TEST LOG:ERROR - destroy_fail>>nonexistent: Got rc: 2, but we expect 4 Thanks and Regards, Deepti. From deeptik at linux.vnet.ibm.com Thu Apr 10 13:27:48 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 10 Apr 2008 18:57:48 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fixed the tc 05_destroysystem_neg.py failure Message-ID: <1f4926b238908ff7f4c6.1207834068@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207834054 -19800 # Node ID 1f4926b238908ff7f4c6610fde37490492ba559c # Parent 19ff9c851ed8cb76b74d158a4c439dfa5f4ccb50 [TEST] Fixed the tc 05_destroysystem_neg.py failure . Signed-off-by: Deepti B. Kalakeri diff -r 19ff9c851ed8 -r 1f4926b23890 suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py Wed Apr 09 18:00:14 2008 +0530 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py Thu Apr 10 18:57:34 2008 +0530 @@ -22,12 +22,9 @@ # import sys -import pywbem from pywbem.cim_obj import CIMInstanceName -from VirtLib import utils from XenKvmLib import vsms from XenKvmLib.classes import get_typed_class -from XenKvmLib.test_doms import undefine_test_domain from CimTest.Globals import log_param, logger from CimTest.Globals import do_main from CimTest.ReturnCodes import FAIL, PASS, SKIP @@ -44,13 +41,12 @@ def destroysystem_fail(tc, options): cs_ref = CIMInstanceName(classname, keybindings = {'CreationClassName':classname}) elif tc == 'nonexistent': - exp_rc = 4 #IM_RC_SYS_NOT_FOUND - cs_ref = CIMInstanceName(classname,keybindings = { + exp_rc = 2 #IM_RC_SYS_NOT_FOUND + cs_ref = CIMInstanceName(classname, keybindings = { 'Name':'##@@!!cimtest_domain', 'CreationClassName':classname}) else: return SKIP - status = FAIL try: ret = service.DestroySystem(AffectedSystem=cs_ref) From deeptik at linux.vnet.ibm.com Thu Apr 10 13:34:43 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 10 Apr 2008 19:04:43 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing the 04_defineStartVS.py tc failure Message-ID: <0e7eb39ed839e03d1dd2.1207834483@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207834470 -19800 # Node ID 0e7eb39ed839e03d1dd2635157f19e5acdc4c9be # Parent 1f4926b238908ff7f4c6610fde37490492ba559c [TEST] Fixing the 04_defineStartVS.py tc failure. Signed-off-by: Deepti B. Kalakeri diff -r 1f4926b23890 -r 0e7eb39ed839 suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Thu Apr 10 18:57:34 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Thu Apr 10 19:04:30 2008 +0530 @@ -6,6 +6,7 @@ # Kaitlin Rupert # Veerendra Chandrappa # Zhengang Li +# Deepti B. kalakeri # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public @@ -28,10 +29,11 @@ # 10-Oct-2007 import sys +from time import sleep from XenKvmLib import vxml from XenKvmLib import computersystem -from VirtLib import utils from CimTest import Globals +from XenKvmLib.classes import get_typed_class from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL @@ -53,18 +55,21 @@ def main(): Globals.logger.error("Failed to Start the dom: %s", test_dom) cxml.undefine(options.ip) return status - + + timeout = 10 try: - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) - - if cs.Name == test_dom: - enabState = cs.EnabledState - else: - Globals.logger.error("VS %s is not defined" % test_dom) - - # Success: VS is in Enabled State after Define and Start - if enabState == 2: - status = PASS + # Need to poll for XenFV, since enabState is not getting set otherwise. + for i in range(1, (timeout + 1)): + sleep(1) + cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) + if cs.Name == test_dom: + enabState = cs.EnabledState + else: + Globals.logger.error("VS %s is not defined" % test_dom) + # Success: VS is in Enabled State after Define and Start + if enabState == 2: + status = PASS + break except Exception, detail: Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE, From deeptik at linux.vnet.ibm.com Thu Apr 10 13:36:08 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 10 Apr 2008 19:06:08 +0530 Subject: [Libvirt-cim] [PATCH] [TEST]Fixing 06_paused_active_suspend.py tc failure Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207834557 -19800 # Node ID dac8e3a5491b28fd6946e6fabf0d4b14cd9921fe # Parent 0e7eb39ed839e03d1dd2635157f19e5acdc4c9be [TEST]Fixing 06_paused_active_suspend.py tc failure. Signed-off-by: Deepti B. Kalakeri diff -r 0e7eb39ed839 -r dac8e3a5491b suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py Thu Apr 10 19:04:30 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py Thu Apr 10 19:05:57 2008 +0530 @@ -44,8 +44,6 @@ from time import sleep from time import sleep from XenKvmLib import computersystem from XenKvmLib import vxml -from VirtLib import utils -from XenKvmLib.test_doms import destroy_and_undefine_all from CimTest.Globals import log_param, logger from CimTest.Globals import do_main from XenKvmLib.common_util import call_request_state_change @@ -61,6 +59,37 @@ FINAL_STATE = 9 FINAL_STATE = 9 REQUESTED_STATE = FINAL_STATE TIME = "00000000000000.000000:000" + +def poll_for_status(server, virt, cxml, expstate): +#Polling for the value of EnabledState to be set to expstate. +#We need to wait for the EnabledState to be set appropriately since +#it does not get set immediatley to value of expstate when created/suspended. + status = FAIL + timeout = 10 + try: + + for i in range(1, (timeout + 1)): + sleep(1) + cs = computersystem.get_cs_class(virt)(server, test_dom) + if cs.Name == test_dom: + to_RequestedState = cs.RequestedState + enabledState = cs.EnabledState + else: + logger.error("VS %s not found" % test_dom) + return status + if enabledState == expstate: + status = PASS + break + + except Exception, detail: + logger.error("Exception variable: %s" % detail) + + if status != PASS: + logger.error("Mismatching state values got %i instead of %i", enabledState, expstate) + cxml.destroy(server) + cxml.undefine(server) + + return status, to_RequestedState, enabledState @do_main(sup_types) def main(): @@ -87,45 +116,26 @@ def main(): cxml.destroy(options.ip) cxml.undefine(options.ip) return status - + + status, to_RequestedState, enabledState = poll_for_status(options.ip, options.virt, cxml, 2) + if status != PASS or enabledState != 2: + return status + #Suspend the VS - rc = call_request_state_change(test_dom, options.ip, REQUESTED_STATE, - TIME, options.virt) + rc = call_request_state_change(test_dom, options.ip, REQUESTED_STATE, TIME, options.virt) if rc != 0: logger.error("Unable to suspend dom %s using RequestedStateChange()", test_dom) cxml.destroy(options.ip) cxml.undefine(options.ip) return status -#Polling for the value of EnabledState to be set to 9. -#We need to wait for the EnabledState to be set appropriately since -#it does not get set immediatley to value of 9 when suspended. - timeout = 10 - try: - for i in range(1, (timeout + 1)): - sleep(1) - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) - if cs.Name == test_dom: - to_RequestedState = cs.RequestedState - enabledState = cs.EnabledState - else: - logger.error("VS %s not found" % test_dom) - return status - if enabledState == FINAL_STATE: - status = PASS - break - - except Exception, detail: - logger.error("Exception variable: %s" % detail) - return status - + status, to_RequestedState, enabledState = poll_for_status(options.ip, options.virt, cxml, + FINAL_STATE) if enabledState != FINAL_STATE: logger.error("EnabledState has %i instead of %i", enabledState, FINAL_STATE) logger.error("Try to increase the timeout and run the test again") if status != PASS: - ret = cxml.destroy(options.ip) - cxml.undefine(options.ip) return status # Success: @@ -134,9 +144,8 @@ def main(): # To state == 2 # Enabled_state == RequestedState - if from_State == START_STATE and \ - to_RequestedState == FINAL_STATE and \ - enabledState == to_RequestedState: + if from_State == START_STATE and to_RequestedState == FINAL_STATE and \ + enabledState == to_RequestedState: status = PASS else: logger.error("ERROR: VS %s transition from suspend State to Activate state \ From deeptik at linux.vnet.ibm.com Thu Apr 10 13:44:23 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 10 Apr 2008 19:14:23 +0530 Subject: [Libvirt-cim] Re: CimTest Report on XenFV 10-04-2008 In-Reply-To: <47FDF40C.1010202@linux.vnet.ibm.com> References: <47FDF40C.1010202@linux.vnet.ibm.com> Message-ID: <47FE19B7.2040003@linux.vnet.ibm.com> Sorry Forgot the attachment for the complete result. Also , in the test report the test cases which do not have support for XenFV are skipped. Also see my comments inline for the test result. Thanks and Regards, Deepti. Deepti B Kalakeri wrote: > Hi, > > Please find the test case list that are failing for the XenFV below: > Please see the attachment for the complete result. > Total FAIL : 14 > > ComputerSystem - 04_defineStartVS.py: FAIL > Thu, 10 Apr 2008 12:42:52:TEST LOG:INFO - > ====04_defineStartVS.py Log==== > Thu, 10 Apr 2008 12:42:53:TEST LOG:ERROR - Error: property > values are not set for VS domguest > The tc are failing since they are not able to get the required property values set immediately. Fixed the tc by adding logic to poll. > ComputerSystem - 06_paused_active_suspend.py: FAIL > Thu, 10 Apr 2008 12:42:58:TEST LOG:INFO - > ====06_paused_active_suspend.py Log==== > Thu, 10 Apr 2008 12:42:59:TEST LOG:ERROR - Exception: (1, > u'CIM_ERR_FAILED: A general error occurred that is not covered by a > more specific error code: "Domain not running"') > Thu, 10 Apr 2008 12:42:59:TEST LOG:ERROR - Unable to suspend > dom DomST1 using RequestedStateChange() > same as above. Fixed the tc by adding logic to poll. > ComputerSystem - 23_suspend_suspend.py: FAIL > Thu, 10 Apr 2008 12:43:03:TEST LOG:INFO - > ====23_suspend_suspend.py Log==== > Thu, 10 Apr 2008 12:43:04:TEST LOG:ERROR - Unexpected rc code > 1 and description: > CIM_ERR_FAILED: A general error occurred that is not covered by a more > specific error code: "Failed to create domain" > Thu, 10 Apr 2008 12:43:04:TEST LOG:ERROR - Unable to define > domain test_domain using DefineSystem() > > ComputerSystem - 27_define_suspend_errs.py: FAIL > Thu, 10 Apr 2008 12:43:05:TEST LOG:INFO - > ====27_define_suspend_errs.py Log==== > Thu, 10 Apr 2008 12:43:05:TEST LOG:ERROR - Unexpected rc code > 1 and description: > CIM_ERR_FAILED: A general error occurred that is not covered by a more > specific error code: "Failed to create domain" > Thu, 10 Apr 2008 12:43:05:TEST LOG:ERROR - Unable to define > domain test_domain using DefineSystem() > > ComputerSystem - 32_start_reboot.py: FAIL > Thu, 10 Apr 2008 12:43:06:TEST LOG:INFO - > ====32_start_reboot.py Log==== > Thu, 10 Apr 2008 12:43:06:TEST LOG:ERROR - Unexpected rc code > 1 and description: > CIM_ERR_FAILED: A general error occurred that is not covered by a more > specific error code: "Failed to create domain" > Thu, 10 Apr 2008 12:43:06:TEST LOG:ERROR - Unable to define > domain test_domain using DefineSystem() > > ComputerSystem - 33_suspend_reboot.py: FAIL > Thu, 10 Apr 2008 12:43:08:TEST LOG:INFO - > ====33_suspend_reboot.py Log==== > Thu, 10 Apr 2008 12:43:08:TEST LOG:ERROR - Unexpected rc code > 1 and description: > CIM_ERR_FAILED: A general error occurred that is not covered by a more > specific error code: "Failed to create domain" > Thu, 10 Apr 2008 12:43:08:TEST LOG:ERROR - Unable to define > domain test_domain using DefineSystem() > > ComputerSystem - 35_start_reset.py: FAIL > Thu, 10 Apr 2008 12:43:09:TEST LOG:INFO - > ====35_start_reset.py Log==== > Thu, 10 Apr 2008 12:43:09:TEST LOG:ERROR - Unexpected rc code > 1 and description: > CIM_ERR_FAILED: A general error occurred that is not covered by a more > specific error code: "Failed to create domain" > Thu, 10 Apr 2008 12:43:09:TEST LOG:ERROR - Unable to define > domain test_domain using DefineSystem() > > ComputerSystem - 40_RSC_start.py: FAIL > Thu, 10 Apr 2008 12:43:10:TEST LOG:INFO - ====40_RSC_start.py > Log==== > Thu, 10 Apr 2008 12:43:11:TEST LOG:ERROR - Unexpected rc code > 1 and description: > CIM_ERR_FAILED: A general error occurred that is not covered by a more > specific error code: "Failed to create domain" > Thu, 10 Apr 2008 12:43:11:TEST LOG:ERROR - Exception: ('Unable > create domain %s using DefineSystem()', 'test_domain') > > ComputerSystemIndication - 01_created_indication.py: FAIL > Thu, 10 Apr 2008 12:43:14:TEST LOG:INFO - > ====01_created_indication.py Log==== > Thu, 10 Apr 2008 12:46:23:TEST LOG:ERROR - error : (110, > 'Connection timed out') > > Memory - 02_defgetmem.py: FAIL > Thu, 10 Apr 2008 12:47:30:TEST LOG:INFO - ====02_defgetmem.py > Log==== > Thu, 10 Apr 2008 12:47:30:TEST LOG:ERROR - Unexpected rc code 1 > and description: > CIM_ERR_FAILED: A general error occurred that is not covered by a more > specific error code: "Failed to create domain" > Thu, 10 Apr 2008 12:47:30:TEST LOG:ERROR - Exception: Unable to > create domain domu using DefineSys() > Need to look into the above tc which are failing. > NetworkPort - 01_netport.py: FAIL > Thu, 10 Apr 2008 12:47:35:TEST LOG:INFO - ====01_netport.py > Log==== > Thu, 10 Apr 2008 12:47:36:TEST LOG:ERROR - KeyError : '__eq__' > Test case error fixed it. > Processor - 02_definesys_get_procs.py: FAIL > Thu, 10 Apr 2008 12:47:45:TEST LOG:INFO - > ====02_definesys_get_procs.py Log==== > Thu, 10 Apr 2008 12:47:45:TEST LOG:ERROR - Unexpected rc code > 1 and description: > CIM_ERR_FAILED: A general error occurred that is not covered by a more > specific error code: "Failed to create domain" > Thu, 10 Apr 2008 12:47:45:TEST LOG:ERROR - Exception: Unable > create domain test_domain using DefineSystem() > > VirtualSystemManagementService - 01_definesystem_name.py: FAIL > Thu, 10 Apr 2008 12:49:09:TEST LOG:INFO - > ====01_definesystem_name.py Log==== > Thu, 10 Apr 2008 12:49:09:TEST LOG:ERROR - Unexpected rc code > 1 and description: > CIM_ERR_FAILED: A general error occurred that is not covered by a more > specific error code: "Failed to create domain" > Need to look into the above tc which are failing. > VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL > Thu, 10 Apr 2008 12:49:17:TEST LOG:INFO - > ====05_destroysystem_neg.py Log==== > Thu, 10 Apr 2008 12:49:17:TEST LOG:ERROR - > destroy_fail>>nonexistent: Got rc: 2, but we expect 4 > Thu, 10 Apr 2008 12:49:17:TEST LOG:ERROR - > destroy_fail>>nonexistent: Got rc: 2, but we expect 4 > The error code returned was mismatching. Fixed it. I have a doubt here though. The part of the code in Virt_VirtualSystemManagementService.c which is checked here does seem to handle all the error condition. 520 error: 521 if (rc == IM_RC_SYS_NOT_FOUND) 522 cu_statusf(_BROKER, &status, 523 CMPI_RC_ERR_FAILED, 524 "Failed to find domain"); 525 else if (rc == IM_RC_OK) 526 status = (CMPIStatus){CMPI_RC_OK, NULL}; 527 The tc does should have got the "Failed to find domain" error when a nonexisting domain is passed, but this is not so because the part of the code which is used to check this does not set the rc to IM_RC_SYS_NOT_FOUND before junping to error , see the code below. // Make sure system exists and destroy it. if (!domain_exists(conn, dom_name)) goto error; > > Thanks and Regards, > Deepti. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: April10-report-complete URL: From deeptik at linux.vnet.ibm.com Thu Apr 10 13:44:57 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 10 Apr 2008 19:14:57 +0530 Subject: [Libvirt-cim] [PATCH] [TEST]Fixing 01_netport.py tc failure Message-ID: <0b1dc112438b0362c888.1207835097@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207835007 -19800 # Node ID 0b1dc112438b0362c88891c4a690fd92bf6ca628 # Parent 19ff9c851ed8cb76b74d158a4c439dfa5f4ccb50 [TEST]Fixing 01_netport.py tc failure. Signed-off-by: Deepti B. Kalakeri diff -r 19ff9c851ed8 -r 0b1dc112438b suites/libvirt-cim/cimtest/NetworkPort/01_netport.py --- a/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Wed Apr 09 18:00:14 2008 +0530 +++ b/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Thu Apr 10 19:13:27 2008 +0530 @@ -51,6 +51,7 @@ def main(): def main(): options = main.options log_param() + status = PASS vsxml = get_class(options.virt)(test_dom, mac=test_mac) vsxml.define(options.ip) @@ -61,9 +62,7 @@ def main(): '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) @@ -72,12 +71,10 @@ def main(): vsxml.undefine(options.ip) return XFAIL_RC(bug) - if dev == None: + if devid not in dev.DeviceID : logger.error("Error retrieving instance for devid %s" % devid) vsxml.undefine(options.ip) return FAIL - - status = PASS if dev.LinkTechnology != devices.LinkTechnology_Ethernet: logger.error("LinkTechnology should be set to `%i' instead of `%s'" % \ @@ -86,20 +83,17 @@ def main(): addrs = dev.NetworkAddresses if len(addrs) != 1: - logger.error("Too many NetworkAddress entries (%i instead of %i)" % \ - (len(addrs), 1)) + logger.error("Too many NetworkAddress entries (%i instead of %i)" % (len(addrs), 1)) status = FAIL if addrs[0] != test_mac: - logger.error("MAC address reported incorrectly (%s instead of %s)" % \ - (addrs[0], test_mac)) + logger.error("MAC address reported incorrectly (%s instead of %s)" % (addrs[0], test_mac)) status = FAIL if status == FAIL: logger.error("Checked interface %s" % test_mac) vsxml.undefine(options.ip) - return status if __name__ == "__main__": From deeptik at linux.vnet.ibm.com Thu Apr 10 13:46:04 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 10 Apr 2008 19:16:04 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Adding 05_RAPF_err.py to verify RAPF In-Reply-To: <47FCEF48.80602@linux.vnet.ibm.com> References: <0142551c8d3cf5f2a3bb.1207303063@dkalaker> <87fxu1ad7f.fsf@caffeine.beaverton.ibm.com> <47FB1324.7000307@linux.vnet.ibm.com> <47FBBBBB.3030408@linux.vnet.ibm.com> <47FCA904.106@linux.vnet.ibm.com> <47FCEF48.80602@linux.vnet.ibm.com> Message-ID: <47FE1A1C.9020008@linux.vnet.ibm.com> Kaitlin Rupert wrote: >>>> Ok , will modify this. >>>>> DK> + if virt != 'XenFV': >>>>> DK> + bridge = vsxml.set_vbridge(server) >>>>> >>>>> Can you explain why this special case exists? >>>>> >>>>> >>>> The network information for the XenFV is getting assigned by default. >>>> The def _devices(): section of the XenFV is calling the >>>> >>>> self.set_bridge(CIM_IP) and hence the bridge information is getting >>>> assigned by default. >>>> While this is not the case with the Xen and KVM. >>> >>> KVM also calls set_bridge() in the _devices() call. >>> >>> Xen does not, but the _devices() call for Xen sets the interface as >>> an ethernet type. So there's no need to set a bridge for the Xen case. >> Wrt to the tc when working with NetRASD requires the domain to be >> created with interface type as bridge. >> NetRASD lists the domains which are created with bridge as the >> network type. Please correct me if I am wrong. > > You'll only get a NetRASD instance if the guest has an interface that > is tied to a virtual network. That is - if the guest's bridge belongs > to a defined virtual network. > >> I suggest we keep the default network type for all the three Virtual >> types to be bridge and the give >> another function which allows to add network type other than bridge >> to the domain when required >> > > The original Xen XML used an ethernet style network as the default. > Can you verify which (if any) test cases will be affected if we change > Xen to use a bridge style network as the default? > > In general, I'd like to see the default XML for all three types be as > similar as possible (where it makes sense). So I think this is a > sound idea. > I need to verify this. From danms at us.ibm.com Thu Apr 10 15:59:27 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 10 Apr 2008 08:59:27 -0700 Subject: [Libvirt-cim] libvirt-cim rpm for Fedora 9 versus recent provider repository In-Reply-To: (Guo Lian Yun's message of "Thu, 10 Apr 2008 11:07:14 +0800") References: Message-ID: <871w5d7lb4.fsf@caffeine.beaverton.ibm.com> GY> The processor id changed to domanin_name/proc, then does the GY> libvirt-cim rpm for Fedora 9 will reflect this recent changes? If GY> so, when is it time to replace? Also the same issues in terms of GY> MB versus KB for memory. I'm not sure if libvirt-cim rpm freezed, GY> then how cimtest are represent? Do we have to branch cimtest into GY> two parts, one for libvirt-cim rpm, the other for recent provider GY> changes? This is a good point. The Fedora 9 RPM has been unchanged for a while now, so none of the changes that you mention are included. I think that the test development should proceed to track the libvirt-cim development tree, but perhaps there is a way that we can map FAIL to XFAIL for older versions of the provider. Does anyone have a suggestion for a reasonable way we could do this? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From veillard at redhat.com Thu Apr 10 17:26:54 2008 From: veillard at redhat.com (Daniel Veillard) Date: Thu, 10 Apr 2008 13:26:54 -0400 Subject: [Libvirt-cim] libvirt-cim rpm for Fedora 9 versus recent provider repository In-Reply-To: <871w5d7lb4.fsf@caffeine.beaverton.ibm.com> References: <871w5d7lb4.fsf@caffeine.beaverton.ibm.com> Message-ID: <20080410172653.GA7050@redhat.com> On Thu, Apr 10, 2008 at 08:59:27AM -0700, Dan Smith wrote: > GY> The processor id changed to domanin_name/proc, then does the > GY> libvirt-cim rpm for Fedora 9 will reflect this recent changes? If > GY> so, when is it time to replace? Also the same issues in terms of > GY> MB versus KB for memory. I'm not sure if libvirt-cim rpm freezed, > GY> then how cimtest are represent? Do we have to branch cimtest into > GY> two parts, one for libvirt-cim rpm, the other for recent provider > GY> changes? > > This is a good point. The Fedora 9 RPM has been unchanged for a while > now, so none of the changes that you mention are included. I think Basically the Fedora-9 tree is frozen, but you should be able to push update for it after it has been released > that the test development should proceed to track the libvirt-cim > development tree, but perhaps there is a way that we can map FAIL to Well you could push dated release to rawhide but it can get tiring quickly Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From danms at us.ibm.com Thu Apr 10 18:10:56 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 10 Apr 2008 11:10:56 -0700 Subject: [Libvirt-cim] libvirt-cim rpm for Fedora 9 versus recent provider repository In-Reply-To: <20080410172653.GA7050@redhat.com> (Daniel Veillard's message of "Thu, 10 Apr 2008 13:26:54 -0400") References: <871w5d7lb4.fsf@caffeine.beaverton.ibm.com> <20080410172653.GA7050@redhat.com> Message-ID: <87od8h60nj.fsf@caffeine.beaverton.ibm.com> DV> Basically the Fedora-9 tree is frozen, but you should be able to DV> push update for it after it has been released Right, which I definitely plan to do. I'd like the ability to look at a test report and see "X failures that have been fixed in the tree but are not fixed on the current platform". That will help indicate when a refresh to Fedora or a new release is a good idea. Might be a bit of a lofty goal, though :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Thu Apr 10 22:34:00 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 10 Apr 2008 15:34:00 -0700 Subject: [Libvirt-cim] [PATCH 6 of 6] Make VSMS not parse the InstanceID of a RASD, but rather use the proper fields In-Reply-To: <01e5b1388ee7604332c4.1207776706@guaranine.danplanet.com> References: <01e5b1388ee7604332c4.1207776706@guaranine.danplanet.com> Message-ID: <47FE95D8.2030709@linux.vnet.ibm.com> > > const static CMPIBroker *_BROKER; > @@ -202,8 +203,16 @@ static int xen_net_rasd_to_vdev(CMPIInst > static int xen_net_rasd_to_vdev(CMPIInstance *inst, > struct virt_device *dev) > { > + const char *val = NULL; > + > free(dev->dev.net.type); > - dev->dev.net.type = strdup("bridge"); > + dev->dev.net.type = strdup("network"); > + > + if (cu_get_str_prop(inst, "PoolID", &val) != CMPI_RC_OK) > + val = "NetworkPool/default"; The default network pool isn't guaranteed to be present. In such a case, the creation of a guest using "network" will fail. Would it be possible to print a meaningful error message in this case? We currently print "Failed to create domain" which isn't very descriptive. Should we use the libvirt API to attempt to discover an available pool? Also, why define val as "NetworkPool/default" just to strip out the "NetworkPool/" piece later on? Is this for clarity / readability reasons? > +static int net_rasd_to_vdev(CMPIInstance *inst, > + struct virt_device *dev) > +{ > + const char *val = NULL; > + CMPIObjectPath *op; > + > + if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) > + val = "00:00:00:00:00:00"; Why does this value differ from the random value assigned in the default NetRASD? I guess this brings up the question - should we be pulling these defaults from the default RASDs? Or should we not assume defaults at all and fail if an attribute we need isn't supplied? The problem I see is that the profiles don't explicitly define what attributes are required. It seems that the default RASDs define this for us in some cases, but not all (see VirtualDevice and Address for disk devices). Should these values be placed in the default RASDs as well? Either way, I'm not sure it's meaningful to use a default value for something such as the mac address. Maybe a distinction could be made - for things like network pool, we can use a default (a statically defined one as included above, or a discover a pool if available). For something like a mac address, which really should be supplied by the user, we can fail. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Thu Apr 10 23:03:29 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 10 Apr 2008 16:03:29 -0700 Subject: [Libvirt-cim] [PATCH 6 of 6] Make VSMS not parse the InstanceID of a RASD, but rather use the proper fields In-Reply-To: <47FE95D8.2030709@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Thu, 10 Apr 2008 15:34:00 -0700") References: <01e5b1388ee7604332c4.1207776706@guaranine.danplanet.com> <47FE95D8.2030709@linux.vnet.ibm.com> Message-ID: <87bq4hs472.fsf@caffeine.beaverton.ibm.com> KR> The default network pool isn't guaranteed to be present. In such a KR> case, the creation of a guest using "network" will fail. Good point. KR> Would it be possible to print a meaningful error message in this KR> case? We currently print "Failed to create domain" which isn't KR> very descriptive. Yeah, we're pretty deep in the plumbing here, I'll see how I can improve that. KR> Should we use the libvirt API to attempt to discover an available KR> pool? We'd need to establish a connection to do that, which seems a little hefty. I wonder what happens if we request a 'network' type without specifying the network we want? Maybe it will take the first one... KR> Also, why define val as "NetworkPool/default" just to strip out KR> the "NetworkPool/" piece later on? Is this for clarity / KR> readability reasons? Yeah, it lets the rest of the code assume you've got a valid Pool InstanceID in your PoolID, which is what would happen if you had allocated it properly with AC. This makes it effective take the exact same path for the default case, which I think is a reasonable expectation. KR> Why does this value differ from the random value assigned in the KR> default NetRASD? Well, because I was thinking that if you didn't specify a MAC and/or you didn't go through the allocation step with AC. However, I'm not sure this is a sane way to handle it, so it's good you brought it up. KR> I guess this brings up the question - should we be pulling these KR> defaults from the default RASDs? Or should we not assume defaults KR> at all and fail if an attribute we need isn't supplied? I tend to want to say that the DefineSystem() call is not an allocation step. You either specify the resources you want, or that you have allocated from AC, or it's an error. There are some fields of a RASD that aren't required, of course, but there are some that should be mandatory. In the network RASD, I think MAC would count as mandatory. If later, we wanted to have the ability to control the MAC allocation per pool (say, to check to see if a randomly-generated MAC was already in use in the pool), doing it automatically here would be a little harder to reconcile, I think. My feeling is that failure to specify something this fundamental in your domain config should be an error. What do others think? KR> The problem I see is that the profiles don't explicitly define KR> what attributes are required. It seems that the default RASDs KR> define this for us in some cases, but not all (see VirtualDevice KR> and Address for disk devices). Should these values be placed in KR> the default RASDs as well? Well, I'm not sure that it makes sense to have a default path for the default DiskRASD, although a default VirtualDevice of 'xvda' for xen and 'hda' for KVM seems sane to me. KR> Either way, I'm not sure it's meaningful to use a default value KR> for something such as the mac address. Maybe a distinction could KR> be made for things like network pool, we can use a default (a KR> statically defined one as included above, or a discover a pool if KR> available). For something like a mac address, which really should KR> be supplied by the user, we can fail. Yeah, I think that if they specify the MAC and don't specify a pool, it makes sense to use the default (or first-found pool). I'll check into the libvirt behavior mentioned above and post another round for comments. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Fri Apr 11 00:18:54 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 10 Apr 2008 17:18:54 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] redirect logging to /dev/null instead of stderr In-Reply-To: <47FD4FAF.8080409@linux.vnet.ibm.com> References: <47FCE69E.1050804@linux.vnet.ibm.com> <47FD4FAF.8080409@linux.vnet.ibm.com> Message-ID: <47FEAE6E.1020904@linux.vnet.ibm.com> Zhengang Li wrote: > Kaitlin Rupert wrote: > >> zli at linux.vnet.ibm.com wrote: >>> # HG changeset patch >>> # User Zhengang Li >>> # Date 1207727823 25200 >>> # Node ID f58194a3271fe20b19894c9f3472164316e1ee4c >>> # Parent b5857217c64a081450cd21219035084eac455d85 >>> [TEST] redirect logging to /dev/null instead of stderr >>> >>> The original default basicConfig() added a stderr Streamhandler. >>> The log is duplicated to both the stderr and the file log 'vsmtest.log'. >>> Outputting all the log to the screen makes the test less easier to read. >>> >>> Signed-off-by: Zhengang Li >> >> Thanks Zhengang for this patch - I've applied this. I'd noticed the >> output of the suite had changed, but wasn't sure what the cause was. >> >> Agreed - the output is much easier to read with this patch applied. >> However, I could see why duplicating the log to stderr might be useful >> in some cases. >> >> Does anyone see value in this? We could add an option that allows to >> user to enable logging to stderr. Although, if we decide to do this, >> some of the tests will need to be cleaned up. Some tests are quite >> verbose, which might need to be pared down. >> >> Thoughts? > I was going for '-v' for 'verbose'. But we already have a '-v' for > 'virt'. How about '-d' for 'debug output'? And I'd like this '-d' > disabled by default. > > Ideas? > -d for debug sounds good to me - if other think it is useful, of course. I don't want to clutter the suite with too many options. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Apr 11 00:38:20 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 10 Apr 2008 17:38:20 -0700 Subject: [Libvirt-cim] libvirt-cim rpm for Fedora 9 versus recent provider repository In-Reply-To: <87od8h60nj.fsf@caffeine.beaverton.ibm.com> References: <871w5d7lb4.fsf@caffeine.beaverton.ibm.com> <20080410172653.GA7050@redhat.com> <87od8h60nj.fsf@caffeine.beaverton.ibm.com> Message-ID: <47FEB2FC.5020005@linux.vnet.ibm.com> Dan Smith wrote: > DV> Basically the Fedora-9 tree is frozen, but you should be able to > DV> push update for it after it has been released > > Right, which I definitely plan to do. I'd like the ability to look at > a test report and see "X failures that have been fixed in the tree but > are not fixed on the current platform". That will help indicate when > a refresh to Fedora or a new release is a good idea. Might be a bit > of a lofty goal, though :) > For future releases, would it be a good idea to archive the current state of the cimtest tree at the same time a release is snapped of libvirt-cim? This would allow us to preserve the state of the tests and tie them to a given release. > This is a good point. The Fedora 9 RPM has been unchanged for a while > now, so none of the changes that you mention are included. I think > that the test development should proceed to track the libvirt-cim > development tree, but perhaps there is a way that we can map FAIL to > XFAIL for older versions of the provider. > Does anyone have a suggestion for a reasonable way we could do this? Have the test suite check for the libvirt-cim rpm. If it exists, grab version. Otherwise, assume the providers are the most recent version upstream. If a test case needs to be updated due to a provider behavior change, use an if condition based on the rpm version (or lack there of) to determine the pass/fail/xfail behavior. It's not a very elegant idea, but something along these lines might work. And of course, such an idea wouldn't work on environments that don't support rpm / that we currently don't build rpms for. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Fri Apr 11 00:42:21 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 10 Apr 2008 17:42:21 -0700 Subject: [Libvirt-cim] libvirt-cim rpm for Fedora 9 versus recent provider repository In-Reply-To: <47FEB2FC.5020005@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Thu, 10 Apr 2008 17:38:20 -0700") References: <871w5d7lb4.fsf@caffeine.beaverton.ibm.com> <20080410172653.GA7050@redhat.com> <87od8h60nj.fsf@caffeine.beaverton.ibm.com> <47FEB2FC.5020005@linux.vnet.ibm.com> Message-ID: <873aptrzma.fsf@caffeine.beaverton.ibm.com> KR> For future releases, would it be a good idea to archive the KR> current state of the cimtest tree at the same time a release is KR> snapped of libvirt-cim? This would allow us to preserve the state KR> of the tests and tie them to a given release. We can, and we could just use a tag for this. However, unless we get closer to an all PASS/XFAIL situation, I'm not sure I see the point :) KR> Have the test suite check for the libvirt-cim rpm. If it exists, KR> grab version. Otherwise, assume the providers are the most recent KR> version upstream. Yeah, I dunno about that. We could definitely embed a version string into one of the providers somewhere (i.e. VSMS) and key off of that. We'd have to assume some base version if it doesn't exist (like for what is in F9 now) of course. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Fri Apr 11 01:24:08 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 10 Apr 2008 18:24:08 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add -d to duplicate error output to stderr In-Reply-To: <47FDBE8B.7040705@linux.vnet.ibm.com> References: <28d173f24fb60cbbe230.1207811406@zeit.cn.ibm.com> <47FDBE8B.7040705@linux.vnet.ibm.com> Message-ID: <47FEBDB8.5060902@linux.vnet.ibm.com> Zhengang Li wrote: > zli at linux.vnet.ibm.com wrote: > >> @@ -119,6 +125,7 @@ def do_main(types=['Xen'], p=parser): >> else: >> def do_try(): >> try: >> + log_param(options.debug) > log_param() is invoked here. It doesn't hurt to leave the invoke in > every test cases. But we don't have to add that in future test cases. > >> from VirtLib.utils import setup_ssh_key >> from XenKvmLib.test_doms import >> destroy_and_undefine_all >> setup_ssh_key() > > Excellent - do_try() just gets better in my book. ;) Would like to see some review comments on this patch. I have no complaints, but I'm interested in hearing whether people think this is useful. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Apr 11 01:28:20 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 10 Apr 2008 18:28:20 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Adding 05_RAPF_err.py to verify RAPF In-Reply-To: <47FE1A1C.9020008@linux.vnet.ibm.com> References: <0142551c8d3cf5f2a3bb.1207303063@dkalaker> <87fxu1ad7f.fsf@caffeine.beaverton.ibm.com> <47FB1324.7000307@linux.vnet.ibm.com> <47FBBBBB.3030408@linux.vnet.ibm.com> <47FCA904.106@linux.vnet.ibm.com> <47FCEF48.80602@linux.vnet.ibm.com> <47FE1A1C.9020008@linux.vnet.ibm.com> Message-ID: <47FEBEB4.7020008@linux.vnet.ibm.com> >> >> The original Xen XML used an ethernet style network as the default. >> Can you verify which (if any) test cases will be affected if we change >> Xen to use a bridge style network as the default? >> >> In general, I'd like to see the default XML for all three types be as >> similar as possible (where it makes sense). So I think this is a >> sound idea. >> > I need to verify this. I would check out Dan's recent Network related patchset. If you specify "network" as the network type and the network pool you wish to use, it looks like libvirt will determine the appropriate settings (bridge, etc) for that pool. So, it seems like switching all 3 platforms to network instead of bridge will be the better way to go. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Apr 11 01:38:38 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 10 Apr 2008 18:38:38 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add -d to duplicate error output to stderr In-Reply-To: <47FEBDB8.5060902@linux.vnet.ibm.com> References: <28d173f24fb60cbbe230.1207811406@zeit.cn.ibm.com> <47FDBE8B.7040705@linux.vnet.ibm.com> <47FEBDB8.5060902@linux.vnet.ibm.com> Message-ID: <47FEC11E.4010808@linux.vnet.ibm.com> >>> def do_try(): >>> try: >>> + log_param(options.debug) >> log_param() is invoked here. It doesn't hurt to leave the invoke in >> every test cases. But we don't have to add that in future test cases. >> > Excellent - do_try() just gets better in my book. ;) > > Would like to see some review comments on this patch. I have no > complaints, but I'm interested in hearing whether people think this is > useful. > > Thanks! > Ah.. my mistake.. I didn't notice this at first. Including log_param() in both the test case itself and do_try() causes the messages to be written to the log twice. However, I like the idea of calling log_param() once in do_try() and not having to worry about calling it in each test case. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From zli at linux.vnet.ibm.com Fri Apr 11 01:55:02 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Fri, 11 Apr 2008 09:55:02 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] Add -d to duplicate error output to stderr In-Reply-To: <47FEC11E.4010808@linux.vnet.ibm.com> References: <28d173f24fb60cbbe230.1207811406@zeit.cn.ibm.com> <47FDBE8B.7040705@linux.vnet.ibm.com> <47FEBDB8.5060902@linux.vnet.ibm.com> <47FEC11E.4010808@linux.vnet.ibm.com> Message-ID: <47FEC4F6.7040702@linux.vnet.ibm.com> Kaitlin Rupert wrote: >>>> def do_try(): >>>> try: >>>> + log_param(options.debug) >>> log_param() is invoked here. It doesn't hurt to leave the invoke in >>> every test cases. But we don't have to add that in future test cases. >>> >> Excellent - do_try() just gets better in my book. ;) >> >> Would like to see some review comments on this patch. I have no >> complaints, but I'm interested in hearing whether people think this is >> useful. >> >> Thanks! >> > > Ah.. my mistake.. I didn't notice this at first. Including log_param() > in both the test case itself and do_try() causes the messages to be > written to the log twice. How about this: def log_param(debug=None): if debug == None: return else: original log_param() body This way, we don't have to worry about twice logging, and give us time to remove the log_param() in the testcases. And after all log_param() is removed from the testcases, we can revert the log_param() to the state without a 'debug==None' check. > > However, I like the idea of calling log_param() once in do_try() and not > having to worry about calling it in each test case. > -- - Zhengang From kaitlin at linux.vnet.ibm.com Fri Apr 11 02:27:54 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 10 Apr 2008 19:27:54 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing the 04_defineStartVS.py tc failure In-Reply-To: <0e7eb39ed839e03d1dd2.1207834483@dkalaker> References: <0e7eb39ed839e03d1dd2.1207834483@dkalaker> Message-ID: <47FECCAA.2020608@linux.vnet.ibm.com> > + # Need to poll for XenFV, since enabState is not getting set otherwise. > + for i in range(1, (timeout + 1)): > + sleep(1) > + cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) > + if cs.Name == test_dom: > + enabState = cs.EnabledState > + else: > + Globals.logger.error("VS %s is not defined" % test_dom) You will print this message every time through the loop. Instead, you'll want to break here and then return a failure. > + # Success: VS is in Enabled State after Define and Start > + if enabState == 2: > + status = PASS > + break > > except Exception, detail: > Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE, > I'd structure the loop differently: if cs.Name != test_dom: # log error, set status message as failure and break enabState = cs.EnabledState if enabState == 2: # set status and break It's not really much different, but it places the enabState closer together, which makes it a bit easier to read. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From yunguol at cn.ibm.com Fri Apr 11 02:06:17 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 10 Apr 2008 19:06:17 -0700 Subject: [Libvirt-cim] [PATCH 6 of 6] [TEST] update processor id in VSSD.04 to reflect recent provider changes In-Reply-To: Message-ID: # HG changeset patch # User Guolian Yun # Date 1207879513 25200 # Node ID cb7da73431b75b11c6e7f01ae9a16003dda71233 # Parent fa561bc3cae2b4de3cf6f43df61bb647e7f9bdbc [TEST] update processor id in VSSD.04 to reflect recent provider changes Signed-off-by: Guolian Yun diff -r fa561bc3cae2 -r cb7da73431b7 suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py --- a/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Thu Apr 10 19:03:13 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Thu Apr 10 19:05:13 2008 -0700 @@ -82,7 +82,7 @@ def init_list(virt): Creating the lists that will be used for comparisons. """ procrasd = { - "InstanceID" : '%s/%s' %(test_dom,0), + "InstanceID" : '%s/%s' %(test_dom, "proc"), "ResourceType" : 3, "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') } From yunguol at cn.ibm.com Fri Apr 11 02:06:16 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 10 Apr 2008 19:06:16 -0700 Subject: [Libvirt-cim] [PATCH 5 of 6] [TEST] update processor id in SystemDevice.01 to reflect recent provider changes In-Reply-To: Message-ID: # HG changeset patch # User Guolian Yun # Date 1207879393 25200 # Node ID fa561bc3cae2b4de3cf6f43df61bb647e7f9bdbc # Parent 248707005ae8efa00fc106f3ad8da02add06b3b6 [TEST] update processor id in SystemDevice.01 to reflect recent provider changes Signed-off-by: Guolian Yun Signed-off-by: Guolian Yun From yunguol at cn.ibm.com Fri Apr 11 02:06:12 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 10 Apr 2008 19:06:12 -0700 Subject: [Libvirt-cim] [PATCH 1 of 6] [TEST] update processor id in 02_hostsystem_to_rasd.py to reflect recent provider changes In-Reply-To: Message-ID: <16ad6528cd7d7ef367d3.1207879572@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207878595 25200 # Node ID 16ad6528cd7d7ef367d354c1cadd0d258fa09e0a # Parent 19ff9c851ed8cb76b74d158a4c439dfa5f4ccb50 [TEST] update processor id in 02_hostsystem_to_rasd.py to reflect recent provider changes Signed-off-by: Guolian Yun diff -r 19ff9c851ed8 -r 16ad6528cd7d suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py --- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Wed Apr 09 18:00:14 2008 +0530 +++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Thu Apr 10 18:49:55 2008 -0700 @@ -79,7 +79,7 @@ def init_list(vsxml, virt="Xen"): rasd_values = { proc_cn : { - "InstanceID" : '%s/%s' %(test_dom,0), + "InstanceID" : '%s/%s' %(test_dom, "proc"), "ResourceType" : 3, }, disk_cn : { From yunguol at cn.ibm.com Fri Apr 11 02:06:13 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 10 Apr 2008 19:06:13 -0700 Subject: [Libvirt-cim] [PATCH 2 of 6] [TEST] update processor id in Processor01~03 to reflect recent provider changes In-Reply-To: Message-ID: <1a230184a44b133bb453.1207879573@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207878768 25200 # Node ID 1a230184a44b133bb453d9f4582a0ff6e9ea5696 # Parent 16ad6528cd7d7ef367d354c1cadd0d258fa09e0a [TEST] update processor id in Processor01~03 to reflect recent provider changes Signed-off-by: Guolian Yun diff -r 16ad6528cd7d -r 1a230184a44b suites/libvirt-cim/cimtest/Processor/01_processor.py --- a/suites/libvirt-cim/cimtest/Processor/01_processor.py Thu Apr 10 18:49:55 2008 -0700 +++ b/suites/libvirt-cim/cimtest/Processor/01_processor.py Thu Apr 10 18:52:48 2008 -0700 @@ -54,7 +54,7 @@ def main(): logger.error("Domain not started, we're not able to check vcpu") else: for i in range(0, test_vcpus): - devid = "%s/%s" % (test_dom, i) + devid = "%s/%s" % (test_dom, "proc") key_list = { 'DeviceID' : devid, 'CreationClassName' : get_typed_class(options.virt, "Processor"), 'SystemName' : test_dom, diff -r 16ad6528cd7d -r 1a230184a44b suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py --- a/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Thu Apr 10 18:49:55 2008 -0700 +++ b/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Thu Apr 10 18:52:48 2008 -0700 @@ -57,7 +57,7 @@ def check_processors(procs): procs['SystemName'], default_dom) return 1 - devid = "%s/%s" % (default_dom, test_vcpus - 1) + devid = "%s/%s" % (default_dom, "proc") if proc['DeviceID'] != devid: logger.error("DeviceID %s does not match expected %s.", diff -r 16ad6528cd7d -r 1a230184a44b suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py --- a/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py Thu Apr 10 18:49:55 2008 -0700 +++ b/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py Thu Apr 10 18:52:48 2008 -0700 @@ -174,7 +174,7 @@ def main(): options = main.options log_param() - devid = "%s/%s" % (test_dom, "0") + devid = "%s/%s" % (test_dom, "proc") status = PASS # Getting the VS list and deleting the test_dom if it already exists. From yunguol at cn.ibm.com Fri Apr 11 02:06:14 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 10 Apr 2008 19:06:14 -0700 Subject: [Libvirt-cim] [PATCH 3 of 6] [TEST] update processor id in RASD01~02 to reflect recent provider changes In-Reply-To: Message-ID: <682ad781e5b01be0baf8.1207879574@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207878950 25200 # Node ID 682ad781e5b01be0baf81a5db2da840f1986655d # Parent 1a230184a44b133bb453d9f4582a0ff6e9ea5696 [TEST] update processor id in RASD01~02 to reflect recent provider changes Signed-off-by: Guolian Yun diff -r 1a230184a44b -r 682ad781e5b0 suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py --- a/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Thu Apr 10 18:52:48 2008 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Thu Apr 10 18:55:50 2008 -0700 @@ -74,7 +74,7 @@ def init_list(xml, disk, virt="Xen"): Creating the lists that will be used for comparisons. """ procrasd = { - "InstanceID" : '%s/%s' %(test_dom,0),\ + "InstanceID" : '%s/%s' %(test_dom, "proc"),\ "ResourceType" : 3,\ "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') } diff -r 1a230184a44b -r 682ad781e5b0 suites/libvirt-cim/cimtest/RASD/02_enum.py --- a/suites/libvirt-cim/cimtest/RASD/02_enum.py Thu Apr 10 18:52:48 2008 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/02_enum.py Thu Apr 10 18:55:50 2008 -0700 @@ -51,7 +51,7 @@ def init_list(virt="Xen"): Creating the lists that will be used for comparisons. """ procrasd = { - "InstanceID" : '%s/%s' %(test_dom,0),\ + "InstanceID" : '%s/%s' %(test_dom, "proc"),\ "ResourceType" : 3,\ "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') } From yunguol at cn.ibm.com Fri Apr 11 02:06:15 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 10 Apr 2008 19:06:15 -0700 Subject: [Libvirt-cim] [PATCH 4 of 6] [TEST] update processor id in SettingsDefine01~03 to reflect recent provider changes In-Reply-To: Message-ID: <248707005ae8efa00fc1.1207879575@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207879260 25200 # Node ID 248707005ae8efa00fc106f3ad8da02add06b3b6 # Parent 682ad781e5b01be0baf81a5db2da840f1986655d [TEST] update processor id in SettingsDefine01~03 to reflect recent provider changes Signed-off-by: Guolian Yun diff -r 682ad781e5b0 -r 248707005ae8 suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Thu Apr 10 18:55:50 2008 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Thu Apr 10 19:01:00 2008 -0700 @@ -82,7 +82,7 @@ def main(): 'LogicalDisk' : test_disk, 'Memory' : 'mem', 'NetworkPort' : test_mac, - 'Processor' : test_vcpus -1 } + 'Processor' : 'proc' } devlist = {} logelelst = {} diff -r 682ad781e5b0 -r 248707005ae8 suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Thu Apr 10 18:55:50 2008 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Thu Apr 10 19:01:00 2008 -0700 @@ -186,13 +186,13 @@ def main(): global rasd_devid rasd_devid = { - 'ProcResourceAllocationSettingData' : '%s/%s' % (test_dom, test_vcpus-1), + 'ProcResourceAllocationSettingData' : '%s/%s' % (test_dom, 'proc'), 'NetResourceAllocationSettingData' : '%s/%s' % (test_dom, test_mac), 'DiskResourceAllocationSettingData' : '%s/%s' % (test_dom, test_disk), 'MemResourceAllocationSettingData' : '%s/%s' % (test_dom, 'mem')} global dev_devid dev_devid = { - 'Processor' : '%s/%s' % (test_dom, test_vcpus-1), + 'Processor' : '%s/%s' % (test_dom, 'proc'), 'NetworkPort' : '%s/%s' % (test_dom, test_mac), 'LogicalDisk' : '%s/%s' % (test_dom, test_disk), 'Memory' : '%s/%s' % (test_dom, 'mem')} diff -r 682ad781e5b0 -r 248707005ae8 suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Thu Apr 10 18:55:50 2008 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Thu Apr 10 19:01:00 2008 -0700 @@ -232,7 +232,7 @@ def main(): get_typed_class(options.virt, 'LogicalDisk') : test_disk, get_typed_class(options.virt, 'Memory') : 'mem', get_typed_class(options.virt, 'NetworkPort') : test_mac, - get_typed_class(options.virt, 'Processor') : test_vcpus - 1 + get_typed_class(options.virt, 'Processor') : 'proc' } tc_scen = [ From yunguol at cn.ibm.com Fri Apr 11 02:15:39 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 10 Apr 2008 19:15:39 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] update processor id in ElementAllocatedFromPool.04 Message-ID: <9682464811b73b7cb48d.1207880139@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207880122 25200 # Node ID 9682464811b73b7cb48dfb0a6c6f3e984da78d6a # Parent 19ff9c851ed8cb76b74d158a4c439dfa5f4ccb50 [TEST] update processor id in ElementAllocatedFromPool.04 Signed-off-by: Guolian Yun diff -r 19ff9c851ed8 -r 9682464811b7 suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py --- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py Wed Apr 09 18:00:14 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py Thu Apr 10 19:15:22 2008 -0700 @@ -99,7 +99,7 @@ def try_assoc(conn, exp_ret, dev_dom_nam diskid = "%s/%s" % (dev_dom_name, test_disk) memid = "%s/mem" % dev_dom_name netid = "%s/%s" % (dev_dom_name, test_mac) - procid = "%s/%s" % (dev_dom_name, 0) + procid = "%s/proc" % dev_dom_name lelist = { get_typed_class(virt, "LogicalDisk") : diskid, \ From zli at linux.vnet.ibm.com Fri Apr 11 02:39:36 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Fri, 11 Apr 2008 10:39:36 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] set default kvm emulator based on cpu capabilities Message-ID: # HG changeset patch # User Zhengang Li # Date 1207881544 -28800 # Node ID fd2df63589968f4a14891f6c23c2748918b9b68f # Parent 70565a27044e9d1f1219230bf1a5f7de6240e6ab [TEST] set default kvm emulator based on cpu capabilities Signed-off-by: Zhengang Li diff -r 70565a27044e -r fd2df6358996 lib/VirtLib/live.py --- a/lib/VirtLib/live.py Thu Apr 10 15:11:06 2008 +0800 +++ b/lib/VirtLib/live.py Fri Apr 11 10:39:04 2008 +0800 @@ -237,13 +237,7 @@ def bootloader(server, gtype = 0): or domUloader.py for SLES. 3) returns the bootloader. """ - cmd = "cat /proc/cpuinfo | egrep flags | uniq | egrep 'vmx|svm' " - ret, out = utils.run_remote(server,cmd) - if ret != 0: - mtype = "PVT" - else: - mtype = "FVT" - if mtype == "FVT" and gtype == 1: + if fv_cap(server) and gtype == 1: bootloader = "/usr/lib/xen/boot/hvmloader" else: cmd = "cat /etc/issue | grep -v ^$ | egrep 'Red Hat|Fedora'" @@ -256,6 +250,11 @@ def bootloader(server, gtype = 0): bootloader = "/usr/bin/pygrub" return bootloader +def fv_cap(server): + cmd = "egrep flags /proc/cpuinfo | uniq | egrep 'vmx|svm'" + ret, out = utils.run_remote(server, cmd) + return ret == 0 + def hostname(server): """To return the hostname of the cimserver""" diff -r 70565a27044e -r fd2df6358996 suites/libvirt-cim/lib/XenKvmLib/const.py --- a/suites/libvirt-cim/lib/XenKvmLib/const.py Thu Apr 10 15:11:06 2008 +0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Fri Apr 11 10:39:04 2008 +0800 @@ -20,6 +20,8 @@ import os import platform +from VirtLib.live import fv_cap +from CimTest.Globals import CIM_IP # vxml.NetXML default_bridge_name = 'testbridge' @@ -43,7 +45,10 @@ Xen_default_net_type = 'ethernet' Xen_default_net_type = 'ethernet' # vxml.KVMXML -KVM_default_emulator = '/usr/bin/qemu-kvm' +if fv_cap(CIM_IP): + KVM_default_emulator = '/usr/bin/qemu-kvm' +else: + KVM_default_emulator = '/usr/bin/qemu' KVM_disk_path = os.path.join(_image_dir, 'default-kvm-dimage') KVM_secondary_disk_path = os.path.join(_image_dir, 'default-kvm-dimage.2ND') KVM_default_disk_dev = 'hda' From kaitlin at linux.vnet.ibm.com Fri Apr 11 02:41:02 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 10 Apr 2008 19:41:02 -0700 Subject: [Libvirt-cim] [PATCH] [TEST]Fixing 01_netport.py tc failure In-Reply-To: <0b1dc112438b0362c888.1207835097@dkalaker> References: <0b1dc112438b0362c888.1207835097@dkalaker> Message-ID: <47FECFBE.8000203@linux.vnet.ibm.com> > > - if dev == None: > + if devid not in dev.DeviceID : I checked in Daisy's fix for this, however it is probably a better check since we're looking for a specific device instance. However, instead of devid not in dev.DeviceID, I would use dev.DeviceID != devid. A DeviceID should be unique. If the provider returns "test_domain/procAndsomegarbage" and our devid is "test_domain/proc", we'd pass here. Due to similar logic, I should have rejected Daisy's patch - a mistake on my part. > logger.error("Error retrieving instance for devid %s" % devid) > vsxml.undefine(options.ip) > return FAIL > - > - status = PASS > > if dev.LinkTechnology != devices.LinkTechnology_Ethernet: > logger.error("LinkTechnology should be set to `%i' instead of `%s'" % \ > @@ -86,20 +83,17 @@ def main(): > > addrs = dev.NetworkAddresses > if len(addrs) != 1: > - logger.error("Too many NetworkAddress entries (%i instead of %i)" % \ > - (len(addrs), 1)) > + logger.error("Too many NetworkAddress entries (%i instead of %i)" % (len(addrs), 1)) This line and the next end up spanning 80 characters long. The libvirt-cim convention is 80 character lines. Even though we don't follow their convention, I like the idea of shorter line lengths. This helps prevent text from running into the next line - helps with readability. You can do the following without in python (I believe): logger.error("Too many NetworkAddress entries (%i instead of %i)" % (len(addrs), 1)) -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From yunguol at cn.ibm.com Fri Apr 11 02:51:00 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Fri, 11 Apr 2008 10:51:00 +0800 Subject: [Libvirt-cim] [PATCH] [TEST]Fixing 01_netport.py tc failure In-Reply-To: <0b1dc112438b0362c888.1207835097@dkalaker> Message-ID: "Deepti B. Kalakeri" libvirt-cim at redhat.com Sent by: cc libvirt-cim-bounc es at redhat.com Subject [Libvirt-cim] [PATCH] [TEST]Fixing 01_netport.py tc failure 2008-04-10 21:44 Please respond to List for discussion and development of libvirt CIM # HG changeset patch # User Deepti B. Kalakeri # Date 1207835007 -19800 # Node ID 0b1dc112438b0362c88891c4a690fd92bf6ca628 # Parent 19ff9c851ed8cb76b74d158a4c439dfa5f4ccb50 [TEST]Fixing 01_netport.py tc failure. Signed-off-by: Deepti B. Kalakeri diff -r 19ff9c851ed8 -r 0b1dc112438b suites/libvirt-cim/cimtest/NetworkPort/01_netport.py --- a/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Wed Apr 09 18:00:14 2008 +0530 +++ b/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Thu Apr 10 19:13:27 2008 +0530 @@ -51,6 +51,7 @@ def main(): def main(): options = main.options log_param() + status = PASS vsxml = get_class(options.virt)(test_dom, mac=test_mac) vsxml.define(options.ip) @@ -61,9 +62,7 @@ def main(): '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) @@ -72,12 +71,10 @@ def main(): vsxml.undefine(options.ip) return XFAIL_RC(bug) - if dev == None: + if devid not in dev.DeviceID : logger.error("Error retrieving instance for devid %s" % devid) vsxml.undefine(options.ip) return FAIL - - status = PASS if dev.LinkTechnology != devices.LinkTechnology_Ethernet: logger.error("LinkTechnology should be set to `%i' instead of `%s'" % \ @@ -86,20 +83,17 @@ def main(): addrs = dev.NetworkAddresses if len(addrs) != 1: - logger.error("Too many NetworkAddress entries (%i instead of %i)" % \ - (len(addrs), 1)) + logger.error("Too many NetworkAddress entries (%i instead of %i)" % (len(addrs), 1)) status = FAIL if addrs[0] != test_mac: - logger.error("MAC address reported incorrectly (%s instead of %s)" % \ - (addrs[0], test_mac)) + logger.error("MAC address reported incorrectly (%s instead of %s)" % (addrs[0], test_mac)) status = FAIL if status == FAIL: logger.error("Checked interface %s" % test_mac) vsxml.undefine(options.ip) - return status if __name__ == "__main__": +1 from me. _______________________________________________ Libvirt-cim mailing list Libvirt-cim at redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: graycol.gif Type: image/gif Size: 105 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pic10539.gif Type: image/gif Size: 1255 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 45 bytes Desc: not available URL: From yunguol at cn.ibm.com Fri Apr 11 02:06:12 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 10 Apr 2008 19:06:12 -0700 Subject: [Libvirt-cim] [PATCH 1 of 6] [TEST] update processor id in 02_hostsystem_to_rasd.py to reflect recent provider changes In-Reply-To: Message-ID: <16ad6528cd7d7ef367d3.1207879572@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207878595 25200 # Node ID 16ad6528cd7d7ef367d354c1cadd0d258fa09e0a # Parent 19ff9c851ed8cb76b74d158a4c439dfa5f4ccb50 [TEST] update processor id in 02_hostsystem_to_rasd.py to reflect recent provider changes Signed-off-by: Guolian Yun diff -r 19ff9c851ed8 -r 16ad6528cd7d suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py --- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Wed Apr 09 18:00:14 2008 +0530 +++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Thu Apr 10 18:49:55 2008 -0700 @@ -79,7 +79,7 @@ def init_list(vsxml, virt="Xen"): rasd_values = { proc_cn : { - "InstanceID" : '%s/%s' %(test_dom,0), + "InstanceID" : '%s/%s' %(test_dom, "proc"), "ResourceType" : 3, }, disk_cn : { From yunguol at cn.ibm.com Fri Apr 11 02:06:15 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 10 Apr 2008 19:06:15 -0700 Subject: [Libvirt-cim] [PATCH 4 of 6] [TEST] update processor id in SettingsDefine01~03 to reflect recent provider changes In-Reply-To: Message-ID: <248707005ae8efa00fc1.1207879575@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1207879260 25200 # Node ID 248707005ae8efa00fc106f3ad8da02add06b3b6 # Parent 682ad781e5b01be0baf81a5db2da840f1986655d [TEST] update processor id in SettingsDefine01~03 to reflect recent provider changes Signed-off-by: Guolian Yun diff -r 682ad781e5b0 -r 248707005ae8 suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Thu Apr 10 18:55:50 2008 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Thu Apr 10 19:01:00 2008 -0700 @@ -82,7 +82,7 @@ def main(): 'LogicalDisk' : test_disk, 'Memory' : 'mem', 'NetworkPort' : test_mac, - 'Processor' : test_vcpus -1 } + 'Processor' : 'proc' } devlist = {} logelelst = {} diff -r 682ad781e5b0 -r 248707005ae8 suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Thu Apr 10 18:55:50 2008 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Thu Apr 10 19:01:00 2008 -0700 @@ -186,13 +186,13 @@ def main(): global rasd_devid rasd_devid = { - 'ProcResourceAllocationSettingData' : '%s/%s' % (test_dom, test_vcpus-1), + 'ProcResourceAllocationSettingData' : '%s/%s' % (test_dom, 'proc'), 'NetResourceAllocationSettingData' : '%s/%s' % (test_dom, test_mac), 'DiskResourceAllocationSettingData' : '%s/%s' % (test_dom, test_disk), 'MemResourceAllocationSettingData' : '%s/%s' % (test_dom, 'mem')} global dev_devid dev_devid = { - 'Processor' : '%s/%s' % (test_dom, test_vcpus-1), + 'Processor' : '%s/%s' % (test_dom, 'proc'), 'NetworkPort' : '%s/%s' % (test_dom, test_mac), 'LogicalDisk' : '%s/%s' % (test_dom, test_disk), 'Memory' : '%s/%s' % (test_dom, 'mem')} diff -r 682ad781e5b0 -r 248707005ae8 suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Thu Apr 10 18:55:50 2008 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Thu Apr 10 19:01:00 2008 -0700 @@ -232,7 +232,7 @@ def main(): get_typed_class(options.virt, 'LogicalDisk') : test_disk, get_typed_class(options.virt, 'Memory') : 'mem', get_typed_class(options.virt, 'NetworkPort') : test_mac, - get_typed_class(options.virt, 'Processor') : test_vcpus - 1 + get_typed_class(options.virt, 'Processor') : 'proc' } tc_scen = [ From yunguol at cn.ibm.com Fri Apr 11 05:38:57 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Fri, 11 Apr 2008 13:38:57 +0800 Subject: [Libvirt-cim] [TEST] KVM test on Fedora8 Message-ID: The test is done on Beaverton lab machine, which I use for the last KVM test. The cimtest is updated, also applied some patches still in waiting for reviews status. Hopefully, it can help us fix issues compared to other reports. stro: Fedora8 Kernel: kernel-2.6.23.1-42.fc8 Xen: xen-3.1.2-2.fc9 Libvirt: libvirt-0.4.0-4.fc8 CIMOM: sblim-sfcb-1.2.5-0 PyWBEM: pywbem-0.6-1 LibCMPIutil: 72 LibvirtCIM: 532 CIM Schema: cimv216Experimental =============CIMTEST REPORT================== AllocationCapabilities - 01_enum.py: PASS AllocationCapabilities - 02_alloccap_gi_errs.py: PASS ComputerSystem - 01_enum.py: PASS ComputerSystem - 02_nosystems.py: PASS ComputerSystem - 03_defineVS.py: PASS ComputerSystem - 04_defineStartVS.py: PASS ComputerSystem - 05_activate_defined_start.py: 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: PASS ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP ComputerSystem - 42_cs_gi_errs.py: PASS ComputerSystemIndication - 01_created_indication.py: PASS ElementAllocatedFromPool - 01_forward.py: SKIP ElementAllocatedFromPool - 02_reverse.py: SKIP ElementAllocatedFromPool - 03_reverse_errs.py: PASS ElementAllocatedFromPool - 04_forward_errs.py: PASS ElementCapabilities - 01_forward.py: PASS ElementCapabilities - 02_reverse.py: PASS ElementCapabilities - 03_forward_errs.py: PASS ElementCapabilities - 04_reverse_errs.py: PASS ElementCapabilities - 05_hostsystem_cap.py: PASS ElementConforms - 01_forward.py: PASS ElementConforms - 02_reverse.py: PASS ElementConforms - 03_ectp_fwd_errs.py: PASS ElementConforms - 04_ectp_rev_errs.py: SKIP ElementSettingData - 01_forward.py: SKIP ElementSettingData - 03_esd_assoc_with_rasd_errs.py: SKIP EnabledLogicalElementCapabilities - 01_enum.py: PASS EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS HostSystem - 01_enum.py: PASS HostSystem - 02_hostsystem_to_rasd.py: PASS HostSystem - 03_hs_to_settdefcap.py: PASS HostSystem - 04_hs_to_EAPF.py: SKIP HostSystem - 05_hs_gi_errs.py: PASS HostSystem - 06_hs_to_vsms.py: PASS HostedDependency - 01_forward.py: SKIP HostedDependency - 02_reverse.py: SKIP HostedDependency - 03_enabledstate.py: SKIP HostedDependency - 04_reverse_errs.py: SKIP 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: SKIP Profile - 02_profile_to_elec.py: SKIP Profile - 03_rprofile_gi_errs.py: SKIP RASD - 01_verify_rasd_fields.py: PASS RASD - 02_enum.py: PASS RASD - 03_rasd_errs.py: PASS ReferencedProfile - 01_verify_refprof.py: PASS ReferencedProfile - 02_refprofile_errs.py: PASS ResourceAllocationFromPool - 01_forward.py: PASS ResourceAllocationFromPool - 02_reverse.py: PASS ResourceAllocationFromPool - 03_forward_errs.py: PASS ResourceAllocationFromPool - 04_reverse_errs.py: PASS ResourceAllocationFromPool - 05_RAPF_err.py: PASS ResourcePool - 01_enum.py: SKIP ResourcePool - 02_rp_gi_errors.py: SKIP ResourcePoolConfigurationCapabilities - 01_enum.py: PASS ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS ResourcePoolConfigurationService - 01_enum.py: PASS ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: XFAIL Bug: 92173 InvokeMethod(AddResourcesToResourcePool): Unknown Method Bug:<92173> ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS SettingsDefine - 01_forward.py: PASS SettingsDefine - 02_reverse.py: PASS SettingsDefine - 03_sds_fwd_errs.py: PASS SettingsDefine - 04_sds_rev_errs.py: PASS SettingsDefineCapabilities - 01_forward.py: 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: PASS VirtualSystemManagementCapabilities - 01_enum.py: PASS VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS VirtualSystemManagementService - 01_definesystem_name.py: PASS VirtualSystemManagementService - 02_destroysystem.py: PASS VirtualSystemManagementService - 03_definesystem_ess.py: PASS VirtualSystemManagementService - 04_definesystem_ers.py: PASS VirtualSystemManagementService - 05_destroysystem_neg.py: PASS VirtualSystemManagementService - 06_addresource.py: FAIL InvokeMethod(AddResourceSettings): Failed to create domain VirtualSystemManagementService - 07_addresource_neg.py: PASS VirtualSystemManagementService - 08_modifyresource.py: XFAIL Bug: 90853 InvokeMethod(ModifyResourceSettings): Failed to create domain 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: SKIP VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: SKIP VirtualSystemSnapshotService - 01_enum.py: FAIL Provider not found or not loadable VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: FAIL VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL Provider not found or not loadable VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: FAIL Best, Regards Daisy Guo Lian Yun E-mail: yunguol at cn.ibm.com IBM China Development Lab, Shanghai, China TEL: (86)-21-61008057 -------------- next part -------------- An HTML attachment was scrubbed... URL: From yunguol at cn.ibm.com Fri Apr 11 05:58:34 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Fri, 11 Apr 2008 13:58:34 +0800 Subject: [Libvirt-cim] [TEST] KVM test on Fedora8 In-Reply-To: Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-04-11 13:38:57: > The test is done on Beaverton lab machine, which I use for the last KVM test. > The cimtest is updated, also applied some patches still in waiting > for reviews status. > Hopefully, it can help us fix issues compared to other reports. > > stro: Fedora8 > Kernel: kernel-2.6.23.1-42.fc8 > Xen: xen-3.1.2-2.fc9 > Libvirt: libvirt-0.4.0-4.fc8 > CIMOM: sblim-sfcb-1.2.5-0 > PyWBEM: pywbem-0.6-1 > LibCMPIutil: 72 > LibvirtCIM: 532 > CIM Schema: cimv216Experimental > > > =============CIMTEST REPORT================== > > AllocationCapabilities - 01_enum.py: PASS > AllocationCapabilities - 02_alloccap_gi_errs.py: PASS > > ComputerSystem - 01_enum.py: PASS > ComputerSystem - 02_nosystems.py: PASS > ComputerSystem - 03_defineVS.py: PASS > ComputerSystem - 04_defineStartVS.py: PASS > ComputerSystem - 05_activate_defined_start.py: 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: PASS > ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP > ComputerSystem - 42_cs_gi_errs.py: PASS > > ComputerSystemIndication - 01_created_indication.py: PASS > > ElementAllocatedFromPool - 01_forward.py: SKIP > ElementAllocatedFromPool - 02_reverse.py: SKIP > ElementAllocatedFromPool - 03_reverse_errs.py: PASS > ElementAllocatedFromPool - 04_forward_errs.py: PASS > > ElementCapabilities - 01_forward.py: PASS > ElementCapabilities - 02_reverse.py: PASS > ElementCapabilities - 03_forward_errs.py: PASS > ElementCapabilities - 04_reverse_errs.py: PASS > ElementCapabilities - 05_hostsystem_cap.py: PASS > > ElementConforms - 01_forward.py: PASS > ElementConforms - 02_reverse.py: PASS > ElementConforms - 03_ectp_fwd_errs.py: PASS > ElementConforms - 04_ectp_rev_errs.py: SKIP > > ElementSettingData - 01_forward.py: SKIP > ElementSettingData - 03_esd_assoc_with_rasd_errs.py: SKIP > > EnabledLogicalElementCapabilities - 01_enum.py: PASS > EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS > > HostSystem - 01_enum.py: PASS > HostSystem - 02_hostsystem_to_rasd.py: PASS > HostSystem - 03_hs_to_settdefcap.py: PASS > HostSystem - 04_hs_to_EAPF.py: SKIP > HostSystem - 05_hs_gi_errs.py: PASS > HostSystem - 06_hs_to_vsms.py: PASS > > HostedDependency - 01_forward.py: SKIP > HostedDependency - 02_reverse.py: SKIP > HostedDependency - 03_enabledstate.py: SKIP > HostedDependency - 04_reverse_errs.py: SKIP > > 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 This fails because of setting "user" as the network type, the test case allows us to keep track of the issues. > > Processor - 01_processor.py: PASS > Processor - 02_definesys_get_procs.py: PASS > Processor - 03_proc_gi_errs.py: PASS > > Profile - 01_enum.py: SKIP > Profile - 02_profile_to_elec.py: SKIP > Profile - 03_rprofile_gi_errs.py: SKIP > > RASD - 01_verify_rasd_fields.py: PASS > RASD - 02_enum.py: PASS > RASD - 03_rasd_errs.py: PASS > > ReferencedProfile - 01_verify_refprof.py: PASS > ReferencedProfile - 02_refprofile_errs.py: PASS > > ResourceAllocationFromPool - 01_forward.py: PASS > ResourceAllocationFromPool - 02_reverse.py: PASS > ResourceAllocationFromPool - 03_forward_errs.py: PASS > ResourceAllocationFromPool - 04_reverse_errs.py: PASS > ResourceAllocationFromPool - 05_RAPF_err.py: PASS > > ResourcePool - 01_enum.py: SKIP > ResourcePool - 02_rp_gi_errors.py: SKIP > > ResourcePoolConfigurationCapabilities - 01_enum.py: PASS > ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS > > ResourcePoolConfigurationService - 01_enum.py: PASS > ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS > ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS > ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS > ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: > XFAIL Bug: 92173 > InvokeMethod(AddResourcesToResourcePool): Unknown Method > Bug:<92173> > ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS > ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS > > SettingsDefine - 01_forward.py: PASS > SettingsDefine - 02_reverse.py: PASS > SettingsDefine - 03_sds_fwd_errs.py: PASS > SettingsDefine - 04_sds_rev_errs.py: PASS > > SettingsDefineCapabilities - 01_forward.py: 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: PASS > > VirtualSystemManagementCapabilities - 01_enum.py: PASS > VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS > > VirtualSystemManagementService - 01_definesystem_name.py: PASS > VirtualSystemManagementService - 02_destroysystem.py: PASS > VirtualSystemManagementService - 03_definesystem_ess.py: PASS > VirtualSystemManagementService - 04_definesystem_ers.py: PASS > VirtualSystemManagementService - 05_destroysystem_neg.py: PASS > VirtualSystemManagementService - 06_addresource.py: FAIL > InvokeMethod(AddResourceSettings): Failed to create domain > VirtualSystemManagementService - 07_addresource_neg.py: PASS > VirtualSystemManagementService - 08_modifyresource.py: XFAIL Bug: 90853 > InvokeMethod(ModifyResourceSettings): Failed to create domain > 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: SKIP > VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: SKIP > > VirtualSystemSnapshotService - 01_enum.py: FAIL > Provider not found or not loadable This fails because of unsuccessful VirtualSystemSnapshotService provider installation. I will try to reinstall it and test again. > VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: FAIL > Same as above. > VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL > Provider not found or not loadable Same as above. > VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: FAIL > Same as above. > > Best, > Regards > > Daisy Guo Lian Yun > E-mail: yunguol at cn.ibm.com > IBM China Development Lab, Shanghai, China > TEL: (86)-21-61008057_______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From yunguol at cn.ibm.com Fri Apr 11 09:46:55 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Fri, 11 Apr 2008 02:46:55 -0700 Subject: [Libvirt-cim] [PATCH] [PATCH] fix vcpu dev error in xml_parse_test.c Message-ID: # HG changeset patch # User Guolian Yun # Date 1207907205 25200 # Node ID a80c7a68af12a390861171e38d2b216c22fb2b41 # Parent a185e443ad6012d86690194112393d58e8c51967 [PATCH] fix vcpu dev error in xml_parse_test.c Signed-off-by: Guolian Yun diff -r a185e443ad60 -r a80c7a68af12 libxkutil/xml_parse_test.c --- a/libxkutil/xml_parse_test.c Tue Apr 08 11:32:06 2008 -0400 +++ b/libxkutil/xml_parse_test.c Fri Apr 11 02:46:45 2008 -0700 @@ -93,7 +93,7 @@ static void print_dev_vcpu(struct virt_d static void print_dev_vcpu(struct virt_device *dev, FILE *d) { - print_u32(d, "Virtual CPU", dev->dev.vcpu.number); + print_u32(d, "Virtual CPU", dev->dev.vcpu.quantity); } static void print_dev_emu(struct virt_device *dev, From deeptik at linux.vnet.ibm.com Fri Apr 11 11:28:33 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 11 Apr 2008 16:58:33 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fixing the 04_defineStartVS.py tc failure Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1207913303 -19800 # Node ID ee931f10e1f0b83d410f8e1c13d320b23bba7f1e # Parent 19ff9c851ed8cb76b74d158a4c439dfa5f4ccb50 [TEST] #2 Fixing the 04_defineStartVS.py tc failure. Signed-off-by: Deepti B. Kalakeri diff -r 19ff9c851ed8 -r ee931f10e1f0 suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Wed Apr 09 18:00:14 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Fri Apr 11 16:58:23 2008 +0530 @@ -6,6 +6,7 @@ # Kaitlin Rupert # Veerendra Chandrappa # Zhengang Li +# Deepti B. kalakeri # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public @@ -28,10 +29,11 @@ # 10-Oct-2007 import sys +from time import sleep from XenKvmLib import vxml from XenKvmLib import computersystem -from VirtLib import utils from CimTest import Globals +from XenKvmLib.classes import get_typed_class from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL @@ -53,18 +55,22 @@ def main(): Globals.logger.error("Failed to Start the dom: %s", test_dom) cxml.undefine(options.ip) return status + + timeout = 10 + try: + # Need to poll for XenFV, since enabState is not getting set otherwise. + for i in range(1, (timeout + 1)): + sleep(1) + cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) + if cs.Name != test_dom: + Globals.logger.error("VS %s is not defined" % test_dom) + break - try: - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) - - if cs.Name == test_dom: + # Success: VS is in Enabled State after Define and Start enabState = cs.EnabledState - else: - Globals.logger.error("VS %s is not defined" % test_dom) - - # Success: VS is in Enabled State after Define and Start - if enabState == 2: - status = PASS + if enabState == 2: + status = PASS + break except Exception, detail: Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE, From deeptik at linux.vnet.ibm.com Fri Apr 11 12:44:32 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 11 Apr 2008 18:14:32 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fixing 01_netport.py tc failure Message-ID: <970eaf6adde2704888d9.1207917872@dkalaker> # HG changeset patch # User Deepti B. Kalakeri # Date 1207917822 -19800 # Node ID 970eaf6adde2704888d914c45c0aba19aff7f4dc # Parent ee931f10e1f0b83d410f8e1c13d320b23bba7f1e [TEST] #2 Fixing 01_netport.py tc failure. Signed-off-by: Deepti B. Kalakeri diff -r ee931f10e1f0 -r 970eaf6adde2 suites/libvirt-cim/cimtest/NetworkPort/01_netport.py --- a/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Fri Apr 11 18:13:42 2008 +0530 @@ -30,12 +30,9 @@ # Date : 24-10-2007 import sys -import pywbem -from VirtLib import utils -from VirtLib import live from XenKvmLib import devices from XenKvmLib.classes import get_typed_class -from XenKvmLib.vxml import XenXML, KVMXML, get_class +from XenKvmLib.vxml import get_class from CimTest.Globals import log_param, logger from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC @@ -51,55 +48,54 @@ def main(): def main(): options = main.options log_param() + status = PASS vsxml = get_class(options.virt)(test_dom, mac=test_mac) vsxml.define(options.ip) devid = "%s/%s" % (test_dom, test_mac) key_list = { 'DeviceID' : devid, - 'CreationClassName' : get_typed_class(options.virt, "NetworkPort"), + 'CreationClassName' : get_typed_class(options.virt, + "NetworkPort"), 'SystemName' : test_dom, - 'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem") + 'SystemCreationClassName' : get_typed_class(options.virt, + "ComputerSystem") } - dev = None - try: - dev = eval('devices.' + get_typed_class(options.virt, "NetworkPort"))(options.ip, key_list) + dev = eval('devices.' + get_typed_class(options.virt, "NetworkPort")) \ + (options.ip, key_list) except Exception, detail: logger.error("Exception: %s" % detail) vsxml.undefine(options.ip) return XFAIL_RC(bug) - if dev == None: + if devid != dev.DeviceID : logger.error("Error retrieving instance for devid %s" % devid) vsxml.undefine(options.ip) return FAIL - - status = PASS if dev.LinkTechnology != devices.LinkTechnology_Ethernet: - logger.error("LinkTechnology should be set to `%i' instead of `%s'" % \ - (devices.LinkTechnology_Ethernet, dev.LinkTechnology)) + logger.error("LinkTechnology should be set to `%i' instead of `%s'" + % (devices.LinkTechnology_Ethernet, dev.LinkTechnology)) status = FAIL addrs = dev.NetworkAddresses if len(addrs) != 1: - logger.error("Too many NetworkAddress entries (%i instead of %i)" % \ - (len(addrs), 1)) + logger.error("Too many NetworkAddress entries (%i instead of %i)" + % (len(addrs), 1)) status = FAIL if addrs[0] != test_mac: - logger.error("MAC address reported incorrectly (%s instead of %s)" % \ - (addrs[0], test_mac)) + logger.error("MAC address reported incorrectly (%s instead of %s)" + % (addrs[0], test_mac)) status = FAIL if status == FAIL: logger.error("Checked interface %s" % test_mac) vsxml.undefine(options.ip) - return status if __name__ == "__main__": From deeptik at linux.vnet.ibm.com Fri Apr 11 12:45:54 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 11 Apr 2008 18:15:54 +0530 Subject: [Libvirt-cim] [PATCH] [TEST]Fixing 01_netport.py tc failure In-Reply-To: <47FECFBE.8000203@linux.vnet.ibm.com> References: <0b1dc112438b0362c888.1207835097@dkalaker> <47FECFBE.8000203@linux.vnet.ibm.com> Message-ID: <47FF5D82.6090208@linux.vnet.ibm.com> Kaitlin Rupert wrote: >> >> - if dev == None: >> + if devid not in dev.DeviceID : > > I checked in Daisy's fix for this, however it is probably a better > check since we're looking for a specific device instance. > > However, instead of devid not in dev.DeviceID, I would use > dev.DeviceID != devid. A DeviceID should be unique. If the provider > returns "test_domain/procAndsomegarbage" and our devid is > "test_domain/proc", we'd pass here. > Sorry , my mistake. > Due to similar logic, I should have rejected Daisy's patch - a mistake > on my part. > >> logger.error("Error retrieving instance for devid %s" % devid) >> vsxml.undefine(options.ip) >> return FAIL >> - >> - status = PASS >> if dev.LinkTechnology != devices.LinkTechnology_Ethernet: >> logger.error("LinkTechnology should be set to `%i' instead of `%s'" % \ >> @@ -86,20 +83,17 @@ def main(): >> >> addrs = dev.NetworkAddresses >> if len(addrs) != 1: >> - logger.error("Too many NetworkAddress entries (%i instead of %i)" % \ >> - (len(addrs), 1)) >> + logger.error("Too many NetworkAddress entries (%i instead of %i)" % >> (len(addrs), 1)) > > This line and the next end up spanning 80 characters long. The > libvirt-cim convention is 80 character lines. Even though we don't > follow their convention, I like the idea of shorter line lengths. This > helps prevent text from running into the next line - helps with > readability. You can do the following without in python (I believe): > > logger.error("Too many NetworkAddress entries (%i instead of %i)" > % (len(addrs), 1)) > I usually run pylint on the tc before submitting them and the pylint config file has the max-line-length set to 90. Do you want it to be 80 ? From deeptik at linux.vnet.ibm.com Fri Apr 11 13:40:55 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 11 Apr 2008 19:10:55 +0530 Subject: [Libvirt-cim] [PATCH 1 of 6] [TEST] update processor id in 02_hostsystem_to_rasd.py to reflect recent provider changes In-Reply-To: <16ad6528cd7d7ef367d3.1207879572@elm3b197.beaverton.ibm.com> References: <16ad6528cd7d7ef367d3.1207879572@elm3b197.beaverton.ibm.com> Message-ID: <47FF6A67.3080101@linux.vnet.ibm.com> +1 for me. Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1207878595 25200 > # Node ID 16ad6528cd7d7ef367d354c1cadd0d258fa09e0a > # Parent 19ff9c851ed8cb76b74d158a4c439dfa5f4ccb50 > [TEST] update processor id in 02_hostsystem_to_rasd.py to reflect recent provider changes > > Signed-off-by: Guolian Yun > > diff -r 19ff9c851ed8 -r 16ad6528cd7d suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py > --- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Wed Apr 09 18:00:14 2008 +0530 > +++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Thu Apr 10 18:49:55 2008 -0700 > @@ -79,7 +79,7 @@ def init_list(vsxml, virt="Xen"): > > rasd_values = { > proc_cn : { > - "InstanceID" : '%s/%s' %(test_dom,0), > + "InstanceID" : '%s/%s' %(test_dom, "proc"), > "ResourceType" : 3, > }, > disk_cn : { > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From danms at us.ibm.com Fri Apr 11 13:44:48 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 11 Apr 2008 06:44:48 -0700 Subject: [Libvirt-cim] [PATCH] [TEST]Fixing 01_netport.py tc failure In-Reply-To: <47FECFBE.8000203@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Thu, 10 Apr 2008 19:41:02 -0700") References: <0b1dc112438b0362c888.1207835097@dkalaker> <47FECFBE.8000203@linux.vnet.ibm.com> Message-ID: <87prswqze7.fsf@caffeine.beaverton.ibm.com> KR> This line and the next end up spanning 80 characters long. The KR> libvirt-cim convention is 80 character lines. Even though we KR> don't follow their convention, I like the idea of shorter line KR> lengths. This helps prevent text from running into the next line KR> - helps with readability. +1.5. The whitespace in many parts of cimtest really hurts my eyes :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Apr 11 13:49:51 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 11 Apr 2008 06:49:51 -0700 Subject: [Libvirt-cim] [PATCH] [PATCH] fix vcpu dev error in xml_parse_test.c In-Reply-To: (Guo Lian Yun's message of "Fri, 11 Apr 2008 02:46:55 -0700") References: Message-ID: <87lk3kqz5s.fsf@caffeine.beaverton.ibm.com> GY> # HG changeset patch GY> # User Guolian Yun GY> # Date 1207907205 25200 GY> # Node ID a80c7a68af12a390861171e38d2b216c22fb2b41 GY> # Parent a185e443ad6012d86690194112393d58e8c51967 GY> [PATCH] fix vcpu dev error in xml_parse_test.c This is a valid fix, but only because nobody has acked my version of it from earlier in the week... I guess the provider is lost in the glow of the new shiny test suite now? :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From deeptik at linux.vnet.ibm.com Fri Apr 11 14:09:52 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 11 Apr 2008 19:39:52 +0530 Subject: [Libvirt-cim] [PATCH 2 of 6] [TEST] update processor id in Processor01~03 to reflect recent provider changes In-Reply-To: <1a230184a44b133bb453.1207879573@elm3b197.beaverton.ibm.com> References: <1a230184a44b133bb453.1207879573@elm3b197.beaverton.ibm.com> Message-ID: <47FF7130.5010706@linux.vnet.ibm.com> Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1207878768 25200 > # Node ID 1a230184a44b133bb453d9f4582a0ff6e9ea5696 > # Parent 16ad6528cd7d7ef367d354c1cadd0d258fa09e0a > [TEST] update processor id in Processor01~03 to reflect recent provider changes > > Signed-off-by: Guolian Yun > > diff -r 16ad6528cd7d -r 1a230184a44b suites/libvirt-cim/cimtest/Processor/01_processor.py > --- a/suites/libvirt-cim/cimtest/Processor/01_processor.py Thu Apr 10 18:49:55 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/Processor/01_processor.py Thu Apr 10 18:52:48 2008 -0700 > @@ -54,7 +54,7 @@ def main(): > logger.error("Domain not started, we're not able to check vcpu") > else: > for i in range(0, test_vcpus): > The for loop is not required anymore, since we get only one record irrespective of the vcpus assigned to the domain. > - devid = "%s/%s" % (test_dom, i) > + devid = "%s/%s" % (test_dom, "proc") > key_list = { 'DeviceID' : devid, > 'CreationClassName' : get_typed_class(options.virt, "Processor"), > 'SystemName' : test_dom > As of now, the test case just gives a log msg, it can be improved by verifying the DeviceID returned as below: if dev.DeviceID != devid: logger.info("Mismatching device, returned %s instead %s" % (dev.DeviceID, devid)) break > diff -r 16ad6528cd7d -r 1a230184a44b suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py > --- a/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Thu Apr 10 18:49:55 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Thu Apr 10 18:52:48 2008 -0700 > @@ -57,7 +57,7 @@ def check_processors(procs): > procs['SystemName'], default_dom) > return 1 > > - devid = "%s/%s" % (default_dom, test_vcpus - 1) > + devid = "%s/%s" % (default_dom, "proc") > looks good. The tc fails for XenFV with the following error: CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" ERROR - Unexpected rc code 1 and description: ERROR - Exception: Unable create domain test_domain using DefineSystem() May be this is an issue on my machine only. Also, for setting the status values can we use PASS, FAIL ? As of now the above two tc used 0, 1 for this. > if proc['DeviceID'] != devid: > logger.error("DeviceID %s does not match expected %s.", > diff -r 16ad6528cd7d -r 1a230184a44b suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py > --- a/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py Thu Apr 10 18:49:55 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py Thu Apr 10 18:52:48 2008 -0700 > @@ -174,7 +174,7 @@ def main(): > options = main.options > log_param() > > - devid = "%s/%s" % (test_dom, "0") > + devid = "%s/%s" % (test_dom, "proc") > Looks good. > status = PASS > > # Getting the VS list and deleting the test_dom if it already exists. > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From deeptik at linux.vnet.ibm.com Fri Apr 11 14:16:32 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 11 Apr 2008 19:46:32 +0530 Subject: [Libvirt-cim] [PATCH 3 of 6] [TEST] update processor id in RASD01~02 to reflect recent provider changes In-Reply-To: <682ad781e5b01be0baf8.1207879574@elm3b197.beaverton.ibm.com> References: <682ad781e5b01be0baf8.1207879574@elm3b197.beaverton.ibm.com> Message-ID: <47FF72C0.4020001@linux.vnet.ibm.com> +1 for me. Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1207878950 25200 > # Node ID 682ad781e5b01be0baf81a5db2da840f1986655d > # Parent 1a230184a44b133bb453d9f4582a0ff6e9ea5696 > [TEST] update processor id in RASD01~02 to reflect recent provider changes > > Signed-off-by: Guolian Yun > > diff -r 1a230184a44b -r 682ad781e5b0 suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py > --- a/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Thu Apr 10 18:52:48 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Thu Apr 10 18:55:50 2008 -0700 > @@ -74,7 +74,7 @@ def init_list(xml, disk, virt="Xen"): > Creating the lists that will be used for comparisons. > """ > procrasd = { > - "InstanceID" : '%s/%s' %(test_dom,0),\ > + "InstanceID" : '%s/%s' %(test_dom, "proc"),\ > "ResourceType" : 3,\ > "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') > } > diff -r 1a230184a44b -r 682ad781e5b0 suites/libvirt-cim/cimtest/RASD/02_enum.py > --- a/suites/libvirt-cim/cimtest/RASD/02_enum.py Thu Apr 10 18:52:48 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/RASD/02_enum.py Thu Apr 10 18:55:50 2008 -0700 > @@ -51,7 +51,7 @@ def init_list(virt="Xen"): > Creating the lists that will be used for comparisons. > """ > procrasd = { > - "InstanceID" : '%s/%s' %(test_dom,0),\ > + "InstanceID" : '%s/%s' %(test_dom, "proc"),\ > "ResourceType" : 3,\ > "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') > } > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From deeptik at linux.vnet.ibm.com Fri Apr 11 14:20:05 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 11 Apr 2008 19:50:05 +0530 Subject: [Libvirt-cim] [PATCH 4 of 6] [TEST] update processor id in SettingsDefine01~03 to reflect recent provider changes In-Reply-To: <248707005ae8efa00fc1.1207879575@elm3b197.beaverton.ibm.com> References: <248707005ae8efa00fc1.1207879575@elm3b197.beaverton.ibm.com> Message-ID: <47FF7395.4000101@linux.vnet.ibm.com> +1 for me. Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1207879260 25200 > # Node ID 248707005ae8efa00fc106f3ad8da02add06b3b6 > # Parent 682ad781e5b01be0baf81a5db2da840f1986655d > [TEST] update processor id in SettingsDefine01~03 to reflect recent provider changes > > Signed-off-by: Guolian Yun > > diff -r 682ad781e5b0 -r 248707005ae8 suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py > --- a/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Thu Apr 10 18:55:50 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Thu Apr 10 19:01:00 2008 -0700 > @@ -82,7 +82,7 @@ def main(): > 'LogicalDisk' : test_disk, > 'Memory' : 'mem', > 'NetworkPort' : test_mac, > - 'Processor' : test_vcpus -1 } > + 'Processor' : 'proc' } > > devlist = {} > logelelst = {} > diff -r 682ad781e5b0 -r 248707005ae8 suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py > --- a/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Thu Apr 10 18:55:50 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Thu Apr 10 19:01:00 2008 -0700 > @@ -186,13 +186,13 @@ def main(): > > global rasd_devid > rasd_devid = { > - 'ProcResourceAllocationSettingData' : '%s/%s' % (test_dom, test_vcpus-1), > + 'ProcResourceAllocationSettingData' : '%s/%s' % (test_dom, 'proc'), > 'NetResourceAllocationSettingData' : '%s/%s' % (test_dom, test_mac), > 'DiskResourceAllocationSettingData' : '%s/%s' % (test_dom, test_disk), > 'MemResourceAllocationSettingData' : '%s/%s' % (test_dom, 'mem')} > global dev_devid > dev_devid = { > - 'Processor' : '%s/%s' % (test_dom, test_vcpus-1), > + 'Processor' : '%s/%s' % (test_dom, 'proc'), > 'NetworkPort' : '%s/%s' % (test_dom, test_mac), > 'LogicalDisk' : '%s/%s' % (test_dom, test_disk), > 'Memory' : '%s/%s' % (test_dom, 'mem')} > diff -r 682ad781e5b0 -r 248707005ae8 suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py > --- a/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Thu Apr 10 18:55:50 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Thu Apr 10 19:01:00 2008 -0700 > @@ -232,7 +232,7 @@ def main(): > get_typed_class(options.virt, 'LogicalDisk') : test_disk, > get_typed_class(options.virt, 'Memory') : 'mem', > get_typed_class(options.virt, 'NetworkPort') : test_mac, > - get_typed_class(options.virt, 'Processor') : test_vcpus - 1 > + get_typed_class(options.virt, 'Processor') : 'proc' > } > > tc_scen = [ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From deeptik at linux.vnet.ibm.com Fri Apr 11 14:22:29 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 11 Apr 2008 19:52:29 +0530 Subject: [Libvirt-cim] [PATCH 5 of 6] [TEST] update processor id in SystemDevice.01 to reflect recent provider changes In-Reply-To: References: Message-ID: <47FF7425.2070707@linux.vnet.ibm.com> +1 for me. Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1207879393 25200 > # Node ID fa561bc3cae2b4de3cf6f43df61bb647e7f9bdbc > # Parent 248707005ae8efa00fc106f3ad8da02add06b3b6 > [TEST] update processor id in SystemDevice.01 to reflect recent provider changes > > Signed-off-by: Guolian Yun > diff -r 248707005ae8 -r fa561bc3cae2 suites/libvirt-cim/cimtest/SystemDevice/01_forward.py > --- a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Thu Apr 10 19:01:00 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Thu Apr 10 19:03:13 2008 -0700 > @@ -74,7 +74,7 @@ def main(): > get_typed_class(options.virt, "NetworkPort") : '%s/%s' % (test_dom, test_mac), > get_typed_class(options.virt, "Memory") : '%s/mem' % test_dom, > get_typed_class(options.virt, "LogicalDisk") : '%s/%s' % (test_dom, test_disk), > - get_typed_class(options.virt, "Processor") : '%s/%s' % (test_dom, test_cpu-1) > + get_typed_class(options.virt, "Processor") : '%s/proc' % test_dom, > } > > key_list = {'DeviceID' : '', > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From deeptik at linux.vnet.ibm.com Fri Apr 11 14:24:12 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 11 Apr 2008 19:54:12 +0530 Subject: [Libvirt-cim] [PATCH 6 of 6] [TEST] update processor id in VSSD.04 to reflect recent provider changes In-Reply-To: References: Message-ID: <47FF748C.8000205@linux.vnet.ibm.com> +1 for me Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1207879513 25200 > # Node ID cb7da73431b75b11c6e7f01ae9a16003dda71233 > # Parent fa561bc3cae2b4de3cf6f43df61bb647e7f9bdbc > [TEST] update processor id in VSSD.04 to reflect recent provider changes > > Signed-off-by: Guolian Yun > > diff -r fa561bc3cae2 -r cb7da73431b7 suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py > --- a/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Thu Apr 10 19:03:13 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Thu Apr 10 19:05:13 2008 -0700 > @@ -82,7 +82,7 @@ def init_list(virt): > Creating the lists that will be used for comparisons. > """ > procrasd = { > - "InstanceID" : '%s/%s' %(test_dom,0), > + "InstanceID" : '%s/%s' %(test_dom, "proc"), > "ResourceType" : 3, > "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') > } > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From deeptik at linux.vnet.ibm.com Fri Apr 11 14:26:27 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 11 Apr 2008 19:56:27 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] update processor id in ElementAllocatedFromPool.04 In-Reply-To: <9682464811b73b7cb48d.1207880139@elm3b197.beaverton.ibm.com> References: <9682464811b73b7cb48d.1207880139@elm3b197.beaverton.ibm.com> Message-ID: <47FF7513.8000905@linux.vnet.ibm.com> +1 for me. Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1207880122 25200 > # Node ID 9682464811b73b7cb48dfb0a6c6f3e984da78d6a > # Parent 19ff9c851ed8cb76b74d158a4c439dfa5f4ccb50 > [TEST] update processor id in ElementAllocatedFromPool.04 > > Signed-off-by: Guolian Yun > > diff -r 19ff9c851ed8 -r 9682464811b7 suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py > --- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py Wed Apr 09 18:00:14 2008 +0530 > +++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py Thu Apr 10 19:15:22 2008 -0700 > @@ -99,7 +99,7 @@ def try_assoc(conn, exp_ret, dev_dom_nam > diskid = "%s/%s" % (dev_dom_name, test_disk) > memid = "%s/mem" % dev_dom_name > netid = "%s/%s" % (dev_dom_name, test_mac) > - procid = "%s/%s" % (dev_dom_name, 0) > + procid = "%s/proc" % dev_dom_name > > lelist = { > get_typed_class(virt, "LogicalDisk") : diskid, \ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From deeptik at linux.vnet.ibm.com Fri Apr 11 14:40:39 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 11 Apr 2008 20:10:39 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fixing 01_netport.py tc failure In-Reply-To: <970eaf6adde2704888d9.1207917872@dkalaker> References: <970eaf6adde2704888d9.1207917872@dkalaker> Message-ID: <47FF7867.2020008@linux.vnet.ibm.com> Please ignore this patch. Regards, Deepti. Deepti B. Kalakeri wrote: > # HG changeset patch > # User Deepti B. Kalakeri > # Date 1207917822 -19800 > # Node ID 970eaf6adde2704888d914c45c0aba19aff7f4dc > # Parent ee931f10e1f0b83d410f8e1c13d320b23bba7f1e > [TEST] #2 Fixing 01_netport.py tc failure. > > Signed-off-by: Deepti B. Kalakeri > > diff -r ee931f10e1f0 -r 970eaf6adde2 suites/libvirt-cim/cimtest/NetworkPort/01_netport.py > --- a/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Fri Apr 11 16:58:23 2008 +0530 > +++ b/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Fri Apr 11 18:13:42 2008 +0530 > @@ -30,12 +30,9 @@ > # Date : 24-10-2007 > > import sys > -import pywbem > -from VirtLib import utils > -from VirtLib import live > from XenKvmLib import devices > from XenKvmLib.classes import get_typed_class > -from XenKvmLib.vxml import XenXML, KVMXML, get_class > +from XenKvmLib.vxml import get_class > from CimTest.Globals import log_param, logger > from CimTest.Globals import do_main > from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC > @@ -51,55 +48,54 @@ def main(): > def main(): > options = main.options > log_param() > + status = PASS > > vsxml = get_class(options.virt)(test_dom, mac=test_mac) > vsxml.define(options.ip) > > devid = "%s/%s" % (test_dom, test_mac) > key_list = { 'DeviceID' : devid, > - 'CreationClassName' : get_typed_class(options.virt, "NetworkPort"), > + 'CreationClassName' : get_typed_class(options.virt, > + "NetworkPort"), > 'SystemName' : test_dom, > - 'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem") > + 'SystemCreationClassName' : get_typed_class(options.virt, > + "ComputerSystem") > } > - > dev = None > - > try: > - dev = eval('devices.' + get_typed_class(options.virt, "NetworkPort"))(options.ip, key_list) > + dev = eval('devices.' + get_typed_class(options.virt, "NetworkPort")) \ > + (options.ip, key_list) > > except Exception, detail: > logger.error("Exception: %s" % detail) > vsxml.undefine(options.ip) > return XFAIL_RC(bug) > > - if dev == None: > + if devid != dev.DeviceID : > logger.error("Error retrieving instance for devid %s" % devid) > vsxml.undefine(options.ip) > return FAIL > - > - status = PASS > > if dev.LinkTechnology != devices.LinkTechnology_Ethernet: > - logger.error("LinkTechnology should be set to `%i' instead of `%s'" % \ > - (devices.LinkTechnology_Ethernet, dev.LinkTechnology)) > + logger.error("LinkTechnology should be set to `%i' instead of `%s'" > + % (devices.LinkTechnology_Ethernet, dev.LinkTechnology)) > status = FAIL > > addrs = dev.NetworkAddresses > if len(addrs) != 1: > - logger.error("Too many NetworkAddress entries (%i instead of %i)" % \ > - (len(addrs), 1)) > + logger.error("Too many NetworkAddress entries (%i instead of %i)" > + % (len(addrs), 1)) > status = FAIL > > if addrs[0] != test_mac: > - logger.error("MAC address reported incorrectly (%s instead of %s)" % \ > - (addrs[0], test_mac)) > + logger.error("MAC address reported incorrectly (%s instead of %s)" > + % (addrs[0], test_mac)) > status = FAIL > > if status == FAIL: > logger.error("Checked interface %s" % test_mac) > > vsxml.undefine(options.ip) > - > return status > > if __name__ == "__main__": > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From kaitlin at linux.vnet.ibm.com Fri Apr 11 14:53:17 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Apr 2008 07:53:17 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixed the tc 05_destroysystem_neg.py failure In-Reply-To: <1f4926b238908ff7f4c6.1207834068@dkalaker> References: <1f4926b238908ff7f4c6.1207834068@dkalaker> Message-ID: <47FF7B5D.2090402@linux.vnet.ibm.com> > elif tc == 'nonexistent': > - exp_rc = 4 #IM_RC_SYS_NOT_FOUND > - cs_ref = CIMInstanceName(classname,keybindings = { > + exp_rc = 2 #IM_RC_SYS_NOT_FOUND The error being returned is actually IM_RC_FAILED, not IM_RC_SYS_NOT_FOUND. Could you update this comment? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Apr 11 15:17:28 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Apr 2008 08:17:28 -0700 Subject: [Libvirt-cim] [PATCH] [TEST]Fixing 06_paused_active_suspend.py tc failure In-Reply-To: References: Message-ID: <47FF8108.7070703@linux.vnet.ibm.com> > + try: > + > + for i in range(1, (timeout + 1)): > + sleep(1) > + cs = computersystem.get_cs_class(virt)(server, test_dom) > + if cs.Name == test_dom: > + to_RequestedState = cs.RequestedState > + enabledState = cs.EnabledState > + else: > + logger.error("VS %s not found" % test_dom) > + return status You'll want to break here, otherwise the guest doesn't get destroyed properly. > + if enabledState == expstate: > + status = PASS > + break Instead of breaking here, you can just return since we've found the value we're looking for. > - > + > + status, to_RequestedState, enabledState = poll_for_status(options.ip, options.virt, cxml, 2) > + if status != PASS or enabledState != 2: No need to verify enabledState == 2, the poll_for_status function do this already. > + return status > + > #Suspend the VS > - rc = call_request_state_change(test_dom, options.ip, REQUESTED_STATE, > - TIME, options.virt) > + rc = call_request_state_change(test_dom, options.ip, REQUESTED_STATE, TIME, options.virt) This change causes the test to span multiple lines. I'll work on sending out some suggested style guidelines and post them to the list to see if people agree. > - except Exception, detail: > - logger.error("Exception variable: %s" % detail) > - return status > - > + status, to_RequestedState, enabledState = poll_for_status(options.ip, options.virt, cxml, > + FINAL_STATE) Unusual formatting here. Usually, the second line of arguments for a function will line up with the first argument. Something like: status, to_RequestedState, enabledState = poll_for_status(options.ip, options.virt, cxml, FINAL_STATE) Hopefully the formatting of the email doesn't kill the illustration. > if enabledState != FINAL_STATE: > logger.error("EnabledState has %i instead of %i", enabledState, FINAL_STATE) > logger.error("Try to increase the timeout and run the test again") > > if status != PASS: > - ret = cxml.destroy(options.ip) > - cxml.undefine(options.ip) Why remove the destroy and undefine here? The guest won't get cleaned up properly. > return status > > # Success: > @@ -134,9 +144,8 @@ def main(): > # To state == 2 > # Enabled_state == RequestedState > > - if from_State == START_STATE and \ > - to_RequestedState == FINAL_STATE and \ > - enabledState == to_RequestedState: > + if from_State == START_STATE and to_RequestedState == FINAL_STATE and \ > + enabledState == to_RequestedState: This is unusual indention style. Usually, the new line starts just below the if or the first part of the statement. So you'd have: if from_State == START_STATE and to_RequestedState == FINAL_STATE and \ enabledState == to_RequestedState: or if from_State == START_STATE and to_RequestedState == FINAL_STATE and \ enabledState == to_RequestedState: My preference is the latter. You can hold off on changing this patch until we agree on a coding style. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Apr 11 15:28:28 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Apr 2008 08:28:28 -0700 Subject: [Libvirt-cim] libvirt-cim rpm for Fedora 9 versus recent provider repository In-Reply-To: <873aptrzma.fsf@caffeine.beaverton.ibm.com> References: <871w5d7lb4.fsf@caffeine.beaverton.ibm.com> <20080410172653.GA7050@redhat.com> <87od8h60nj.fsf@caffeine.beaverton.ibm.com> <47FEB2FC.5020005@linux.vnet.ibm.com> <873aptrzma.fsf@caffeine.beaverton.ibm.com> Message-ID: <47FF839C.8000704@linux.vnet.ibm.com> Dan Smith wrote: > KR> For future releases, would it be a good idea to archive the > KR> current state of the cimtest tree at the same time a release is > KR> snapped of libvirt-cim? This would allow us to preserve the state > KR> of the tests and tie them to a given release. > > We can, and we could just use a tag for this. However, unless we get > closer to an all PASS/XFAIL situation, I'm not sure I see the point :) That's a good point. > > KR> Have the test suite check for the libvirt-cim rpm. If it exists, > KR> grab version. Otherwise, assume the providers are the most recent > KR> version upstream. > > Yeah, I dunno about that. We could definitely embed a version string > into one of the providers somewhere (i.e. VSMS) and key off of that. > We'd have to assume some base version if it doesn't exist (like for > what is in F9 now) of course. When would you update the version string? Anytime a change goes into libvirt-cim, there's a possibility that the change in behavior will affect the test case. If you want to update a test so that it behaves one way for libvirt releases older than x.x.4 and a different way for releases x.x.4 and higher, then you'd need to update the embedded string every time you check in a changeset. Unless I'm missing what you mean here. Ideally, it'd be nice to use the hg changeset number, but I'm not sure how to make that happen. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Apr 11 15:40:46 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Apr 2008 08:40:46 -0700 Subject: [Libvirt-cim] [PATCH 2 of 6] [TEST] update processor id in Processor01~03 to reflect recent provider changes In-Reply-To: <1a230184a44b133bb453.1207879573@elm3b197.beaverton.ibm.com> References: <1a230184a44b133bb453.1207879573@elm3b197.beaverton.ibm.com> Message-ID: <47FF867E.8020602@linux.vnet.ibm.com> > logger.error("Domain not started, we're not able to check vcpu") > else: > for i in range(0, test_vcpus): Can you remove the loop here? We're only testing one processor, no need for a loop. Also, > - devid = "%s/%s" % (test_dom, i) > + devid = "%s/%s" % (test_dom, "proc") > key_list = { 'DeviceID' : devid, > 'CreationClassName' : get_typed_class(options.virt, "Processor"), > 'SystemName' : test_dom, > diff -r 16ad6528cd7d -r 1a230184a44b suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py > --- a/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Thu Apr 10 18:49:55 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Thu Apr 10 18:52:48 2008 -0700 > @@ -57,7 +57,7 @@ def check_processors(procs): > procs['SystemName'], default_dom) > return 1 > > - devid = "%s/%s" % (default_dom, test_vcpus - 1) > + devid = "%s/%s" % (default_dom, "proc") > > if proc['DeviceID'] != devid: > logger.error("DeviceID %s does not match expected %s.", > diff -r 16ad6528cd7d -r 1a230184a44b suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py > --- a/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py Thu Apr 10 18:49:55 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py Thu Apr 10 18:52:48 2008 -0700 > @@ -174,7 +174,7 @@ def main(): > options = main.options > log_param() > > - devid = "%s/%s" % (test_dom, "0") > + devid = "%s/%s" % (test_dom, "proc") > status = PASS > -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Fri Apr 11 16:11:45 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 11 Apr 2008 09:11:45 -0700 Subject: [Libvirt-cim] libvirt-cim rpm for Fedora 9 versus recent provider repository In-Reply-To: <47FF839C.8000704@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Fri, 11 Apr 2008 08:28:28 -0700") References: <871w5d7lb4.fsf@caffeine.beaverton.ibm.com> <20080410172653.GA7050@redhat.com> <87od8h60nj.fsf@caffeine.beaverton.ibm.com> <47FEB2FC.5020005@linux.vnet.ibm.com> <873aptrzma.fsf@caffeine.beaverton.ibm.com> <47FF839C.8000704@linux.vnet.ibm.com> Message-ID: <878wzkqsla.fsf@caffeine.beaverton.ibm.com> KR> When would you update the version string? Anytime a change goes KR> into libvirt-cim, there's a possibility that the change in KR> behavior will affect the test case. If you want to update a test KR> so that it behaves one way for libvirt releases older than x.x.4 KR> and a different way for releases x.x.4 and higher, then you'd need KR> to update the embedded string every time you check in a changeset. KR> Unless I'm missing what you mean here. Well, I think it's probably appropriate to embed the actual version number (i.e. 0.4) as well as the changeset number. KR> Ideally, it'd be nice to use the hg changeset number, but I'm not KR> sure how to make that happen. There are ways :) I'll see about a patch. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Fri Apr 11 16:42:13 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Apr 2008 09:42:13 -0700 Subject: [Libvirt-cim] [PATCH] [PATCH] fix vcpu dev error in xml_parse_test.c In-Reply-To: <87lk3kqz5s.fsf@caffeine.beaverton.ibm.com> References: <87lk3kqz5s.fsf@caffeine.beaverton.ibm.com> Message-ID: <47FF94E5.1050101@linux.vnet.ibm.com> Dan Smith wrote: > GY> # HG changeset patch > GY> # User Guolian Yun > GY> # Date 1207907205 25200 > GY> # Node ID a80c7a68af12a390861171e38d2b216c22fb2b41 > GY> # Parent a185e443ad6012d86690194112393d58e8c51967 > GY> [PATCH] fix vcpu dev error in xml_parse_test.c > > This is a valid fix, but only because nobody has acked my version of > it from earlier in the week... > > I guess the provider is lost in the glow of the new shiny test suite > now? :) > I sent an ack 4/9. Maybe the mail didn't go to the list properly. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Fri Apr 11 16:44:33 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 11 Apr 2008 09:44:33 -0700 Subject: [Libvirt-cim] [PATCH] [PATCH] fix vcpu dev error in xml_parse_test.c In-Reply-To: <47FF94E5.1050101@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Fri, 11 Apr 2008 09:42:13 -0700") References: <87lk3kqz5s.fsf@caffeine.beaverton.ibm.com> <47FF94E5.1050101@linux.vnet.ibm.com> Message-ID: <87zls0pci6.fsf@caffeine.beaverton.ibm.com> KR> I sent an ack 4/9. Maybe the mail didn't go to the list properly. Ah, okay, maybe I missed it... Thanks :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Fri Apr 11 16:47:18 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Apr 2008 09:47:18 -0700 Subject: [Libvirt-cim] [PATCH] [TEST]Fixing 01_netport.py tc failure In-Reply-To: <47FF5D82.6090208@linux.vnet.ibm.com> References: <0b1dc112438b0362c888.1207835097@dkalaker> <47FECFBE.8000203@linux.vnet.ibm.com> <47FF5D82.6090208@linux.vnet.ibm.com> Message-ID: <47FF9616.1010305@linux.vnet.ibm.com> >> This line and the next end up spanning 80 characters long. The >> libvirt-cim convention is 80 character lines. Even though we don't >> follow their convention, I like the idea of shorter line lengths. This >> helps prevent text from running into the next line - helps with >> readability. You can do the following without in python (I believe): >> >> logger.error("Too many NetworkAddress entries (%i instead of %i)" >> % (len(addrs), 1)) >> > I usually run pylint on the tc before submitting them and the pylint > config file has the max-line-length set to 90. > Do you want it to be 80 ? Yes, if you are using a pylint config, then setting a max line length of 80 would be great. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Apr 11 17:05:43 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Apr 2008 10:05:43 -0700 Subject: [Libvirt-cim] [TEST] KVM test on Fedora8 In-Reply-To: References: Message-ID: <47FF9A67.6070004@linux.vnet.ibm.com> > > > > VirtualSystemSnapshotService - 01_enum.py: FAIL > > Provider not found or not loadable > > This fails because of unsuccessful VirtualSystemSnapshotService provider > installation. I will try to reinstall it and test again. This is interesting. There was a problem awhile back with a different provider. It seems that the automake process doesn't handle things as we're expecting. If you run make install twice, does it fix your issue? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Fri Apr 11 17:22:09 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 11 Apr 2008 10:22:09 -0700 Subject: [Libvirt-cim] [PATCH] Add revision information to the VSMS Message-ID: <52e2f501b44994af849d.1207934529@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1207934505 25200 # Node ID 52e2f501b44994af849df3a8e354bbe6097cd9d6 # Parent 17cf33b5cf9ac533d51f73037a6f08499dc0a67b Add revision information to the VSMS This is done at build time, if possible. If not, the changeset/revision at the last automake run will be used. This should make it work for the tarball/release case as well as the RPM build. The way this works, if you build, then apply a patch or pull a new changeset, the exposed revision/version information will be stale unless you do a clean. Since this is really just for the purposes of test-tracking, I think this is a reasonable restriction that can be minded by the people doing testing. The changeset hash and revision number are exposed in aptly-named properties of the VSMS for each platform. If anyone has a better place for these to show up, or a better format, please bring it up. Signed-off-by: Dan Smith diff -r 17cf33b5cf9a -r 52e2f501b449 Makefile.am --- a/Makefile.am Fri Apr 11 09:53:15 2008 -0700 +++ b/Makefile.am Fri Apr 11 10:21:45 2008 -0700 @@ -98,7 +98,8 @@ pkgdata_SCRIPTS = provider-register.sh EXTRA_DIST = schema $(pkgdata_DATA) $(pkgdata_SCRIPTS) \ libvirt-cim.spec.in libvirt-cim.spec \ - doc/CodingStyle doc/SubmittingPatches + doc/CodingStyle doc/SubmittingPatches \ + .changeset .revision preinstall: sh -x base_schema/install_base_schema.sh `pwd`/base_schema diff -r 17cf33b5cf9a -r 52e2f501b449 acinclude.m4 --- a/acinclude.m4 Fri Apr 11 09:53:15 2008 -0700 +++ b/acinclude.m4 Fri Apr 11 10:21:45 2008 -0700 @@ -313,4 +313,23 @@ AC_DEFUN([DEFINE_DISK_CONFIG], [ AC_DEFINE_UNQUOTED([DISK_POOL_CONFIG], "$1", [Disk pool config filepath.]) ] -) \ No newline at end of file +) + +AC_DEFUN([SET_CSET], + [ + if test -d .hg && test -x $(which hg); then + cs='-DLIBVIRT_CIM_CS=\"`hg id -i`\"' + rv='-DLIBVIRT_CIM_RV=\"`hg id -n`\"' + elif test -f .changeset; then + cset=$(cat .changeset) + revn=$(cat .revision) + cs="-DLIBVIRT_CIM_CS=\\\"$cset\\\"" + rv="-DLIBVIRT_CIM_RV=\\\"$revn\\\"" + else + cs='-DLIBVIRT_CIM_CS=\"Unknown\"' + rv='-DLIBVIRT_CIM_RV=\"0\"' + fi + + CFLAGS="$CFLAGS $cs $rv" + ] +) diff -r 17cf33b5cf9a -r 52e2f501b449 autoconfiscate.sh --- a/autoconfiscate.sh Fri Apr 11 09:53:15 2008 -0700 +++ b/autoconfiscate.sh Fri Apr 11 10:21:45 2008 -0700 @@ -17,4 +17,12 @@ echo "Running autoconf ..." && echo "Running autoconf ..." && autoconf --force && +if test -x $(which hg); then + hg id -i > .changeset + hg id -n > .revision +else + echo "Unknown" > .changeset + echo "0" > .revision +fi + echo "You may now run ./configure" diff -r 17cf33b5cf9a -r 52e2f501b449 configure.ac --- a/configure.ac Fri Apr 11 09:53:15 2008 -0700 +++ b/configure.ac Fri Apr 11 10:21:45 2008 -0700 @@ -143,6 +143,7 @@ AC_SUBST(CFLAGS_STRICT) AC_SUBST(CFLAGS_STRICT) CFLAGS="$CFLAGS $CC_WARNINGS" +SET_CSET # Display configuration options echo "----------------------------------------------------------" diff -r 17cf33b5cf9a -r 52e2f501b449 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Fri Apr 11 09:53:15 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Fri Apr 11 10:21:45 2008 -0700 @@ -1244,6 +1244,12 @@ CMPIStatus get_vsms(const CMPIObjectPath CMSetProperty(inst, "SystemCreationClassName", (CMPIValue *)ccname, CMPI_chars); + CMSetProperty(inst, "Changeset", + (CMPIValue *)LIBVIRT_CIM_CS, CMPI_chars); + + CMSetProperty(inst, "Revision", + (CMPIValue *)LIBVIRT_CIM_RV, CMPI_chars); + if (is_get_inst) { s = cu_validate_ref(broker, reference, inst); if (s.rc != CMPI_RC_OK) From kaitlin at linux.vnet.ibm.com Fri Apr 11 17:38:29 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Apr 2008 10:38:29 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fixing the 04_defineStartVS.py tc failure In-Reply-To: References: Message-ID: <47FFA215.70908@linux.vnet.ibm.com> > + # Success: VS is in Enabled State after Define and Start Normally, comments are indented to match the line they precede. So, in this case, You'd want: # Success: VS is in Enabled State after Define and Start if enabState == 2: Instead of: # Success: VS is in Enabled State after Define and Start if enabState == 2: However, I've checked this in since it's minor. Also, I noticed another issue in this test not related to your patch. The exception block returns without destroying/undefining the guest. Could you write a fix for this? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Apr 11 19:08:17 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Apr 2008 12:08:17 -0700 Subject: [Libvirt-cim] Re: CimTest Report on XenFV 10-04-2008 In-Reply-To: <47FE19B7.2040003@linux.vnet.ibm.com> References: <47FDF40C.1010202@linux.vnet.ibm.com> <47FE19B7.2040003@linux.vnet.ibm.com> Message-ID: <47FFB721.3080304@linux.vnet.ibm.com> > The error code returned was mismatching. Fixed it. > I have a doubt here though. > > The part of the code in Virt_VirtualSystemManagementService.c which is > checked here does seem to handle all the error condition. > 520 error: > 521 if (rc == IM_RC_SYS_NOT_FOUND) > 522 cu_statusf(_BROKER, &status, > 523 CMPI_RC_ERR_FAILED, > 524 "Failed to find domain"); > 525 else if (rc == IM_RC_OK) > 526 status = (CMPIStatus){CMPI_RC_OK, NULL}; > 527 > The tc does should have got the "Failed to find domain" error when a > nonexisting domain is passed, but this is not so because the part of the > code which is used to check this does not set > the rc to IM_RC_SYS_NOT_FOUND before junping to error , see the code below. > > // Make sure system exists and destroy it. > if (!domain_exists(conn, dom_name)) > goto error; Thanks Deepti - this looks like a bug. We should be setting the status variable appropriately for the rc == IM_RC_FAILED case. I'll be sending out a patch for this issue. This will affect the test fix you sent out, so you'll want to wait for the patch to go in before resubmitting that fix. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Apr 11 22:12:59 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Apr 2008 15:12:59 -0700 Subject: [Libvirt-cim] [PATCH] Add revision information to the VSMS In-Reply-To: <52e2f501b44994af849d.1207934529@guaranine.danplanet.com> References: <52e2f501b44994af849d.1207934529@guaranine.danplanet.com> Message-ID: <47FFE26B.7020803@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1207934505 25200 > # Node ID 52e2f501b44994af849df3a8e354bbe6097cd9d6 > # Parent 17cf33b5cf9ac533d51f73037a6f08499dc0a67b > Add revision information to the VSMS > > This is done at build time, if possible. If not, the changeset/revision > at the last automake run will be used. This should make it work for the > tarball/release case as well as the RPM build. > > The way this works, if you build, then apply a patch or pull a new changeset, > the exposed revision/version information will be stale unless you do a clean. > Since this is really just for the purposes of test-tracking, I think this > is a reasonable restriction that can be minded by the people doing testing. > > The changeset hash and revision number are exposed in aptly-named properties > of the VSMS for each platform. If anyone has a better place for these to > show up, or a better format, please bring it up. > You'll also need to modify the mof file to add the new attributes, right? I think this a neat approach. I'm not sure whether VSMS is the correct place.. I initially thought this would be good to add to the profile, but I don't know if we want to advertise this info there. The SoftwareIdentity class has attributes for this kind of information, but it definitely doesn't fit in the scope of the VSP and SVP. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From yunguol at cn.ibm.com Mon Apr 14 02:08:09 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 14 Apr 2008 10:08:09 +0800 Subject: [Libvirt-cim] [TEST] KVM test on Fedora8 In-Reply-To: <47FF9A67.6070004@linux.vnet.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-04-12 01:05:43: > > > > > > VirtualSystemSnapshotService - 01_enum.py: FAIL > > > Provider not found or not loadable > > > > This fails because of unsuccessful VirtualSystemSnapshotService provider > > installation. I will try to reinstall it and test again. > > This is interesting. There was a problem awhile back with a different > provider. It seems that the automake process doesn't handle things as > we're expecting. > > If you run make install twice, does it fix your issue? It doesn't fix the issue by running make install twice. Although the below lines show the provider is registered already. .... Registering class Xen_VirtualSystemSnapshotService Registering class KVM_VirtualSystemSnapshotService Registering class LXC_VirtualSystemSnapshotService Registering class Xen_VirtualSystemSnapshotServiceCapabilities Registering class KVM_VirtualSystemSnapshotServiceCapabilities Registering class LXC_VirtualSystemSnapshotServiceCapabilities ... > > -- > Kaitlin Rupert > IBM Linux Technology Center > kaitlin at linux.vnet.ibm.com > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From yunguol at cn.ibm.com Mon Apr 14 02:03:23 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Sun, 13 Apr 2008 19:03:23 -0700 Subject: [Libvirt-cim] [PATCH] [TEST].2# update processor id to reflect recent provider changes Message-ID: # HG changeset patch # User Guolian Yun # Date 1208138597 25200 # Node ID ede68ec5664dd564fe55ae9a90243d6e53465003 # Parent 137e5079c73fcbfc70e6654cee0b3c3eb3c6acd2 [TEST].2# update processor id to reflect recent provider changes Signed-off-by: Guolian Yun diff -r 137e5079c73f -r ede68ec5664d suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py --- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py Sun Apr 13 19:03:17 2008 -0700 @@ -99,7 +99,7 @@ def try_assoc(conn, exp_ret, dev_dom_nam diskid = "%s/%s" % (dev_dom_name, test_disk) memid = "%s/mem" % dev_dom_name netid = "%s/%s" % (dev_dom_name, test_mac) - procid = "%s/%s" % (dev_dom_name, 0) + procid = "%s/proc" % dev_dom_name lelist = { get_typed_class(virt, "LogicalDisk") : diskid, \ diff -r 137e5079c73f -r ede68ec5664d suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py --- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Sun Apr 13 19:03:17 2008 -0700 @@ -79,7 +79,7 @@ def init_list(vsxml, virt="Xen"): rasd_values = { proc_cn : { - "InstanceID" : '%s/%s' %(test_dom,0), + "InstanceID" : '%s/%s' %(test_dom, "proc"), "ResourceType" : 3, }, disk_cn : { diff -r 137e5079c73f -r ede68ec5664d suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py --- a/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Sun Apr 13 19:03:17 2008 -0700 @@ -74,7 +74,7 @@ def init_list(xml, disk, virt="Xen"): Creating the lists that will be used for comparisons. """ procrasd = { - "InstanceID" : '%s/%s' %(test_dom,0),\ + "InstanceID" : '%s/%s' %(test_dom, "proc"),\ "ResourceType" : 3,\ "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') } diff -r 137e5079c73f -r ede68ec5664d suites/libvirt-cim/cimtest/RASD/02_enum.py --- a/suites/libvirt-cim/cimtest/RASD/02_enum.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/RASD/02_enum.py Sun Apr 13 19:03:17 2008 -0700 @@ -51,7 +51,7 @@ def init_list(virt="Xen"): Creating the lists that will be used for comparisons. """ procrasd = { - "InstanceID" : '%s/%s' %(test_dom,0),\ + "InstanceID" : '%s/%s' %(test_dom, "proc"),\ "ResourceType" : 3,\ "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') } diff -r 137e5079c73f -r ede68ec5664d suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Sun Apr 13 19:03:17 2008 -0700 @@ -82,7 +82,7 @@ def main(): 'LogicalDisk' : test_disk, 'Memory' : 'mem', 'NetworkPort' : test_mac, - 'Processor' : test_vcpus -1 } + 'Processor' : 'proc' } devlist = {} logelelst = {} diff -r 137e5079c73f -r ede68ec5664d suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Sun Apr 13 19:03:17 2008 -0700 @@ -186,13 +186,13 @@ def main(): global rasd_devid rasd_devid = { - 'ProcResourceAllocationSettingData' : '%s/%s' % (test_dom, test_vcpus-1), + 'ProcResourceAllocationSettingData' : '%s/%s' % (test_dom, 'proc'), 'NetResourceAllocationSettingData' : '%s/%s' % (test_dom, test_mac), 'DiskResourceAllocationSettingData' : '%s/%s' % (test_dom, test_disk), 'MemResourceAllocationSettingData' : '%s/%s' % (test_dom, 'mem')} global dev_devid dev_devid = { - 'Processor' : '%s/%s' % (test_dom, test_vcpus-1), + 'Processor' : '%s/%s' % (test_dom, 'proc'), 'NetworkPort' : '%s/%s' % (test_dom, test_mac), 'LogicalDisk' : '%s/%s' % (test_dom, test_disk), 'Memory' : '%s/%s' % (test_dom, 'mem')} diff -r 137e5079c73f -r ede68ec5664d suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Sun Apr 13 19:03:17 2008 -0700 @@ -232,7 +232,7 @@ def main(): get_typed_class(options.virt, 'LogicalDisk') : test_disk, get_typed_class(options.virt, 'Memory') : 'mem', get_typed_class(options.virt, 'NetworkPort') : test_mac, - get_typed_class(options.virt, 'Processor') : test_vcpus - 1 + get_typed_class(options.virt, 'Processor') : 'proc' } tc_scen = [ diff -r 137e5079c73f -r ede68ec5664d suites/libvirt-cim/cimtest/SystemDevice/01_forward.py --- a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Sun Apr 13 19:03:17 2008 -0700 @@ -74,7 +74,7 @@ def main(): get_typed_class(options.virt, "NetworkPort") : '%s/%s' % (test_dom, test_mac), get_typed_class(options.virt, "Memory") : '%s/mem' % test_dom, get_typed_class(options.virt, "LogicalDisk") : '%s/%s' % (test_dom, test_disk), - get_typed_class(options.virt, "Processor") : '%s/%s' % (test_dom, test_cpu-1) + get_typed_class(options.virt, "Processor") : '%s/proc' % test_dom } key_list = {'DeviceID' : '', diff -r 137e5079c73f -r ede68ec5664d suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py --- a/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Sun Apr 13 19:03:17 2008 -0700 @@ -82,7 +82,7 @@ def init_list(virt): Creating the lists that will be used for comparisons. """ procrasd = { - "InstanceID" : '%s/%s' %(test_dom,0), + "InstanceID" : '%s/%s' %(test_dom, "proc"), "ResourceType" : 3, "CreationClassName": get_typed_class(virt, 'ProcResourceAllocationSettingData') } From yunguol at cn.ibm.com Mon Apr 14 02:29:52 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Sun, 13 Apr 2008 19:29:52 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] update processor id in Processor01~03 Message-ID: # HG changeset patch # User Guolian Yun # Date 1208140185 25200 # Node ID fa24152bf20383e0ae5104fa3e81687aab8c1c91 # Parent 137e5079c73fcbfc70e6654cee0b3c3eb3c6acd2 [TEST] update processor id in Processor01~03 Signed-off-by: Guolian Yun diff -r 137e5079c73f -r fa24152bf203 suites/libvirt-cim/cimtest/Processor/01_processor.py --- a/suites/libvirt-cim/cimtest/Processor/01_processor.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/Processor/01_processor.py Sun Apr 13 19:29:45 2008 -0700 @@ -32,6 +32,7 @@ from XenKvmLib.vxml import XenXML, KVMXM from XenKvmLib.vxml import XenXML, KVMXML, get_class from CimTest.Globals import log_param, logger from CimTest.Globals import do_main +from CimTest.ReturnCodes import PASS, FAIL SUPPORTED_TYPES = ['Xen', 'KVM', 'XenFV'] @@ -42,7 +43,7 @@ def main(): def main(): options = main.options log_param() - status = 0 + status = PASS vsxml = get_class(options.virt)(test_dom, vcpus=test_vcpus) vsxml.define(options.ip) vsxml.start(options.ip) @@ -50,22 +51,26 @@ def main(): # Processor instance enumerate need the domain to be active domlist = live.active_domain_list(options.ip, options.virt) if test_dom not in domlist: - status = 1 + status = FAIL logger.error("Domain not started, we're not able to check vcpu") else: - for i in range(0, test_vcpus): - devid = "%s/%s" % (test_dom, i) - key_list = { 'DeviceID' : devid, - 'CreationClassName' : get_typed_class(options.virt, "Processor"), - 'SystemName' : test_dom, - 'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem") - } - try: - dev = eval(('devices.' + get_typed_class(options.virt, 'Processor')))(options.ip, key_list) + devid = "%s/%s" % (test_dom, "proc") + key_list = { 'DeviceID' : devid, + 'CreationClassName' : get_typed_class(options.virt, "Processor"), + 'SystemName' : test_dom, + 'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem") + } + try: + dev = eval(('devices.' + get_typed_class(options.virt, 'Processor')))(options.ip, key_list) + if dev.DeviceID == devid: logger.info("Checked device %s" % devid) - except Exception, details: - logger.error("Error check device %s: %s" % (devid, details)) - status = 1 + else: + logger.error("Mismatching device, returned %s instead %s" % + (dev.DeviceID, devid)) + status = FAIL + except Exception, details: + logger.error("Error check device %s: %s" % (devid, details)) + status = FAIL vsxml.stop(options.ip) vsxml.undefine(options.ip) diff -r 137e5079c73f -r fa24152bf203 suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py --- a/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Sun Apr 13 19:29:45 2008 -0700 @@ -39,6 +39,7 @@ from XenKvmLib.common_util import create from XenKvmLib.common_util import create_using_definesystem from XenKvmLib.devices import get_dom_proc_insts from CimTest.Globals import log_param, logger, do_main +from CimTest.ReturnCodes import PASS, FAIL sup_types = ['Xen', 'KVM', 'XenFV'] @@ -49,28 +50,28 @@ def check_processors(procs): if len(procs) != test_vcpus: logger.error("%d vcpu instances were returned. %d expected", len(procs), test_vcpus) - return 1 + return FAIL for proc in procs: if proc['SystemName'] != default_dom: logger.error("Inst returned is for guesst %s, expected guest %s.", procs['SystemName'], default_dom) - return 1 + return FAIL - devid = "%s/%s" % (default_dom, test_vcpus - 1) + devid = "%s/%s" % (default_dom, "proc") if proc['DeviceID'] != devid: logger.error("DeviceID %s does not match expected %s.", procs['DeviceID'], devid) - return 1 + return FAIL - return 0 + return PASS @do_main(sup_types) def main(): options = main.options log_param() - status = 0 + status = PASS undefine_test_domain(default_dom, options.ip) @@ -94,7 +95,7 @@ def main(): except Exception, detail: logger.error("Exception: %s" % detail) - status = 1 + status = FAIL finally: undefine_test_domain(default_dom, options.ip) diff -r 137e5079c73f -r fa24152bf203 suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py --- a/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py Sun Apr 13 19:29:45 2008 -0700 @@ -174,7 +174,7 @@ def main(): options = main.options log_param() - devid = "%s/%s" % (test_dom, "0") + devid = "%s/%s" % (test_dom, "proc") status = PASS # Getting the VS list and deleting the test_dom if it already exists. From yunguol at cn.ibm.com Mon Apr 14 02:47:16 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Sun, 13 Apr 2008 19:47:16 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] fix the tc 05_destroysystem_neg.py failure Message-ID: <167489e6f009e6208c11.1208141236@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1208141230 25200 # Node ID 167489e6f009e6208c119baca9a64efee7881475 # Parent 137e5079c73fcbfc70e6654cee0b3c3eb3c6acd2 [TEST] fix the tc 05_destroysystem_neg.py failure Signed-off-by: Guolian Yun diff -r 137e5079c73f -r 167489e6f009 suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py Sun Apr 13 19:47:10 2008 -0700 @@ -44,7 +44,7 @@ def destroysystem_fail(tc, options): cs_ref = CIMInstanceName(classname, keybindings = {'CreationClassName':classname}) elif tc == 'nonexistent': - exp_rc = 4 #IM_RC_SYS_NOT_FOUND + exp_rc = 2 #IM_RC_FAILED cs_ref = CIMInstanceName(classname,keybindings = { 'Name':'##@@!!cimtest_domain', 'CreationClassName':classname}) From zli at linux.vnet.ibm.com Mon Apr 14 07:23:04 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Mon, 14 Apr 2008 15:23:04 +0800 Subject: [Libvirt-cim] KVM test report on Fedora 9 Message-ID: <48030658.5060504@linux.vnet.ibm.com> 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-76 =========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 at 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). 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 at 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 ====FULL CIMTEST REPORT=PASS(70)=FAIL(18)=SKIP(34)=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: SKIP ElementSettingData - 01_forward.py: SKIP ElementSettingData - 03_esd_assoc_with_rasd_errs.py: SKIP 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: SKIP HostedDependency - 02_reverse.py: SKIP HostedDependency - 03_enabledstate.py: SKIP HostedDependency - 04_reverse_errs.py: SKIP 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: SKIP 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: SKIP ResourcePool - 02_rp_gi_errors.py: SKIP 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: PASS 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: SKIP VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: SKIP 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 From deeptik at linux.vnet.ibm.com Mon Apr 14 07:27:38 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 14 Apr 2008 12:57:38 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing 04_defineStartVS.py tc Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1208157938 -19800 # Node ID f622bcacdd160dd9bd1ad5f1c7cbbc8101aabbbc # Parent 137e5079c73fcbfc70e6654cee0b3c3eb3c6acd2 [TEST] Fixing 04_defineStartVS.py tc. Signed-off-by: Deepti B. Kalakeri diff -r 137e5079c73f -r f622bcacdd16 suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Mon Apr 14 12:55:38 2008 +0530 @@ -26,7 +26,8 @@ # This test case checks state of the VS is in enabled state after # defining and starting the VS. # By verifying the properties of EnabledState = 2 of the VS. -# 10-Oct-2007 +# +# 10-Oct-2007 import sys from time import sleep @@ -58,15 +59,17 @@ def main(): timeout = 10 try: - # Need to poll for XenFV, since enabState is not getting set otherwise. + # Need to poll for XenFV, since enabState is not getting set + # otherwise. for i in range(1, (timeout + 1)): sleep(1) - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) + cs = computersystem.get_cs_class(options.virt)(options.ip, + test_dom) if cs.Name != test_dom: Globals.logger.error("VS %s is not defined" % test_dom) break - # Success: VS is in Enabled State after Define and Start + # Success: VS is in Enabled State after Define and Start enabState = cs.EnabledState if enabState == 2: status = PASS @@ -76,10 +79,13 @@ def main(): Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE, get_typed_class(options.virt, 'ComputerSystem')) Globals.logger.error("Exception: %s", detail) - return status + cxml.destroy(options.ip) + cxml.undefine(options.ip) + return status if status != PASS : - Globals.logger.error("Error: property values are not set for VS %s" , test_dom) + Globals.logger.error("Error: property values are not set for VS %s", + test_dom) cxml.destroy(options.ip) cxml.undefine(options.ip) From yunguol at cn.ibm.com Mon Apr 14 08:10:51 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 14 Apr 2008 16:10:51 +0800 Subject: [Libvirt-cim] Xen test report on Fedora 8 Message-ID: stro: Fedora8 Kernel: kernel-2.6.23.1-42.fc8 Xen: xen-3.1.2-2.fc8 Libvirt: libvirt-0.4.2-1 CIMOM: sblim-sfcb-1.2.5-0 PyWBEM: pywbem-0.6-2 LibCMPIutil: 72 LibvirtCIM: 532 CIM Schema: cimv216Experimental Cimtest: 76 and patched with proceesor id update =============CIMTEST FAILING REPORT======================================== ComputerSystem - 23_suspend_suspend.py: FAIL It fails because of invoking method `DefineSystem', it's unable to define domain using DefineSystem() ComputerSystem - 27_define_suspend_errs.py: FAIL Same as above ComputerSystem - 32_start_reboot.py: FAIL InvokeMethod(DefineSystem): Failed to create domain ComputerSystem - 33_suspend_reboot.py: FAIL Same as ComputerSystem.23 ComputerSystem - 35_start_reset.py: FAIL ComputerSystem - 40_RSC_start.py: FAIL Same as ComputerSystem.23 ComputerSystem - 41_cs_to_settingdefinestate.py: FAIL This fails because of processor id, I will fix it later. ElementAllocatedFromPool - 02_reverse.py: FAIL No such instance (foo) ElementConforms - 01_forward.py: FAIL ElementConforms - 04_ectp_rev_errs.py: FAIL HostSystem - 03_hs_to_settdefcap.py: FAIL HostSystem - 04_hs_to_EAPF.py: FAIL Memory - 02_defgetmem.py: FAIL Same as ComputerSystem.23 Memory - 03_mem_gi_errs.py: FAIL Processor - 02_definesys_get_procs.py: FAIL Same as ComputerSystem.23 Profile - 01_enum.py: FAIL Mon, 14 Apr 2008 15:40:07:TEST LOG:PRINT - Verifying the fields for :System Virtualization Mon, 14 Apr 2008 15:40:07:TEST LOG:PRINT - Verifying the fields for :Virtual System Profile Mon, 14 Apr 2008 15:40:07:TEST LOG:PRINT - Verifying the fields for :Generic Device Resource Virtualization Profile - 02_profile_to_elec.py: FAIL SettingsDefineCapabilities - 01_forward.py: FAIL No such instance (foo) SettingsDefineCapabilities - 04_forward_vsmsdata.py: FAIL SystemDevice - 02_reverse.py: FAIL VSSD - 03_vssd_gi_errs.py: FAIL VirtualSystemManagementService - 01_definesystem_name.py: FAIL VirtualSystemMigrationService - 01_migratable_host.py: FAIL InvokeMethod(CheckVirtualSystemIsMigratableToHost): Provider not found or not loadable The provider is registered successfully, and I can get expected result by wbemcli ein. Who knows why it is? VirtualSystemMigrationService - 02_host_migrate_type.py: FAIL InvokeMethod(CheckVirtualSystemIsMigratableToHost): Provider not found or not loadable VirtualSystemMigrationService - 05_migratable_host_errs.py: FAIL InvokeMethod(CheckVirtualSystemIsMigratableToHost): Provider not found or not loadable VirtualSystemMigrationSettingData - 01_enum.py: FAIL Provider not found or not loadable VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: FAIL VirtualSystemSettingDataComponent - 01_forward.py: FAIL No such instance (VSSDC_dom/00:11:22:33:44:aa) No such instance (VSSDC_dom/xvda) No such instance (VSSDC_dom/mem) VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: FAIL VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL Provider not found or not loadable VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: FAIL ====================CIMTEST FULL REPORT============================================== AllocationCapabilities - 01_enum.py: PASS AllocationCapabilities - 02_alloccap_gi_errs.py: PASS ComputerSystem - 01_enum.py: PASS ComputerSystem - 02_nosystems.py: PASS ComputerSystem - 03_defineVS.py: PASS ComputerSystem - 04_defineStartVS.py: PASS ComputerSystem - 05_activate_defined_start.py: XFAIL Bug: 85769 ComputerSystem - 06_paused_active_suspend.py: XFAIL Bug: 85769 ComputerSystem - 22_define_suspend.py: PASS ComputerSystem - 23_suspend_suspend.py: FAIL ComputerSystem - 27_define_suspend_errs.py: FAIL ComputerSystem - 32_start_reboot.py: FAIL InvokeMethod(DefineSystem): Failed to create domain ComputerSystem - 33_suspend_reboot.py: FAIL ComputerSystem - 35_start_reset.py: FAIL ComputerSystem - 40_RSC_start.py: FAIL ComputerSystem - 41_cs_to_settingdefinestate.py: FAIL ComputerSystem - 42_cs_gi_errs.py: PASS ComputerSystemIndication - 01_created_indication.py: FAIL Got indication: Xen_ComputerSystemCreatedIndication ElementAllocatedFromPool - 01_forward.py: PASS ElementAllocatedFromPool - 02_reverse.py: FAIL No such instance (foo) ElementAllocatedFromPool - 03_reverse_errs.py: PASS ElementAllocatedFromPool - 04_forward_errs.py: PASS ElementCapabilities - 01_forward.py: PASS ElementCapabilities - 02_reverse.py: PASS ElementCapabilities - 03_forward_errs.py: PASS ElementCapabilities - 04_reverse_errs.py: PASS ElementCapabilities - 05_hostsystem_cap.py: PASS ElementConforms - 01_forward.py: FAIL ElementConforms - 02_reverse.py: PASS ElementConforms - 03_ectp_fwd_errs.py: PASS ElementConforms - 04_ectp_rev_errs.py: FAIL ElementSettingData - 01_forward.py: PASS ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS EnabledLogicalElementCapabilities - 01_enum.py: PASS EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS HostSystem - 01_enum.py: PASS HostSystem - 02_hostsystem_to_rasd.py: PASS HostSystem - 03_hs_to_settdefcap.py: FAIL HostSystem - 04_hs_to_EAPF.py: FAIL HostSystem - 05_hs_gi_errs.py: PASS HostSystem - 06_hs_to_vsms.py: PASS HostedDependency - 01_forward.py: PASS HostedDependency - 02_reverse.py: PASS HostedDependency - 03_enabledstate.py: PASS HostedDependency - 04_reverse_errs.py: PASS HostedResourcePool - 01_forward.py: PASS HostedResourcePool - 02_reverse.py: PASS HostedResourcePool - 03_forward_errs.py: PASS HostedResourcePool - 04_reverse_errs.py: PASS HostedService - 01_forward.py: PASS HostedService - 02_reverse.py: PASS HostedService - 03_forward_errs.py: PASS HostedService - 04_reverse_errs.py: PASS LogicalDisk - 01_disk.py: PASS LogicalDisk - 02_nodevs.py: SKIP LogicalDisk - 03_ld_gi_errs.py: PASS Memory - 01_memory.py: PASS Memory - 02_defgetmem.py: FAIL Memory - 03_mem_gi_errs.py: FAIL NetworkPort - 01_netport.py: XFAIL Bug: 90844 NetworkPort - 02_np_gi_errors.py: PASS NetworkPort - 03_user_netport.py: SKIP Processor - 01_processor.py: PASS Processor - 02_definesys_get_procs.py: FAIL Processor - 03_proc_gi_errs.py: PASS Profile - 01_enum.py: FAIL Mon, 14 Apr 2008 15:40:07:TEST LOG:PRINT - Verifying the fields for :System Virtualization Mon, 14 Apr 2008 15:40:07:TEST LOG:PRINT - Verifying the fields for :Virtual System Profile Mon, 14 Apr 2008 15:40:07:TEST LOG:PRINT - Verifying the fields for :Generic Device Resource Virtualization Profile - 02_profile_to_elec.py: FAIL Profile - 03_rprofile_gi_errs.py: PASS RASD - 01_verify_rasd_fields.py: PASS RASD - 02_enum.py: PASS RASD - 03_rasd_errs.py: PASS ReferencedProfile - 01_verify_refprof.py: PASS ReferencedProfile - 02_refprofile_errs.py: PASS ResourceAllocationFromPool - 01_forward.py: PASS ResourceAllocationFromPool - 02_reverse.py: PASS ResourceAllocationFromPool - 03_forward_errs.py: PASS ResourceAllocationFromPool - 04_reverse_errs.py: PASS ResourceAllocationFromPool - 05_RAPF_err.py: PASS ResourcePool - 01_enum.py: PASS ResourcePool - 02_rp_gi_errors.py: PASS ResourcePoolConfigurationCapabilities - 01_enum.py: PASS ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS ResourcePoolConfigurationService - 01_enum.py: PASS ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: XFAIL Bug: 92173 InvokeMethod(AddResourcesToResourcePool): Unknown Method Bug:<92173> ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS SettingsDefine - 01_forward.py: PASS SettingsDefine - 02_reverse.py: PASS SettingsDefine - 03_sds_fwd_errs.py: PASS SettingsDefine - 04_sds_rev_errs.py: PASS SettingsDefineCapabilities - 01_forward.py: FAIL No such instance (foo) SettingsDefineCapabilities - 03_forward_errs.py: XFAIL Bug: Test error: returned XFAIL without a valid bug string. Bug:<> SettingsDefineCapabilities - 04_forward_vsmsdata.py: FAIL SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS SystemDevice - 01_forward.py: PASS SystemDevice - 02_reverse.py: FAIL SystemDevice - 03_fwderrs.py: PASS VSSD - 01_enum.py: PASS VSSD - 02_bootldr.py: PASS VSSD - 03_vssd_gi_errs.py: FAIL VSSD - 04_vssd_to_rasd.py: PASS VirtualSystemManagementCapabilities - 01_enum.py: PASS VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS VirtualSystemManagementService - 01_definesystem_name.py: FAIL VirtualSystemManagementService - 02_destroysystem.py: PASS VirtualSystemManagementService - 03_definesystem_ess.py: PASS VirtualSystemManagementService - 04_definesystem_ers.py: PASS VirtualSystemManagementService - 05_destroysystem_neg.py: PASS VirtualSystemManagementService - 06_addresource.py: PASS VirtualSystemManagementService - 07_addresource_neg.py: PASS VirtualSystemManagementService - 08_modifyresource.py: XFAIL Bug: 90853 InvokeMethod(ModifyResourceSettings): Device `11:22:33:aa:bb:cc' not found Bug:<90853> VirtualSystemMigrationCapabilities - 01_enum.py: PASS VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS VirtualSystemMigrationService - 01_migratable_host.py: FAIL InvokeMethod(CheckVirtualSystemIsMigratableToHost): Provider not found or not loadable VirtualSystemMigrationService - 02_host_migrate_type.py: FAIL InvokeMethod(CheckVirtualSystemIsMigratableToHost): Provider not found or not loadable VirtualSystemMigrationService - 05_migratable_host_errs.py: FAIL InvokeMethod(CheckVirtualSystemIsMigratableToHost): Provider not found or not loadable VirtualSystemMigrationSettingData - 01_enum.py: FAIL Provider not found or not loadable VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: FAIL VirtualSystemSettingDataComponent - 01_forward.py: FAIL No such instance (VSSDC_dom/00:11:22:33:44:aa) No such instance (VSSDC_dom/xvda) No such instance (VSSDC_dom/mem) VirtualSystemSettingDataComponent - 02_reverse.py: PASS VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: FAIL VirtualSystemSnapshotService - 01_enum.py: PASS VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL Provider not found or not loadable VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: FAIL Best, Regards Daisy Guo Lian Yun E-mail: yunguol at cn.ibm.com IBM China Development Lab, Shanghai, China TEL: (86)-21-61008057 -------------- next part -------------- An HTML attachment was scrubbed... URL: From yunguol at cn.ibm.com Mon Apr 14 08:17:03 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 14 Apr 2008 01:17:03 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] update processor id in CS.41_cs_to_settingdefinestate.py Message-ID: # HG changeset patch # User Guolian Yun # Date 1208161017 25200 # Node ID fad36e2dbc79278a25beb47a45696ec19705f8d1 # Parent 137e5079c73fcbfc70e6654cee0b3c3eb3c6acd2 [TEST] update processor id in CS.41_cs_to_settingdefinestate.py Signed-off-by: Guolian Yun diff -r 137e5079c73f -r fad36e2dbc79 suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Mon Apr 14 01:16:57 2008 -0700 @@ -84,7 +84,7 @@ def rasd_init_list(): Creating the lists that will be used for comparisons. """ proc_rasd = { - "InstanceID" : '%s/%s' %(test_dom,0),\ + "InstanceID" : '%s/%s' %(test_dom, "proc"),\ "ResourceType" : 3,\ } From deeptik at linux.vnet.ibm.com Mon Apr 14 11:17:49 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Mon, 14 Apr 2008 16:47:49 +0530 Subject: [Libvirt-cim] Re: CimTest Report on XenFV 10-04-2008 In-Reply-To: <47FE19B7.2040003@linux.vnet.ibm.com> References: <47FDF40C.1010202@linux.vnet.ibm.com> <47FE19B7.2040003@linux.vnet.ibm.com> Message-ID: <48033D5D.4060703@linux.vnet.ibm.com> Hi, All the test cases which are failing below ComputerSystem - 23_suspend_suspend.py: FAIL ComputerSystem - 27_define_suspend_errs.py: FAIL ComputerSystem - 32_start_reboot.py: FAIL ComputerSystem - 33_suspend_reboot.py: FAIL ComputerSystem - 35_start_reset.py: FAIL ComputerSystem - 40_RSC_start.py: FAIL Memory - 02_defgetmem.py: FAIL Processor - 02_definesys_get_procs.py: FAIL VirtualSystemManagementService - 01_definesystem_name.py: FAIL have one thing in common.They make use of create_using_definesystem() funtion. When I ran the tc with the gdb ON I found the following error for XenFV: /libvir: XML error : missing kernel information libvir: Xen Daemon error : XML description for domain is not well formed or invalid/ I tried modifying the vsms.py functions which is ultimately called by the create_using_definesystem(). The only difference I found between the way the Xen and XenFV params was the absence of the Kernel info for XenFV. I tried specifying the normal kernel and the initrd image available on my Fc8 FV machine, but even this did not seem to solve the problem. Can someone help ? Thanks and Regards, Deepti. Deepti B Kalakeri wrote: > Sorry Forgot the attachment for the complete result. > Also , in the test report the test cases which do not have support for > XenFV are skipped. > Also see my comments inline for the test result. > > Thanks and Regards, > Deepti. > > Deepti B Kalakeri wrote: >> Hi, >> >> Please find the test case list that are failing for the XenFV below: >> Please see the attachment for the complete result. >> Total FAIL : 14 >> >> ComputerSystem - 04_defineStartVS.py: FAIL >> Thu, 10 Apr 2008 12:42:52:TEST LOG:INFO - >> ====04_defineStartVS.py Log==== >> Thu, 10 Apr 2008 12:42:53:TEST LOG:ERROR - Error: property >> values are not set for VS domguest >> > The tc are failing since they are not able to get the required > property values set immediately. > Fixed the tc by adding logic to poll. >> ComputerSystem - 06_paused_active_suspend.py: FAIL >> Thu, 10 Apr 2008 12:42:58:TEST LOG:INFO - >> ====06_paused_active_suspend.py Log==== >> Thu, 10 Apr 2008 12:42:59:TEST LOG:ERROR - Exception: (1, >> u'CIM_ERR_FAILED: A general error occurred that is not covered by a >> more specific error code: "Domain not running"') >> Thu, 10 Apr 2008 12:42:59:TEST LOG:ERROR - Unable to suspend >> dom DomST1 using RequestedStateChange() >> > same as above. > Fixed the tc by adding logic to poll. >> ComputerSystem - 23_suspend_suspend.py: FAIL >> Thu, 10 Apr 2008 12:43:03:TEST LOG:INFO - >> ====23_suspend_suspend.py Log==== >> Thu, 10 Apr 2008 12:43:04:TEST LOG:ERROR - Unexpected rc code >> 1 and description: >> CIM_ERR_FAILED: A general error occurred that is not covered by a >> more specific error code: "Failed to create domain" >> Thu, 10 Apr 2008 12:43:04:TEST LOG:ERROR - Unable to define >> domain test_domain using DefineSystem() > >> >> ComputerSystem - 27_define_suspend_errs.py: FAIL >> Thu, 10 Apr 2008 12:43:05:TEST LOG:INFO - >> ====27_define_suspend_errs.py Log==== >> Thu, 10 Apr 2008 12:43:05:TEST LOG:ERROR - Unexpected rc code >> 1 and description: >> CIM_ERR_FAILED: A general error occurred that is not covered by a >> more specific error code: "Failed to create domain" >> Thu, 10 Apr 2008 12:43:05:TEST LOG:ERROR - Unable to define >> domain test_domain using DefineSystem() >> >> ComputerSystem - 32_start_reboot.py: FAIL >> Thu, 10 Apr 2008 12:43:06:TEST LOG:INFO - >> ====32_start_reboot.py Log==== >> Thu, 10 Apr 2008 12:43:06:TEST LOG:ERROR - Unexpected rc code >> 1 and description: >> CIM_ERR_FAILED: A general error occurred that is not covered by a >> more specific error code: "Failed to create domain" >> Thu, 10 Apr 2008 12:43:06:TEST LOG:ERROR - Unable to define >> domain test_domain using DefineSystem() >> >> ComputerSystem - 33_suspend_reboot.py: FAIL >> Thu, 10 Apr 2008 12:43:08:TEST LOG:INFO - >> ====33_suspend_reboot.py Log==== >> Thu, 10 Apr 2008 12:43:08:TEST LOG:ERROR - Unexpected rc code >> 1 and description: >> CIM_ERR_FAILED: A general error occurred that is not covered by a >> more specific error code: "Failed to create domain" >> Thu, 10 Apr 2008 12:43:08:TEST LOG:ERROR - Unable to define >> domain test_domain using DefineSystem() >> >> ComputerSystem - 35_start_reset.py: FAIL >> Thu, 10 Apr 2008 12:43:09:TEST LOG:INFO - >> ====35_start_reset.py Log==== >> Thu, 10 Apr 2008 12:43:09:TEST LOG:ERROR - Unexpected rc code >> 1 and description: >> CIM_ERR_FAILED: A general error occurred that is not covered by a >> more specific error code: "Failed to create domain" >> Thu, 10 Apr 2008 12:43:09:TEST LOG:ERROR - Unable to define >> domain test_domain using DefineSystem() >> >> ComputerSystem - 40_RSC_start.py: FAIL >> Thu, 10 Apr 2008 12:43:10:TEST LOG:INFO - >> ====40_RSC_start.py Log==== >> Thu, 10 Apr 2008 12:43:11:TEST LOG:ERROR - Unexpected rc code >> 1 and description: >> CIM_ERR_FAILED: A general error occurred that is not covered by a >> more specific error code: "Failed to create domain" >> Thu, 10 Apr 2008 12:43:11:TEST LOG:ERROR - Exception: >> ('Unable create domain %s using DefineSystem()', 'test_domain') >> >> ComputerSystemIndication - 01_created_indication.py: FAIL >> Thu, 10 Apr 2008 12:43:14:TEST LOG:INFO - >> ====01_created_indication.py Log==== >> Thu, 10 Apr 2008 12:46:23:TEST LOG:ERROR - error : (110, >> 'Connection timed out') >> >> Memory - 02_defgetmem.py: FAIL >> Thu, 10 Apr 2008 12:47:30:TEST LOG:INFO - ====02_defgetmem.py >> Log==== >> Thu, 10 Apr 2008 12:47:30:TEST LOG:ERROR - Unexpected rc code 1 >> and description: >> CIM_ERR_FAILED: A general error occurred that is not covered by a >> more specific error code: "Failed to create domain" >> Thu, 10 Apr 2008 12:47:30:TEST LOG:ERROR - Exception: Unable to >> create domain domu using DefineSys() >> > Need to look into the above tc which are failing. >> NetworkPort - 01_netport.py: FAIL >> Thu, 10 Apr 2008 12:47:35:TEST LOG:INFO - ====01_netport.py >> Log==== >> Thu, 10 Apr 2008 12:47:36:TEST LOG:ERROR - KeyError : '__eq__' >> > Test case error fixed it. >> Processor - 02_definesys_get_procs.py: FAIL >> Thu, 10 Apr 2008 12:47:45:TEST LOG:INFO - >> ====02_definesys_get_procs.py Log==== >> Thu, 10 Apr 2008 12:47:45:TEST LOG:ERROR - Unexpected rc code >> 1 and description: >> CIM_ERR_FAILED: A general error occurred that is not covered by a >> more specific error code: "Failed to create domain" >> Thu, 10 Apr 2008 12:47:45:TEST LOG:ERROR - Exception: Unable >> create domain test_domain using DefineSystem() >> >> VirtualSystemManagementService - 01_definesystem_name.py: FAIL >> Thu, 10 Apr 2008 12:49:09:TEST LOG:INFO - >> ====01_definesystem_name.py Log==== >> Thu, 10 Apr 2008 12:49:09:TEST LOG:ERROR - Unexpected rc code >> 1 and description: >> CIM_ERR_FAILED: A general error occurred that is not covered by a >> more specific error code: "Failed to create domain" >> > Need to look into the above tc which are failing. >> VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL >> Thu, 10 Apr 2008 12:49:17:TEST LOG:INFO - >> ====05_destroysystem_neg.py Log==== >> Thu, 10 Apr 2008 12:49:17:TEST LOG:ERROR - >> destroy_fail>>nonexistent: Got rc: 2, but we expect 4 >> Thu, 10 Apr 2008 12:49:17:TEST LOG:ERROR - >> destroy_fail>>nonexistent: Got rc: 2, but we expect 4 >> > The error code returned was mismatching. Fixed it. > I have a doubt here though. > > The part of the code in Virt_VirtualSystemManagementService.c which is > checked here does seem to handle all the error condition. > 520 error: > 521 if (rc == IM_RC_SYS_NOT_FOUND) > 522 cu_statusf(_BROKER, &status, > 523 CMPI_RC_ERR_FAILED, > 524 "Failed to find domain"); > 525 else if (rc == IM_RC_OK) > 526 status = (CMPIStatus){CMPI_RC_OK, NULL}; > 527 > The tc does should have got the "Failed to find domain" error when a > nonexisting domain is passed, but this is not so because the part of > the code which is used to check this does not set > the rc to IM_RC_SYS_NOT_FOUND before junping to error , see the code > below. > > // Make sure system exists and destroy it. > if (!domain_exists(conn, dom_name)) > goto error; > >> >> Thanks and Regards, >> Deepti. > ------------------------------------------------------------------------ > > ====================================== > CIM Test Report for XenFV > ====================================== > Distro : Fedora release 8 > Kernel : 2.6.21-2950.fc8xen > Xen version : 3.1.0-rc7-2950.fc8 > Libvirt : libvirt-0.3.3-2.fc8 > CIMOM : pegasus > PyWBEM : pywbem-0.6 > CIM Schema : cimv216Experimental > LibCMPIutil : 72 > LibVirtCIM : 530 > CIMTEST : 73 > ====================================== > PASS : 80 > FAIL : 14 > XFAIL : 3 > SKIP : 32 > ----------------- > Total : 129 > ====================================== > Cleaned log files. > Testing XenFV hypervisor > AllocationCapabilities - 01_enum.py: PASS > AllocationCapabilities - 02_alloccap_gi_errs.py: PASS > ComputerSystem - 01_enum.py: PASS > ComputerSystem - 02_nosystems.py: PASS > ComputerSystem - 03_defineVS.py: PASS > ComputerSystem - 04_defineStartVS.py: FAIL > ComputerSystem - 05_activate_defined_start.py: XFAIL Bug: 85769 > ComputerSystem - 06_paused_active_suspend.py: FAIL > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Domain not running" > ComputerSystem - 22_define_suspend.py: PASS > ComputerSystem - 23_suspend_suspend.py: FAIL > InvokeMethod(DefineSystem): CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" > ComputerSystem - 27_define_suspend_errs.py: FAIL > InvokeMethod(DefineSystem): CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" > ComputerSystem - 32_start_reboot.py: FAIL > InvokeMethod(DefineSystem): CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" > ComputerSystem - 33_suspend_reboot.py: FAIL > InvokeMethod(DefineSystem): CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" > ComputerSystem - 35_start_reset.py: FAIL > InvokeMethod(DefineSystem): CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" > ComputerSystem - 40_RSC_start.py: FAIL > InvokeMethod(DefineSystem): CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" > 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: PASS > ElementAllocatedFromPool - 04_forward_errs.py: PASS > ElementCapabilities - 01_forward.py: PASS > ElementCapabilities - 02_reverse.py: PASS > ElementCapabilities - 03_forward_errs.py: PASS > ElementCapabilities - 04_reverse_errs.py: PASS > ElementCapabilities - 05_hostsystem_cap.py: PASS > ElementConforms - 01_forward.py: PASS > ElementConforms - 02_reverse.py: PASS > ElementConforms - 03_ectp_fwd_errs.py: PASS > ElementConforms - 04_ectp_rev_errs.py: SKIP > ElementSettingData - 01_forward.py: SKIP > ElementSettingData - 03_esd_assoc_with_rasd_errs.py: SKIP > EnabledLogicalElementCapabilities - 01_enum.py: PASS > EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS > HostSystem - 01_enum.py: PASS > HostSystem - 02_hostsystem_to_rasd.py: PASS > HostSystem - 03_hs_to_settdefcap.py: PASS > HostSystem - 04_hs_to_EAPF.py: SKIP > HostSystem - 05_hs_gi_errs.py: PASS > HostSystem - 06_hs_to_vsms.py: PASS > HostedDependency - 01_forward.py: SKIP > HostedDependency - 02_reverse.py: SKIP > HostedDependency - 03_enabledstate.py: SKIP > HostedDependency - 04_reverse_errs.py: SKIP > 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: FAIL > InvokeMethod(DefineSystem): CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" > Memory - 03_mem_gi_errs.py: PASS > NetworkPort - 01_netport.py: FAIL > NetworkPort - 02_np_gi_errors.py: PASS > NetworkPort - 03_user_netport.py: SKIP > Processor - 01_processor.py: PASS > Processor - 02_definesys_get_procs.py: FAIL > InvokeMethod(DefineSystem): CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" > Processor - 03_proc_gi_errs.py: PASS > Profile - 01_enum.py: SKIP > Profile - 02_profile_to_elec.py: SKIP > Profile - 03_rprofile_gi_errs.py: SKIP > RASD - 01_verify_rasd_fields.py: PASS > RASD - 02_enum.py: PASS > RASD - 03_rasd_errs.py: PASS > ReferencedProfile - 01_verify_refprof.py: PASS > ReferencedProfile - 02_refprofile_errs.py: PASS > ResourceAllocationFromPool - 01_forward.py: PASS > ResourceAllocationFromPool - 02_reverse.py: PASS > ResourceAllocationFromPool - 03_forward_errs.py: PASS > ResourceAllocationFromPool - 04_reverse_errs.py: PASS > ResourceAllocationFromPool - 05_RAPF_err.py: PASS > ResourcePool - 01_enum.py: SKIP > ResourcePool - 02_rp_gi_errors.py: SKIP > ResourcePoolConfigurationCapabilities - 01_enum.py: PASS > ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS > ResourcePoolConfigurationService - 01_enum.py: PASS > ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS > ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS > ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS > ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: XFAIL Bug: 92173 > InvokeMethod(AddResourcesToResourcePool): CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Unknown Method" > Bug:<92173> > ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS > ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS > SettingsDefine - 01_forward.py: PASS > SettingsDefine - 02_reverse.py: PASS > SettingsDefine - 03_sds_fwd_errs.py: PASS > SettingsDefine - 04_sds_rev_errs.py: PASS > SettingsDefineCapabilities - 01_forward.py: 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: SKIP > VSSD - 02_bootldr.py: SKIP > VSSD - 03_vssd_gi_errs.py: SKIP > VSSD - 04_vssd_to_rasd.py: PASS > VirtualSystemManagementCapabilities - 01_enum.py: PASS > VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS > VirtualSystemManagementService - 01_definesystem_name.py: FAIL > InvokeMethod(DefineSystem): CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" > VirtualSystemManagementService - 02_destroysystem.py: PASS > VirtualSystemManagementService - 03_definesystem_ess.py: PASS > VirtualSystemManagementService - 04_definesystem_ers.py: PASS > VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL > VirtualSystemManagementService - 06_addresource.py: SKIP > VirtualSystemManagementService - 07_addresource_neg.py: PASS > VirtualSystemManagementService - 08_modifyresource.py: XFAIL Bug: 90853 > InvokeMethod(ModifyResourceSettings): CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "Failed to create domain" > 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: SKIP > VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: SKIP > 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 > > From danms at us.ibm.com Mon Apr 14 16:14:38 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 09:14:38 -0700 Subject: [Libvirt-cim] [PATCH] Add revision information to the VSMS In-Reply-To: <47FFE26B.7020803@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Fri, 11 Apr 2008 15:12:59 -0700") References: <52e2f501b44994af849d.1207934529@guaranine.danplanet.com> <47FFE26B.7020803@linux.vnet.ibm.com> Message-ID: <87wsn0o1ld.fsf@caffeine.beaverton.ibm.com> KR> You'll also need to modify the mof file to add the new attributes, KR> right? Yeah, we should. KR> I think this a neat approach. I'm not sure whether VSMS is the KR> correct place.. I initially thought this would be good to add to KR> the profile, but I don't know if we want to advertise this info KR> there. I think it's probably the best of the options, without dragging another profile and/or provider into the mix. So, was that a +1 or at least something that rounds up to 1? :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Apr 14 16:15:34 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 09:15:34 -0700 Subject: [Libvirt-cim] [PATCH] Make the 'default' NetRASD allocation include a randomly-generated MAC Message-ID: # HG changeset patch # User Dan Smith # Date 1208189730 25200 # Node ID abf9b4881cc061cca318fe39c3c849f01316cdc8 # Parent da267e967adbd316d30303cc064584ebd36d7123 Make the 'default' NetRASD allocation include a randomly-generated MAC No changes from last time, except I think this can be put in by itself, to reduce the size of my queue for the VSMS stuff. Signed-off-by: Dan Smith diff -r da267e967adb -r abf9b4881cc0 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Mon Apr 14 09:13:15 2008 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Mon Apr 14 09:15:30 2008 -0700 @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -52,6 +53,8 @@ const static CMPIBroker *_BROKER; #define SDC_DISK_MIN 2000 #define SDC_DISK_DEF 5000 #define SDC_DISK_INC 250 + +#define DEFAULT_MAC_PREFIX "00:16:3e" static bool rasd_prop_copy_value(struct sdc_rasd_prop src, struct sdc_rasd_prop *dest) @@ -430,6 +433,45 @@ static struct sdc_rasd_prop *net_max(con return rasd; } +static const char *_net_rand_mac(void) +{ + int r; + int ret; + unsigned int s; + char *mac = NULL; + CMPIString *str = NULL; + CMPIStatus status; + + srand(time(NULL)); + r = rand_r(&s); + + ret = asprintf(&mac, + "%s:%02x:%02x:%02x", + DEFAULT_MAC_PREFIX, + r & 0xFF, + (r & 0xFF00) >> 8, + (r & 0xFF0000) >> 16); + + if (ret == -1) + goto out; + + str = CMNewString(_BROKER, mac, &status); + if ((str == NULL) || (status.rc != CMPI_RC_OK)) { + str = NULL; + CU_DEBUG("Failed to create string"); + goto out; + } + out: + free(mac); + + if (str != NULL) + mac = CMGetCharPtr(str); + else + mac = NULL; + + return mac; +} + static struct sdc_rasd_prop *net_def(const CMPIObjectPath *ref, CMPIStatus *s) { @@ -440,6 +482,7 @@ static struct sdc_rasd_prop *net_def(con struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, + {"Address", (CMPIValue *)_net_rand_mac(), CMPI_chars}, PROP_END }; From danms at us.ibm.com Mon Apr 14 16:28:38 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 09:28:38 -0700 Subject: [Libvirt-cim] KVM test report on Fedora 9 In-Reply-To: <48030658.5060504@linux.vnet.ibm.com> (Zhengang Li's message of "Mon, 14 Apr 2008 15:23:04 +0800") References: <48030658.5060504@linux.vnet.ibm.com> Message-ID: <87skxoo0y1.fsf@caffeine.beaverton.ibm.com> ZL> ComputerSystemIndication - 01_created_indication.py: FAIL ZL> Exception : Authentication (or request) Failed! ZL> Previous tests were always on sfcb. Anyone has a successful experience ZL> on pegasus for indication? Make sure you have the following in your cimconfig: repositoryIsDefaultInstanceProvider=true enableIndicationService=true -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Apr 14 16:32:10 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 09:32:10 -0700 Subject: [Libvirt-cim] Re: CimTest Report on XenFV 10-04-2008 In-Reply-To: <48033D5D.4060703@linux.vnet.ibm.com> (Deepti B. Kalakeri's message of "Mon, 14 Apr 2008 16:47:49 +0530") References: <47FDF40C.1010202@linux.vnet.ibm.com> <47FE19B7.2040003@linux.vnet.ibm.com> <48033D5D.4060703@linux.vnet.ibm.com> Message-ID: <87od8co0s5.fsf@caffeine.beaverton.ibm.com> DK> /libvir: XML error : missing kernel information DK> libvir: Xen Daemon error : XML description for domain is not well DK> formed or invalid/ Okay, set the following before starting the cimserver: export CU_DEBUG=/tmp/libvirt-cim.log Then do the DefineSystem call and grab the XML description out. If you can post that, I can figure out what it's doing wrong. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Apr 14 16:42:03 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 09:42:03 -0700 Subject: [Libvirt-cim] [PATCH] Set PoolID on all allocated RASD objects for later correlation in DefineSystem Message-ID: <041175667e48789b50ef.1208191323@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1208191321 25200 # Node ID 041175667e48789b50efe550a3d7d41f42110caa # Parent abf9b4881cc061cca318fe39c3c849f01316cdc8 Set PoolID on all allocated RASD objects for later correlation in DefineSystem No changes, but this can be a standalone patch, so I'm submitting it outside my other set. Signed-off-by: Dan Smith diff -r abf9b4881cc0 -r 041175667e48 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Mon Apr 14 09:15:30 2008 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Mon Apr 14 09:42:01 2008 -0700 @@ -829,6 +829,7 @@ static CMPIStatus alloc_cap_to_rasd(cons CMPIStatus s = {CMPI_RC_OK}; uint16_t type; const char *id = NULL; + int i; if (!match_hypervisor_prefix(ref, info)) return s; @@ -850,6 +851,10 @@ static CMPIStatus alloc_cap_to_rasd(cons } s = sdc_rasds_for_type(ref, list, type); + + for (i = 0; i < list->cur; i++) + CMSetProperty(list->list[i], "PoolID", + (CMPIValue *)id, CMPI_chars); out: return s; From danms at us.ibm.com Mon Apr 14 16:42:36 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 09:42:36 -0700 Subject: [Libvirt-cim] [PATCH] Fix typo in NetRASD creation that could have caused a break if we rearrange things Message-ID: <857848be56f0bdc3480b.1208191356@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1208191352 25200 # Node ID 857848be56f0bdc3480bb9f5a7ae6d0598b4d9a8 # Parent 041175667e48789b50efe550a3d7d41f42110caa Fix typo in NetRASD creation that could have caused a break if we rearrange things No changes, but separate from the larger set. Signed-off-by: Dan Smith diff -r 041175667e48 -r 857848be56f0 src/Virt_RASD.c --- a/src/Virt_RASD.c Mon Apr 14 09:42:01 2008 -0700 +++ b/src/Virt_RASD.c Mon Apr 14 09:42:32 2008 -0700 @@ -155,7 +155,7 @@ static CMPIInstance *rasd_from_vdev(cons } else if (dev->type == CIM_RES_TYPE_NET) { CMSetProperty(inst, "NetworkType", - (CMPIValue *)dev->dev.disk.type, + (CMPIValue *)dev->dev.net.type, CMPI_chars); } else if (dev->type == CIM_RES_TYPE_MEM) { const char *units = "KiloBytes"; From danms at us.ibm.com Mon Apr 14 16:44:45 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 09:44:45 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Add function to parse out pool name from InstanceID In-Reply-To: Message-ID: <2afa2a7d1d5a4e7d026f.1208191485@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1208191443 25200 # Node ID 2afa2a7d1d5a4e7d026f2f6cf8b5a1a8a266b5a0 # Parent 857848be56f0bdc3480bb9f5a7ae6d0598b4d9a8 Add function to parse out pool name from InstanceID Signed-off-by: Dan Smith diff -r 857848be56f0 -r 2afa2a7d1d5a src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Mon Apr 14 09:42:32 2008 -0700 +++ b/src/Virt_DevicePool.c Mon Apr 14 09:44:03 2008 -0700 @@ -500,6 +500,17 @@ uint16_t res_type_from_pool_id(const cha return CIM_RES_TYPE_UNKNOWN; } +char *name_from_pool_id(const char *id) +{ + char *s; + + s = strchr(id, '/'); + if (s == NULL) + return NULL; + + return strdup((char *)s+1); +} + static bool mempool_set_total(CMPIInstance *inst, virConnectPtr conn) { virNodeInfo info; diff -r 857848be56f0 -r 2afa2a7d1d5a src/Virt_DevicePool.h --- a/src/Virt_DevicePool.h Mon Apr 14 09:42:32 2008 -0700 +++ b/src/Virt_DevicePool.h Mon Apr 14 09:44:03 2008 -0700 @@ -58,6 +58,14 @@ uint16_t res_type_from_pool_id(const cha uint16_t res_type_from_pool_id(const char *id); /** + * Get the pool name from a given pool's InstanceID + * + * @param id The InstanceID of the pool + * @returns the name (must be free'd by the caller) + */ +char *name_from_pool_id(const char *id); + +/** * Get all device pools on the system for the given type * * From danms at us.ibm.com Mon Apr 14 16:44:44 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 09:44:44 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Updates to DevicePool Message-ID: Add some external interfaces to DevicePool Unchanged from previous versions in the NetRASD set From danms at us.ibm.com Mon Apr 14 16:44:46 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 09:44:46 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Add ability to get a default pool of a given type to the pool provider In-Reply-To: Message-ID: <327cfc9f69191f5a2f04.1208191486@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1208191444 25200 # Node ID 327cfc9f69191f5a2f0454290c8ecf02e223d4dd # Parent 2afa2a7d1d5a4e7d026f2f6cf8b5a1a8a266b5a0 Add ability to get a default pool of a given type to the pool provider Signed-off-by: Dan Smith diff -r 2afa2a7d1d5a -r 327cfc9f6919 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Mon Apr 14 09:44:03 2008 -0700 +++ b/src/Virt_DevicePool.c Mon Apr 14 09:44:04 2008 -0700 @@ -991,6 +991,39 @@ CMPIStatus enum_pools(const CMPIBroker * return _get_pools(broker, reference, type, NULL, list); } +CMPIInstance *default_device_pool(const CMPIBroker *broker, + const CMPIObjectPath *reference, + uint16_t type, + CMPIStatus *s) +{ + CMPIInstance *inst = NULL; + struct inst_list list; + + inst_list_init(&list); + + if (type == CIM_RES_TYPE_MEM) { + *s = get_pool_by_name(broker, reference, "MemoryPool/0", &inst); + } else if (type == CIM_RES_TYPE_PROC) { + *s = get_pool_by_name(broker, reference, "ProcPool/0", &inst); + } else if (type == CIM_RES_TYPE_DISK) { + *s = enum_pools(broker, reference, type, &list); + if (s->rc == CMPI_RC_OK) + inst = list.list[0]; + } else if (type == CIM_RES_TYPE_NET) { + *s = enum_pools(broker, reference, type, &list); + if (s->rc == CMPI_RC_OK) + inst = list.list[0]; + } else { + cu_statusf(broker, s, + CMPI_RC_ERR_INVALID_PARAMETER, + "No such device type `%s'", type); + } + + inst_list_free(&list); + + return inst; +} + static CMPIStatus return_pool(const CMPIObjectPath *ref, const CMPIResult *results, bool names_only) diff -r 2afa2a7d1d5a -r 327cfc9f6919 src/Virt_DevicePool.h --- a/src/Virt_DevicePool.h Mon Apr 14 09:44:03 2008 -0700 +++ b/src/Virt_DevicePool.h Mon Apr 14 09:44:04 2008 -0700 @@ -105,6 +105,20 @@ CMPIStatus get_pool_by_name(const CMPIBr const char *id, CMPIInstance **_inst); +/** + * Get the default pool for a given device type + * + * @param broker A pointer to the current broker + * @param ref The object path containing namespace and prefix info + * @param type The device type in question + * @param status The returned status + * @returns Default instance of a pool + */ +CMPIInstance *default_device_pool(const CMPIBroker *broker, + const CMPIObjectPath *reference, + uint16_t type, + CMPIStatus *status); + #endif /* From danms at us.ibm.com Mon Apr 14 16:54:15 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 09:54:15 -0700 Subject: [Libvirt-cim] [PATCH 0 of 4] (#2) Fix up handling of NetRASD-related define path Message-ID: This is the updated version of the previous set, but with some of the less-related pieces stripped out. The default network pool is assumed, and an error is thrown if the MAC is omitted. From danms at us.ibm.com Mon Apr 14 16:54:16 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 09:54:16 -0700 Subject: [Libvirt-cim] [PATCH 1 of 4] Make NetRASD expose its MAC in the Address field In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1208191947 25200 # Node ID cd5c245ad76e4b397f13fc9f4eab540d071921a5 # Parent 327cfc9f69191f5a2f0454290c8ecf02e223d4dd Make NetRASD expose its MAC in the Address field Signed-off-by: Dan Smith diff -r 327cfc9f6919 -r cd5c245ad76e src/Virt_RASD.c --- a/src/Virt_RASD.c Mon Apr 14 09:44:04 2008 -0700 +++ b/src/Virt_RASD.c Mon Apr 14 09:52:27 2008 -0700 @@ -157,6 +157,10 @@ static CMPIInstance *rasd_from_vdev(cons "NetworkType", (CMPIValue *)dev->dev.net.type, CMPI_chars); + CMSetProperty(inst, + "Address", + (CMPIValue *)dev->dev.net.mac, + CMPI_chars); } else if (dev->type == CIM_RES_TYPE_MEM) { const char *units = "KiloBytes"; From danms at us.ibm.com Mon Apr 14 16:54:17 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 09:54:17 -0700 Subject: [Libvirt-cim] [PATCH 2 of 4] Make VSMS::DefineSystem() throw some error messages up the stack on failure In-Reply-To: Message-ID: <49dd281a34132f2ac3d5.1208192057@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1208191947 25200 # Node ID 49dd281a34132f2ac3d57efb967fafffb9de14e6 # Parent cd5c245ad76e4b397f13fc9f4eab540d071921a5 Make VSMS::DefineSystem() throw some error messages up the stack on failure Signed-off-by: Dan Smith diff -r cd5c245ad76e -r 49dd281a3413 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Apr 14 09:52:27 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Mon Apr 14 09:52:27 2008 -0700 @@ -199,17 +199,17 @@ static int vssd_to_domain(CMPIInstance * return ret; } -static int xen_net_rasd_to_vdev(CMPIInstance *inst, - struct virt_device *dev) +static const char *xen_net_rasd_to_vdev(CMPIInstance *inst, + struct virt_device *dev) { free(dev->dev.net.type); dev->dev.net.type = strdup("bridge"); - return 1; -} - -static int kvm_net_rasd_to_vdev(CMPIInstance *inst, - struct virt_device *dev) + return NULL; +} + +static const char *kvm_net_rasd_to_vdev(CMPIInstance *inst, + struct virt_device *dev) { free(dev->dev.net.type); dev->dev.net.type = strdup("network"); @@ -217,11 +217,11 @@ static int kvm_net_rasd_to_vdev(CMPIInst free(dev->dev.net.source); dev->dev.net.source = strdup("default"); - return 1; -} - -static int rasd_to_vdev(CMPIInstance *inst, - struct virt_device *dev) + return NULL; +} + +static const char *rasd_to_vdev(CMPIInstance *inst, + struct virt_device *dev) { uint16_t type; const char *id = NULL; @@ -229,6 +229,7 @@ static int rasd_to_vdev(CMPIInstance *in char *name = NULL; char *devid = NULL; CMPIObjectPath *op; + const char *msg = NULL; op = CMGetObjectPath(inst, NULL); if (op == NULL) @@ -260,12 +261,11 @@ static int rasd_to_vdev(CMPIInstance *in dev->dev.net.mac = devid; if (STARTS_WITH(CLASSNAME(op), "Xen")) - xen_net_rasd_to_vdev(inst, dev); + msg = xen_net_rasd_to_vdev(inst, dev); else if (STARTS_WITH(CLASSNAME(op), "KVM")) - kvm_net_rasd_to_vdev(inst, dev); + msg = kvm_net_rasd_to_vdev(inst, dev); else - CU_DEBUG("Unknown class type for net device: %s", - CLASSNAME(op)); + msg = "Invalid domain type"; } else if (type == CIM_RES_TYPE_MEM) { cu_get_u64_prop(inst, "VirtualQuantity", &dev->dev.mem.size); @@ -278,16 +278,16 @@ static int rasd_to_vdev(CMPIInstance *in free(name); - return 1; + return msg; err: free(name); free(devid); - return 0; -} - -static int classify_resources(CMPIArray *resources, - struct domain *domain) + return msg; +} + +static const char *classify_resources(CMPIArray *resources, + struct domain *domain) { int i; uint16_t type; @@ -298,7 +298,7 @@ static int classify_resources(CMPIArray count = CMGetArrayCount(resources, NULL); if (count < 1) - return 0; + return "No resources specified"; domain->dev_disk = calloc(count, sizeof(struct virt_device)); domain->dev_vcpu = calloc(count, sizeof(struct virt_device)); @@ -308,34 +308,39 @@ static int classify_resources(CMPIArray for (i = 0; i < count; i++) { CMPIObjectPath *op; CMPIData item; + const char *msg = NULL; item = CMGetArrayElementAt(resources, i, NULL); if (CMIsNullObject(item.value.inst)) - return 0; + return "Internal array error"; op = CMGetObjectPath(item.value.inst, NULL); if (op == NULL) - return 0; + return "Unknown resource instance type"; if (res_type_from_rasd_classname(CLASSNAME(op), &type) != CMPI_RC_OK) - return 0; + return "Unable to determine resource type"; if (type == CIM_RES_TYPE_PROC) - rasd_to_vdev(item.value.inst, - &domain->dev_vcpu[domain->dev_vcpu_ct++]); + msg = rasd_to_vdev(item.value.inst, + &domain->dev_vcpu[domain->dev_vcpu_ct++]); else if (type == CIM_RES_TYPE_MEM) - rasd_to_vdev(item.value.inst, - &domain->dev_mem[domain->dev_mem_ct++]); + msg = rasd_to_vdev(item.value.inst, + &domain->dev_mem[domain->dev_mem_ct++]); else if (type == CIM_RES_TYPE_DISK) - rasd_to_vdev(item.value.inst, - &domain->dev_disk[domain->dev_disk_ct++]); + msg = rasd_to_vdev(item.value.inst, + &domain->dev_disk[domain->dev_disk_ct++]); else if (type == CIM_RES_TYPE_NET) - rasd_to_vdev(item.value.inst, - &domain->dev_net[domain->dev_net_ct++]); - } - - return 1; + msg = rasd_to_vdev(item.value.inst, + &domain->dev_net[domain->dev_net_ct++]); + + if (msg != NULL) + return msg; + + } + + return NULL; } static CMPIInstance *connect_and_create(char *xml, @@ -385,6 +390,7 @@ static CMPIInstance *create_system(CMPII { CMPIInstance *inst = NULL; char *xml = NULL; + const char *msg = NULL; struct domain *domain; @@ -396,8 +402,9 @@ static CMPIInstance *create_system(CMPII goto out; } - if (!classify_resources(resources, domain)) { - CU_DEBUG("Failed to classify resources"); + msg = classify_resources(resources, domain); + if (msg != NULL) { + CU_DEBUG("Failed to classify resources: %s", msg); cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, "ResourceSettings Error"); From danms at us.ibm.com Mon Apr 14 16:54:19 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 09:54:19 -0700 Subject: [Libvirt-cim] [PATCH 4 of 4] Make VSMS not parse the InstanceID of a RASD, but rather use the proper fields In-Reply-To: Message-ID: <38627ba5e177c03bef62.1208192059@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1208192047 25200 # Node ID 38627ba5e177c03bef62abd13bc3a8b0b2938870 # Parent e5d09c60a54e8b4b60a8c46d3b1e8e3c4048252f Make VSMS not parse the InstanceID of a RASD, but rather use the proper fields For Network, grab the Address for the MAC and then also try to extract the PoolID for the network name. I left it split between KVM and Xen, because I think as we expand the supported network types, we'll still need to differentiate in the code. This means that we no longer examine the InstanceID of the incoming RASDs for a DefineSystem operation (which is correct). The test suite will need to change to use these values correctly instead of generating the InstanceID and should also have a test that verifies that the InstanceID is not honored. I think that the InstanceID should be ignored if specified, although discussion of this point is certainly welcomed. Changes: - Use exposed defaults for network pool (but not the MAC) - Set the namespace on the instance of the RASD we got from the parser, so that it's a usable reference for namespace, etc. Signed-off-by: Dan Smith diff -r e5d09c60a54e -r 38627ba5e177 src/Makefile.am --- a/src/Makefile.am Mon Apr 14 09:52:27 2008 -0700 +++ b/src/Makefile.am Mon Apr 14 09:54:07 2008 -0700 @@ -75,9 +75,9 @@ libVirt_ComputerSystemMigrationIndicatio libVirt_ComputerSystemMigrationIndication_la_SOURCES = Virt_ComputerSystemMigrationIndication.c libVirt_ComputerSystemMigrationIndication_la_LIBADD = -lVirt_ComputerSystem -libVirt_VirtualSystemManagementService_la_DEPENDENCIES = libVirt_ComputerSystem.la libVirt_ComputerSystemIndication.la libVirt_RASD.la libVirt_HostSystem.la +libVirt_VirtualSystemManagementService_la_DEPENDENCIES = libVirt_ComputerSystem.la libVirt_ComputerSystemIndication.la libVirt_RASD.la libVirt_HostSystem.la libVirt_DevicePool.la libVirt_VirtualSystemManagementService_la_SOURCES = Virt_VirtualSystemManagementService.c -libVirt_VirtualSystemManagementService_la_LIBADD = -lVirt_ComputerSystem -lVirt_ComputerSystemIndication -lVirt_RASD -lVirt_HostSystem +libVirt_VirtualSystemManagementService_la_LIBADD = -lVirt_ComputerSystem -lVirt_ComputerSystemIndication -lVirt_RASD -lVirt_HostSystem -lVirt_DevicePool libVirt_VirtualSystemManagementCapabilities_la_DEPENDENCIES = libVirt_HostSystem.la libVirt_VirtualSystemManagementCapabilities_la_SOURCES = Virt_VirtualSystemManagementCapabilities.c diff -r e5d09c60a54e -r 38627ba5e177 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Apr 14 09:52:27 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Mon Apr 14 09:54:07 2008 -0700 @@ -47,6 +47,7 @@ #include "Virt_ComputerSystemIndication.h" #include "Virt_RASD.h" #include "Virt_HostSystem.h" +#include "Virt_DevicePool.h" #include "svpc_types.h" const static CMPIBroker *_BROKER; @@ -199,11 +200,50 @@ static int vssd_to_domain(CMPIInstance * return ret; } +static const char *_default_network(CMPIInstance *inst) +{ + CMPIInstance *pool; + CMPIObjectPath *op; + CMPIStatus s; + const char *poolid = NULL; + + op = CMGetObjectPath(inst, &s); + if ((op == NULL) || (s.rc != CMPI_RC_OK)) { + CU_DEBUG("Failed to get path for instance: %s", + CMGetCharPtr(s.msg)); + return NULL; + } + + pool = default_device_pool(_BROKER, op, CIM_RES_TYPE_NET, &s); + if ((pool == NULL) || (s.rc != CMPI_RC_OK)) { + CU_DEBUG("Failed to get default network pool: %s", + CMGetCharPtr(s.msg)); + return NULL; + } + + if (cu_get_str_prop(pool, "InstanceID", &poolid) != CMPI_RC_OK) { + CU_DEBUG("Unable to get pool's InstanceID"); + } + + return poolid; +} + static const char *xen_net_rasd_to_vdev(CMPIInstance *inst, struct virt_device *dev) { + const char *val = NULL; + free(dev->dev.net.type); - dev->dev.net.type = strdup("bridge"); + dev->dev.net.type = strdup("network"); + + if (cu_get_str_prop(inst, "PoolID", &val) != CMPI_RC_OK) + val = _default_network(inst); + + if (val == NULL) + return 0; + + free(dev->dev.net.source); + dev->dev.net.source = name_from_pool_id(val); return NULL; } @@ -211,11 +251,88 @@ static const char *kvm_net_rasd_to_vdev( static const char *kvm_net_rasd_to_vdev(CMPIInstance *inst, struct virt_device *dev) { + const char *val = NULL; + free(dev->dev.net.type); dev->dev.net.type = strdup("network"); + if (cu_get_str_prop(inst, "PoolID", &val) != CMPI_RC_OK) + val = _default_network(inst); + + if (val == NULL) + return "No NetworkPool specified and no default available"; + free(dev->dev.net.source); - dev->dev.net.source = strdup("default"); + dev->dev.net.source = name_from_pool_id(val); + + return NULL; +} + +static const char *net_rasd_to_vdev(CMPIInstance *inst, + struct virt_device *dev) +{ + const char *val = NULL; + CMPIObjectPath *op; + const char *msg = NULL; + + if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) { + msg = "Required field `Address' missing from NetRASD"; + goto out; + } + + free(dev->dev.net.mac); + dev->dev.net.mac = strdup(val); + + op = CMGetObjectPath(inst, NULL); + if (op == NULL) { + CU_DEBUG("Unable to get instance path"); + goto out; + } + + if (STARTS_WITH(CLASSNAME(op), "Xen")) + msg = xen_net_rasd_to_vdev(inst, dev); + else if (STARTS_WITH(CLASSNAME(op), "KVM")) + msg = kvm_net_rasd_to_vdev(inst, dev); + else { + msg = "Unknown class type for net device"; + CU_DEBUG("Unknown class type for net device: %s", + CLASSNAME(op)); + } + + out: + return msg; +} + +static const char *disk_rasd_to_vdev(CMPIInstance *inst, + struct virt_device *dev) +{ + const char *val = NULL; + + if (cu_get_str_prop(inst, "VirtualDevice", &val) != CMPI_RC_OK) + val = "hda"; + + free(dev->dev.disk.virtual_dev); + dev->dev.disk.virtual_dev = strdup(val); + + if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) + val = "/dev/null"; + + free(dev->dev.disk.source); + dev->dev.disk.source = strdup(val); + dev->dev.disk.disk_type = disk_type_from_file(val); + + return NULL; +} + +static const char *mem_rasd_to_vdev(CMPIInstance *inst, + struct virt_device *dev) +{ + cu_get_u64_prop(inst, "VirtualQuantity", &dev->dev.mem.size); + cu_get_u64_prop(inst, "Reservation", &dev->dev.mem.size); + dev->dev.mem.maxsize = dev->dev.mem.size; + cu_get_u64_prop(inst, "Limit", &dev->dev.mem.maxsize); + dev->dev.mem.size <<= 10; + dev->dev.mem.maxsize <<= 10; return NULL; } @@ -224,69 +341,38 @@ static const char *rasd_to_vdev(CMPIInst struct virt_device *dev) { uint16_t type; - const char *id = NULL; - const char *val = NULL; - char *name = NULL; - char *devid = NULL; CMPIObjectPath *op; const char *msg = NULL; op = CMGetObjectPath(inst, NULL); - if (op == NULL) - goto err; - - if (res_type_from_rasd_classname(CLASSNAME(op), &type) != CMPI_RC_OK) - goto err; + if (op == NULL) { + msg = "Unable to get path for device instance"; + goto out; + } + + if (res_type_from_rasd_classname(CLASSNAME(op), &type) != CMPI_RC_OK) { + msg = "Unable to get device type"; + goto out; + } dev->type = (int)type; - if (cu_get_str_prop(inst, "InstanceID", &id) != CMPI_RC_OK) - goto err; - - if (!parse_fq_devid(id, &name, &devid)) - goto err; - if (type == CIM_RES_TYPE_DISK) { - free(dev->dev.disk.virtual_dev); - dev->dev.disk.virtual_dev = devid; - - if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) - val = "/dev/null"; - - free(dev->dev.disk.source); - dev->dev.disk.source = strdup(val); - dev->dev.disk.disk_type = disk_type_from_file(val); + msg = disk_rasd_to_vdev(inst, dev); } else if (type == CIM_RES_TYPE_NET) { - free(dev->dev.net.mac); - dev->dev.net.mac = devid; - - if (STARTS_WITH(CLASSNAME(op), "Xen")) - msg = xen_net_rasd_to_vdev(inst, dev); - else if (STARTS_WITH(CLASSNAME(op), "KVM")) - msg = kvm_net_rasd_to_vdev(inst, dev); - else - msg = "Invalid domain type"; - + msg = net_rasd_to_vdev(inst, dev); } else if (type == CIM_RES_TYPE_MEM) { - cu_get_u64_prop(inst, "VirtualQuantity", &dev->dev.mem.size); - cu_get_u64_prop(inst, "Reservation", &dev->dev.mem.size); - dev->dev.mem.maxsize = dev->dev.mem.size; - cu_get_u64_prop(inst, "Limit", &dev->dev.mem.maxsize); - dev->dev.mem.size <<= 10; - dev->dev.mem.maxsize <<= 10; - } - - free(name); + msg = mem_rasd_to_vdev(inst, dev); + } + out: + if (msg) + CU_DEBUG("rasd_to_vdev(): %s", msg); return msg; - err: - free(name); - free(devid); - - return msg; } static const char *classify_resources(CMPIArray *resources, + const char *ns, struct domain *domain) { int i; @@ -308,31 +394,37 @@ static const char *classify_resources(CM for (i = 0; i < count; i++) { CMPIObjectPath *op; CMPIData item; + CMPIInstance *inst; const char *msg = NULL; item = CMGetArrayElementAt(resources, i, NULL); if (CMIsNullObject(item.value.inst)) return "Internal array error"; - op = CMGetObjectPath(item.value.inst, NULL); + inst = item.value.inst; + + op = CMGetObjectPath(inst, NULL); if (op == NULL) return "Unknown resource instance type"; + + CMSetNameSpace(op, ns); + CMSetObjectPath(inst, op); if (res_type_from_rasd_classname(CLASSNAME(op), &type) != CMPI_RC_OK) return "Unable to determine resource type"; if (type == CIM_RES_TYPE_PROC) - msg = rasd_to_vdev(item.value.inst, + msg = rasd_to_vdev(inst, &domain->dev_vcpu[domain->dev_vcpu_ct++]); else if (type == CIM_RES_TYPE_MEM) - msg = rasd_to_vdev(item.value.inst, + msg = rasd_to_vdev(inst, &domain->dev_mem[domain->dev_mem_ct++]); else if (type == CIM_RES_TYPE_DISK) - msg = rasd_to_vdev(item.value.inst, + msg = rasd_to_vdev(inst, &domain->dev_disk[domain->dev_disk_ct++]); else if (type == CIM_RES_TYPE_NET) - msg = rasd_to_vdev(item.value.inst, + msg = rasd_to_vdev(inst, &domain->dev_net[domain->dev_net_ct++]); if (msg != NULL) @@ -402,12 +494,12 @@ static CMPIInstance *create_system(CMPII goto out; } - msg = classify_resources(resources, domain); + msg = classify_resources(resources, NAMESPACE(ref), domain); if (msg != NULL) { CU_DEBUG("Failed to classify resources: %s", msg); cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "ResourceSettings Error"); + "ResourceSettings Error: %s", msg); goto out; } From danms at us.ibm.com Mon Apr 14 16:54:18 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 09:54:18 -0700 Subject: [Libvirt-cim] [PATCH 3 of 4] Make DevicePool handle missing network In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1208191947 25200 # Node ID e5d09c60a54e8b4b60a8c46d3b1e8e3c4048252f # Parent 49dd281a34132f2ac3d57efb967fafffb9de14e6 Make DevicePool handle missing network Signed-off-by: Dan Smith diff -r 49dd281a3413 -r e5d09c60a54e src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Mon Apr 14 09:52:27 2008 -0700 +++ b/src/Virt_DevicePool.c Mon Apr 14 09:52:27 2008 -0700 @@ -673,6 +673,16 @@ static CMPIStatus _netpool_for_network(s refcn, "NetworkPool", ns); + if (inst == NULL) { + CMPIStatus s; + + CU_DEBUG("Unable to get instance: %s:%s_NetworkPool", + ns, refcn); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Error getting pool instance"); + return s; + } if (asprintf(&str, "NetworkPool/%s", netname) == -1) return (CMPIStatus){CMPI_RC_ERR_FAILED, NULL}; From kaitlin at linux.vnet.ibm.com Mon Apr 14 17:32:22 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Apr 2008 10:32:22 -0700 Subject: [Libvirt-cim] [PATCH] Set PoolID on all allocated RASD objects for later correlation in DefineSystem In-Reply-To: <041175667e48789b50ef.1208191323@guaranine.danplanet.com> References: <041175667e48789b50ef.1208191323@guaranine.danplanet.com> Message-ID: <48039526.8060000@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1208191321 25200 > # Node ID 041175667e48789b50efe550a3d7d41f42110caa > # Parent abf9b4881cc061cca318fe39c3c849f01316cdc8 > Set PoolID on all allocated RASD objects for later correlation in DefineSystem > > No changes, but this can be a standalone patch, so I'm submitting it outside > my other set. > > Signed-off-by: Dan Smith > No complaints here. +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Apr 14 17:34:09 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Apr 2008 10:34:09 -0700 Subject: [Libvirt-cim] [PATCH] Fix typo in NetRASD creation that could have caused a break if we rearrange things In-Reply-To: <857848be56f0bdc3480b.1208191356@guaranine.danplanet.com> References: <857848be56f0bdc3480b.1208191356@guaranine.danplanet.com> Message-ID: <48039591.4000301@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1208191352 25200 > # Node ID 857848be56f0bdc3480bb9f5a7ae6d0598b4d9a8 > # Parent 041175667e48789b50efe550a3d7d41f42110caa > Fix typo in NetRASD creation that could have caused a break if we rearrange things > > No changes, but separate from the larger set. > > Signed-off-by: Dan Smith +1 =) -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From grendel at linux.vnet.ibm.com Mon Apr 14 17:36:59 2008 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 14 Apr 2008 13:36:59 -0400 Subject: [Libvirt-cim] [PATCH] Add revision information to the VSMS In-Reply-To: <87wsn0o1ld.fsf@caffeine.beaverton.ibm.com> References: <52e2f501b44994af849d.1207934529@guaranine.danplanet.com> <47FFE26B.7020803@linux.vnet.ibm.com> <87wsn0o1ld.fsf@caffeine.beaverton.ibm.com> Message-ID: <4803963B.2070803@linux.vnet.ibm.com> Dan Smith wrote: > KR> You'll also need to modify the mof file to add the new attributes, > KR> right? > > Yeah, we should. > > KR> I think this a neat approach. I'm not sure whether VSMS is the > KR> correct place.. I initially thought this would be good to add to > KR> the profile, but I don't know if we want to advertise this info > KR> there. > > I think it's probably the best of the options, without dragging > another profile and/or provider into the mix. > > So, was that a +1 or at least something that rounds up to 1? :) > > I'll chip in to get it up to one providing the mof change gets made as well. -- -Jay From kaitlin at linux.vnet.ibm.com Mon Apr 14 17:53:36 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Apr 2008 10:53:36 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Add ability to get a default pool of a given type to the pool provider In-Reply-To: <327cfc9f69191f5a2f04.1208191486@guaranine.danplanet.com> References: <327cfc9f69191f5a2f04.1208191486@guaranine.danplanet.com> Message-ID: <48039A20.4050505@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1208191444 25200 > # Node ID 327cfc9f69191f5a2f0454290c8ecf02e223d4dd > # Parent 2afa2a7d1d5a4e7d026f2f6cf8b5a1a8a266b5a0 > Add ability to get a default pool of a given type to the pool provider > > Signed-off-by: Dan Smith > > diff -r 2afa2a7d1d5a -r 327cfc9f6919 src/Virt_DevicePool.c > --- a/src/Virt_DevicePool.c Mon Apr 14 09:44:03 2008 -0700 > +++ b/src/Virt_DevicePool.c Mon Apr 14 09:44:04 2008 -0700 > @@ -991,6 +991,39 @@ CMPIStatus enum_pools(const CMPIBroker * > return _get_pools(broker, reference, type, NULL, list); > } > > +CMPIInstance *default_device_pool(const CMPIBroker *broker, > + const CMPIObjectPath *reference, > + uint16_t type, > + CMPIStatus *s) > +{ > + CMPIInstance *inst = NULL; > + struct inst_list list; > + > + inst_list_init(&list); > + > + if (type == CIM_RES_TYPE_MEM) { > + *s = get_pool_by_name(broker, reference, "MemoryPool/0", &inst); > + } else if (type == CIM_RES_TYPE_PROC) { > + *s = get_pool_by_name(broker, reference, "ProcPool/0", &inst); This should be ProcessorPool, which is how the InstanceID is set elsewhere. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From grendel at linux.vnet.ibm.com Mon Apr 14 17:59:43 2008 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 14 Apr 2008 13:59:43 -0400 Subject: [Libvirt-cim] [PATCH] Make the 'default' NetRASD allocation include a randomly-generated MAC In-Reply-To: References: Message-ID: <48039B8F.1010704@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1208189730 25200 > # Node ID abf9b4881cc061cca318fe39c3c849f01316cdc8 > # Parent da267e967adbd316d30303cc064584ebd36d7123 > Make the 'default' NetRASD allocation include a randomly-generated MAC > > No changes from last time, except I think this can be put in by itself, > to reduce the size of my queue for the VSMS stuff. > > Signed-off-by: Dan Smith > > > static struct sdc_rasd_prop *net_def(const CMPIObjectPath *ref, > CMPIStatus *s) > { > @@ -440,6 +482,7 @@ static struct sdc_rasd_prop *net_def(con > struct sdc_rasd_prop tmp[] = { > {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, > {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, > + {"Address", (CMPIValue *)_net_rand_mac(), CMPI_chars}, > PROP_END > }; > Is this going to segfault if _net_rand_mac() hits an error and comes back NULL? Or is the code that actually turns the struct into an inst able to handle that gracefully? -- -Jay From danms at us.ibm.com Mon Apr 14 18:08:51 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 11:08:51 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Add ability to get a default pool of a given type to the pool provider In-Reply-To: <48039A20.4050505@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Mon, 14 Apr 2008 10:53:36 -0700") References: <327cfc9f69191f5a2f04.1208191486@guaranine.danplanet.com> <48039A20.4050505@linux.vnet.ibm.com> Message-ID: <87d4osnwb0.fsf@caffeine.beaverton.ibm.com> KR> This should be ProcessorPool, which is how the InstanceID is set KR> elsewhere. Well, that was stupid of me :) Replacement on the way soon. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Apr 14 18:11:32 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 11:11:32 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] (#2) Updates to DevicePool Message-ID: Fix procpool name From danms at us.ibm.com Mon Apr 14 18:11:34 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 11:11:34 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Add ability to get a default pool of a given type to the pool provider In-Reply-To: Message-ID: <4d7ede1d251ba8c8982a.1208196694@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1208196681 25200 # Node ID 4d7ede1d251ba8c8982a2bc65f53b8de3982a04e # Parent b342662208d69fb8f3c7189b1f227e3dff04fd59 Add ability to get a default pool of a given type to the pool provider Changes: - Make ProcPool ProcessorPool Signed-off-by: Dan Smith diff -r b342662208d6 -r 4d7ede1d251b src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Mon Apr 14 10:57:32 2008 -0700 +++ b/src/Virt_DevicePool.c Mon Apr 14 11:11:21 2008 -0700 @@ -991,6 +991,39 @@ CMPIStatus enum_pools(const CMPIBroker * return _get_pools(broker, reference, type, NULL, list); } +CMPIInstance *default_device_pool(const CMPIBroker *broker, + const CMPIObjectPath *reference, + uint16_t type, + CMPIStatus *s) +{ + CMPIInstance *inst = NULL; + struct inst_list list; + + inst_list_init(&list); + + if (type == CIM_RES_TYPE_MEM) { + *s = get_pool_by_name(broker, reference, "MemoryPool/0", &inst); + } else if (type == CIM_RES_TYPE_PROC) { + *s = get_pool_by_name(broker, reference, "ProcessorPool/0", &inst); + } else if (type == CIM_RES_TYPE_DISK) { + *s = enum_pools(broker, reference, type, &list); + if (s->rc == CMPI_RC_OK) + inst = list.list[0]; + } else if (type == CIM_RES_TYPE_NET) { + *s = enum_pools(broker, reference, type, &list); + if (s->rc == CMPI_RC_OK) + inst = list.list[0]; + } else { + cu_statusf(broker, s, + CMPI_RC_ERR_INVALID_PARAMETER, + "No such device type `%s'", type); + } + + inst_list_free(&list); + + return inst; +} + static CMPIStatus return_pool(const CMPIObjectPath *ref, const CMPIResult *results, bool names_only) diff -r b342662208d6 -r 4d7ede1d251b src/Virt_DevicePool.h --- a/src/Virt_DevicePool.h Mon Apr 14 10:57:32 2008 -0700 +++ b/src/Virt_DevicePool.h Mon Apr 14 11:11:21 2008 -0700 @@ -105,6 +105,20 @@ CMPIStatus get_pool_by_name(const CMPIBr const char *id, CMPIInstance **_inst); +/** + * Get the default pool for a given device type + * + * @param broker A pointer to the current broker + * @param ref The object path containing namespace and prefix info + * @param type The device type in question + * @param status The returned status + * @returns Default instance of a pool + */ +CMPIInstance *default_device_pool(const CMPIBroker *broker, + const CMPIObjectPath *reference, + uint16_t type, + CMPIStatus *status); + #endif /* From danms at us.ibm.com Mon Apr 14 18:11:33 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 11:11:33 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Add function to parse out pool name from InstanceID In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1208195852 25200 # Node ID b342662208d69fb8f3c7189b1f227e3dff04fd59 # Parent 9518a04a73bef32166da24e795f0d5c8c6665981 Add function to parse out pool name from InstanceID Signed-off-by: Dan Smith diff -r 9518a04a73be -r b342662208d6 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Mon Apr 14 10:57:32 2008 -0700 +++ b/src/Virt_DevicePool.c Mon Apr 14 10:57:32 2008 -0700 @@ -500,6 +500,17 @@ uint16_t res_type_from_pool_id(const cha return CIM_RES_TYPE_UNKNOWN; } +char *name_from_pool_id(const char *id) +{ + char *s; + + s = strchr(id, '/'); + if (s == NULL) + return NULL; + + return strdup((char *)s+1); +} + static bool mempool_set_total(CMPIInstance *inst, virConnectPtr conn) { virNodeInfo info; diff -r 9518a04a73be -r b342662208d6 src/Virt_DevicePool.h --- a/src/Virt_DevicePool.h Mon Apr 14 10:57:32 2008 -0700 +++ b/src/Virt_DevicePool.h Mon Apr 14 10:57:32 2008 -0700 @@ -58,6 +58,14 @@ uint16_t res_type_from_pool_id(const cha uint16_t res_type_from_pool_id(const char *id); /** + * Get the pool name from a given pool's InstanceID + * + * @param id The InstanceID of the pool + * @returns the name (must be free'd by the caller) + */ +char *name_from_pool_id(const char *id); + +/** * Get all device pools on the system for the given type * * From Lukasz.Szymanski at unisys.com Mon Apr 14 18:50:51 2008 From: Lukasz.Szymanski at unisys.com (Szymanski, Lukasz K) Date: Mon, 14 Apr 2008 13:50:51 -0500 Subject: [Libvirt-cim] UML diagrams Message-ID: Hello, I am not sure if this is the place to post this so I apologize if it is not. Please point me to the right mailing list to answer the following question: Is it possible for someone to post the UML class and/or instance diagrams (like DMTF), that you are using as the basis of the providers? Thank you, Luke Szymanski Unisys Corp. -------------- next part -------------- An HTML attachment was scrubbed... URL: From danms at us.ibm.com Mon Apr 14 20:00:36 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 13:00:36 -0700 Subject: [Libvirt-cim] [PATCH] Make the 'default' NetRASD allocation include a randomly-generated MAC In-Reply-To: <48039B8F.1010704@linux.vnet.ibm.com> (Jay Gagnon's message of "Mon, 14 Apr 2008 13:59:43 -0400") References: <48039B8F.1010704@linux.vnet.ibm.com> Message-ID: <878wzgnr4r.fsf@caffeine.beaverton.ibm.com> JG> Is this going to segfault if _net_rand_mac() hits an error and JG> comes back NULL? Or is the code that actually turns the struct JG> into an inst able to handle that gracefully? Yep, sure is. Replacement soon :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Apr 14 20:02:50 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 13:02:50 -0700 Subject: [Libvirt-cim] UML diagrams In-Reply-To: (Lukasz K. Szymanski's message of "Mon, 14 Apr 2008 13:50:51 -0500") References: Message-ID: <874pa4nr11.fsf@caffeine.beaverton.ibm.com> Hi Luke, SK> Is it possible for someone to post the UML class and/or instance SK> diagrams (like DMTF), that you are using as the basis of the SK> providers? We don't have any additional UML diagrams to offer. However, we have adhered pretty closely with the actual DMTF model, so with the exception of a very few additional class attributes here and there, the DMTF diagrams should represent our providers accurately. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Apr 14 20:11:25 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 13:11:25 -0700 Subject: [Libvirt-cim] [PATCH] Make the 'default' NetRASD allocation include a randomly-generated MAC Message-ID: # HG changeset patch # User Dan Smith # Date 1208203862 25200 # Node ID b8c657f804fda928ea45798f5c1f0ff9f0234889 # Parent d00685b6206aaf99f37527442886c878e1010362 Make the 'default' NetRASD allocation include a randomly-generated MAC No changes from last time, except I think this can be put in by itself, to reduce the size of my queue for the VSMS stuff. Signed-off-by: Dan Smith diff -r d00685b6206a -r b8c657f804fd src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Mon Apr 14 10:57:32 2008 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Mon Apr 14 13:11:02 2008 -0700 @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -52,6 +53,8 @@ const static CMPIBroker *_BROKER; #define SDC_DISK_MIN 2000 #define SDC_DISK_DEF 5000 #define SDC_DISK_INC 250 + +#define DEFAULT_MAC_PREFIX "00:16:3e" static bool rasd_prop_copy_value(struct sdc_rasd_prop src, struct sdc_rasd_prop *dest) @@ -430,26 +433,73 @@ static struct sdc_rasd_prop *net_max(con return rasd; } +static const char *_net_rand_mac(void) +{ + int r; + int ret; + unsigned int s; + char *mac = NULL; + CMPIString *str = NULL; + CMPIStatus status; + + srand(time(NULL)); + r = rand_r(&s); + + ret = asprintf(&mac, + "%s:%02x:%02x:%02x", + DEFAULT_MAC_PREFIX, + r & 0xFF, + (r & 0xFF00) >> 8, + (r & 0xFF0000) >> 16); + + if (ret == -1) + goto out; + + str = CMNewString(_BROKER, mac, &status); + if ((str == NULL) || (status.rc != CMPI_RC_OK)) { + str = NULL; + CU_DEBUG("Failed to create string"); + goto out; + } + out: + free(mac); + + if (str != NULL) + mac = CMGetCharPtr(str); + else + mac = NULL; + + return mac; +} + static struct sdc_rasd_prop *net_def(const CMPIObjectPath *ref, CMPIStatus *s) { bool ret; uint16_t num_nics = 1; struct sdc_rasd_prop *rasd = NULL; - + const char *mac = _net_rand_mac(); struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, - PROP_END - }; - - ret = dup_rasd_prop_list(tmp, &rasd); - if (!ret) { - cu_statusf(_BROKER, s, - CMPI_RC_ERR_FAILED, - "Could not copy RASD"); - } - + {"Address", (CMPIValue *)mac, CMPI_chars}, + PROP_END + }; + + if (mac == NULL) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Failed to generate new MAC address"); + goto out; + } + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD"); + } + out: return rasd; } From kaitlin at linux.vnet.ibm.com Mon Apr 14 20:12:53 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Apr 2008 13:12:53 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Add ability to get a default pool of a given type to the pool provider In-Reply-To: <4d7ede1d251ba8c8982a.1208196694@guaranine.danplanet.com> References: <4d7ede1d251ba8c8982a.1208196694@guaranine.danplanet.com> Message-ID: <4803BAC5.5060801@linux.vnet.ibm.com> > + } else if (type == CIM_RES_TYPE_DISK) { > + *s = enum_pools(broker, reference, type, &list); > + if (s->rc == CMPI_RC_OK) > + inst = list.list[0]; > + } else if (type == CIM_RES_TYPE_NET) { > + *s = enum_pools(broker, reference, type, &list); > + if (s->rc == CMPI_RC_OK) > + inst = list.list[0]; I somehow missed this last time - you could collapse these statements into one else if. However, I think having the statements parallel the PROC and MEM statements is easier to read (and easier to change later on if need be). +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Mon Apr 14 21:39:58 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 14 Apr 2008 14:39:58 -0700 Subject: [Libvirt-cim] [PATCH] Add revision information to the VSMS Message-ID: <606a412caaf41e1d49ca.1208209198@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1208209155 25200 # Node ID 606a412caaf41e1d49ca47809ec0e94e65f29785 # Parent 67e30fff0026214f509e688bdb082d07ffd267f2 Add revision information to the VSMS This is done at build time, if possible. If not, the changeset/revision at the last automake run will be used. This should make it work for the tarball/release case as well as the RPM build. The way this works, if you build, then apply a patch or pull a new changeset, the exposed revision/version information will be stale unless you do a clean. Since this is really just for the purposes of test-tracking, I think this is a reasonable restriction that can be minded by the people doing testing. The changeset hash and revision number are exposed in aptly-named properties of the VSMS for each platform. If anyone has a better place for these to show up, or a better format, please bring it up. Changes: - Update the VSMS schema for the new values Signed-off-by: Dan Smith diff -r 67e30fff0026 -r 606a412caaf4 Makefile.am --- a/Makefile.am Mon Apr 14 10:49:02 2008 -0700 +++ b/Makefile.am Mon Apr 14 14:39:15 2008 -0700 @@ -98,7 +98,8 @@ pkgdata_SCRIPTS = provider-register.sh EXTRA_DIST = schema $(pkgdata_DATA) $(pkgdata_SCRIPTS) \ libvirt-cim.spec.in libvirt-cim.spec \ - doc/CodingStyle doc/SubmittingPatches + doc/CodingStyle doc/SubmittingPatches \ + .changeset .revision preinstall: sh -x base_schema/install_base_schema.sh `pwd`/base_schema diff -r 67e30fff0026 -r 606a412caaf4 acinclude.m4 --- a/acinclude.m4 Mon Apr 14 10:49:02 2008 -0700 +++ b/acinclude.m4 Mon Apr 14 14:39:15 2008 -0700 @@ -313,4 +313,23 @@ AC_DEFUN([DEFINE_DISK_CONFIG], [ AC_DEFINE_UNQUOTED([DISK_POOL_CONFIG], "$1", [Disk pool config filepath.]) ] -) \ No newline at end of file +) + +AC_DEFUN([SET_CSET], + [ + if test -d .hg && test -x $(which hg); then + cs='-DLIBVIRT_CIM_CS=\"`hg id -i`\"' + rv='-DLIBVIRT_CIM_RV=\"`hg id -n`\"' + elif test -f .changeset; then + cset=$(cat .changeset) + revn=$(cat .revision) + cs="-DLIBVIRT_CIM_CS=\\\"$cset\\\"" + rv="-DLIBVIRT_CIM_RV=\\\"$revn\\\"" + else + cs='-DLIBVIRT_CIM_CS=\"Unknown\"' + rv='-DLIBVIRT_CIM_RV=\"0\"' + fi + + CFLAGS="$CFLAGS $cs $rv" + ] +) diff -r 67e30fff0026 -r 606a412caaf4 autoconfiscate.sh --- a/autoconfiscate.sh Mon Apr 14 10:49:02 2008 -0700 +++ b/autoconfiscate.sh Mon Apr 14 14:39:15 2008 -0700 @@ -17,4 +17,12 @@ echo "Running autoconf ..." && echo "Running autoconf ..." && autoconf --force && +if test -x $(which hg); then + hg id -i > .changeset + hg id -n > .revision +else + echo "Unknown" > .changeset + echo "0" > .revision +fi + echo "You may now run ./configure" diff -r 67e30fff0026 -r 606a412caaf4 configure.ac --- a/configure.ac Mon Apr 14 10:49:02 2008 -0700 +++ b/configure.ac Mon Apr 14 14:39:15 2008 -0700 @@ -143,6 +143,7 @@ AC_SUBST(CFLAGS_STRICT) AC_SUBST(CFLAGS_STRICT) CFLAGS="$CFLAGS $CC_WARNINGS" +SET_CSET # Display configuration options echo "----------------------------------------------------------" diff -r 67e30fff0026 -r 606a412caaf4 schema/VirtualSystemManagementService.mof --- a/schema/VirtualSystemManagementService.mof Mon Apr 14 10:49:02 2008 -0700 +++ b/schema/VirtualSystemManagementService.mof Mon Apr 14 14:39:15 2008 -0700 @@ -3,14 +3,29 @@ [Provider("cmpi::Virt_VirtualSystemManagementService")] class Xen_VirtualSystemManagementService : CIM_VirtualSystemManagementService { + [Description("HG changeset id of the providers")] + string Changeset; + + [Description("HG revision number of the providers")] + string Revision; }; [Provider("cmpi::Virt_VirtualSystemManagementService")] class KVM_VirtualSystemManagementService : CIM_VirtualSystemManagementService { + [Description("HG changeset id of the providers")] + string Changeset; + + [Description("HG revision number of the providers")] + string Revision; }; [Provider("cmpi::Virt_VirtualSystemManagementService")] class LXC_VirtualSystemManagementService : CIM_VirtualSystemManagementService { + [Description("HG changeset id of the providers")] + string Changeset; + + [Description("HG revision number of the providers")] + string Revision; }; diff -r 67e30fff0026 -r 606a412caaf4 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Apr 14 10:49:02 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Mon Apr 14 14:39:15 2008 -0700 @@ -1246,6 +1246,12 @@ CMPIStatus get_vsms(const CMPIObjectPath CMSetProperty(inst, "SystemCreationClassName", (CMPIValue *)ccname, CMPI_chars); + CMSetProperty(inst, "Changeset", + (CMPIValue *)LIBVIRT_CIM_CS, CMPI_chars); + + CMSetProperty(inst, "Revision", + (CMPIValue *)LIBVIRT_CIM_RV, CMPI_chars); + if (is_get_inst) { s = cu_validate_ref(broker, reference, inst); if (s.rc != CMPI_RC_OK) From kaitlin at linux.vnet.ibm.com Mon Apr 14 21:54:07 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Apr 2008 14:54:07 -0700 Subject: [Libvirt-cim] [PATCH] Make the 'default' NetRASD allocation include a randomly-generated MAC In-Reply-To: References: Message-ID: <4803D27F.1010404@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1208203862 25200 > # Node ID b8c657f804fda928ea45798f5c1f0ff9f0234889 > # Parent d00685b6206aaf99f37527442886c878e1010362 > Make the 'default' NetRASD allocation include a randomly-generated MAC > > No changes from last time, except I think this can be put in by itself, > to reduce the size of my queue for the VSMS stuff. > This tested out fine for me. +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 15 00:21:17 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Apr 2008 17:21:17 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add -d to duplicate error output to stderr In-Reply-To: <47FEC4F6.7040702@linux.vnet.ibm.com> References: <28d173f24fb60cbbe230.1207811406@zeit.cn.ibm.com> <47FDBE8B.7040705@linux.vnet.ibm.com> <47FEBDB8.5060902@linux.vnet.ibm.com> <47FEC11E.4010808@linux.vnet.ibm.com> <47FEC4F6.7040702@linux.vnet.ibm.com> Message-ID: <4803F4FD.3080806@linux.vnet.ibm.com> Zhengang Li wrote: > Kaitlin Rupert wrote: > >>>>> def do_try(): >>>>> try: >>>>> + log_param(options.debug) >>>> log_param() is invoked here. It doesn't hurt to leave the invoke in >>>> every test cases. But we don't have to add that in future test cases. >>>> >>> Excellent - do_try() just gets better in my book. ;) >>> >>> Would like to see some review comments on this patch. I have no >>> complaints, but I'm interested in hearing whether people think this >>> is useful. >>> >>> Thanks! >>> >> >> Ah.. my mistake.. I didn't notice this at first. Including >> log_param() in both the test case itself and do_try() causes the >> messages to be written to the log twice. > How about this: > def log_param(debug=None): > if debug == None: > return > else: > original log_param() body > > This way, we don't have to worry about twice logging, and give us time > to remove the log_param() in the testcases. > And after all log_param() is removed from the testcases, we can revert > the log_param() to the state without a 'debug==None' check. Sorry Zhengang, I thought I'd responded to this already. Yes, I think this is a good approach. Can you modify your original patch and resend? Also, can you add a FIXME comment as well? I am keeping track of such FIXME issues, but adding the comment makes it easier to search for later on. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 15 01:02:03 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Apr 2008 18:02:03 -0700 Subject: [Libvirt-cim] [PATCH 4 of 6] [TEST] update processor id in SettingsDefine01~03 to reflect recent provider changes In-Reply-To: <248707005ae8efa00fc1.1207879575@elm3b197.beaverton.ibm.com> References: <248707005ae8efa00fc1.1207879575@elm3b197.beaverton.ibm.com> Message-ID: <4803FE8B.4070901@linux.vnet.ibm.com> > diff -r 682ad781e5b0 -r 248707005ae8 suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py > --- a/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Thu Apr 10 18:55:50 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Thu Apr 10 19:01:00 2008 -0700 > @@ -186,13 +186,13 @@ def main(): > > global rasd_devid > rasd_devid = { > - 'ProcResourceAllocationSettingData' : '%s/%s' % (test_dom, test_vcpus-1), > + 'ProcResourceAllocationSettingData' : '%s/%s' % (test_dom, 'proc'), > 'NetResourceAllocationSettingData' : '%s/%s' % (test_dom, test_mac), > 'DiskResourceAllocationSettingData' : '%s/%s' % (test_dom, test_disk), > 'MemResourceAllocationSettingData' : '%s/%s' % (test_dom, 'mem')} Daisy, can you resend this patch so that it only has this change? I believe the recent provider changes should have only affected the InstanceID of the ProcRASD class, and not the Processor class InstanceID as well. So, the Processor related changes shouldn't be necessary. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 15 01:07:31 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Apr 2008 18:07:31 -0700 Subject: [Libvirt-cim] [PATCH 5 of 6] [TEST] update processor id in SystemDevice.01 to reflect recent provider changes In-Reply-To: References: Message-ID: <4803FFD3.9090002@linux.vnet.ibm.com> Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1207879393 25200 > # Node ID fa561bc3cae2b4de3cf6f43df61bb647e7f9bdbc > # Parent 248707005ae8efa00fc106f3ad8da02add06b3b6 > [TEST] update processor id in SystemDevice.01 to reflect recent provider changes > > Signed-off-by: Guolian Yun > diff -r 248707005ae8 -r fa561bc3cae2 suites/libvirt-cim/cimtest/SystemDevice/01_forward.py I'm going to ignore this patch for now, since I think the Processor class behavior is not supposed to change. Out of this patchset, just resend patch 4 (update processor id in SettingsDefine01~03 to reflect recent provider changes). I've applied the others (except for this one, which I'm going to hold off on for now). Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 15 01:16:57 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Apr 2008 18:16:57 -0700 Subject: [Libvirt-cim] [PATCH] [TEST].2# update processor id to reflect recent provider changes In-Reply-To: References: Message-ID: <48040209.9050605@linux.vnet.ibm.com> Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1208138597 25200 > # Node ID ede68ec5664dd564fe55ae9a90243d6e53465003 > # Parent 137e5079c73fcbfc70e6654cee0b3c3eb3c6acd2 > [TEST].2# update processor id to reflect recent provider changes > > Signed-off-by: Guolian Yun > Sorry Daisy - I didn't realize this patch was a resend of your previous patch set. Sorry for the confusion. Usually, if a patchset needs to be reworked, the entire set is resent. However, I didn't finish reviewing your patches, which caused some confusion. My mistake there. =) You can either resend patch 4 (of the previous set), or you can modify this patch to just include the changes the ProcRASD related changes to suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py. Either way is fine. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Apr 15 01:37:25 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Apr 2008 18:37:25 -0700 Subject: [Libvirt-cim] Xen test report on Fedora 8 In-Reply-To: References: Message-ID: <480406D5.4000406@linux.vnet.ibm.com> Guo Lian Yun wrote: > stro: Fedora8 > Kernel: kernel-2.6.23.1-42.fc8 > Xen: xen-3.1.2-2.fc8 > Libvirt: libvirt-0.4.2-1 > CIMOM: sblim-sfcb-1.2.5-0 > PyWBEM: pywbem-0.6-2 > LibCMPIutil: 72 > LibvirtCIM: 532 > CIM Schema: cimv216Experimental > Cimtest: 76 and patched with proceesor id update In the future, runs that use a cimtest clean tree would be good idea. If someone wants to duplicate the run, it's easier for them to check out changeset 76, than to checkout changeset 76 and then manually apply the additional patches. > > =============CIMTEST FAILING REPORT======================================== > > ComputerSystem - 23_suspend_suspend.py: FAIL > It fails because of invoking method `DefineSystem', it's unable to > define domain using DefineSystem() > ComputerSystem - 27_define_suspend_errs.py: FAIL > Same as above > ComputerSystem - 32_start_reboot.py: FAIL > InvokeMethod(DefineSystem): Failed to create domain > ComputerSystem - 33_suspend_reboot.py: FAIL > Same as ComputerSystem.23 > ComputerSystem - 35_start_reset.py: FAIL > ComputerSystem - 40_RSC_start.py: FAIL > Same as ComputerSystem.23 Interesting - is this due to an existing domain that was created by the testsuite and not properly cleaned up? > VirtualSystemManagementService - 01_definesystem_name.py: FAIL This is unusual. I ran a test on a RHEL 5.2 box using both Xen and XenFV - this passed. Any information in the log? > VirtualSystemMigrationService - 01_migratable_host.py: FAIL > InvokeMethod(CheckVirtualSystemIsMigratableToHost): Provider not found > or not loadable > The provider is registered successfully, and I can get expected result > by wbemcli ein. > Who knows why it is? I will occasionally see a similar issue with Pegasus. In my case, the provider has been properly registered with Pegasus, but not installed properly (the provider library is missing from the expected location). In this case, both wbemecli commands and tests fail. I don't have much experience with sfcb, but I would expect it to work the same. Did you verify that the provider was installed in the proper location? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From zli at linux.vnet.ibm.com Tue Apr 15 01:54:23 2008 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Tue, 15 Apr 2008 09:54:23 +0800 Subject: [Libvirt-cim] KVM test report on Fedora 9 In-Reply-To: <87skxoo0y1.fsf@caffeine.beaverton.ibm.com> References: <48030658.5060504@linux.vnet.ibm.com> <87skxoo0y1.fsf@caffeine.beaverton.ibm.com> Message-ID: <48040ACF.6090803@linux.vnet.ibm.com> Dan Smith wrote: > ZL> ComputerSystemIndication - 01_created_indication.py: FAIL > ZL> Exception : Authentication (or request) Failed! > ZL> Previous tests were always on sfcb. Anyone has a successful experience > ZL> on pegasus for indication? > > Make sure you have the following in your cimconfig: > > repositoryIsDefaultInstanceProvider=true > enableIndicationService=true Tried with the two properties set to true. Still the same error message. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- - Zhengang From yunguol at cn.ibm.com Tue Apr 15 01:32:02 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 14 Apr 2008 18:32:02 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] update ProcResourceAllocationSettingData instance id in SettingsDefine.02 Message-ID: <955cc0b1395b743b3102.1208223122@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1208223114 25200 # Node ID 955cc0b1395b743b31027a7d48c82df753d9a9e5 # Parent 137e5079c73fcbfc70e6654cee0b3c3eb3c6acd2 [TEST] update ProcResourceAllocationSettingData instance id in SettingsDefine.02 Signed-off-by: Guolian Yun diff -r 137e5079c73f -r 955cc0b1395b suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Mon Apr 14 18:31:54 2008 -0700 @@ -186,7 +186,7 @@ def main(): global rasd_devid rasd_devid = { - 'ProcResourceAllocationSettingData' : '%s/%s' % (test_dom, test_vcpus-1), + 'ProcResourceAllocationSettingData' : '%s/%s' % (test_dom, 'proc'), 'NetResourceAllocationSettingData' : '%s/%s' % (test_dom, test_mac), 'DiskResourceAllocationSettingData' : '%s/%s' % (test_dom, test_disk), 'MemResourceAllocationSettingData' : '%s/%s' % (test_dom, 'mem')} From yunguol at cn.ibm.com Tue Apr 15 02:10:51 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 15 Apr 2008 10:10:51 +0800 Subject: [Libvirt-cim] [PATCH 4 of 6] [TEST] update processor id in SettingsDefine01~03 to reflect recent provider changes In-Reply-To: <4803FE8B.4070901@linux.vnet.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-04-15 09:02:03: > > diff -r 682ad781e5b0 -r 248707005ae8 suites/libvirt- > cim/cimtest/SettingsDefine/02_reverse.py > > --- a/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py > Thu Apr 10 18:55:50 2008 -0700 > > +++ b/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py > Thu Apr 10 19:01:00 2008 -0700 > > @@ -186,13 +186,13 @@ def main(): > > > > global rasd_devid > > rasd_devid = { > > - 'ProcResourceAllocationSettingData' : '%s/%s' % > (test_dom, test_vcpus-1), > > + 'ProcResourceAllocationSettingData' : '%s/%s' % > (test_dom, 'proc'), > > 'NetResourceAllocationSettingData' : '%s/%s' % > (test_dom, test_mac), > > 'DiskResourceAllocationSettingData' : '%s/%s' % > (test_dom, test_disk), > > 'MemResourceAllocationSettingData' : '%s/%s' % > (test_dom, 'mem')} > > > Daisy, can you resend this patch so that it only has this change? > Done it. > I believe the recent provider changes should have only affected the > InstanceID of the ProcRASD class, and not the Processor class InstanceID > as well. > > So, the Processor related changes shouldn't be necessary. > -- > Kaitlin Rupert > IBM Linux Technology Center > kaitlin at linux.vnet.ibm.com > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From zli at linux.vnet.ibm.com Tue Apr 15 02:25:11 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Tue, 15 Apr 2008 10:25:11 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Add -d to duplicate error output to stderr Message-ID: # HG changeset patch # User Zhengang Li # Date 1208226308 -28800 # Node ID a22ea10d1e46adfcd2e878328c1746b5c618230b # Parent 137e5079c73fcbfc70e6654cee0b3c3eb3c6acd2 [TEST] #2 Add -d to duplicate error output to stderr This gives us the capability to output the error messages to screen. .#2: - Added a temp work around to avoid duplicated logging to file. - Update some indent (8 spaces -> 4 spaces, line cut, commenting) Signed-off-by: Zhengang Li diff -r 137e5079c73f -r a22ea10d1e46 lib/CimTest/Globals.py --- a/lib/CimTest/Globals.py Fri Apr 11 16:58:23 2008 +0530 +++ b/lib/CimTest/Globals.py Tue Apr 15 10:25:08 2008 +0800 @@ -68,6 +68,8 @@ parser.add_option("-v", "--virt", dest=" parser.add_option("-v", "--virt", dest="virt", type="choice", choices=platform_sup, default="Xen", help="Virt type, select from: 'Xen' & 'KVM' & 'XenFV', default: Xen") +parser.add_option("-d", "--debug-output", action="store_true", dest="debug", + help="Duplicate the output to stderr") if not CIM_NS: CIM_NS = "root/cimv2" @@ -85,29 +87,42 @@ if not CIM_IP: if not CIM_IP: CIM_IP = "localhost" -def log_param(): +def log_param(debug=None): + #FIXME debug=None is a temporary work around to avoid duplicate + # logging in vsmtest.log because we have log_param in both the + # do_main decorator and the test case's main function. + # We can safely delete the if branch here after all test cases + # have removed the log_param invoke. + if debug == None: + return + else: logger.setLevel(logging.DEBUG) -#create console handler and set level to debug + #create console handler and set level to debug ch = logging.StreamHandler() - ch.setLevel(int(CIM_LEVEL)) -#create file handler and set level to debug + if debug: + ch.setLevel(logging.ERROR) + else: + ch.setLevel(int(CIM_LEVEL)) + #create file handler and set level to debug fh = logging.FileHandler("vsmtest.log") fh.setLevel(logging.DEBUG) -#create formatter - formatter = logging.Formatter("%(asctime)s:%(name)s:%(levelname)s \ -\t- %(message)s", datefmt="%a, %d %b %Y %H:%M:%S") -#add formatter to handlers + #create formatter + formatter = logging.Formatter(\ + "%(asctime)s:%(name)s:%(levelname)s \t- %(message)s", + datefmt="%a, %d %b %Y %H:%M:%S") + #add formatter to handlers fh.setFormatter(formatter) + formatter = logging.Formatter("%(levelname)s \t- %(message)s") ch.setFormatter(formatter) -#add handlers to logger + #add handlers to logger logger.addHandler(fh) logger.addHandler(ch) -#Print header + #Print header logger.info("====%s Log====", CIM_TC) def log_bug(bug_num): - logger.info("Known Bug:%s" % bug_num) - print "Bug:<%s>" % bug_num + logger.info("Known Bug:%s" % bug_num) + print "Bug:<%s>" % bug_num def do_main(types=['Xen'], p=parser): def do_type(f): @@ -119,6 +134,7 @@ def do_main(types=['Xen'], p=parser): else: def do_try(): try: + log_param(options.debug) from VirtLib.utils import setup_ssh_key from XenKvmLib.test_doms import destroy_and_undefine_all setup_ssh_key() diff -r 137e5079c73f -r a22ea10d1e46 suites/libvirt-cim/main.py --- a/suites/libvirt-cim/main.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/main.py Tue Apr 15 10:25:08 2008 +0800 @@ -49,6 +49,8 @@ parser.add_option("-v", "--virt", dest=" parser.add_option("-v", "--virt", dest="virt", type="choice", choices=platform_sup, default="Xen", help="Virt type, select from 'Xen' & 'KVM' & 'XenFV'(default: Xen). ") +parser.add_option("-d", "--debug-output", action="store_true", dest="debug", + help="Duplicate the output to stderr") TEST_SUITE = 'cimtest' @@ -110,14 +112,19 @@ def main(): if options.clean: remove_old_logs(options.group) + if options.debug: + dbg = "-d" + else: + dbg = "" + print "Testing " + options.virt + " hypervisor" for test in test_list: t_path = os.path.join(TEST_SUITE, test['group']) os.environ['CIM_TC'] = test['test'] - cmd = "cd %s && python %s -i %s -v %s" % \ - (t_path, test['test'], options.ip, options.virt) + cmd = "cd %s && python %s -i %s -v %s %s" % \ + (t_path, test['test'], options.ip, options.virt, dbg) status, output = commands.getstatusoutput(cmd) os_status = os.WEXITSTATUS(status) From yunguol at cn.ibm.com Tue Apr 15 06:25:59 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 15 Apr 2008 14:25:59 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] fix error code and description in ElementConforms.04 Message-ID: <0dd12af47c75cf09c45b.1208240759@localhost.localdomain> # HG changeset patch # User Guolian Yun # Date 1208240754 -28800 # Node ID 0dd12af47c75cf09c45b00684c05a5b04efce8fa # Parent 137e5079c73fcbfc70e6654cee0b3c3eb3c6acd2 [TEST] fix error code and description in ElementConforms.04 Signed-off-by: Guolian Yun diff -r 137e5079c73f -r 0dd12af47c75 suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py --- a/suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py Fri Apr 11 16:58:23 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py Tue Apr 15 14:25:54 2008 +0800 @@ -91,11 +91,18 @@ ac_classname = 'Xen_ElementConformsToProfile' bug = '92642' -expr_values = { - "INVALID_CCName_Keyname" : { 'rc' : '' , 'desc' : '' }, \ - "INVALID_CCName_Keyvalue" : { 'rc' : '' , 'desc' : '' }, \ - "INVALID_Name_Keyname" : { 'rc' : '' , 'desc' : '' }, \ - "INVALID_Name_Keyvalue" : { 'rc' : '' , 'desc' : '' } +cs_values = { + "INVALID_CCName_Keyname" : { 'rc' : 6 , 'desc' : 'No such instance' }, \ + "INVALID_CCName_Keyvalue" : { 'rc' : 6 , 'desc' : 'No such instance' }, \ + "INVALID_Name_Keyname" : { 'rc' : 1 , 'desc' : 'No domain name specified'}, \ + "INVALID_Name_Keyvalue" : { 'rc' : 6 , 'desc' : 'No such instance' } + } + +hs_values = { + "INVALID_CCName_Keyname" : { 'rc' : 6 , 'desc' : 'No such instance' }, \ + "INVALID_CCName_Keyvalue" : { 'rc' : 6 , 'desc' : 'No such instance' }, \ + "INVALID_Name_Keyname" : { 'rc' : 6 , 'desc' : 'No such instance'}, \ + "INVALID_Name_Keyvalue" : { 'rc' : 6 , 'desc' : 'No such instance' } } def try_invalid_assoc(classname, name_val, i, field): @@ -106,6 +113,10 @@ for j in range(len(name_val)/2): k = j * 2 keys[name_val[k]] = name_val[k+1] + if classname == "Xen_HostSystem": + expr_values = hs_values + else: + expr_values = cs_values ret_val = try_assoc(conn, classname, ac_classname, keys, field_name=field, \ expr_values=expr_values[field], bug_no=bug) if ret_val != PASS: From zli at linux.vnet.ibm.com Tue Apr 15 07:00:54 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Tue, 15 Apr 2008 15:00:54 +0800 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] ElementSettingData KVM update Message-ID: From zli at linux.vnet.ibm.com Tue Apr 15 07:00:55 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Tue, 15 Apr 2008 15:00:55 +0800 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Add KVM support for ElementSettingData.01 In-Reply-To: Message-ID: <823907d0d5b3c03ff675.1208242855@zeit.cn.ibm.com> # HG changeset patch # User Zhengang Li # Date 1208241728 -28800 # Node ID 823907d0d5b3c03ff675f9fe116307b5570622b6 # Parent a22ea10d1e46adfcd2e878328c1746b5c618230b [TEST] Add KVM support for ElementSettingData.01 Signed-off-by: Zhengang Li diff -r a22ea10d1e46 -r 823907d0d5b3 suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Tue Apr 15 10:25:08 2008 +0800 +++ b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Tue Apr 15 14:42:08 2008 +0800 @@ -51,34 +51,33 @@ from VirtLib import utils from VirtLib import utils from XenKvmLib import enumclass from XenKvmLib import assoc +from XenKvmLib.classes import get_class_basename from CimTest import Globals from CimTest.Globals import do_main -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM'] +esd_cn = 'ElementSettingData' +vssd_cn = 'VirtualSystemSettingData' +vssdc_cn = 'VirtualSystemSettingDataComponent' +rasd_cn = 'ResourceAllocationSettingData' -def test_assoc(host, class_name, id): +def test_assoc(host, class_name, id, virt): try: - ret_inst = assoc.AssociatorNames(host, - "Xen_ElementSettingData", - class_name, + ret_inst = assoc.AssociatorNames(host,esd_cn, class_name, virt, InstanceID = id) except Exception: - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, - 'Xen_ElementSettingData') + Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, esd_cn) return 1 if len(ret_inst) != 1: - Globals.logger.error("Xen_ElementSettingData returned %i %s instances", - len(ret_inst), - class_name) + Globals.logger.error("%s returned %i %s instances", esd_cn, + len(ret_inst), class_name) return 1 ret_id = ret_inst[0].keybindings["InstanceID"] if ret_id != id: Globals.logger.error("%s returned %s instance with wrong id %s", - "Xen_ElementSettingData", - class_name, - ret_id) + esd_cn, class_name, ret_id) return 1 return 0; @@ -90,9 +89,8 @@ def main(): try: key_list = ["InstanceID"] - vssd_lst = enumclass.enumerate(options.ip, - enumclass.Xen_VirtualSystemSettingData, - key_list) + vssd_lst = enumclass.enumerate(options.ip, vssd_cn, key_list, + options.virt) except Exception, details: Globals.logger.error("Exception %s", details) @@ -100,40 +98,31 @@ def main(): for vssd in vssd_lst: - rc = test_assoc(options.ip, - "Xen_VirtualSystemSettingData", - vssd.InstanceID) + rc = test_assoc(options.ip, vssd_cn, vssd.InstanceID, options.virt) if rc != 0: Globals.logger.error("Unable to get associated %s from %s", - "Xen_VirtualSystemSettingData", - "Xen_ElementSettingData") + vssd_cn, esd_cn) return 1 try: - rasd_list = assoc.Associators(options.ip, - "Xen_VirtualSystemSettingDataComponent", - "Xen_VirtualSystemSettingData", - InstanceID = vssd.InstanceID) + rasd_list = assoc.Associators(options.ip, vssdc_cn, vssd_cn, + options.virt, + InstanceID = vssd.InstanceID) except Exception: - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, - 'Xen_VirtualSystemSettingDataComponent') + Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, vssdc_cn) return 1 if len(rasd_list) == 0: - Globals.logger.error("%s returned %i %s instances", - "Xen_ElementSettingData", - len(rasd_list), - "Xen_VirtualSystemSettingData") + Globals.logger.error("%s returned %i %s instances", esd_cn, + len(rasd_list), vssd_cn) return 1 for rasd in rasd_list: - rc = test_assoc(options.ip, - rasd.classname, - rasd["InstanceID"]) + rc = test_assoc(options.ip, get_class_basename(rasd.classname), + rasd["InstanceID"], options.virt) if rc != 0: Globals.logger.error("Unable to get associated %s from %s", - "Xen_ResourceAllocationSettingData", - "Xen_ElementSettingData") + rasd_cn, esd_cn) return 1 return 0 From zli at linux.vnet.ibm.com Tue Apr 15 07:00:56 2008 From: zli at linux.vnet.ibm.com (zli at linux.vnet.ibm.com) Date: Tue, 15 Apr 2008 15:00:56 +0800 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Add KVM support to ElementSettingData.03 In-Reply-To: Message-ID: # HG changeset patch # User Zhengang Li # Date 1208242801 -28800 # Node ID f972b4f3276f784136bfccef22d50ac8e43972ed # Parent 823907d0d5b3c03ff675f9fe116307b5570622b6 [TEST] Add KVM support to ElementSettingData.03 Signed-off-by: Zhengang Li diff -r 823907d0d5b3 -r f972b4f3276f suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py --- a/suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py Tue Apr 15 14:42:08 2008 +0800 +++ b/suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py Tue Apr 15 15:00:01 2008 +0800 @@ -50,20 +50,24 @@ import sys import pywbem -from XenKvmLib.test_xml import testxml from VirtLib import utils +from XenKvmLib import vxml from XenKvmLib import assoc -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all from CimTest.Globals import log_param, logger, CIM_USER, CIM_PASS, CIM_NS, \ CIM_ERROR_ASSOCIATORS from CimTest.Globals import do_main from XenKvmLib.common_util import try_assoc +from XenKvmLib.classes import get_typed_class from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM'] test_dom = "hd_domain1" test_mac = "00:11:22:33:44:55" + +vssdc_cn = "VirtualSystemSettingDataComponent" +vssd_cn = "VirtualSystemSettingData" +esd_cn = "ElementSettingData" expr_values = { "invalid_instid_keyvalue" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND, \ @@ -78,30 +82,30 @@ def main(): log_param() status = PASS - destroy_and_undefine_all(options.ip) - test_xml = testxml(test_dom, mac = test_mac) - ret = test_domain_function(test_xml, options.ip, cmd = "create") + virtxml = vxml.get_class(options.virt) + cxml = virtxml(test_dom, mac = test_mac) + ret = cxml.create(options.ip) if not ret: logger.error("Failed to Create the dom: %s" % test_dom) status = FAIL return status try: - instid = 'Xen:%s' %test_dom - rasd_list = assoc.Associators(options.ip, - "Xen_VirtualSystemSettingDataComponent", - "Xen_VirtualSystemSettingData", - InstanceID = instid) + instid = '%s:%s' % (options.virt, test_dom) + rasd_list = assoc.Associators(options.ip, vssdc_cn, vssd_cn, + options.virt, InstanceID=instid) except Exception: - logger.error(CIM_ERROR_ASSOCIATORS, 'Xen_VirtualSystemSettingDataComponent') - test_domain_function(test_dom, options.ip, cmd = "destroy") + logger.error(CIM_ERROR_ASSOCIATORS, vssdc_cn) + cxml.destroy(options.ip) + cxml.undefine(options.ip) return FAIL if len(rasd_list) < 1: - logger.error("eturned %i objects, expected at least 1", len(rasd_list)) - test_domain_function(test_dom, options.ip, cmd = "destroy") + logger.error("returned %i objects, expected at least 1", len(rasd_list)) + cxml.destroy(options.ip) + cxml.undefine(options.ip) return FAIL conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS) - assoc_classname = 'Xen_ElementSettingData' + assoc_classname = get_typed_class(options.virt, esd_cn) for rasd in rasd_list: classname = rasd.classname field = 'INVALID_InstID_KeyName' @@ -124,7 +128,8 @@ def main(): status = ret_value if status != PASS: break - test_domain_function(test_dom, options.ip, cmd = "destroy") + cxml.destroy(options.ip) + cxml.undefine(options.ip) return status if __name__ == "__main__": sys.exit(main()) From deeptik at linux.vnet.ibm.com Tue Apr 15 08:32:12 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 15 Apr 2008 14:02:12 +0530 Subject: [Libvirt-cim] Re: CimTest Report on XenFV 10-04-2008 In-Reply-To: <87od8co0s5.fsf@caffeine.beaverton.ibm.com> References: <47FDF40C.1010202@linux.vnet.ibm.com> <47FE19B7.2040003@linux.vnet.ibm.com> <48033D5D.4060703@linux.vnet.ibm.com> <87od8co0s5.fsf@caffeine.beaverton.ibm.com> Message-ID: <4804680C.8090305@linux.vnet.ibm.com> Hi , Please find the DEBUG o/p: Virt_VirtualSystemManagementService.c(455): DefineSystem xmlgen.c(571): New UUID Virt_VirtualSystemManagementService.c(416): System XML: 657146ae-20bf-43f5-9542-17adab081cfb test_domain destroy destroy hvm /usr/lib/xen/boot/hvmloader 524288 524288 1