From yunguol at cn.ibm.com Tue Jul 1 02:26:41 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 1 Jul 2008 10:26:41 +0800 Subject: Fw: [Fwd: [Libvirt-cim] [PATCH] [TEST] A few migration related fixes] Message-ID: ----- Forwarded by Guo Lian Yun/China/IBM on 2008-07-01 10:29 ----- Guo Lian Yun/China/IBM 2008-07-01 10:24 To Kaitlin Rupert cc Subject Re: [Fwd: [Libvirt-cim] [PATCH] [TEST] A few migration related fixes] Kaitlin Rupert wrote on 2008-07-01 00:05:03: > Can I get a review of this patch? > > Thanks! > -- > Kaitlin Rupert > IBM Linux Technology Center > kaitlin at linux.vnet.ibm.com > > ----- Message from Kaitlin Rupert on > Wed, 25 Jun 2008 14:18:23 -0700 ----- > > To: > > libvirt-cim at redhat.com > > Subject: > > [Libvirt-cim] [PATCH] [TEST] A few migration related fixes > > # HG changeset patch > # User Kaitlin Rupert > # Date 1214423985 25200 > # Node ID ef376bdad2e186904b15cda1afd230d8056e8015 > # Parent 5c90c9a2fd567d7cf592932db189afbc8a4756f8 > [TEST] A few migration related fixes. > > Fixes: > -Remove destroy_and_undefine_domain() call from > migrate_guest_to_host(). This call takes the domain name as a > parameter, but migrate_guest_to_host() doesn't take the domain name > So calling destroy_and_undefine_domain() resulted in an error. > -Add a hack to get_typed_class() so it supports Virt_MigrationJob > (which doesn't fit the typical _ pattern. > > Signed-off-by: Kaitlin Rupert > > diff -r 5c90c9a2fd56 -r ef376bdad2e1 suites/libvirt- > cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py > --- a/suites/libvirt- > cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py > Thu Jun 19 10:35:59 2008 -0700 > +++ b/suites/libvirt- > cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py > Wed Jun 25 12:59:45 2008 -0700 > @@ -90,10 +90,10 @@ > return FAIL > > status, ret = migrate_guest_to_host(service, cs_ref, target_ip) > - > if status == FAIL: > logger.error("MigrateVirtualSystemToHost: unexpected list length %s" > % len(ret)) > + destroy_and_undefine_domain(dom_name, options.ip) > return status > elif len(ret) == 2: > id = ret[1]['Job'].keybindings['InstanceID'] > @@ -102,7 +102,7 @@ > guest_name, local_migrate) > > > - destroy_and_undefine_domain(dom_name, options.ip) > + destroy_and_undefine_domain(dom_name, options.ip) > > return status > Do you think we should also to call destroy_and_undefine_domain() below based on your patch? status, cs_ref = start_guest_get_ref(options.ip, dom_name) if status != PASS: + destroy_and_undefine_domain(dom_name, options.ip) return FAIL > diff -r 5c90c9a2fd56 -r ef376bdad2e1 suites/libvirt- > cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py > --- a/suites/libvirt- > cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py > Thu Jun 19 10:35:59 2008 -0700 > +++ b/suites/libvirt- > cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py > Wed Jun 25 12:59:45 2008 -0700 > @@ -145,12 +145,11 @@ > > logger.info("Migrating guest with the following options:") > logger.info("%s" % item) > - status, ret = migrate_guest_to_host(service, cs_ref, target_ip, > - item) > - > + status, ret = migrate_guest_to_host(service, cs_ref, target_ip, item) > if status == FAIL: > logger.error("MigrateVirtualSystemToHost: unexpected > list length %s" > % len(ret)) > + destroy_and_undefine_domain(dom_name, options.ip) > return status > elif len(ret) == 2: > id = ret[1]['Job'].keybindings['InstanceID'] > diff -r 5c90c9a2fd56 -r ef376bdad2e1 suites/libvirt- > cim/lib/XenKvmLib/classes.py > --- a/suites/libvirt-cim/lib/XenKvmLib/classes.py Thu Jun 19 10: > 35:59 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/classes.py Wed Jun 25 12: > 59:45 2008 -0700 > @@ -23,7 +23,8 @@ > > def get_typed_class(virt, basename): > if virt not in virt_types: > - raise ValueError('Invalid class type') > + if virt != "Virt" and basename != "MigrationJob": > + raise ValueError('Invalid class type') > > if basename == None or basename == '': > raise ValueError('Invalide class base name') > diff -r 5c90c9a2fd56 -r ef376bdad2e1 suites/libvirt- > cim/lib/XenKvmLib/vsmigrations.py > --- a/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Thu Jun 19 > 10:35:59 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Wed Jun 25 > 12:59:45 2008 -0700 > @@ -95,10 +95,10 @@ > except Exception, details: > logger.error("Error invoke method 'MigrateVirtualSystemToHost\'.") > logger.error("%s", details) > + return FAIL, ret > > if len(ret) == 0: > logger.error("MigrateVirtualSystemToHost returns an empty list") > - destroy_and_undefine_domain(test_dom, ip) > return FAIL, ret > > return PASS, ret > > _______________________________________________ > 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 Jul 1 02:31:55 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 1 Jul 2008 10:31:55 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] Fix HostSystem - 04_hs_to_EAPF.py to verify proper mem val In-Reply-To: <692121d37b3aefafce0d.1214845146@elm3b41.beaverton.ibm.com> Message-ID: +1 from me =). libvirt-cim-bounces at redhat.com wrote on 2008-07-01 00:59:06: > # HG changeset patch > # User Kaitlin Rupert > # Date 1214845116 25200 > # Node ID 692121d37b3aefafce0d6856d81468add629514d > # Parent 450c5a235e0c95d7be7ef4a967fcb30d2f2abb9c > [TEST] Fix HostSystem - 04_hs_to_EAPF.py to verify proper mem val > > The memory value used for NumberOfBlocks needs to be multiplied by > 1024, since the memory value supplied when the guest is created is > multiplied by 1024. > > Also removed an extraneous print statement. Removed some functions > that were no longer being used. Also fixed some line length issues. > > Signed-off-by: Kaitlin Rupert > > diff -r 450c5a235e0c -r 692121d37b3a suites/libvirt- > cim/cimtest/HostSystem/04_hs_to_EAPF.py > --- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Mon > Jun 30 09:27:42 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Mon > Jun 30 09:58:36 2008 -0700 > @@ -76,8 +76,9 @@ > > def setup_env(server): > destroy_and_undefine_all(server) > - test_xml, bridge = testxml_bridge(test_dom, mem = test_mem, > vcpus = test_vcpus, \ > - mac = test_mac, disk = > test_disk, server = server) > + test_xml, bridge = testxml_bridge(test_dom, mem = test_mem, > + vcpus = test_vcpus, mac = test_mac, > + disk = test_disk, server = server) > if bridge == None: > logger.error("Unable to find virtual bridge") > return SKIP > @@ -100,14 +101,6 @@ > def print_err(err, detail, cn): > logger.error(err % cn) > logger.error("Exception: %s", detail) > - > -def field_err(assoc_info, field_list, fieldname): > - logger.error("%s Mismatch", fieldname) > - logger.error("Returned %s instead of %s", > assoc_info[fieldname], field_list[fieldname]) > - > -def spec_err(fieldvalue, field_list, fieldname): > - logger.error("%s Mismatch", fieldname) > - logger.error("Returned %s instead of %s", fieldvalue, > field_list[fieldname]) > > def pool_init_list(pool_assoc): > """ > @@ -142,14 +135,13 @@ > 'SystemName' : test_dom, > 'CreationClassName' : "Xen_Memory", > 'DeviceID' : "%s/%s" % (test_dom, "mem"), > - 'NumberOfBlocks' : test_mem > + 'NumberOfBlocks' : test_mem * 1024 > } > eaf_values = { "Xen_Processor" : proc, > "Xen_LogicalDisk" : disk, > "Xen_NetworkPort" : net, > "Xen_Memory" : mem > } > - print eaf_values > return eaf_values > > def get_inst_for_dom(assoc_val): > @@ -171,7 +163,8 @@ > CreationClassName=cn, > Name = hostname) > if len(assoc_info) < 1: > - logger.error("%s returned %i %s objects" % (an, > len(assoc_info), qcn)) > + logger.error("%s returned %i %s objects" % (an, > + len(assoc_info), qcn)) > status = FAIL > > except Exception, detail: > @@ -186,7 +179,8 @@ > > def check_len(an, assoc_list_info, qcn, exp_len): > if len(assoc_list_info) != exp_len: > - logger.error("%s returned %i %s objects" % (an, > len(assoc_list_info), qcn)) > + logger.error("%s returned %i %s objects" % (an, > + len(assoc_list_info), qcn)) > return FAIL > return PASS > > > _______________________________________________ > 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 Jul 1 02:49:40 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 1 Jul 2008 10:49:40 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] Some VirtualSystemManagementService -t 02_destroysystem.py cleanup In-Reply-To: <7d3d5dcffad210d1da9f.1214852681@elm3b41.beaverton.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-01 03:04:41: > # HG changeset patch > # User Kaitlin Rupert > # Date 1214852675 25200 > # Node ID 7d3d5dcffad210d1da9f208ce1881f391a21ba9e > # Parent 692121d37b3aefafce0d6856d81468add629514d > [TEST] Some VirtualSystemManagementService -t 02_destroysystem.py cleanup. > > Add checks to see if the define() / start() calls pass. > Added cleanup_env() function to destroy()/undefine() guest in case of error. > Ensure status is set to PASS only if the guest is not found in the > domain list after the DestroySystem() call is made. > > Signed-off-by: Kaitlin Rupert > > diff -r 692121d37b3a -r 7d3d5dcffad2 suites/libvirt- > cim/cimtest/VirtualSystemManagementService/02_destroysystem.py > --- a/suites/libvirt- > cim/cimtest/VirtualSystemManagementService/02_destroysystem.py Mon > Jun 30 09:58:36 2008 -0700 > +++ b/suites/libvirt- > cim/cimtest/VirtualSystemManagementService/02_destroysystem.py Mon > Jun 30 12:04:35 2008 -0700 > @@ -35,47 +35,53 @@ > sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > default_dom = 'test_domain' > > +def cleanup_env(ip, cxml): > + cxml.destroy(ip) > + cxml.undefine(ip) > + > @do_main(sup_types) > def main(): > options = main.options > > service = vsms.get_vsms_class(options.virt)(options.ip) > cxml = vxml.get_class(options.virt)(default_dom) > - cxml.define(options.ip) > - cxml.start(options.ip) > + ret = cxml.define(options.ip) > + if not ret: > + logger.error("Failed to define the dom: %s", default_dom) > + return FAIL > + ret = cxml.start(options.ip) > + if not ret: > + logger.error("Failed to define the dom: %s", default_dom) It's better to log the error as "logger.error("Failed to create(or start) the dom: %s", default_dom)", which more reflect the actual failure. > + cleanup_env(options.ip, cxml) > + return FAIL > > classname = get_typed_class(options.virt, 'ComputerSystem') > cs_ref = CIMInstanceName(classname, keybindings = { > 'Name':default_dom, > 'CreationClassName':classname}) > list_before = domain_list(options.ip, options.virt) > - status = PASS > - rc = -1 > + if default_dom not in list_before: > + logger.error("Domain not in domain list") > + cleanup_env(options.ip, cxml) > + return FAIL > > try: > service.DestroySystem(AffectedSystem=cs_ref) > - rc = 0 > except Exception, details: > logger.error('Unknow exception happened') > logger.error(details) > - status = FAIL > + cleanup_env(options.ip, cxml) > + return FAIL > > list_after = domain_list(options.ip, options.virt) > > - status = PASS > - if default_dom not in list_before: > - logger.error("Domain not started, check config") > + if default_dom in list_after: > + logger.error("Domain %s not destroyed: provider didn't > return error" % \ > + default_dom) > + cleanup_env(options.ip, cxml) > status = FAIL > else: > - destroyed = set(list_before) - set(list_after) > - if len(destroyed) != 1: > - logger.error("Destroyed multiple domains") > - status = FAIL > - elif default_dom not in destroyed: > - logger.error("Wrong domain destroyed") > - status = FAIL > - > - cxml.undefine(options.ip) > + status = PASS > > return status > > > _______________________________________________ > 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 Jul 1 03:12:39 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 1 Jul 2008 11:12:39 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] Fix VirtualSystemSettingDataComponent - 01_forward.py failure In-Reply-To: <5f49d1d08e8e7f9b905e.1214856260@elm3b41.beaverton.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-01 04:04:20: > # HG changeset patch > # User Kaitlin Rupert > # Date 1214856251 25200 > # Node ID 5f49d1d08e8e7f9b905ef77d1a43e4b54917bd03 > # Parent 7d3d5dcffad210d1da9f208ce1881f391a21ba9e > [TEST] Fix VirtualSystemSettingDataComponent - 01_forward.py failure. > > Test was expecting one ProcRASD for each domain processor. It should > expect onky one RASD. > > Also updated this test to use PASS/FAIL, removed global variables, > and cleaned up indention. > > This test will need to be updated to support other XenFV, etc. > > Signed-off-by: Kaitlin Rupert > > diff -r 7d3d5dcffad2 -r 5f49d1d08e8e suites/libvirt- > cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py > --- a/suites/libvirt- > cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Mon > Jun 30 12:04:35 2008 -0700 > +++ b/suites/libvirt- > cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Mon > Jun 30 13:04:11 2008 -0700 > @@ -58,6 +58,7 @@ > from CimTest import Globals > from XenKvmLib import assoc > from CimTest.Globals import logger, do_main > +from CimTest.ReturnCodes import FAIL, PASS > > sup_types = ['Xen'] > > @@ -67,35 +68,30 @@ > test_disk = 'xvda' > status = 0 > VSType = "Xen" > -vssd_names = [] > -vssd_values = [] > > -RASD_cllist = [ > - 'Xen_DiskResourceAllocationSettingData', \ > - 'Xen_MemResourceAllocationSettingData', \ > - 'Xen_NetResourceAllocationSettingData', \ > - 'Xen_ProcResourceAllocationSettingData' > - ] > - > def init_list(): > """ > Creating the lists that will be used for comparisons. > """ > - prop_list = [] > - prop_list = ["%s/%s" % (test_dom, test_disk), \ > - "%s/%s" % (test_dom, "mem"), \ > - "%s/%s" % (test_dom, test_mac) > - ] > - proc_list = [] > - for i in range(test_vcpus): > - proc_list.append("%s/%s" % (test_dom, i)) > - return prop_list, proc_list > + > + rlist = ['Xen_DiskResourceAllocationSettingData', > + 'Xen_MemResourceAllocationSettingData', > + 'Xen_NetResourceAllocationSettingData', > + 'Xen_ProcResourceAllocationSettingData' > + ] > + > + prop_list = {rlist[0] : "%s/%s" % (test_dom, test_disk), > + rlist[1] : "%s/%s" % (test_dom, "mem"), > + rlist[2] : "%s/%s" % (test_dom, test_mac), > + rlist[3] : "%s/%s" % (test_dom, "proc") > + } > + > + return prop_list > > def build_vssd_info(ip, vssd): > """ > Creating the vssd fileds lists that will be used for comparisons. > """ > - global vssd_names, vssd_values > > if vssd.Bootloader == "" or vssd.Caption == "" or \ > vssd.InstanceID == "" or vssd.ElementName == "" or \ > @@ -105,26 +101,17 @@ > test_domain_function(test_dom, ip, "undefine") > sys.exit(status) > > - vssd_names = [ > - 'Bootloader', \ > - 'Caption', \ > - 'InstanceID', \ > - 'ElementName', \ > - 'VirtualSystemIdentifier', \ > - 'VirtualSystemType', \ > - ] > - > - vssd_values = [ > - vssd.Bootloader, \ > - vssd.Caption, \ > - vssd.InstanceID, \ > - vssd.ElementName, \ > - vssd.VirtualSystemIdentifier, \ > - vssd.VirtualSystemType, \ > - ] > + vssd_vals = {'Bootloader' : vssd.Bootloader, > + 'Caption' : vssd.Caption, > + 'InstanceID' : vssd.InstanceID, > + 'ElementName' : vssd.ElementName, > + 'VirtualSystemIdentifier' : vssd.VirtualSystemIdentifier, > + 'VirtualSystemType' : vssd.VirtualSystemType > + } > > + return vssd_vals > You can also update the status setting in build_vssd_info(ip, vssd) function. Below is the code detail to update: - status = 1 test_domain_function(test_dom, ip, "undefine") - sys.exit(status) + return FAIL > -def assoc_values(ip, assoc_info, cn): > +def assoc_values(ip, assoc_info, cn, an, vals): > """ > The association info of > Xen_VirtualSystemSettingDataComponent with every RASDclass is > @@ -132,36 +119,29 @@ > Caption, InstanceID, ElementName, VirtualSystemIdentifier, > VirtualSystemType, Bootloader > """ > - global status > - global vssd_names, vssd_values > > try: > if len(assoc_info) != 1: > - Globals.logger.error("Xen_VirtualSystemSettingDataComponent \ > -returned %i Resource objects for class '%s'", len(assoc_info),cn) > - status = 1 > - return status > + Globals.logger.error("%s returned %i resource objects > for '%s'" % \ > + (an, len(assoc_info), cn)) > + return FAIL > > - for idx in range(len(vssd_names)): > - if assoc_info[0][vssd_names[idx]] != vssd_values[idx]: > - Globals.logger.error("%s Mismatch", vssd_names[idx]) > - Globals.logger.error("Returned %s instead of %s", \ > - assoc_info[0][vssd_names[idx]], \ > - vssd_fields[idx]) > - status = 1 > - if status != 0: > - break > + for prop, val in vals.iteritems(): > + if assoc_info[0][prop] != val: > + Globals.logger.error("%s mismatch: returned %s > instead of %s" %\ > + (prop, assoc_info[0][prop], val)) > + return FAIL > + > + return PASS > + > except Exception, detail : > logger.error("Exception in assoc_values function: %s" % detail) > - status = 1 > - test_domain_function(test_dom, ip, "undefine") > - return status > - > + return FAIL > > @do_main(sup_types) > def main(): > options = main.options > - global status > + status = FAIL > > destroy_and_undefine_all(options.ip) > test_xml = testxml_bl(test_dom, vcpus = test_vcpus, \ > @@ -171,9 +151,7 @@ > ret = test_domain_function(test_xml, options.ip, cmd = "define") > if not ret: > logger.error("Failed to define the dom: %s", test_dom) > - status = 1 > - return status > - > + return FAIL > > instIdval = "%s:%s" % (VSType, test_dom) > keyname = "InstanceID" > @@ -183,48 +161,39 @@ > vssd = enumclass.getInstance(options.ip, \ > enumclass.Xen_VirtualSystemSettingData, \ > key_list) > - build_vssd_info(options.ip, vssd) > + if vssd is None: > + logger.error("VSSD instance for %s not found" % test_dom) > + test_domain_function(test_dom, options.ip, "undefine") > + return FAIL > + > + vssd_vals = build_vssd_info(options.ip, vssd) > > except Exception, detail : > logger.error(Globals.CIM_ERROR_GETINSTANCE, \ > - 'Xen_VirtualSystemSettingData') > + 'Xen_VirtualSystemSettingData') > logger.error("Exception : %s" % detail) > test_domain_function(test_dom, options.ip, "undefine") > - status = 1 > - return status > + return FAIL > > - prop_list, proc_list = init_list() > + prop_list = init_list() > > try: > - idx = 0 > - # Looping through the RASD_cllist, call association > - # Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist > - for rasd_cname in RASD_cllist: > - if rasd_cname != 'Xen_ProcResourceAllocationSettingData': > - assoc_info = assoc.Associators(options.ip, \ > - > 'Xen_VirtualSystemSettingDataComponent', \ > - > rasd_cname, \ > - InstanceID = > prop_list[idx]) > - # Verify the association fields returned for > particular rasd_cname. > - assoc_values(options.ip, assoc_info, rasd_cname) > - idx = idx + 1 > - else: > - # Xen_ProcResourceAllocationSettingData, we need to find > - # association information for all the proc InstanceID and hence > - # we loop from 0 to (test_vcpus - 1 ) > - for index in range(len(proc_list)): > - assoc_info = assoc.Associators(options.ip, \ > - > 'Xen_VirtualSystemSettingDataComponent', \ > - > rasd_cname, \ > - InstanceID = > prop_list[index]) > + # Looping through the RASD_cllist, call association > + # Xen_VirtualSystemSettingDataComponent with each class in > RASD_cllist > + an = 'Xen_VirtualSystemSettingDataComponent' > + for rasd_cname, prop in prop_list.iteritems(): > + assoc_info = assoc.Associators(options.ip, an, rasd_cname, > + InstanceID = prop) > # Verify the association fields returned for particular > rasd_cname. > - assoc_values(options.ip, assoc_info, rasd_cname) > + status = assoc_values(options.ip, assoc_info, rasd_cname, an, > + vssd_vals) > + if status != PASS: > + break > > except Exception, detail : > - logger.error(Globals.CIM_ERROR_ASSOCIATORS, \ > - > 'Xen_VirtualSystemSettingDataComponent') > + logger.error(Globals.CIM_ERROR_ASSOCIATORS, an) > logger.error("Exception : %s" % detail) > - status = 1 > + status = FAIL > > test_domain_function(test_dom, options.ip, "undefine") > return status > > _______________________________________________ > 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 Tue Jul 1 06:08:23 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 30 Jun 2008 23:08:23 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fixing the ComputerSystem tc's Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1214892426 25200 # Node ID cc7716fa4252235924577a0e9bb16c89fc55870b # Parent 0c3bd5f782c4776719799ad5c74226c95e70092e [TEST] #2 Fixing the ComputerSystem tc's. Changes: ------- Patch 2: ------- 1) Removed the bug no 00001. 2) Removed the XFAIL_RC associated with bug 00001. Patch 1: -------- Updated the tc to report XFAIL since the tc are failing as the requested_state property is not being set appropriately. Signed-off-by: Deepti B. Kalakeri diff -r 0c3bd5f782c4 -r cc7716fa4252 suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py Fri Jun 27 09:57:11 2008 +0800 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py Mon Jun 30 23:07:06 2008 -0700 @@ -52,7 +52,7 @@ ACTIVE_STATE = 2 ACTIVE_STATE = 2 SUSPND_STATE = 9 -bug = "00001" +bug_req_state = "00002" default_dom = 'test_domain' TIME = "00000000000000.000000:000" @@ -61,13 +61,15 @@ def check_attributes(domain_name, ip, en if rc != 0: return rc if cs.RequestedState != rq_state: - logger.error("RequestedState should be %d not %d", \ + logger.error("RequestedState should be %d not %d", rq_state, cs.RequestedState) - return FAIL + return XFAIL_RC(bug_req_state) + if cs.EnabledState != en_state: - logger.error("EnabledState should be %d not %d", \ + logger.error("EnabledState should be %d not %d", en_state, cs.EnabledState) return FAIL + return PASS @do_main(sup_types) @@ -97,7 +99,6 @@ def main(): if status != PASS: logger.error("Unable to %s dom %s using \ RequestedStateChange()", action, default_dom) - status = XFAIL_RC(bug) break # FIX ME @@ -106,8 +107,8 @@ RequestedStateChange()", action, default status = check_attributes(default_dom, options.ip, en_state, rq_state, options.virt) if status != PASS: - logger.error("Attributes for dom %s not set as expected.", \ - default_dom) + logger.error("Attributes for dom %s not set as expected.", + default_dom) break except Exception, detail: diff -r 0c3bd5f782c4 -r cc7716fa4252 suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py Fri Jun 27 09:57:11 2008 +0800 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py Mon Jun 30 23:07:06 2008 -0700 @@ -51,7 +51,7 @@ ACTIVE_STATE = 2 ACTIVE_STATE = 2 REBOOT_STATE = 10 -bug = "00001" +bug_req_state = "00002" default_dom = 'test_domain' TIME = "00000000000000.000000:000" @@ -60,13 +60,15 @@ def check_attributes(domain_name, ip, en if rc != 0: return rc if cs.RequestedState != rq_state: - logger.error("RequestedState should be %d not %d", \ + logger.error("RequestedState should be %d not %d", rq_state, cs.RequestedState) - return FAIL + return XFAIL_RC(bug_req_state) + if cs.EnabledState != en_state: - logger.error("EnabledState should be %d not %d", \ + logger.error("EnabledState should be %d not %d", en_state, cs.EnabledState) return FAIL + return PASS @do_main(sup_types) @@ -96,7 +98,6 @@ def main(): if status != PASS: logger.error("Unable to %s dom %s using \ RequestedStateChange()", action, default_dom) - status = XFAIL_RC(bug) break # FIX ME @@ -105,8 +106,8 @@ RequestedStateChange()", action, default status = check_attributes(default_dom, options.ip, en_state, rq_state, options.virt) if status != PASS: - logger.error("Attributes for dom %s not set as expected.", \ - default_dom) + logger.error("Attributes for dom %s not set as expected.", + default_dom) break except Exception, detail: diff -r 0c3bd5f782c4 -r cc7716fa4252 suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py Fri Jun 27 09:57:11 2008 +0800 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py Mon Jun 30 23:07:06 2008 -0700 @@ -54,7 +54,7 @@ SUSPND_STATE = 9 SUSPND_STATE = 9 REBOOT_STATE = 10 -bug = "00001" +bug_req_state = "00002" default_dom = 'test_domain' TIME = "00000000000000.000000:000" @@ -63,13 +63,15 @@ def check_attributes(domain_name, ip, en if rc != 0: return rc if cs.RequestedState != rq_state: - logger.error("RequestedState should be %d not %d", \ + logger.error("RequestedState should be %d not %d", rq_state, cs.RequestedState) - return FAIL + return XFAIL_RC(bug_req_state) + if cs.EnabledState != en_state: - logger.error("EnabledState should be %d not %d", \ + logger.error("EnabledState should be %d not %d", en_state, cs.EnabledState) return FAIL + return PASS @do_main(sup_types) @@ -100,7 +102,6 @@ def main(): if status != PASS: logger.error("Unable to %s dom %s using \ RequestedStateChange()", action, default_dom) - status = XFAIL_RC(bug) break # FIX ME @@ -109,8 +110,8 @@ RequestedStateChange()", action, default status = check_attributes(default_dom, options.ip, en_state, rq_state, options.virt) if status != PASS: - logger.error("Attributes for dom %s not set as expected.", \ - default_dom) + logger.error("Attributes for dom %s not set as expected.", + default_dom) break except Exception, detail: diff -r 0c3bd5f782c4 -r cc7716fa4252 suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py Fri Jun 27 09:57:11 2008 +0800 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py Mon Jun 30 23:07:06 2008 -0700 @@ -52,7 +52,7 @@ ACTIVE_STATE = 2 ACTIVE_STATE = 2 RESET_STATE = 11 -bug = "00001" +bug_req_state = "00002" default_dom = 'test_domain' TIME = "00000000000000.000000:000" @@ -61,13 +61,15 @@ def check_attributes(domain_name, ip, en if rc != 0: return rc if cs.RequestedState != rq_state: - logger.error("RequestedState should be %d not %d", \ + logger.error("RequestedState should be %d not %d", rq_state, cs.RequestedState) - return FAIL + return XFAIL_RC(bug_req_state) + if cs.EnabledState != en_state: - logger.error("EnabledState should be %d not %d", \ + logger.error("EnabledState should be %d not %d", en_state, cs.EnabledState) return FAIL + return PASS @do_main(sup_types) @@ -97,7 +99,6 @@ def main(): if status != PASS: logger.error("Unable to %s dom %s using \ RequestedStateChange()", action, default_dom) - status = XFAIL_RC(bug) break # FIX ME @@ -106,8 +107,8 @@ RequestedStateChange()", action, default status = check_attributes(default_dom, options.ip, en_state, rq_state, options.virt) if status != PASS: - logger.error("Attributes for dom %s not set as expected.", \ - default_dom) + logger.error("Attributes for dom %s not set as expected.", + default_dom) break except Exception, detail: From deeptik at linux.vnet.ibm.com Tue Jul 1 06:20:02 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 01 Jul 2008 11:50:02 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing the ComputerSystem tc's In-Reply-To: <4868F442.3020007@linux.vnet.ibm.com> References: <197ecb3db922d841a2cd.1214830410@elm3b217.beaverton.ibm.com> <4868F442.3020007@linux.vnet.ibm.com> Message-ID: <4869CC92.80001@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Deepti B. Kalakeri wrote: >> # HG changeset patch >> # User Deepti B. Kalakeri >> # Date 1214830309 25200 >> # Node ID 197ecb3db922d841a2cdfbcdec5a4bf149dddc83 >> # Parent 0c3bd5f782c4776719799ad5c74226c95e70092e >> [TEST] Fixing the ComputerSystem tc's. >> >> Updated the tc to report XFAIL since the tc are failing as the >> requested_state property is not being set appropriately. >> >> Signed-off-by: Deepti B. Kalakeri >> >> diff -r 0c3bd5f782c4 -r 197ecb3db922 >> suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py >> --- a/suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py >> Fri Jun 27 09:57:11 2008 +0800 >> +++ b/suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py >> Mon Jun 30 05:51:49 2008 -0700 >> @@ -52,7 +52,8 @@ ACTIVE_STATE = 2 >> ACTIVE_STATE = 2 >> SUSPND_STATE = 9 >> >> -bug = "00001" >> +bug = "00001" >> +bug_req_state = "00002" > > For each of these tests, can you also remove the XFAIL for the 00001 > bug case. And can you also remove the corresponding XFAIL call. I > don't think tests should be failing for that bug anymore. > > Thanks! > Done. Thanks, Deepti. >> default_dom = 'test_domain' >> TIME = "00000000000000.000000:000" >> >> @@ -61,13 +62,15 @@ def check_attributes(domain_name, ip, en >> if rc != 0: >> return rc >> if cs.RequestedState != rq_state: >> - logger.error("RequestedState should be %d not %d", \ >> + logger.error("RequestedState should be %d not %d", rq_state, >> cs.RequestedState) >> - return FAIL >> + return XFAIL_RC(bug_req_state) >> + >> if cs.EnabledState != en_state: >> - logger.error("EnabledState should be %d not %d", \ >> + logger.error("EnabledState should be %d not %d", en_state, >> cs.EnabledState) >> return FAIL >> + >> return PASS >> >> @do_main(sup_types) >> @@ -106,8 +109,8 @@ RequestedStateChange()", action, default >> status = check_attributes(default_dom, options.ip, >> en_state, rq_state, options.virt) >> if status != PASS: >> - logger.error("Attributes for dom %s not set as expected.", \ >> - default_dom) >> + logger.error("Attributes for dom %s not set as expected.", + >> default_dom) >> break >> > > From deeptik at linux.vnet.ibm.com Tue Jul 1 15:16:24 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 01 Jul 2008 08:16:24 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing the 06_paused_active_suspend.py tc of ComputerSystem Message-ID: <16bbf4d2f48e04334471.1214925384@elm3b217.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1214925380 25200 # Node ID 16bbf4d2f48e04334471805a524cfb653a391dd8 # Parent cc7716fa4252235924577a0e9bb16c89fc55870b [TEST] Fixing the 06_paused_active_suspend.py tc of ComputerSystem. 1) Updated the tc to use the poll_for_state_change() function. 2) Included the get_state_values() functions that returns the enable_state, req_state values. 3) Included the extra sleep bcs sometimes the provider is not able to suspend the domain immediately even though the enable_state is set to 2 and hence the tc was failing intermittently. 4) Removed cxml.undefine() call since it was not req. 5) Fixed Indentation. Signed-off-by: Deepti B. Kalakeri ~ diff -r cc7716fa4252 -r 16bbf4d2f48e suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py Mon Jun 30 23:07:06 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py Tue Jul 01 08:16:20 2008 -0700 @@ -55,6 +55,7 @@ def main(): raise Exception('No cs instance returned') for dom in cs: if dom.Name == test_dom: + Globals.logger.error("Deepti %s", dom.Name) enabState = dom.EnabledState status = PASS break diff -r cc7716fa4252 -r 16bbf4d2f48e suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py Mon Jun 30 23:07:06 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py Tue Jul 01 08:16:20 2008 -0700 @@ -48,103 +48,97 @@ from XenKvmLib.test_doms import destroy_ from XenKvmLib.test_doms import destroy_and_undefine_all from CimTest.Globals import logger from CimTest.Globals import do_main -from XenKvmLib.common_util import call_request_state_change +from XenKvmLib.common_util import call_request_state_change, \ +poll_for_state_change from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC sup_types = ['Xen', 'KVM', 'XenFV'] test_dom = "DomST1" mem = 128 # MB -# Keeping the bug no for future reference -# bug_no_req_change_method = "90559" bug_no_req_change_prop = "00002" START_STATE = 2 FINAL_STATE = 9 REQUESTED_STATE = FINAL_STATE TIME = "00000000000000.000000:000" +def get_state_values(server, virt): + enable_state = req_state = None + try: + cs = computersystem.get_cs_class(virt)(server, test_dom) + if cs.Name == test_dom: + enable_state = cs.EnabledState + req_state = cs.RequestedState + else: + logger.error("ERROR: VS %s not found" % test_dom) + except Exception, detail: + logger.error("Exception variable: %s" % detail) + return enable_state, req_state + @do_main(sup_types) def main(): options = main.options status = FAIL + server = options.ip + virt = options.virt - cxml = vxml.get_class(options.virt)(test_dom, mem) + cxml = vxml.get_class(virt)(test_dom, mem) -#Create VS + #Create VS try: - ret = cxml.create(options.ip) + ret = cxml.create(server) if not ret: logger.error("ERROR: VS %s was not created" % test_dom) return status - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) - if cs.Name == test_dom: - from_State = cs.EnabledState - else: - logger.error("ERROR: VS %s not found" % test_dom) - return status - except Exception, detail: - logger.error("Exception variable: %s" % detail) - cxml.destroy(options.ip) - cxml.undefine(options.ip) - return status - -#Suspend the VS - 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 = poll_for_state_change(server, virt, test_dom, + START_STATE) + from_State, req_state = get_state_values(server, virt) - 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 or from_State == None or req_state == None: + cxml.destroy(server) + return status + + sleep(10) + #Suspend the VS + status = call_request_state_change(test_dom, server, REQUESTED_STATE, + TIME, virt) if status != PASS: - ret = cxml.destroy(options.ip) - cxml.undefine(options.ip) + logger.error("Unable to suspend dom %s using RequestedStateChange()", + test_dom) + cxml.destroy(server) return status -# Success: -# if -# From state == 9 -# To state == 2 -# Enabled_state == RequestedState + #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. + status = poll_for_state_change(server, virt, test_dom, + FINAL_STATE, timeout=40) + enabledState, to_RequestedState = get_state_values(server, virt) + + if status != PASS or enabledState == None or to_RequestedState == None: + ret = cxml.destroy(server) + return status + + # Success: + # if + # From state == 9 + # To state == 2 + # Enabled_state == 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 \ - was not Successful" % test_dom) + logger.error("VS %s transition from Suspend State to Activate State" + " was not Successful" % test_dom) # Replace the status with FAIL once the bug is fixed. status = XFAIL_RC(bug_no_req_change_prop) - ret = cxml.destroy(options.ip) - cxml.undefine(options.ip) + + ret = cxml.destroy(server) return status - if __name__ == "__main__": sys.exit(main()) From kaitlin at linux.vnet.ibm.com Tue Jul 1 16:48:02 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 09:48:02 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] Indications for state changes In-Reply-To: References: Message-ID: <486A5FC2.6040805@linux.vnet.ibm.com> Dan Smith wrote: > This set: > - Makes domain state an explicit factor in the dom_changed() determination > for CSI > - Makes CS trigger CSI on state change to avoid waiting for the loop > - Fixes up registration of KVM_ and LXC_ CSI variants > +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Tue Jul 1 18:25:44 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 01 Jul 2008 11:25:44 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [CU] Report disabled indications In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1214936716 25200 # Node ID fa42fd637a89653873eb0039e8fadf834228f4bd # Parent 943ae9ae775336ee6cf5a8116eaae069d0bfe5fc [CU] Report disabled indications Make sure we always return a valid status object so that we can actually tell from the caller if the indication was delivered or not. Signed-off-by: Dan Smith diff -r 943ae9ae7753 -r fa42fd637a89 std_indication.c --- a/std_indication.c Tue May 20 10:30:32 2008 -0700 +++ b/std_indication.c Tue Jul 01 11:25:16 2008 -0700 @@ -167,6 +167,7 @@ cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, "Couldn't get indication name for enable check."); + goto out; } enabled = is_ind_enabled(args->_ctx, ind_name, &s); @@ -175,8 +176,16 @@ goto out; } + CU_DEBUG("Indication %s is%s enabled", + ind_name, + enabled ? "" : " not"); + if (enabled) s = CBDeliverIndication(broker, ctx, args->ns, ind); + else + cu_statusf(broker, &s, + CMPI_RC_ERR_METHOD_NOT_AVAILABLE, + "Indication not enabled"); out: return s; From danms at us.ibm.com Tue Jul 1 18:25:45 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 01 Jul 2008 11:25:45 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [CU] Fix indication_tester.py to pass a scheme in the destination In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1214936717 25200 # Node ID ef4c4ae1217b6f8e0f284178e6674ce3c9322f15 # Parent fa42fd637a89653873eb0039e8fadf834228f4bd [CU] Fix indication_tester.py to pass a scheme in the destination Signed-off-by: Dan Smith diff -r fa42fd637a89 -r ef4c4ae1217b tools/indication_tester.py --- a/tools/indication_tester.py Tue Jul 01 11:25:16 2008 -0700 +++ b/tools/indication_tester.py Tue Jul 01 11:25:17 2008 -0700 @@ -81,7 +81,7 @@ %sHandler - localhost:%i + http://localhost:%i From danms at us.ibm.com Tue Jul 1 18:25:43 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 01 Jul 2008 11:25:43 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [CU] Indication-related fixes Message-ID: Changes detailed per patch From kaitlin at linux.vnet.ibm.com Tue Jul 1 19:10:02 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 12:10:02 -0700 Subject: [Libvirt-cim] [PATCH] Fix CSI failure path In-Reply-To: <02aaaea433146ad4f6dc.1214857696@guaranine.danplanet.com> References: <02aaaea433146ad4f6dc.1214857696@guaranine.danplanet.com> Message-ID: <486A810A.2070206@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1214857687 25200 > # Node ID 02aaaea433146ad4f6dc5c63b34701bc46567fb4 > # Parent f72441bf10fdd467d3f47d33e4bfb29537cc53e1 > Fix CSI failure path > > Since connect_by_classname() can return NULL without it being an > error condition, printing the status message is not valid unless you > check the s.rc field. I don't think the message adds much here, since there > is only one place that the message is filled out, and it's a static string. > Instead, change the debug message to something useful to avoid the SEGV. > > Signed-off-by: Dan Smith > > diff -r f72441bf10fd -r 02aaaea43314 src/Virt_ComputerSystemIndication.c +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 1 19:09:23 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 12:09:23 -0700 Subject: [Libvirt-cim] [PATCH] Remove explicit "Xen" from VSMS indication trigger In-Reply-To: References: Message-ID: <486A80E3.2080300@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1214856741 25200 > # Node ID f72441bf10fdd467d3f47d33e4bfb29537cc53e1 > # Parent 834563d8520b1876d99bf579cc3319b1dfa09795 > Remove explicit "Xen" from VSMS indication trigger > > Signed-off-by: Dan Smith > > diff -r 834563d8520b -r f72441bf10fd src/Virt_VirtualSystemManagementService.c +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 1 19:11:23 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 12:11:23 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [CU] Indication-related fixes In-Reply-To: References: Message-ID: <486A815B.3030900@linux.vnet.ibm.com> Dan Smith wrote: > Changes detailed per patch > +1 I can follow up with a test that patches the indication_tester related code in cimtest. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Tue Jul 1 19:26:21 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 01 Jul 2008 12:26:21 -0700 Subject: [Libvirt-cim] [PATCH] Add state transition poll to DestroySystem() call In-Reply-To: <98e6e7b6160be701c412.1214852744@elm3b41.beaverton.ibm.com> (Kaitlin Rupert's message of "Mon, 30 Jun 2008 12:05:44 -0700") References: <98e6e7b6160be701c412.1214852744@elm3b41.beaverton.ibm.com> Message-ID: <87wsk51k4i.fsf@caffeine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1214850941 25200 KR> # Node ID 98e6e7b6160be701c4124cb04eef9c893fdfaa1d KR> # Parent b123b6b1fb08c3ab956f1c33801e743e082192b9 KR> Add state transition poll to DestroySystem() call. Sorry for the delay here... KR> +#define STATE_TRANSITION_TIMEOUT 120 First off, 120 seconds is sure to be longer than the CIM timeout, so if the call really lasts this long, the client will get a timeout. I think it's probably reasonable to expect that after a destroy(), the undefine() would happen before the domain could really be pulled offline. However, 120 seconds should be considered "something is wrong and the domain isn't going away" IMHO. If you think that 120 seconds is necessary (and reasonable), then we need to check for online-ness, and start a job to do this in that case. KR> + for (i = 0; i < STATE_TRANSITION_TIMEOUT; i++) { KR> + if ((i % 30) == 0) { KR> + CU_DEBUG("Polling for destroy completion..."); KR> + } KR> + KR> + dom = virDomainLookupByName(conn, dom_name); KR> + if (dom == NULL) { KR> + CU_DEBUG("Domain successfully destroyed"); KR> + rc = IM_RC_OK; KR> + trigger_indication(context, KR> + "ComputerSystemDeletedIndication", KR> + NAMESPACE(reference)); KR> + goto error; KR> + } KR> + KR> + if (virDomainGetInfo(dom, &info) != 0) { KR> + CU_DEBUG("Unable to get domain current state"); KR> + rc = IM_RC_SYS_NOT_FOUND; KR> + goto error; KR> + } KR> + KR> + if (info.state == VIR_DOMAIN_SHUTOFF) KR> + break; KR> + We have domain_online() which does (effectively) the same thing (but more concisely) and is considered to be the test for online-ness of a domain elsewhere. Any reason not to use that 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 kaitlin at linux.vnet.ibm.com Tue Jul 1 19:33:50 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 12:33:50 -0700 Subject: Fw: [Fwd: [Libvirt-cim] [PATCH] [TEST] A few migration related fixes] In-Reply-To: References: Message-ID: <486A869E.1030206@linux.vnet.ibm.com> > > - destroy_and_undefine_domain(dom_name, options.ip) > > + destroy_and_undefine_domain(dom_name, options.ip) > > > > return status > > > Do you think we should also to call destroy_and_undefine_domain() > below based > on your patch? > > status, cs_ref = start_guest_get_ref(options.ip, dom_name) > if status != PASS: > + destroy_and_undefine_domain(dom_name, options.ip) > return FAIL > start_guest_get_ref() calls destroy_and_undefine_domain() if an exception is encountered. This is also the only place the FAIL status is set in start_guest_get_ref(). However, the error checking in start_guest_get_ref() could be improved, so I'll resend. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Tue Jul 1 19:47:24 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 01 Jul 2008 12:47:24 -0700 Subject: [Libvirt-cim] [PATCH] Reduce the non-CIM cycle timer from 3 minutes to 1 minute Message-ID: # HG changeset patch # User Dan Smith # Date 1214941641 25200 # Node ID e41428ac70e85d4cecc5fd0738680fc11de5e775 # Parent 117ae7952d7264c64a3abbf236cf18758ae0200d Reduce the non-CIM cycle timer from 3 minutes to 1 minute Signed-off-by: Dan Smith diff -r 117ae7952d72 -r e41428ac70e8 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Tue Jul 01 12:47:21 2008 -0700 +++ b/src/Virt_ComputerSystemIndication.c Tue Jul 01 12:47:21 2008 -0700 @@ -56,7 +56,7 @@ static pthread_mutex_t lifecycle_mutex = PTHREAD_MUTEX_INITIALIZER; static bool lifecycle_enabled = 0; -#define WAIT_TIME 180 +#define WAIT_TIME 60 #define FAIL_WAIT_TIME 2 struct dom_xml { From danms at us.ibm.com Tue Jul 1 19:47:44 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 01 Jul 2008 12:47:44 -0700 Subject: [Libvirt-cim] [PATCH] Report failure to deliver indication Message-ID: # HG changeset patch # User Dan Smith # Date 1214941651 25200 # Node ID cb343a986592c25c487c53042ad889fa24ea9d97 # Parent e41428ac70e85d4cecc5fd0738680fc11de5e775 Report failure to deliver indication Signed-off-by: Dan Smith diff -r e41428ac70e8 -r cb343a986592 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Tue Jul 01 12:47:21 2008 -0700 +++ b/src/Virt_ComputerSystemIndication.c Tue Jul 01 12:47:31 2008 -0700 @@ -240,8 +240,12 @@ CU_DEBUG("Delivering Indication: %s", CMGetCharPtr(CMObjectPathToString(ind_op, NULL))); - stdi_deliver(broker, ctx, args, ind); - CU_DEBUG("Delivered"); + s = stdi_deliver(broker, ctx, args, ind); + if (s.rc == CMPI_RC_OK) { + CU_DEBUG("Indication delivered"); + } else { + CU_DEBUG("Not delivered: %s", CMGetCharPtr(s.msg)); + } out: return ret; From kaitlin at linux.vnet.ibm.com Tue Jul 1 20:39:25 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 13:39:25 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 A few migration related fixes Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1214942997 25200 # Node ID da0aebe9e441c2a0020fad9d063c489026eee2b2 # Parent 0c3bd5f782c4776719799ad5c74226c95e70092e [TEST] #2 A few migration related fixes. Fixes: -Remove destroy_and_undefine_domain() call from migrate_guest_to_host(). This call takes the domain name as a parameter, but migrate_guest_to_host() doesn't take the domain name So calling destroy_and_undefine_domain() resulted in an error. -Add a hack to get_typed_class() so it supports Virt_MigrationJob (which doesn't fit the typical _ pattern. Updates from 1 to 2: -Improve error catching / reporting in start_guest_get_ref() Signed-off-by: Kaitlin Rupert diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Fri Jun 27 09:57:11 2008 +0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Tue Jul 01 13:09:57 2008 -0700 @@ -42,19 +42,26 @@ def start_guest_get_ref(ip, guest_name): try: xmlfile = testxml(guest_name) - define_test_domain(xmlfile, ip) + ret = define_test_domain(xmlfile, ip) + if not ret: + return FAIL, None - start_test_domain(guest_name, ip) + ret = start_test_domain(guest_name, ip) + if not ret: + return FAIL, None + time.sleep(10) except Exception: logger.error("Error creating domain %s" % guest_name) - destroy_and_undefine_domain(guest_name, options.ip) return FAIL, None classname = 'Xen_ComputerSystem' cs_ref = CIMInstanceName(classname, keybindings = { 'Name':guest_name, 'CreationClassName':classname}) + + if cs_ref is None: + return FAIL, None return PASS, cs_ref @@ -80,6 +87,7 @@ status, cs_ref = start_guest_get_ref(options.ip, dom_name) if status != PASS: + destroy_and_undefine_domain(guest_name, options.ip) return FAIL guest_name = cs_ref['Name'] @@ -90,10 +98,10 @@ return FAIL status, ret = migrate_guest_to_host(service, cs_ref, target_ip) - if status == FAIL: logger.error("MigrateVirtualSystemToHost: unexpected list length %s" % len(ret)) + destroy_and_undefine_domain(dom_name, options.ip) return status elif len(ret) == 2: id = ret[1]['Job'].keybindings['InstanceID'] @@ -102,7 +110,7 @@ guest_name, local_migrate) - destroy_and_undefine_domain(dom_name, options.ip) + destroy_and_undefine_domain(dom_name, options.ip) return status diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Fri Jun 27 09:57:11 2008 +0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Tue Jul 01 13:09:57 2008 -0700 @@ -145,12 +145,11 @@ logger.info("Migrating guest with the following options:") logger.info("%s" % item) - status, ret = migrate_guest_to_host(service, cs_ref, target_ip, - item) - + status, ret = migrate_guest_to_host(service, cs_ref, target_ip, item) if status == FAIL: logger.error("MigrateVirtualSystemToHost: unexpected list length %s" % len(ret)) + destroy_and_undefine_domain(dom_name, options.ip) return status elif len(ret) == 2: id = ret[1]['Job'].keybindings['InstanceID'] diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt-cim/lib/XenKvmLib/classes.py --- a/suites/libvirt-cim/lib/XenKvmLib/classes.py Fri Jun 27 09:57:11 2008 +0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/classes.py Tue Jul 01 13:09:57 2008 -0700 @@ -23,7 +23,8 @@ def get_typed_class(virt, basename): if virt not in virt_types: - raise ValueError('Invalid class type') + if virt != "Virt" and basename != "MigrationJob": + raise ValueError('Invalid class type') if basename == None or basename == '': raise ValueError('Invalide class base name') diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Fri Jun 27 09:57:11 2008 +0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Tue Jul 01 13:09:57 2008 -0700 @@ -95,10 +95,10 @@ except Exception, details: logger.error("Error invoke method 'MigrateVirtualSystemToHost\'.") logger.error("%s", details) + return FAIL, ret if len(ret) == 0: logger.error("MigrateVirtualSystemToHost returns an empty list") - destroy_and_undefine_domain(test_dom, ip) return FAIL, ret return PASS, ret From kaitlin at linux.vnet.ibm.com Tue Jul 1 20:43:53 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 13:43:53 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Some VirtualSystemManagementService -t 02_destroysystem.py cleanup In-Reply-To: References: Message-ID: <486A9709.7020008@linux.vnet.ibm.com> > > + ret = cxml.define(options.ip) > > + if not ret: > > + logger.error("Failed to define the dom: %s", default_dom) > > + return FAIL > > + ret = cxml.start(options.ip) > > + if not ret: > > + logger.error("Failed to define the dom: %s", default_dom) > > It's better to log the error as "logger.error("Failed to create(or > start) the dom: %s", default_dom)", > which more reflect the actual failure. > Yes, good catch - thanks! I had a copy/paste error here. I'll change it to be "Failed to start the dom: %s" since we're starting it (not creating it). -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 1 20:46:16 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 13:46:16 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Some VirtualSystemManagementService -t 02_destroysystem.py cleanup Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1214945125 25200 # Node ID ea52dde5ac3e1b10d5aa59b101d91b8ffc5b127e # Parent cb09fbc0900ca656f629057742f19f1771fed4f8 [TEST] #2 Some VirtualSystemManagementService -t 02_destroysystem.py cleanup. Add checks to see if the define() / start() calls pass. Added cleanup_env() function to destroy()/undefine() guest in case of error. Ensure status is set to PASS only if the guest is not found in the domain list after the DestroySystem() call is made. Updated from 1 to 2: -Fix error message - if we are unable to start the guest, error message should say "Failed to start the dom: %s" Signed-off-by: Kaitlin Rupert diff -r cb09fbc0900c -r ea52dde5ac3e suites/libvirt-cim/cimtest/VirtualSystemManagementService/02_destroysystem.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/02_destroysystem.py Tue Jul 01 13:42:52 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/02_destroysystem.py Tue Jul 01 13:45:25 2008 -0700 @@ -35,47 +35,53 @@ sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] default_dom = 'test_domain' +def cleanup_env(ip, cxml): + cxml.destroy(ip) + cxml.undefine(ip) + @do_main(sup_types) def main(): options = main.options service = vsms.get_vsms_class(options.virt)(options.ip) cxml = vxml.get_class(options.virt)(default_dom) - cxml.define(options.ip) - cxml.start(options.ip) + ret = cxml.define(options.ip) + if not ret: + logger.error("Failed to define the dom: %s", default_dom) + return FAIL + ret = cxml.start(options.ip) + if not ret: + logger.error("Failed to start the dom: %s", default_dom) + cleanup_env(options.ip, cxml) + return FAIL classname = get_typed_class(options.virt, 'ComputerSystem') cs_ref = CIMInstanceName(classname, keybindings = { 'Name':default_dom, 'CreationClassName':classname}) list_before = domain_list(options.ip, options.virt) - status = PASS - rc = -1 + if default_dom not in list_before: + logger.error("Domain not in domain list") + cleanup_env(options.ip, cxml) + return FAIL try: service.DestroySystem(AffectedSystem=cs_ref) - rc = 0 except Exception, details: logger.error('Unknow exception happened') logger.error(details) - status = FAIL + cleanup_env(options.ip, cxml) + return FAIL list_after = domain_list(options.ip, options.virt) - status = PASS - if default_dom not in list_before: - logger.error("Domain not started, check config") + if default_dom in list_after: + logger.error("Domain %s not destroyed: provider didn't return error" % \ + default_dom) + cleanup_env(options.ip, cxml) status = FAIL else: - destroyed = set(list_before) - set(list_after) - if len(destroyed) != 1: - logger.error("Destroyed multiple domains") - status = FAIL - elif default_dom not in destroyed: - logger.error("Wrong domain destroyed") - status = FAIL - - cxml.undefine(options.ip) + status = PASS return status From kaitlin at linux.vnet.ibm.com Tue Jul 1 20:59:08 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 13:59:08 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix VirtualSystemSettingDataComponent - 01_forward.py failure In-Reply-To: References: Message-ID: <486A9A9C.3070208@linux.vnet.ibm.com> > > def build_vssd_info(ip, vssd): > > """ > > Creating the vssd fileds lists that will be used for > comparisons. > > """ > > - global vssd_names, vssd_values > > > > if vssd.Bootloader == "" or vssd.Caption == "" or \ > > vssd.InstanceID == "" or vssd.ElementName == "" or \ > > @@ -105,26 +101,17 @@ > > test_domain_function(test_dom, ip, "undefine") > > sys.exit(status) > > > > > You can also update the status setting in build_vssd_info(ip, vssd) > function. > Below is the code detail to update: > > - status = 1 > test_domain_function(test_dom, ip, "undefine") > - sys.exit(status) > + return FAIL Excellent catch - thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 1 20:59:38 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 13:59:38 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix VirtualSystemSettingDataComponent - 01_forward.py failure Message-ID: <5872801b69296bac39b1.1214945978@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1214945951 25200 # Node ID 5872801b69296bac39b1b5060e6de2643471f290 # Parent ea52dde5ac3e1b10d5aa59b101d91b8ffc5b127e [TEST] #2 Fix VirtualSystemSettingDataComponent - 01_forward.py failure. Test was expecting one ProcRASD for each domain processor. It should expect only one RASD. Also updated this test to use PASS/FAIL, removed global variables, and cleaned up indention. This test will need to be updated to support other XenFV, etc. Updates from 1 to 2: -Fix build_vssd_info() to return FAIL in case of error, not call sys.exit(). Signed-off-by: Kaitlin Rupert diff -r ea52dde5ac3e -r 5872801b6929 suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Tue Jul 01 13:45:25 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Tue Jul 01 13:59:11 2008 -0700 @@ -58,6 +58,7 @@ from CimTest import Globals from XenKvmLib import assoc from CimTest.Globals import logger, do_main +from CimTest.ReturnCodes import FAIL, PASS sup_types = ['Xen'] @@ -67,64 +68,49 @@ test_disk = 'xvda' status = 0 VSType = "Xen" -vssd_names = [] -vssd_values = [] -RASD_cllist = [ - 'Xen_DiskResourceAllocationSettingData', \ - 'Xen_MemResourceAllocationSettingData', \ - 'Xen_NetResourceAllocationSettingData', \ - 'Xen_ProcResourceAllocationSettingData' - ] - def init_list(): """ Creating the lists that will be used for comparisons. """ - prop_list = [] - prop_list = ["%s/%s" % (test_dom, test_disk), \ - "%s/%s" % (test_dom, "mem"), \ - "%s/%s" % (test_dom, test_mac) - ] - proc_list = [] - for i in range(test_vcpus): - proc_list.append("%s/%s" % (test_dom, i)) - return prop_list, proc_list + + rlist = ['Xen_DiskResourceAllocationSettingData', + 'Xen_MemResourceAllocationSettingData', + 'Xen_NetResourceAllocationSettingData', + 'Xen_ProcResourceAllocationSettingData' + ] + + prop_list = {rlist[0] : "%s/%s" % (test_dom, test_disk), + rlist[1] : "%s/%s" % (test_dom, "mem"), + rlist[2] : "%s/%s" % (test_dom, test_mac), + rlist[3] : "%s/%s" % (test_dom, "proc") + } + + return prop_list def build_vssd_info(ip, vssd): """ Creating the vssd fileds lists that will be used for comparisons. """ - global vssd_names, vssd_values if vssd.Bootloader == "" or vssd.Caption == "" or \ vssd.InstanceID == "" or vssd.ElementName == "" or \ vssd.VirtualSystemIdentifier == "" or vssd.VirtualSystemType == "": logger.error("One of the required VSSD details seems to be empty") - status = 1 test_domain_function(test_dom, ip, "undefine") - sys.exit(status) + return FAIL - vssd_names = [ - 'Bootloader', \ - 'Caption', \ - 'InstanceID', \ - 'ElementName', \ - 'VirtualSystemIdentifier', \ - 'VirtualSystemType', \ - ] - - vssd_values = [ - vssd.Bootloader, \ - vssd.Caption, \ - vssd.InstanceID, \ - vssd.ElementName, \ - vssd.VirtualSystemIdentifier, \ - vssd.VirtualSystemType, \ - ] + vssd_vals = {'Bootloader' : vssd.Bootloader, + 'Caption' : vssd.Caption, + 'InstanceID' : vssd.InstanceID, + 'ElementName' : vssd.ElementName, + 'VirtualSystemIdentifier' : vssd.VirtualSystemIdentifier, + 'VirtualSystemType' : vssd.VirtualSystemType + } + return vssd_vals -def assoc_values(ip, assoc_info, cn): +def assoc_values(ip, assoc_info, cn, an, vals): """ The association info of Xen_VirtualSystemSettingDataComponent with every RASDclass is @@ -132,36 +118,29 @@ Caption, InstanceID, ElementName, VirtualSystemIdentifier, VirtualSystemType, Bootloader """ - global status - global vssd_names, vssd_values try: if len(assoc_info) != 1: - Globals.logger.error("Xen_VirtualSystemSettingDataComponent \ -returned %i Resource objects for class '%s'", len(assoc_info),cn) - status = 1 - return status + Globals.logger.error("%s returned %i resource objects for '%s'" % \ + (an, len(assoc_info), cn)) + return FAIL - for idx in range(len(vssd_names)): - if assoc_info[0][vssd_names[idx]] != vssd_values[idx]: - Globals.logger.error("%s Mismatch", vssd_names[idx]) - Globals.logger.error("Returned %s instead of %s", \ - assoc_info[0][vssd_names[idx]], \ - vssd_fields[idx]) - status = 1 - if status != 0: - break + for prop, val in vals.iteritems(): + if assoc_info[0][prop] != val: + Globals.logger.error("%s mismatch: returned %s instead of %s" %\ + (prop, assoc_info[0][prop], val)) + return FAIL + + return PASS + except Exception, detail : logger.error("Exception in assoc_values function: %s" % detail) - status = 1 - test_domain_function(test_dom, ip, "undefine") - return status - + return FAIL @do_main(sup_types) def main(): options = main.options - global status + status = FAIL destroy_and_undefine_all(options.ip) test_xml = testxml_bl(test_dom, vcpus = test_vcpus, \ @@ -171,9 +150,7 @@ ret = test_domain_function(test_xml, options.ip, cmd = "define") if not ret: logger.error("Failed to define the dom: %s", test_dom) - status = 1 - return status - + return FAIL instIdval = "%s:%s" % (VSType, test_dom) keyname = "InstanceID" @@ -183,48 +160,39 @@ vssd = enumclass.getInstance(options.ip, \ enumclass.Xen_VirtualSystemSettingData, \ key_list) - build_vssd_info(options.ip, vssd) + if vssd is None: + logger.error("VSSD instance for %s not found" % test_dom) + test_domain_function(test_dom, options.ip, "undefine") + return FAIL + + vssd_vals = build_vssd_info(options.ip, vssd) except Exception, detail : logger.error(Globals.CIM_ERROR_GETINSTANCE, \ - 'Xen_VirtualSystemSettingData') + 'Xen_VirtualSystemSettingData') logger.error("Exception : %s" % detail) test_domain_function(test_dom, options.ip, "undefine") - status = 1 - return status + return FAIL - prop_list, proc_list = init_list() + prop_list = init_list() try: - idx = 0 - # Looping through the RASD_cllist, call association - # Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist - for rasd_cname in RASD_cllist: - if rasd_cname != 'Xen_ProcResourceAllocationSettingData': - assoc_info = assoc.Associators(options.ip, \ - 'Xen_VirtualSystemSettingDataComponent', \ - rasd_cname, \ - InstanceID = prop_list[idx]) - # Verify the association fields returned for particular rasd_cname. - assoc_values(options.ip, assoc_info, rasd_cname) - idx = idx + 1 - else: - # Xen_ProcResourceAllocationSettingData, we need to find - # association information for all the proc InstanceID and hence - # we loop from 0 to (test_vcpus - 1 ) - for index in range(len(proc_list)): - assoc_info = assoc.Associators(options.ip, \ - 'Xen_VirtualSystemSettingDataComponent', \ - rasd_cname, \ - InstanceID = prop_list[index]) + # Looping through the RASD_cllist, call association + # Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist + an = 'Xen_VirtualSystemSettingDataComponent' + for rasd_cname, prop in prop_list.iteritems(): + assoc_info = assoc.Associators(options.ip, an, rasd_cname, + InstanceID = prop) # Verify the association fields returned for particular rasd_cname. - assoc_values(options.ip, assoc_info, rasd_cname) + status = assoc_values(options.ip, assoc_info, rasd_cname, an, + vssd_vals) + if status != PASS: + break except Exception, detail : - logger.error(Globals.CIM_ERROR_ASSOCIATORS, \ - 'Xen_VirtualSystemSettingDataComponent') + logger.error(Globals.CIM_ERROR_ASSOCIATORS, an) logger.error("Exception : %s" % detail) - status = 1 + status = FAIL test_domain_function(test_dom, options.ip, "undefine") return status From danms at us.ibm.com Tue Jul 1 21:20:47 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 01 Jul 2008 14:20:47 -0700 Subject: [Libvirt-cim] [PATCH] Set the SourceInstanceHost property in migration indications Message-ID: <4565972096b56353938e.1214947247@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1214947245 25200 # Node ID 4565972096b56353938ea30813b6c780e8488e65 # Parent cb343a986592c25c487c53042ad889fa24ea9d97 Set the SourceInstanceHost property in migration indications This is a total hack at the moment, because we don't persist any platform details in the job (since only Xen is supported at the moment). When we do, this can be cleaned up. However, it works for now and would be good to get in place. Signed-off-by: Dan Smith diff -r cb343a986592 -r 4565972096b5 src/Virt_VSMigrationService.c --- a/src/Virt_VSMigrationService.c Tue Jul 01 12:47:31 2008 -0700 +++ b/src/Virt_VSMigrationService.c Tue Jul 01 14:20:45 2008 -0700 @@ -712,12 +712,29 @@ { char *type; CMPIStatus s; + CMPIObjectPath *ref; const char *ind_name = NULL; + const char *host = NULL; + const char *ccname = NULL; if (ind == NULL) return false; ind_name = ind_type_to_name(ind_type); + + /* FIXME: This is a hack until we un-Xenify this provider */ + ref = CMNewObjectPath(_BROKER, ns, "Xen_Foo", &s); + if (s.rc == CMPI_RC_OK) { + s = get_host_system_properties(&host, &ccname, ref, _BROKER); + if (s.rc == CMPI_RC_OK) { + CMSetProperty(ind, "SourceInstanceHost", + (CMPIValue *)host, CMPI_chars); + } else { + CU_DEBUG("Unable to get HostSystem properties"); + } + } else { + CU_DEBUG("Failed to get job reference"); + } CU_DEBUG("Setting SourceInstance"); CMSetProperty(ind, "SourceInstance", From danms at us.ibm.com Tue Jul 1 21:28:41 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 01 Jul 2008 14:28:41 -0700 Subject: [Libvirt-cim] [PATCH] For pause, reboot, and enable add support for guests in the NOSTATE state In-Reply-To: <4863C3BA.70104@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Thu, 26 Jun 2008 09:28:42 -0700") References: <4863C3BA.70104@linux.vnet.ibm.com> Message-ID: <87r6ad1egm.fsf@caffeine.beaverton.ibm.com> KR> Looking at the VSP, it looks like we're supposed to support reboot KR> from the following states: Active, Paused, Suspended. KR> If there aren't any objections, I'll rework this patch to support KR> that. KR> Same story with reset. We should support Active, Paused, KR> Suspended as valid from states. In order to do that, I think you'll need to first unpause the domain and then do a shutdown or reboot. I'm fine with it if it works well, and with the rest of the content of the patch. 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 kwoodson at novell.com Tue Jul 1 22:05:40 2008 From: kwoodson at novell.com (Kenny Woodson) Date: Tue, 01 Jul 2008 16:05:40 -0600 Subject: [Libvirt-cim] Xen_ComputerSystem RequestStateChange Message-ID: <486AAA34.5050701@novell.com> When testing the Xen_ComputerSystem RequestStateChange, I noticed that the shutdown state wasn't working but the disabled state was. Was there a difference for these(disabled (3) and shutdown (4))? Is there a reason why the shutdown isn't working but disabled is? Thanks, kwoodson From kaitlin at linux.vnet.ibm.com Tue Jul 1 23:02:38 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 16:02:38 -0700 Subject: [Libvirt-cim] Xen_ComputerSystem RequestStateChange In-Reply-To: <486AAA34.5050701@novell.com> References: <486AAA34.5050701@novell.com> Message-ID: <486AB78E.9020309@linux.vnet.ibm.com> Kenny Woodson wrote: > > When testing the Xen_ComputerSystem RequestStateChange, I noticed that > the shutdown state wasn't working but the disabled state was. Was there > a difference for these(disabled (3) and shutdown (4))? Is there a > reason why the shutdown isn't working but disabled is? > Right now, shutdown isn't supported. The DMTF Virtual System Profile lists an extra step for shutdown - the provider needs to tell the software running on the guest to shutdown. Once the software has terminated its tasks and shut itself down, the provider then treats the shutdown action in the same manner it treats disable. The steps to indicate to the guest that the OS needs to shutdown are involved. This is probably out of the project's scope, for awhile at least. It would be possible to have shutdown and disable behave the same way, but that wouldn't conform to the DMTF profile. Dan - thoughts? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 1 23:03:24 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 16:03:24 -0700 Subject: [Libvirt-cim] [PATCH] Reduce the non-CIM cycle timer from 3 minutes to 1 minute In-Reply-To: References: Message-ID: <486AB7BC.1080900@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1214941641 25200 > # Node ID e41428ac70e85d4cecc5fd0738680fc11de5e775 > # Parent 117ae7952d7264c64a3abbf236cf18758ae0200d > Reduce the non-CIM cycle timer from 3 minutes to 1 minute > > Signed-off-by: Dan Smith > > diff -r 117ae7952d72 -r e41428ac70e8 src/Virt_ComputerSystemIndication.c > https://www.redhat.com/mailman/listinfo/libvirt-cim +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 1 23:04:06 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 16:04:06 -0700 Subject: [Libvirt-cim] [PATCH] Report failure to deliver indication In-Reply-To: References: Message-ID: <486AB7E6.2050409@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1214941651 25200 > # Node ID cb343a986592c25c487c53042ad889fa24ea9d97 > # Parent e41428ac70e85d4cecc5fd0738680fc11de5e775 > Report failure to deliver indication > > Signed-off-by: Dan Smith > > diff -r e41428ac70e8 -r cb343a986592 src/Virt_ComputerSystemIndication.c +1 for useful debug =) -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 1 23:06:54 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 16:06:54 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] Indications related fixes. Message-ID: The first patch is a mirror of a change that was may in the libcmpiutil indication_tester.py. The second patch fixes a false positive situation. See commit log for details. From kaitlin at linux.vnet.ibm.com Tue Jul 1 23:06:55 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 16:06:55 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Based on recent updates to the indication_tester.py in libcmpiutil In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1214946766 25200 # Node ID c5c60637d2ab399491b204ba1e4cbd00e9266416 # Parent 5872801b69296bac39b1b5060e6de2643471f290 [TEST] Based on recent updates to the indication_tester.py in libcmpiutil. Signed-off-by: Kaitlin Rupert diff -r 5872801b6929 -r c5c60637d2ab suites/libvirt-cim/lib/XenKvmLib/indication_tester.py --- a/suites/libvirt-cim/lib/XenKvmLib/indication_tester.py Tue Jul 01 13:59:11 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/indication_tester.py Tue Jul 01 14:12:46 2008 -0700 @@ -81,7 +81,7 @@ %sHandler - localhost:%i + http://localhost:%i From kaitlin at linux.vnet.ibm.com Tue Jul 1 23:06:56 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 01 Jul 2008 16:06:56 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Fix false positive in CSI 01_created_indication.py In-Reply-To: Message-ID: <1565499973597852f4ce.1214953616@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1214946768 25200 # Node ID 1565499973597852f4ce91f93f611683f777ae2b # Parent c5c60637d2ab399491b204ba1e4cbd00e9266416 [TEST] Fix false positive in CSI 01_created_indication.py Test was not checking the return of waitpid() properly. Also, in the case of failure, the status value wasn't being set properly. Replace sys.exit() with os._exit() in child process. Only attempt to kill child process if the child didn't exit properly on its own. Fix some line length issues. Signed-off-by: Kaitlin Rupert diff -r c5c60637d2ab -r 156549997359 suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py --- a/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Tue Jul 01 14:12:46 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Tue Jul 01 14:12:48 2008 -0700 @@ -43,10 +43,13 @@ status = FAIL dict = set_default(options.ip) - indication_name = get_typed_class(options.virt, 'ComputerSystemCreatedIndication') + 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 = 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) @@ -56,39 +59,55 @@ sub.server.handle_request() if len(sub.server.indications) == 0: logger.error("No valid indications received") - sys.exit(1) + os._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) + logger.error("Received indication %s instead of %s" % \ + (indication_name, str(sub.server.indications[0]))) + os._exit(2) else: - sys.exit(0) + os._exit(0) else: - status = create_using_definesystem(test_dom, options.ip, None, None, options.virt) + status = create_using_definesystem(test_dom, options.ip, None, None, + options.virt) if status != PASS: sub.unsubscribe(dict['default_auth']) logger.info("Cancelling subscription for %s" % indication_name) os.kill(pid, signal.SIGKILL) return status + status = FAIL for i in range(0,100): - pw = os.waitpid(pid, os.WNOHANG)[1] - if pw == 0: + pw = os.waitpid(pid, os.WNOHANG) + + # If pid exits, waitpid returns [pid, return_code] + # If pid is still running, waitpid returns [0, 0] + # Only return a success if waitpid returns the expected pid + # and the return code is 0. + if pw[0] == pid and pw[1] == 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") + elif pw[1] == 0 and i < 99: + if i % 10 == 0: + logger.info("In child process, waiting for indication") time.sleep(1) else: - logger.error("Received indication error or wait too long") + status = FAIL + + # Time is up and waitpid never returned the expected pid + if pw[0] != pid: + logger.error("Waited too long for indication") + os.kill(pid, signal.SIGKILL) + else: + logger.error("Received indication error: %d" % pw[1]) break + except Exception, details: logger.error("Unknown exception happened") logger.error(details) 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 From danms at us.ibm.com Wed Jul 2 00:21:20 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 01 Jul 2008 17:21:20 -0700 Subject: [Libvirt-cim] Xen_ComputerSystem RequestStateChange In-Reply-To: <486AB78E.9020309@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Tue, 01 Jul 2008 16:02:38 -0700") References: <486AAA34.5050701@novell.com> <486AB78E.9020309@linux.vnet.ibm.com> Message-ID: <87myl116gv.fsf@caffeine.beaverton.ibm.com> KR> Right now, shutdown isn't supported. The DMTF Virtual System Profile KR> lists an extra step for shutdown - the provider needs to tell the KR> software running on the guest to shutdown. Once the software has KR> terminated its tasks and shut itself down, the provider then treats KR> the shutdown action in the same manner it treats disable. KR> The steps to indicate to the guest that the OS needs to shutdown are KR> involved. This is probably out of the project's scope, for awhile at KR> least. KR> It would be possible to have shutdown and disable behave the same way, KR> but that wouldn't conform to the DMTF profile. KR> Dan - thoughts? For paravirt Xen, issuing the shutdown command actually triggers an action in the guest kernel to start a shutdown (which becomes the equivalent of "shutdown -h now"). For fullvirt and KVM guests, a shutdown action should be simulated via ACPI (the equivalent of pushing the power button on an ACPI-enabled physical machine). I think I recall there being some plumbing issues to make this really work for KVM guests, but I think we should assume that it works. From what I can tell, requesting the shutdown state is equivalent to requesting the disabled state from our perspective. It would be trivial to make both of these target states perform the same action and have the same result. Doing so seems reasonable to me... anybody have a comment about 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 yunguol at cn.ibm.com Wed Jul 2 01:44:11 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 2 Jul 2008 09:44:11 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] #2 A few migration related fixes In-Reply-To: Message-ID: +1 from me. libvirt-cim-bounces at redhat.com wrote on 2008-07-02 04:39:25: > # HG changeset patch > # User Kaitlin Rupert > # Date 1214942997 25200 > # Node ID da0aebe9e441c2a0020fad9d063c489026eee2b2 > # Parent 0c3bd5f782c4776719799ad5c74226c95e70092e > [TEST] #2 A few migration related fixes. > > Fixes: > -Remove destroy_and_undefine_domain() call from > migrate_guest_to_host(). This call takes the domain name as a > parameter, but migrate_guest_to_host() doesn't take the domain name > So calling destroy_and_undefine_domain() resulted in an error. > -Add a hack to get_typed_class() so it supports Virt_MigrationJob > (which doesn't fit the typical _ pattern. > > Updates from 1 to 2: > -Improve error catching / reporting in start_guest_get_ref() > > Signed-off-by: Kaitlin Rupert > > diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt- > cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py > --- a/suites/libvirt- > cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py > Fri Jun 27 09:57:11 2008 +0800 > +++ b/suites/libvirt- > cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py > Tue Jul 01 13:09:57 2008 -0700 > @@ -42,19 +42,26 @@ > def start_guest_get_ref(ip, guest_name): > try: > xmlfile = testxml(guest_name) > - define_test_domain(xmlfile, ip) > + ret = define_test_domain(xmlfile, ip) > + if not ret: > + return FAIL, None > > - start_test_domain(guest_name, ip) > + ret = start_test_domain(guest_name, ip) > + if not ret: > + return FAIL, None > + > time.sleep(10) > except Exception: > logger.error("Error creating domain %s" % guest_name) > - destroy_and_undefine_domain(guest_name, options.ip) > return FAIL, None > > classname = 'Xen_ComputerSystem' > cs_ref = CIMInstanceName(classname, keybindings = { > 'Name':guest_name, > 'CreationClassName':classname}) > + > + if cs_ref is None: > + return FAIL, None > > return PASS, cs_ref > > @@ -80,6 +87,7 @@ > > status, cs_ref = start_guest_get_ref(options.ip, dom_name) > if status != PASS: > + destroy_and_undefine_domain(guest_name, options.ip) > return FAIL > > guest_name = cs_ref['Name'] > @@ -90,10 +98,10 @@ > return FAIL > > status, ret = migrate_guest_to_host(service, cs_ref, target_ip) > - > if status == FAIL: > logger.error("MigrateVirtualSystemToHost: unexpected list length %s" > % len(ret)) > + destroy_and_undefine_domain(dom_name, options.ip) > return status > elif len(ret) == 2: > id = ret[1]['Job'].keybindings['InstanceID'] > @@ -102,7 +110,7 @@ > guest_name, local_migrate) > > > - destroy_and_undefine_domain(dom_name, options.ip) > + destroy_and_undefine_domain(dom_name, options.ip) > > return status > > diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt- > cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py > --- a/suites/libvirt- > cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py > Fri Jun 27 09:57:11 2008 +0800 > +++ b/suites/libvirt- > cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py > Tue Jul 01 13:09:57 2008 -0700 > @@ -145,12 +145,11 @@ > > logger.info("Migrating guest with the following options:") > logger.info("%s" % item) > - status, ret = migrate_guest_to_host(service, cs_ref, target_ip, > - item) > - > + status, ret = migrate_guest_to_host(service, cs_ref, target_ip, item) > if status == FAIL: > logger.error("MigrateVirtualSystemToHost: unexpected > list length %s" > % len(ret)) > + destroy_and_undefine_domain(dom_name, options.ip) > return status > elif len(ret) == 2: > id = ret[1]['Job'].keybindings['InstanceID'] > diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt- > cim/lib/XenKvmLib/classes.py > --- a/suites/libvirt-cim/lib/XenKvmLib/classes.py Fri Jun 27 09: > 57:11 2008 +0800 > +++ b/suites/libvirt-cim/lib/XenKvmLib/classes.py Tue Jul 01 13: > 09:57 2008 -0700 > @@ -23,7 +23,8 @@ > > def get_typed_class(virt, basename): > if virt not in virt_types: > - raise ValueError('Invalid class type') > + if virt != "Virt" and basename != "MigrationJob": > + raise ValueError('Invalid class type') > > if basename == None or basename == '': > raise ValueError('Invalide class base name') > diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt- > cim/lib/XenKvmLib/vsmigrations.py > --- a/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Fri Jun 27 > 09:57:11 2008 +0800 > +++ b/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Tue Jul 01 > 13:09:57 2008 -0700 > @@ -95,10 +95,10 @@ > except Exception, details: > logger.error("Error invoke method 'MigrateVirtualSystemToHost\'.") > logger.error("%s", details) > + return FAIL, ret > > if len(ret) == 0: > logger.error("MigrateVirtualSystemToHost returns an empty list") > - destroy_and_undefine_domain(test_dom, ip) > return FAIL, ret > > return PASS, ret > > _______________________________________________ > 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 Jul 2 01:44:52 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 2 Jul 2008 09:44:52 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Some VirtualSystemManagementService -t 02_destroysystem.py cleanup In-Reply-To: Message-ID: +1 =) libvirt-cim-bounces at redhat.com wrote on 2008-07-02 04:46:16: > # HG changeset patch > # User Kaitlin Rupert > # Date 1214945125 25200 > # Node ID ea52dde5ac3e1b10d5aa59b101d91b8ffc5b127e > # Parent cb09fbc0900ca656f629057742f19f1771fed4f8 > [TEST] #2 Some VirtualSystemManagementService -t 02_destroysystem.py cleanup. > > Add checks to see if the define() / start() calls pass. > Added cleanup_env() function to destroy()/undefine() guest in case of error. > Ensure status is set to PASS only if the guest is not found in the > domain list after the DestroySystem() call is made. > > Updated from 1 to 2: > -Fix error message - if we are unable to start the guest, error > message should say "Failed to start the dom: %s" > > Signed-off-by: Kaitlin Rupert > > diff -r cb09fbc0900c -r ea52dde5ac3e suites/libvirt- > cim/cimtest/VirtualSystemManagementService/02_destroysystem.py > --- a/suites/libvirt- > cim/cimtest/VirtualSystemManagementService/02_destroysystem.py Tue > Jul 01 13:42:52 2008 -0700 > +++ b/suites/libvirt- > cim/cimtest/VirtualSystemManagementService/02_destroysystem.py Tue > Jul 01 13:45:25 2008 -0700 > @@ -35,47 +35,53 @@ > sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > default_dom = 'test_domain' > > +def cleanup_env(ip, cxml): > + cxml.destroy(ip) > + cxml.undefine(ip) > + > @do_main(sup_types) > def main(): > options = main.options > > service = vsms.get_vsms_class(options.virt)(options.ip) > cxml = vxml.get_class(options.virt)(default_dom) > - cxml.define(options.ip) > - cxml.start(options.ip) > + ret = cxml.define(options.ip) > + if not ret: > + logger.error("Failed to define the dom: %s", default_dom) > + return FAIL > + ret = cxml.start(options.ip) > + if not ret: > + logger.error("Failed to start the dom: %s", default_dom) > + cleanup_env(options.ip, cxml) > + return FAIL > > classname = get_typed_class(options.virt, 'ComputerSystem') > cs_ref = CIMInstanceName(classname, keybindings = { > 'Name':default_dom, > 'CreationClassName':classname}) > list_before = domain_list(options.ip, options.virt) > - status = PASS > - rc = -1 > + if default_dom not in list_before: > + logger.error("Domain not in domain list") > + cleanup_env(options.ip, cxml) > + return FAIL > > try: > service.DestroySystem(AffectedSystem=cs_ref) > - rc = 0 > except Exception, details: > logger.error('Unknow exception happened') > logger.error(details) > - status = FAIL > + cleanup_env(options.ip, cxml) > + return FAIL > > list_after = domain_list(options.ip, options.virt) > > - status = PASS > - if default_dom not in list_before: > - logger.error("Domain not started, check config") > + if default_dom in list_after: > + logger.error("Domain %s not destroyed: provider didn't > return error" % \ > + default_dom) > + cleanup_env(options.ip, cxml) > status = FAIL > else: > - destroyed = set(list_before) - set(list_after) > - if len(destroyed) != 1: > - logger.error("Destroyed multiple domains") > - status = FAIL > - elif default_dom not in destroyed: > - logger.error("Wrong domain destroyed") > - status = FAIL > - > - cxml.undefine(options.ip) > + status = PASS > > return status > > > _______________________________________________ > 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 Jul 2 02:10:01 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 2 Jul 2008 10:10:01 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix VirtualSystemSettingDataComponent - 01_forward.py failure In-Reply-To: <5872801b69296bac39b1.1214945978@elm3b41.beaverton.ibm.com> Message-ID: +1 from me =) libvirt-cim-bounces at redhat.com wrote on 2008-07-02 04:59:38: > # HG changeset patch > # User Kaitlin Rupert > # Date 1214945951 25200 > # Node ID 5872801b69296bac39b1b5060e6de2643471f290 > # Parent ea52dde5ac3e1b10d5aa59b101d91b8ffc5b127e > [TEST] #2 Fix VirtualSystemSettingDataComponent - 01_forward.py failure. > > Test was expecting one ProcRASD for each domain processor. It should > expect only one RASD. > > Also updated this test to use PASS/FAIL, removed global variables, > and cleaned up indention. > > This test will need to be updated to support other XenFV, etc. > > Updates from 1 to 2: > -Fix build_vssd_info() to return FAIL in case of error, not call sys.exit(). > > Signed-off-by: Kaitlin Rupert > > diff -r ea52dde5ac3e -r 5872801b6929 suites/libvirt- > cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py > --- a/suites/libvirt- > cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Tue > Jul 01 13:45:25 2008 -0700 > +++ b/suites/libvirt- > cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Tue > Jul 01 13:59:11 2008 -0700 > @@ -58,6 +58,7 @@ > from CimTest import Globals > from XenKvmLib import assoc > from CimTest.Globals import logger, do_main > +from CimTest.ReturnCodes import FAIL, PASS > > sup_types = ['Xen'] > > @@ -67,64 +68,49 @@ > test_disk = 'xvda' > status = 0 > VSType = "Xen" > -vssd_names = [] > -vssd_values = [] > > -RASD_cllist = [ > - 'Xen_DiskResourceAllocationSettingData', \ > - 'Xen_MemResourceAllocationSettingData', \ > - 'Xen_NetResourceAllocationSettingData', \ > - 'Xen_ProcResourceAllocationSettingData' > - ] > - > def init_list(): > """ > Creating the lists that will be used for comparisons. > """ > - prop_list = [] > - prop_list = ["%s/%s" % (test_dom, test_disk), \ > - "%s/%s" % (test_dom, "mem"), \ > - "%s/%s" % (test_dom, test_mac) > - ] > - proc_list = [] > - for i in range(test_vcpus): > - proc_list.append("%s/%s" % (test_dom, i)) > - return prop_list, proc_list > + > + rlist = ['Xen_DiskResourceAllocationSettingData', > + 'Xen_MemResourceAllocationSettingData', > + 'Xen_NetResourceAllocationSettingData', > + 'Xen_ProcResourceAllocationSettingData' > + ] > + > + prop_list = {rlist[0] : "%s/%s" % (test_dom, test_disk), > + rlist[1] : "%s/%s" % (test_dom, "mem"), > + rlist[2] : "%s/%s" % (test_dom, test_mac), > + rlist[3] : "%s/%s" % (test_dom, "proc") > + } > + > + return prop_list > > def build_vssd_info(ip, vssd): > """ > Creating the vssd fileds lists that will be used for comparisons. > """ > - global vssd_names, vssd_values > > if vssd.Bootloader == "" or vssd.Caption == "" or \ > vssd.InstanceID == "" or vssd.ElementName == "" or \ > vssd.VirtualSystemIdentifier == "" or vssd.VirtualSystemType == "": > logger.error("One of the required VSSD details seems to be empty") > - status = 1 > test_domain_function(test_dom, ip, "undefine") > - sys.exit(status) > + return FAIL > > - vssd_names = [ > - 'Bootloader', \ > - 'Caption', \ > - 'InstanceID', \ > - 'ElementName', \ > - 'VirtualSystemIdentifier', \ > - 'VirtualSystemType', \ > - ] > - > - vssd_values = [ > - vssd.Bootloader, \ > - vssd.Caption, \ > - vssd.InstanceID, \ > - vssd.ElementName, \ > - vssd.VirtualSystemIdentifier, \ > - vssd.VirtualSystemType, \ > - ] > + vssd_vals = {'Bootloader' : vssd.Bootloader, > + 'Caption' : vssd.Caption, > + 'InstanceID' : vssd.InstanceID, > + 'ElementName' : vssd.ElementName, > + 'VirtualSystemIdentifier' : vssd.VirtualSystemIdentifier, > + 'VirtualSystemType' : vssd.VirtualSystemType > + } > > + return vssd_vals > > -def assoc_values(ip, assoc_info, cn): > +def assoc_values(ip, assoc_info, cn, an, vals): > """ > The association info of > Xen_VirtualSystemSettingDataComponent with every RASDclass is > @@ -132,36 +118,29 @@ > Caption, InstanceID, ElementName, VirtualSystemIdentifier, > VirtualSystemType, Bootloader > """ > - global status > - global vssd_names, vssd_values > > try: > if len(assoc_info) != 1: > - Globals.logger.error("Xen_VirtualSystemSettingDataComponent \ > -returned %i Resource objects for class '%s'", len(assoc_info),cn) > - status = 1 > - return status > + Globals.logger.error("%s returned %i resource objects > for '%s'" % \ > + (an, len(assoc_info), cn)) > + return FAIL > > - for idx in range(len(vssd_names)): > - if assoc_info[0][vssd_names[idx]] != vssd_values[idx]: > - Globals.logger.error("%s Mismatch", vssd_names[idx]) > - Globals.logger.error("Returned %s instead of %s", \ > - assoc_info[0][vssd_names[idx]], \ > - vssd_fields[idx]) > - status = 1 > - if status != 0: > - break > + for prop, val in vals.iteritems(): > + if assoc_info[0][prop] != val: > + Globals.logger.error("%s mismatch: returned %s > instead of %s" %\ > + (prop, assoc_info[0][prop], val)) > + return FAIL > + > + return PASS > + > except Exception, detail : > logger.error("Exception in assoc_values function: %s" % detail) > - status = 1 > - test_domain_function(test_dom, ip, "undefine") > - return status > - > + return FAIL > > @do_main(sup_types) > def main(): > options = main.options > - global status > + status = FAIL > > destroy_and_undefine_all(options.ip) > test_xml = testxml_bl(test_dom, vcpus = test_vcpus, \ > @@ -171,9 +150,7 @@ > ret = test_domain_function(test_xml, options.ip, cmd = "define") > if not ret: > logger.error("Failed to define the dom: %s", test_dom) > - status = 1 > - return status > - > + return FAIL > > instIdval = "%s:%s" % (VSType, test_dom) > keyname = "InstanceID" > @@ -183,48 +160,39 @@ > vssd = enumclass.getInstance(options.ip, \ > enumclass.Xen_VirtualSystemSettingData, \ > key_list) > - build_vssd_info(options.ip, vssd) > + if vssd is None: > + logger.error("VSSD instance for %s not found" % test_dom) > + test_domain_function(test_dom, options.ip, "undefine") > + return FAIL > + > + vssd_vals = build_vssd_info(options.ip, vssd) > > except Exception, detail : > logger.error(Globals.CIM_ERROR_GETINSTANCE, \ > - 'Xen_VirtualSystemSettingData') > + 'Xen_VirtualSystemSettingData') > logger.error("Exception : %s" % detail) > test_domain_function(test_dom, options.ip, "undefine") > - status = 1 > - return status > + return FAIL > > - prop_list, proc_list = init_list() > + prop_list = init_list() > > try: > - idx = 0 > - # Looping through the RASD_cllist, call association > - # Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist > - for rasd_cname in RASD_cllist: > - if rasd_cname != 'Xen_ProcResourceAllocationSettingData': > - assoc_info = assoc.Associators(options.ip, \ > - > 'Xen_VirtualSystemSettingDataComponent', \ > - > rasd_cname, \ > - InstanceID = > prop_list[idx]) > - # Verify the association fields returned for > particular rasd_cname. > - assoc_values(options.ip, assoc_info, rasd_cname) > - idx = idx + 1 > - else: > - # Xen_ProcResourceAllocationSettingData, we need to find > - # association information for all the proc InstanceID and hence > - # we loop from 0 to (test_vcpus - 1 ) > - for index in range(len(proc_list)): > - assoc_info = assoc.Associators(options.ip, \ > - > 'Xen_VirtualSystemSettingDataComponent', \ > - > rasd_cname, \ > - InstanceID = > prop_list[index]) > + # Looping through the RASD_cllist, call association > + # Xen_VirtualSystemSettingDataComponent with each class in > RASD_cllist > + an = 'Xen_VirtualSystemSettingDataComponent' > + for rasd_cname, prop in prop_list.iteritems(): > + assoc_info = assoc.Associators(options.ip, an, rasd_cname, > + InstanceID = prop) > # Verify the association fields returned for particular > rasd_cname. > - assoc_values(options.ip, assoc_info, rasd_cname) > + status = assoc_values(options.ip, assoc_info, rasd_cname, an, > + vssd_vals) > + if status != PASS: > + break > > except Exception, detail : > - logger.error(Globals.CIM_ERROR_ASSOCIATORS, \ > - > 'Xen_VirtualSystemSettingDataComponent') > + logger.error(Globals.CIM_ERROR_ASSOCIATORS, an) > logger.error("Exception : %s" % detail) > - status = 1 > + status = FAIL > > test_domain_function(test_dom, options.ip, "undefine") > return status > > _______________________________________________ > 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 Jul 2 09:48:58 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 02 Jul 2008 15:18:58 +0530 Subject: [Libvirt-cim] CimTest Report for KVM on F9 02-07-2008 Message-ID: <486B4F0A.8050105@linux.vnet.ibm.com> ======================================================================== CIM Test Report for KVM on F9 with latest libvirt-cim and libcmpiutil ======================================================================== Distro : Fedora 9 Beta Kernel : 2.6.25-0.121.rc5.git4.fc9 Libvirt : libvirt-0.4.2-1.fc9.x86_64 CIMOM : pegasus PyWBEM : pywbem-0.6 CIM Schema : cimv216Experimental LibCMPIutil : 79 LibVirtCIM : 624 CIMTEST : 235 ======================================================= PASS : 108 FAIL : 0 XFAIL : 4 SKIP : 18 ----------------- Total : 130 ======================================================= Please find the complete report attached with the mail. Thanks and Regards, Deepti. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: July2-KVM-report URL: From veillard at redhat.com Wed Jul 2 13:40:02 2008 From: veillard at redhat.com (Daniel Veillard) Date: Wed, 2 Jul 2008 09:40:02 -0400 Subject: [Libvirt-cim] CimTest Report for KVM on F9 02-07-2008 In-Reply-To: <486B4F0A.8050105@linux.vnet.ibm.com> References: <486B4F0A.8050105@linux.vnet.ibm.com> Message-ID: <20080702134002.GE2734@redhat.com> On Wed, Jul 02, 2008 at 03:18:58PM +0530, Deepti B Kalakeri wrote: > ======================================================================== > CIM Test Report for KVM on F9 with latest libvirt-cim and libcmpiutil > ======================================================================== > Distro : Fedora 9 Beta > Kernel : 2.6.25-0.121.rc5.git4.fc9 > Libvirt : libvirt-0.4.2-1.fc9.x86_64 I have pushed libvirt-0.4.4-1.fc9 to the Fedora 9 updates, maybe it's a good idea to upgrade at this point (though it should not matter from a CIM perspective but it's better to regression test the more recent code :-) thanks ! 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 Wed Jul 2 14:07:25 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Jul 2008 07:07:25 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Fix false positive in CSI 01_created_indication.py In-Reply-To: <1565499973597852f4ce.1214953616@elm3b41.beaverton.ibm.com> (Kaitlin Rupert's message of "Tue, 01 Jul 2008 16:06:56 -0700") References: <1565499973597852f4ce.1214953616@elm3b41.beaverton.ibm.com> Message-ID: <87abh01isi.fsf@caffeine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1214946768 25200 KR> # Node ID 1565499973597852f4ce91f93f611683f777ae2b KR> # Parent c5c60637d2ab399491b204ba1e4cbd00e9266416 KR> [TEST] Fix false positive in CSI 01_created_indication.py +1 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 Wed Jul 2 15:12:58 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 02 Jul 2008 08:12:58 -0700 Subject: [Libvirt-cim] [PATCH] Set the SourceInstanceHost property in migration indications In-Reply-To: <4565972096b56353938e.1214947247@guaranine.danplanet.com> References: <4565972096b56353938e.1214947247@guaranine.danplanet.com> Message-ID: <486B9AFA.4070904@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1214947245 25200 > # Node ID 4565972096b56353938ea30813b6c780e8488e65 > # Parent cb343a986592c25c487c53042ad889fa24ea9d97 > Set the SourceInstanceHost property in migration indications > > This is a total hack at the moment, because we don't persist any > platform details in the job (since only Xen is supported at the moment). > When we do, this can be cleaned up. However, it works for now and would > be good to get in place. > > Signed-off-by: Dan Smith > > diff -r cb343a986592 -r 4565972096b5 src/Virt_VSMigrationService.c +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Wed Jul 2 15:57:11 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Jul 2008 08:57:11 -0700 Subject: [Libvirt-cim] [PATCH] (#2) Set SourceInstance{Host, ModelPath} in migration indications Message-ID: <35d00def6476eb4e21b3.1215014231@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1215014224 25200 # Node ID 35d00def6476eb4e21b3a26837682362917f9915 # Parent cb343a986592c25c487c53042ad889fa24ea9d97 (#2) Set SourceInstance{Host,ModelPath} in migration indications This is a total hack at the moment, because we don't persist any platform details in the job (since only Xen is supported at the moment). When we do, this can be cleaned up. However, it works for now and would be good to get in place. Changes: - Add SourceInstanceModelPath as well Signed-off-by: Dan Smith diff -r cb343a986592 -r 35d00def6476 src/Virt_VSMigrationService.c --- a/src/Virt_VSMigrationService.c Tue Jul 01 12:47:31 2008 -0700 +++ b/src/Virt_VSMigrationService.c Wed Jul 02 08:57:04 2008 -0700 @@ -712,12 +712,47 @@ { char *type; CMPIStatus s; + CMPIObjectPath *ref; const char *ind_name = NULL; + const char *host = NULL; + const char *ccname = NULL; if (ind == NULL) return false; ind_name = ind_type_to_name(ind_type); + + /* FIXME: This is a hack until we un-Xenify this provider */ + ref = CMNewObjectPath(_BROKER, ns, "Xen_Foo", &s); + if ((ref == NULL) || (s.rc != CMPI_RC_OK)) { + CU_DEBUG("Failed to get job reference"); + } else { + s = get_host_system_properties(&host, &ccname, ref, _BROKER); + if (s.rc == CMPI_RC_OK) { + CMSetProperty(ind, "SourceInstanceHost", + (CMPIValue *)host, CMPI_chars); + } else { + CU_DEBUG("Unable to get HostSystem properties"); + } + } + + /* FIXME: This should be merged with above once the job path is + * properly typed + */ + ref = CMGetObjectPath(inst, &s); + if ((ref == NULL) || (s.rc != CMPI_RC_OK)) { + CU_DEBUG("Failed to get job reference"); + } else { + CMPIString *str; + + str = CMObjectPathToString(ref, &s); + if ((str == NULL) || (s.rc != CMPI_RC_OK)) { + CU_DEBUG("Failed to get path string"); + } else { + CMSetProperty(ind, "SourceInstanceModelPath", + (CMPIValue *)&str, CMPI_string); + } + } CU_DEBUG("Setting SourceInstance"); CMSetProperty(ind, "SourceInstance", From danms at us.ibm.com Wed Jul 2 15:57:34 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Jul 2008 08:57:34 -0700 Subject: [Libvirt-cim] [PATCH] Add SourceInstance{Host,ModelPath} to CSI Message-ID: <5f084775a1757e92dc02.1215014254@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1215014236 25200 # Node ID 5f084775a1757e92dc02eb950a30565c6dbb75a4 # Parent 35d00def6476eb4e21b3a26837682362917f9915 Add SourceInstance{Host,ModelPath} to CSI Signed-off-by: Dan Smith diff -r 35d00def6476 -r 5f084775a175 src/Makefile.am --- a/src/Makefile.am Wed Jul 02 08:57:04 2008 -0700 +++ b/src/Makefile.am Wed Jul 02 08:57:16 2008 -0700 @@ -69,9 +69,9 @@ libVirt_ComputerSystem_la_SOURCES = Virt_ComputerSystem.c libVirt_Device_la_SOURCES = Virt_Device.c -libVirt_ComputerSystemIndication_la_DEPENDENCIES = libVirt_ComputerSystem.la +libVirt_ComputerSystemIndication_la_DEPENDENCIES = libVirt_ComputerSystem.la libVirt_HostSystem.la libVirt_ComputerSystemIndication_la_SOURCES = Virt_ComputerSystemIndication.c -libVirt_ComputerSystemIndication_la_LIBADD = -lVirt_ComputerSystem -lpthread -lrt +libVirt_ComputerSystemIndication_la_LIBADD = -lVirt_ComputerSystem -lVirt_HostSystem -lpthread -lrt libVirt_ComputerSystemMigrationIndication_la_DEPENDENCIES = libVirt_ComputerSystem.la libVirt_ComputerSystemMigrationIndication_la_SOURCES = Virt_ComputerSystemMigrationIndication.c diff -r 35d00def6476 -r 5f084775a175 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Wed Jul 02 08:57:04 2008 -0700 +++ b/src/Virt_ComputerSystemIndication.c Wed Jul 02 08:57:16 2008 -0700 @@ -42,6 +42,7 @@ #include "Virt_ComputerSystem.h" #include "Virt_ComputerSystemIndication.h" +#include "Virt_HostSystem.h" static const CMPIBroker *_BROKER; @@ -184,6 +185,33 @@ return ret; } +static void set_source_inst_props(const CMPIBroker *broker, + CMPIObjectPath *ref, + CMPIInstance *ind) +{ + const char *host; + const char *hostccn; + CMPIStatus s; + CMPIString *str; + + str = CMObjectPathToString(ref, &s); + if ((str == NULL) || (s.rc != CMPI_RC_OK)) { + CU_DEBUG("Unable to get path string"); + } else { + CMSetProperty(ind, "SourceInstanceModelPath", + (CMPIValue *)&str, CMPI_string); + } + + s = get_host_system_properties(&host, &hostccn, ref, broker); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("Unable to get host properties (%s): %s", + CLASSNAME(ref), CMGetCharPtr(s.msg)); + } else { + CMSetProperty(ind, "SourceInstanceHost", + (CMPIValue *)host, CMPI_chars); + } +} + static bool _do_indication(const CMPIBroker *broker, const CMPIContext *ctx, CMPIInstance *affected_inst, @@ -217,17 +245,21 @@ if (s.rc != CMPI_RC_OK) { CU_DEBUG("Failed to get ind_op. Error: '%s'", s.msg); ret = false; + goto out; } + CMSetNameSpace(ind_op, args->ns); + + affected_op = CMGetObjectPath(affected_inst, &s); + if (s.rc != CMPI_RC_OK) { + ret = false; + CU_DEBUG("problem getting affected_op: '%s'", s.msg); + goto out; + } + CMSetNameSpace(affected_op, args->ns); switch (ind_type) { case CS_CREATED: case CS_DELETED: - affected_op = CMGetObjectPath(affected_inst, &s); - if (s.rc != CMPI_RC_OK) { - ret = false; - CU_DEBUG("problem getting affected_op: '%s'", s.msg); - goto out; - } CMSetProperty(ind, "AffectedSystem", (CMPIValue *)&affected_op, CMPI_ref); break; @@ -236,6 +268,8 @@ (CMPIValue *)&affected_inst, CMPI_instance); break; } + + set_source_inst_props(broker, affected_op, ind); CU_DEBUG("Delivering Indication: %s", CMGetCharPtr(CMObjectPathToString(ind_op, NULL))); From kaitlin at linux.vnet.ibm.com Wed Jul 2 16:40:27 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 02 Jul 2008 09:40:27 -0700 Subject: [Libvirt-cim] [PATCH] (#2) Set SourceInstance{Host, ModelPath} in migration indications In-Reply-To: <35d00def6476eb4e21b3.1215014231@guaranine.danplanet.com> References: <35d00def6476eb4e21b3.1215014231@guaranine.danplanet.com> Message-ID: <486BAF7B.1020301@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1215014224 25200 > # Node ID 35d00def6476eb4e21b3a26837682362917f9915 > # Parent cb343a986592c25c487c53042ad889fa24ea9d97 > (#2) Set SourceInstance{Host,ModelPath} in migration indications > > This is a total hack at the moment, because we don't persist any > platform details in the job (since only Xen is supported at the moment). > When we do, this can be cleaned up. However, it works for now and would > be good to get in place. > > Changes: > - Add SourceInstanceModelPath as well > > Signed-off-by: Dan Smith > > diff -r cb343a986592 -r 35d00def6476 src/Virt_VSMigrationService.c +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 2 19:36:51 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 02 Jul 2008 12:36:51 -0700 Subject: [Libvirt-cim] [PATCH] Add state transition poll to DestroySystem() call In-Reply-To: <87wsk51k4i.fsf@caffeine.beaverton.ibm.com> References: <98e6e7b6160be701c412.1214852744@elm3b41.beaverton.ibm.com> <87wsk51k4i.fsf@caffeine.beaverton.ibm.com> Message-ID: <486BD8D3.8030407@linux.vnet.ibm.com> Dan Smith wrote: > KR> # HG changeset patch > KR> # User Kaitlin Rupert > KR> # Date 1214850941 25200 > KR> # Node ID 98e6e7b6160be701c4124cb04eef9c893fdfaa1d > KR> # Parent b123b6b1fb08c3ab956f1c33801e743e082192b9 > KR> Add state transition poll to DestroySystem() call. > > Sorry for the delay here... > > KR> +#define STATE_TRANSITION_TIMEOUT 120 > > First off, 120 seconds is sure to be longer than the CIM timeout, so > if the call really lasts this long, the client will get a timeout. I > think it's probably reasonable to expect that after a destroy(), the > undefine() would happen before the domain could really be pulled > offline. However, 120 seconds should be considered "something is > wrong and the domain isn't going away" IMHO. > > If you think that 120 seconds is necessary (and reasonable), then we > need to check for online-ness, and start a job to do this in that case. I did some more testing, and adding the additional virDomainLookupByName() (to handle the case where the domain was created using virsh/virt-manager without being defined first) slows things down enough to prevent the issue I was seeing. I'm going to resubmit with the loop removed. And then I'll do some further testing with a system under load to see what happens. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 2 19:49:16 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 02 Jul 2008 12:49:16 -0700 Subject: [Libvirt-cim] [PATCH] {#2) Add state transition poll to DestroySystem() call Message-ID: <4d99e7ac6e39a1f077b5.1215028156@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1215027772 25200 # Node ID 4d99e7ac6e39a1f077b5476fdb3ad01e32c5fe13 # Parent 35d00def6476eb4e21b3a26837682362917f9915 {#2) Add state transition poll to DestroySystem() call. Updates from 1 to 2: -Remove polling loop -Move indications trigger to where the status is set (no need to duplicate the call). Signed-off-by: Kaitlin Rupert diff -r 35d00def6476 -r 4d99e7ac6e39 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Jul 02 08:57:04 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Wed Jul 02 12:42:52 2008 -0700 @@ -858,11 +858,17 @@ infostore_delete(virConnectGetType(conn), dom_name); virDomainDestroy(dom); /* Okay for this to fail */ + + dom = virDomainLookupByName(conn, dom_name); + if (dom == NULL) { + CU_DEBUG("Domain successfully destroyed"); + rc = IM_RC_OK; + goto error; + } + if (virDomainUndefine(dom) == 0) { + CU_DEBUG("Domain successfully destroyed and undefined"); rc = IM_RC_OK; - trigger_indication(context, - "ComputerSystemDeletedIndication", - reference); } error: @@ -874,8 +880,12 @@ cu_statusf(_BROKER, &status, CMPI_RC_ERR_FAILED, "Unable to retrieve domain name."); - else if (rc == IM_RC_OK) + else if (rc == IM_RC_OK) { status = (CMPIStatus){CMPI_RC_OK, NULL}; + trigger_indication(context, + "ComputerSystemDeletedIndication", + reference); + } virDomainFree(dom); virConnectClose(conn); From danms at us.ibm.com Wed Jul 2 22:08:22 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Jul 2008 15:08:22 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] More CSI fixes Message-ID: Changes detailed per patch From danms at us.ibm.com Wed Jul 2 22:08:23 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Jul 2008 15:08:23 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Fix CSI to support a separate thread per platform In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1215036468 25200 # Node ID b7f53024c5a4d815691aa3112f5effb25df66d20 # Parent d1c55a723ad873d04620a336465d496bbc3f31ea Fix CSI to support a separate thread per platform This is crucial to being able to deliver indications from multiple platforms at the same time. By keeping a separate thread_id for each platform, we ensure that we start one and only one thread per platform, so that they can properly establish their connections to libvirt. Note that pegasus won't hand me a fresh ObjectPath if I subscribe to a (e.g) Xen indication after a KVM one, so this doesn't actually enable subscription of indications from multiple platforms. However, this seems to be a pegasus issue and can be worked independently. Also fix leak of args in ActivateFilter if thread is already started. Signed-off-by: Dan Smith diff -r d1c55a723ad8 -r b7f53024c5a4 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Wed Jul 02 10:18:13 2008 -0700 +++ b/src/Virt_ComputerSystemIndication.c Wed Jul 02 15:07:48 2008 -0700 @@ -46,7 +46,13 @@ static const CMPIBroker *_BROKER; -static CMPI_THREAD_TYPE lifecycle_thread_id = 0; +#define CSI_NUM_PLATFORMS 3 +enum CSI_PLATFORMS {CSI_XEN, + CSI_KVM, + CSI_LXC, +}; + +static CMPI_THREAD_TYPE thread_id[CSI_NUM_PLATFORMS]; enum CS_EVENTS {CS_CREATED, CS_DELETED, @@ -362,6 +368,18 @@ return rc; } +static int platform_from_class(const char *cn) +{ + if (STARTS_WITH(cn, "Xen")) + return CSI_XEN; + else if (STARTS_WITH(cn, "KVM")) + return CSI_KVM; + else if (STARTS_WITH(cn, "LXC")) + return CSI_LXC; + else + return -1; +} + static CMPI_THREAD_RETURN lifecycle_thread(void *params) { struct ind_args *args = (struct ind_args *)params; @@ -374,6 +392,7 @@ struct dom_xml *prev_xml = NULL; virConnectPtr conn; char *prefix = class_prefix_name(args->classname); + int platform = platform_from_class(args->classname); conn = connect_by_classname(_BROKER, args->classname, &s); if (conn == NULL) { @@ -393,7 +412,7 @@ free_domain_list(tmp_list, prev_count); free(tmp_list); - CU_DEBUG("entering event loop"); + CU_DEBUG("Entering CSI event loop (%s)", prefix); while (lifecycle_enabled) { int i; bool res; @@ -449,12 +468,12 @@ } out: + thread_id[platform] = 0; + pthread_mutex_unlock(&lifecycle_mutex); stdi_free_ind_args(&args); free(prefix); virConnectClose(conn); - - lifecycle_thread_id = 0; return NULL; } @@ -469,7 +488,8 @@ CU_DEBUG("ActivateFilter"); CMPIStatus s = {CMPI_RC_OK, NULL}; struct std_indication_ctx *_ctx; - struct ind_args *args = malloc(sizeof(struct ind_args)); + struct ind_args *args; + int platform; _ctx = (struct std_indication_ctx *)mi->hdl; @@ -479,14 +499,41 @@ "No ObjectPath given"); goto out; } - args->ns = strdup(NAMESPACE(op)); - args->classname = strdup(CLASSNAME(op)); - args->_ctx = _ctx; - if (lifecycle_thread_id == 0) { + /* FIXME: op is stale the second time around, for some reason */ + platform = platform_from_class(CLASSNAME(op)); + if (platform < 0) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unknown platform"); + goto out; + } + + if (thread_id[platform] == 0) { + args = malloc(sizeof(struct ind_args)); + if (args == NULL) { + CU_DEBUG("Failed to allocate ind_args"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to allocate ind_args"); + goto out; + } + args->context = CBPrepareAttachThread(_BROKER, ctx); + if (args->context == NULL) { + CU_DEBUG("Failed to create thread context"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to create thread context"); + free(args); + goto out; + } - lifecycle_thread_id = _BROKER->xft->newThread(lifecycle_thread, + args->ns = strdup(NAMESPACE(op)); + args->classname = strdup(CLASSNAME(op)); + args->_ctx = _ctx; + + thread_id[platform] = _BROKER->xft->newThread(lifecycle_thread, args, 0); } @@ -508,6 +555,7 @@ static _EI_RTYPE EnableIndications(CMPIIndicationMI* mi, const CMPIContext *ctx) { + CU_DEBUG("EnableIndications"); pthread_mutex_lock(&lifecycle_mutex); lifecycle_enabled = true; pthread_mutex_unlock(&lifecycle_mutex); From danms at us.ibm.com Wed Jul 2 22:08:24 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 02 Jul 2008 15:08:24 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Fix race between EnableIndications and ActivateFilter's thread In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1215036495 25200 # Node ID eeb54ba6f7b6d3b74b67faefa5e35a12ed5945e9 # Parent b7f53024c5a4d815691aa3112f5effb25df66d20 Fix race between EnableIndications and ActivateFilter's thread Accomplish this by decoupling the enabled-ness of the whole provider from the presence of activated filters against the provider. Keep a count of the number of subscribed filters against us (per platform) and keep the thread running until that reaches zero. Use the enabled-ness of the provider to gate actual delivery of any indications (as intended). The original race was because ActivateFilter could be run before EnableIndications (which seems broken to me -- thanks Pegasus) and thus the thread was started before the global flag was set true. Thus, the thread fell right through the while loop and stopped running. Signed-off-by: Dan Smith diff -r b7f53024c5a4 -r eeb54ba6f7b6 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Wed Jul 02 15:07:48 2008 -0700 +++ b/src/Virt_ComputerSystemIndication.c Wed Jul 02 15:08:15 2008 -0700 @@ -53,6 +53,7 @@ }; static CMPI_THREAD_TYPE thread_id[CSI_NUM_PLATFORMS]; +static int active_filters[CSI_NUM_PLATFORMS]; enum CS_EVENTS {CS_CREATED, CS_DELETED, @@ -331,6 +332,11 @@ char *type_name = NULL; CMPIInstance *affected_inst; + if (!lifecycle_enabled) { + CU_DEBUG("CSI not enabled, skipping indication delivery"); + return false; + } + affected_inst = get_typed_instance(_BROKER, prefix, "ComputerSystem", @@ -413,7 +419,7 @@ free(tmp_list); CU_DEBUG("Entering CSI event loop (%s)", prefix); - while (lifecycle_enabled) { + while (active_filters[platform] > 0) { int i; bool res; bool failure = false; @@ -468,6 +474,8 @@ } out: + CU_DEBUG("Exiting CSI event loop (%s)", prefix); + thread_id[platform] = 0; pthread_mutex_unlock(&lifecycle_mutex); @@ -485,11 +493,14 @@ const CMPIObjectPath* op, CMPIBoolean first) { - CU_DEBUG("ActivateFilter"); CMPIStatus s = {CMPI_RC_OK, NULL}; struct std_indication_ctx *_ctx; struct ind_args *args; int platform; + + CU_DEBUG("ActivateFilter for %s", CLASSNAME(op)); + + pthread_mutex_lock(&lifecycle_mutex); _ctx = (struct std_indication_ctx *)mi->hdl; @@ -533,12 +544,17 @@ args->classname = strdup(CLASSNAME(op)); args->_ctx = _ctx; + active_filters[platform] += 1; + thread_id[platform] = _BROKER->xft->newThread(lifecycle_thread, args, 0); - } + } else + active_filters[platform] += 1; out: + pthread_mutex_unlock(&lifecycle_mutex); + return s; } @@ -549,7 +565,26 @@ const CMPIObjectPath* op, CMPIBoolean last) { - return (CMPIStatus){CMPI_RC_OK, NULL}; + int platform; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + CU_DEBUG("DeActivateFilter for %s", CLASSNAME(op)); + + platform = platform_from_class(CLASSNAME(op)); + if (platform < 0) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unknown platform"); + goto out; + } + + pthread_mutex_lock(&lifecycle_mutex); + active_filters[platform] -= 1; + pthread_mutex_unlock(&lifecycle_mutex); + + pthread_cond_signal(&lifecycle_cond); + out: + return s; } static _EI_RTYPE EnableIndications(CMPIIndicationMI* mi, @@ -566,6 +601,7 @@ static _EI_RTYPE DisableIndications(CMPIIndicationMI* mi, const CMPIContext *ctx) { + CU_DEBUG("DisableIndications"); pthread_mutex_lock(&lifecycle_mutex); lifecycle_enabled = false; pthread_mutex_unlock(&lifecycle_mutex); From kaitlin at linux.vnet.ibm.com Thu Jul 3 02:19:28 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 02 Jul 2008 19:19:28 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] More CSI fixes In-Reply-To: References: Message-ID: <486C3730.7040708@linux.vnet.ibm.com> Dan Smith wrote: > Changes detailed per patch > I haven't tested this much, but no complaints on the read through. +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From yunguol at cn.ibm.com Thu Jul 3 02:43:15 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 3 Jul 2008 10:43:15 +0800 Subject: [Libvirt-cim] [TEST] Cimtest Report for LXC with SFCB on F9 (2008/07/03) Message-ID: stro: Fedora 9 Beta kernel-2.6.25-0.121.rc5.git4.fc9.i686 kernel-2.6.25-0.218.rc8.git7.fc9.x86_64 CIMOM: sblim-sfcb-1.3.0-0.i386 libcmpiutil: 81 libvirt-cim: 629 cimtest: changeset-240 ================================================================== PASS : 84 FAIL : 6 XFAIL : 1 SKIP : 39 ----------------- Total : 130 ========================= FAILED ========================================== ComputerSystem - 05_activate_defined_start.py: FAIL ComputerSystem - 27_define_suspend_errs.py: FAIL InvokeMethod(DefineSystem): *** Provider Virt_VirtualSystemManagementService(6322) exiting due to a SIGSEGV signal HostSystem - 03_hs_to_settdefcap.py: FAIL Memory - 02_defgetmem.py: FAIL InvokeMethod(DefineSystem): *** Provider Virt_VirtualSystemManagementService(8447) exiting due to a SIGSEGV signal VirtualSystemManagementService - 01_definesystem_name.py: FAIL InvokeMethod(DefineSystem): *** Provider Virt_VirtualSystemManagementService(23930) exiting due to a SIGSEGV signal VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL InvokeMethod(DestroySystem): Unable to retrieve domain name. InvokeMethod(DestroySystem): Failed to find domain ======================CIMTEST FULL REPORT================================== AllocationCapabilities - 01_enum.py: PASS AllocationCapabilities - 02_alloccap_gi_errs.py: PASS ComputerSystem - 01_enum.py: PASS ComputerSystem - 02_nosystems.py: SKIP ComputerSystem - 03_defineVS.py: PASS ComputerSystem - 04_defineStartVS.py: PASS ComputerSystem - 05_activate_defined_start.py: FAIL ComputerSystem - 06_paused_active_suspend.py: SKIP ComputerSystem - 22_define_suspend.py: PASS ComputerSystem - 23_suspend_suspend.py: SKIP ComputerSystem - 27_define_suspend_errs.py: FAIL InvokeMethod(DefineSystem): *** Provider Virt_VirtualSystemManagementService(6322) exiting due to a SIGSEGV signal ComputerSystem - 32_start_reboot.py: SKIP ComputerSystem - 33_suspend_reboot.py: SKIP ComputerSystem - 35_start_reset.py: SKIP ComputerSystem - 40_RSC_start.py: SKIP ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP ComputerSystem - 42_cs_gi_errs.py: PASS ComputerSystemIndication - 01_created_indication.py: SKIP ElementAllocatedFromPool - 01_forward.py: SKIP ElementAllocatedFromPool - 02_reverse.py: SKIP ElementAllocatedFromPool - 03_reverse_errs.py: SKIP ElementAllocatedFromPool - 04_forward_errs.py: SKIP ElementCapabilities - 01_forward.py: PASS ElementCapabilities - 02_reverse.py: PASS ElementCapabilities - 03_forward_errs.py: PASS ElementCapabilities - 04_reverse_errs.py: PASS ElementCapabilities - 05_hostsystem_cap.py: PASS ElementConforms - 01_forward.py: PASS ElementConforms - 02_reverse.py: PASS ElementConforms - 03_ectp_fwd_errs.py: PASS ElementConforms - 04_ectp_rev_errs.py: PASS ElementSettingData - 01_forward.py: PASS ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS EnabledLogicalElementCapabilities - 01_enum.py: PASS EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS HostSystem - 01_enum.py: PASS HostSystem - 02_hostsystem_to_rasd.py: PASS HostSystem - 03_hs_to_settdefcap.py: FAIL HostSystem - 04_hs_to_EAPF.py: SKIP HostSystem - 05_hs_gi_errs.py: PASS HostSystem - 06_hs_to_vsms.py: PASS HostedDependency - 01_forward.py: PASS HostedDependency - 02_reverse.py: PASS HostedDependency - 03_enabledstate.py: SKIP 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: SKIP LogicalDisk - 02_nodevs.py: SKIP LogicalDisk - 03_ld_gi_errs.py: SKIP Memory - 01_memory.py: PASS Memory - 02_defgetmem.py: FAIL InvokeMethod(DefineSystem): *** Provider Virt_VirtualSystemManagementService(8447) exiting due to a SIGSEGV signal Memory - 03_mem_gi_errs.py: PASS NetworkPort - 01_netport.py: SKIP NetworkPort - 02_np_gi_errors.py: SKIP NetworkPort - 03_user_netport.py: SKIP Processor - 01_processor.py: SKIP Processor - 02_definesys_get_procs.py: SKIP Processor - 03_proc_gi_errs.py: SKIP Profile - 01_enum.py: PASS Profile - 02_profile_to_elec.py: SKIP 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: SKIP 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: SKIP ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: SKIP ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: SKIP ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: SKIP ResourcePoolConfigurationService - 07_DeleteResourcePool.py: SKIP SettingsDefine - 01_forward.py: PASS SettingsDefine - 02_reverse.py: PASS SettingsDefine - 03_sds_fwd_errs.py: PASS SettingsDefine - 04_sds_rev_errs.py: PASS SettingsDefineCapabilities - 01_forward.py: PASS SettingsDefineCapabilities - 03_forward_errs.py: XFAIL Bug: Test error: returned XFAIL without a valid bug string. Bug:<> SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS SystemDevice - 01_forward.py: PASS SystemDevice - 02_reverse.py: PASS SystemDevice - 03_fwderrs.py: PASS VSSD - 01_enum.py: PASS VSSD - 02_bootldr.py: SKIP VSSD - 03_vssd_gi_errs.py: PASS VSSD - 04_vssd_to_rasd.py: PASS VirtualSystemManagementCapabilities - 01_enum.py: PASS VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS VirtualSystemManagementService - 01_definesystem_name.py: FAIL InvokeMethod(DefineSystem): *** Provider Virt_VirtualSystemManagementService(23930) exiting due to a SIGSEGV signal VirtualSystemManagementService - 02_destroysystem.py: PASS VirtualSystemManagementService - 03_definesystem_ess.py: PASS VirtualSystemManagementService - 04_definesystem_ers.py: PASS VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL InvokeMethod(DestroySystem): Unable to retrieve domain name. InvokeMethod(DestroySystem): Failed to find domain VirtualSystemManagementService - 06_addresource.py: SKIP VirtualSystemManagementService - 07_addresource_neg.py: PASS VirtualSystemManagementService - 08_modifyresource.py: SKIP VirtualSystemManagementService - 09_procrasd_persist.py: SKIP 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: PASS VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS VirtualSystemSnapshotService - 01_enum.py: PASS VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922144 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 -------------- next part -------------- An HTML attachment was scrubbed... URL: From deeptik at linux.vnet.ibm.com Thu Jul 3 09:42:51 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 03 Jul 2008 15:12:51 +0530 Subject: [Libvirt-cim] CimTest Report on XenFV 03-07-2008 Message-ID: <486C9F1B.1070509@linux.vnet.ibm.com> ====================================== CIM Test Report for XenFV ====================================== Distro : RHEL 5.2 Beta Kernel : 2.6.18-88.el5xen Xen version : 3.1.2-88.el5 Libvirt : libvirt-0.3.3-7.el5 CIMOM : pegasus PyWBEM : pywbem-3.14 CIM Schema : cimv216Experimental LibCMPIutil : 79 LibVirtCIM : 629 CIMTEST : 240 ====================================== PASS : 91 TOTAL FAILED : 11 [9 test cases passed when ran manually] ACTUAL FAILED : 2 XFAIL : 6 SKIP : 22 ------------------- Total : 130 ====================================== List of tc that are failing: ComputerSystem - 06_paused_active_suspend.py: FAIL VirtualSystemManagementService - 02_destroysystem.py: FAIL The following tc passed when run manually: ElementConforms - 01_forward.py: FAIL ElementConforms - 02_reverse.py: FAIL EnabledLogicalElementCapabilities - 01_enum.py: FAIL HostSystem - 02_hostsystem_to_rasd.py: FAIL LogicalDisk - 03_ld_gi_errs.py: FAIL Memory - 01_memory.py: FAIL NetworkPort - 01_netport.py: FAIL VSSD - 04_vssd_to_rasd.py: FAIL VirtualSystemManagementService - 09_procrasd_persist.py: FAIL Please find the complete report attached with the mail. Thanks and Regards, Deepti. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: July03-XenFV-report URL: From kaitlin at linux.vnet.ibm.com Thu Jul 3 13:49:02 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 03 Jul 2008 06:49:02 -0700 Subject: [Libvirt-cim] [TEST] Cimtest Report for LXC with SFCB on F9 (2008/07/03) In-Reply-To: References: Message-ID: <486CD8CE.4030809@linux.vnet.ibm.com> Guo Lian Yun wrote: > > stro: Fedora 9 Beta > kernel-2.6.25-0.121.rc5.git4.fc9.i686 > kernel-2.6.25-0.218.rc8.git7.fc9.x86_64 > CIMOM: sblim-sfcb-1.3.0-0.i386 > libcmpiutil: 81 > libvirt-cim: 629 > cimtest: changeset-240 > > ================================================================== > PASS : 84 > FAIL : 6 > XFAIL : 1 > SKIP : 39 > ----------------- > Total : 130 > > ========================= FAILED > ========================================== > ComputerSystem - 05_activate_defined_start.py: FAIL > InvokeMethod(DefineSystem): *** Provider > Virt_VirtualSystemManagementService(6322) exiting due to a SIGSEGV signal > Memory - 02_defgetmem.py: FAIL > InvokeMethod(DefineSystem): *** Provider > Virt_VirtualSystemManagementService(8447) exiting due to a SIGSEGV signal > VirtualSystemManagementService - 01_definesystem_name.py: FAIL > InvokeMethod(DefineSystem): *** Provider > Virt_VirtualSystemManagementService(23930) exiting due to a SIGSEGV signal Thanks for the SFCB run Daisy! Do you have any info on why the provider is hitting a SIGSEGV? Any provider debug available? > ComputerSystem - 27_define_suspend_errs.py: FAIL > HostSystem - 03_hs_to_settdefcap.py: FAIL > VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL > InvokeMethod(DestroySystem): Unable to retrieve domain name. > InvokeMethod(DestroySystem): Failed to find domain These seem to be new failures - any information on why these are failing? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From tyler.berry at hp.com Thu Jul 3 20:54:26 2008 From: tyler.berry at hp.com (Tyler Berry) Date: Thu, 03 Jul 2008 14:54:26 -0600 Subject: [Libvirt-cim] Apparent RPM spec file conflict Message-ID: <1215118466.27049.8.camel@tyler> The RPM spec file libvirt-cim.spec from the most recent snapshot includes these two build constraints: BuildRequires: libcmpiutil-devel BuildConflicts: sblim-cmpi-devel The RPM spec file libcmpiutil.spec from the most recent snapshot includes this constraint: BuildRequires: sblim-cmpi-devel With RPM 4.4.2 on RH5.2, this results in it being impossible to generate a libvirt-cim RPM; the build dependency libcmpiutil has on sblim-cmpi-devel is being retained as a runtime dependency. This may be a result of a mistake or mistaken assumption on my part, but it may also be an error in one or both spec files. Below is a lightly edited log of the results of trying to build a libvirt-cim RPM from the current snapshots. - [tyler at tyler-rhel32-vm libvirt-cim-0.5]$ sudo rpmbuild -ba libvirt-cim.spec Password: error: Failed build dependencies: libcmpiutil-devel is needed by libvirt-cim-0.5-1.i386 [tyler at tyler-rhel32-vm libcmpiutil-0.1]$ sudo rpmbuild -ba libcmpiutil.spec error: Failed build dependencies: sblim-cmpi-devel is needed by libcmpiutil-0.1-1.i386 [tyler at tyler-rhel32-vm Server]$ sudo rpm -ivh sblim-cmpi-devel-1.0.4-31.el5.i386.rpm warning: sblim-cmpi-devel-1.0.4-31.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 Preparing... ########################################### [100%] 1:sblim-cmpi-devel ########################################### [100%] [tyler at tyler-rhel32-vm libcmpiutil-0.1]$ sudo rpmbuild -ba libcmpiutil.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.17372 ... ... [tyler at tyler-rhel32-vm libcmpiutil-0.1]$ sudo rpm -ivh /usr/src/redhat/RPMS/i386/libcmpiutil-0.1-1.i386.rpm Preparing... ########################################### [100%] 1:libcmpiutil ########################################### [100%] [tyler at tyler-rhel32-vm libcmpiutil-0.1]$ sudo rpm -ivh /usr/src/redhat/RPMS/i386/libcmpiutil-devel-0.1-1.i386.rpm Preparing... ########################################### [100%] 1:libcmpiutil-devel ########################################### [100%] [tyler at tyler-rhel32-vm libvirt-cim-0.5]$ sudo rpmbuild -ba libvirt-cim.spec error: Failed build dependencies: sblim-cmpi-devel conflicts with libvirt-cim-0.5-1.i386 [tyler at tyler-rhel32-vm libvirt-cim-0.5]$ sudo rpm -e sblim-cmpi-devel error: Failed dependencies: sblim-cmpi-devel is needed by (installed) libcmpiutil-devel-0.1-1.i386 -- Tyler Berry ESS Software, Hewlett-Packard OSLO -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From kaitlin at linux.vnet.ibm.com Thu Jul 3 23:19:47 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 03 Jul 2008 16:19:47 -0700 Subject: [Libvirt-cim] Apparent RPM spec file conflict In-Reply-To: <1215118466.27049.8.camel@tyler> References: <1215118466.27049.8.camel@tyler> Message-ID: <486D5E93.3030709@linux.vnet.ibm.com> Tyler Berry wrote: > The RPM spec file libvirt-cim.spec from the most recent snapshot > includes these two build constraints: > > BuildRequires: libcmpiutil-devel > BuildConflicts: sblim-cmpi-devel > > The RPM spec file libcmpiutil.spec from the most recent snapshot > includes this constraint: > > BuildRequires: sblim-cmpi-devel Hi Tyler, It looks like the libcmpiutil-snapshot.tar.gz link on ftp://libvirt.org/libvirt-cim is pointing to the 0.1 release of libcmpiutil (your libcmpiutil spec should say Version: 0.1 at the top). Can you try with the 0.4 tarball instead? It's the most recent release. ftp://libvirt.org/libvirt-cim/libcmpiutil-0.4.tar.gz Thanks for bringing this issue up. I'll see about getting the link to point to the proper release. =) -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From jfehlig at novell.com Sun Jul 6 01:19:11 2008 From: jfehlig at novell.com (Jim Fehlig) Date: Sat, 05 Jul 2008 19:19:11 -0600 Subject: [Libvirt-cim] Xen_ComputerSystem RequestStateChange In-Reply-To: <87myl116gv.fsf@caffeine.beaverton.ibm.com> References: <486AAA34.5050701@novell.com> <486AB78E.9020309@linux.vnet.ibm.com> <87myl116gv.fsf@caffeine.beaverton.ibm.com> Message-ID: <48701D8F.1000007@novell.com> Dan Smith wrote: > KR> Right now, shutdown isn't supported. The DMTF Virtual System Profile > KR> lists an extra step for shutdown - the provider needs to tell the > KR> software running on the guest to shutdown. Once the software has > KR> terminated its tasks and shut itself down, the provider then treats > KR> the shutdown action in the same manner it treats disable. > > KR> The steps to indicate to the guest that the OS needs to shutdown are > KR> involved. This is probably out of the project's scope, for awhile at > KR> least. > > KR> It would be possible to have shutdown and disable behave the same way, > KR> but that wouldn't conform to the DMTF profile. > > KR> Dan - thoughts? > > For paravirt Xen, issuing the shutdown command actually triggers an > action in the guest kernel to start a shutdown (which becomes the > equivalent of "shutdown -h now"). For fullvirt and KVM guests, a > shutdown action should be simulated via ACPI (the equivalent of > pushing the power button on an ACPI-enabled physical machine). I > think I recall there being some plumbing issues to make this really > work for KVM guests, but I think we should assume that it works. > IIRC, someone in the Xen community is doing similar work to inject ACPI events in HVM guests. Additionally, many existing Xen HVM guests using PV drivers support the "shutdown -h now" semantics. > From what I can tell, requesting the shutdown state is equivalent to > requesting the disabled state from our perspective. Agreed. Regards, Jim From yunguol at cn.ibm.com Mon Jul 7 03:08:42 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 7 Jul 2008 11:08:42 +0800 Subject: [Libvirt-cim] Cimtest Report for LXC on F9 (2008/07/07) Message-ID: stro: Fedora 9 Beta kernel-2.6.25-0.218.rc8.git7.fc9.x86_64 CIMOM: tog-pegasus-2.7.0-6.fc9.x86_64 cimtest: changeset-240 ================================================================== PASS : 90 FAIL : 1 XFAIL : 1 SKIP : 38 ----------------- Total : 130 ========================= FAILED ========================================== ComputerSystem - 04_defineStartVS.py: FAIL ERROR - Error: property values are not set for VS domguest ======================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: FAIL ComputerSystem - 05_activate_defined_start.py: XFAIL Bug: 00002 ComputerSystem - 06_paused_active_suspend.py: SKIP ComputerSystem - 22_define_suspend.py: PASS ComputerSystem - 23_suspend_suspend.py: SKIP ComputerSystem - 27_define_suspend_errs.py: PASS ComputerSystem - 32_start_reboot.py: SKIP ComputerSystem - 33_suspend_reboot.py: SKIP ComputerSystem - 35_start_reset.py: SKIP ComputerSystem - 40_RSC_start.py: SKIP ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP ComputerSystem - 42_cs_gi_errs.py: PASS ComputerSystemIndication - 01_created_indication.py: SKIP ElementAllocatedFromPool - 01_forward.py: SKIP ElementAllocatedFromPool - 02_reverse.py: SKIP ElementAllocatedFromPool - 03_reverse_errs.py: SKIP ElementAllocatedFromPool - 04_forward_errs.py: SKIP ElementCapabilities - 01_forward.py: PASS ElementCapabilities - 02_reverse.py: PASS ElementCapabilities - 03_forward_errs.py: PASS ElementCapabilities - 04_reverse_errs.py: PASS ElementCapabilities - 05_hostsystem_cap.py: PASS ElementConforms - 01_forward.py: PASS ElementConforms - 02_reverse.py: PASS ElementConforms - 03_ectp_fwd_errs.py: PASS ElementConforms - 04_ectp_rev_errs.py: PASS ElementSettingData - 01_forward.py: PASS ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS EnabledLogicalElementCapabilities - 01_enum.py: PASS EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS HostSystem - 01_enum.py: PASS HostSystem - 02_hostsystem_to_rasd.py: PASS HostSystem - 03_hs_to_settdefcap.py: PASS HostSystem - 04_hs_to_EAPF.py: SKIP HostSystem - 05_hs_gi_errs.py: PASS HostSystem - 06_hs_to_vsms.py: PASS HostedDependency - 01_forward.py: PASS HostedDependency - 02_reverse.py: PASS HostedDependency - 03_enabledstate.py: SKIP 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: SKIP LogicalDisk - 02_nodevs.py: SKIP LogicalDisk - 03_ld_gi_errs.py: SKIP Memory - 01_memory.py: PASS Memory - 02_defgetmem.py: PASS Memory - 03_mem_gi_errs.py: PASS NetworkPort - 01_netport.py: SKIP NetworkPort - 02_np_gi_errors.py: SKIP NetworkPort - 03_user_netport.py: SKIP Processor - 01_processor.py: SKIP Processor - 02_definesys_get_procs.py: SKIP Processor - 03_proc_gi_errs.py: SKIP Profile - 01_enum.py: PASS Profile - 02_profile_to_elec.py: SKIP 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: SKIP 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: SKIP ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: SKIP ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: SKIP ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: SKIP ResourcePoolConfigurationService - 07_DeleteResourcePool.py: SKIP SettingsDefine - 01_forward.py: PASS SettingsDefine - 02_reverse.py: PASS SettingsDefine - 03_sds_fwd_errs.py: PASS SettingsDefine - 04_sds_rev_errs.py: PASS SettingsDefineCapabilities - 01_forward.py: PASS SettingsDefineCapabilities - 03_forward_errs.py: PASS SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS SystemDevice - 01_forward.py: PASS SystemDevice - 02_reverse.py: PASS SystemDevice - 03_fwderrs.py: PASS VSSD - 01_enum.py: PASS VSSD - 02_bootldr.py: SKIP VSSD - 03_vssd_gi_errs.py: PASS VSSD - 04_vssd_to_rasd.py: PASS VirtualSystemManagementCapabilities - 01_enum.py: PASS VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS VirtualSystemManagementService - 01_definesystem_name.py: PASS VirtualSystemManagementService - 02_destroysystem.py: PASS VirtualSystemManagementService - 03_definesystem_ess.py: PASS VirtualSystemManagementService - 04_definesystem_ers.py: PASS VirtualSystemManagementService - 05_destroysystem_neg.py: PASS VirtualSystemManagementService - 06_addresource.py: SKIP VirtualSystemManagementService - 07_addresource_neg.py: PASS VirtualSystemManagementService - 08_modifyresource.py: SKIP VirtualSystemManagementService - 09_procrasd_persist.py: SKIP 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: PASS VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS VirtualSystemSnapshotService - 01_enum.py: PASS VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922144 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 -------------- next part -------------- An HTML attachment was scrubbed... URL: From yunguol at cn.ibm.com Mon Jul 7 03:17:42 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 7 Jul 2008 11:17:42 +0800 Subject: [Libvirt-cim] Cimtest Report for LXC on F9 (2008/07/07) In-Reply-To: Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-07 11:08:42: > > stro: Fedora 9 Beta > kernel-2.6.25-0.218.rc8.git7.fc9.x86_64 > CIMOM: tog-pegasus-2.7.0-6.fc9.x86_64 > cimtest: changeset-240 > > ================================================================== > PASS : 90 > FAIL : 1 > XFAIL : 1 > SKIP : 38 > ----------------- > Total : 130 > > ========================= FAILED ========================================== > ComputerSystem - 04_defineStartVS.py: FAIL > ERROR - Error: property values are not set for VS domguest > I'm not sure why it fails sometimes, it pass on for me on the next running. > ======================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: FAIL > ComputerSystem - 05_activate_defined_start.py: XFAIL Bug: 00002 > ComputerSystem - 06_paused_active_suspend.py: SKIP > ComputerSystem - 22_define_suspend.py: PASS > ComputerSystem - 23_suspend_suspend.py: SKIP > ComputerSystem - 27_define_suspend_errs.py: PASS > ComputerSystem - 32_start_reboot.py: SKIP > ComputerSystem - 33_suspend_reboot.py: SKIP > ComputerSystem - 35_start_reset.py: SKIP > ComputerSystem - 40_RSC_start.py: SKIP > ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP > ComputerSystem - 42_cs_gi_errs.py: PASS > ComputerSystemIndication - 01_created_indication.py: SKIP > ElementAllocatedFromPool - 01_forward.py: SKIP > ElementAllocatedFromPool - 02_reverse.py: SKIP > ElementAllocatedFromPool - 03_reverse_errs.py: SKIP > ElementAllocatedFromPool - 04_forward_errs.py: SKIP > ElementCapabilities - 01_forward.py: PASS > ElementCapabilities - 02_reverse.py: PASS > ElementCapabilities - 03_forward_errs.py: PASS > ElementCapabilities - 04_reverse_errs.py: PASS > ElementCapabilities - 05_hostsystem_cap.py: PASS > ElementConforms - 01_forward.py: PASS > ElementConforms - 02_reverse.py: PASS > ElementConforms - 03_ectp_fwd_errs.py: PASS > ElementConforms - 04_ectp_rev_errs.py: PASS > ElementSettingData - 01_forward.py: PASS > ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS > EnabledLogicalElementCapabilities - 01_enum.py: PASS > EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS > HostSystem - 01_enum.py: PASS > HostSystem - 02_hostsystem_to_rasd.py: PASS > HostSystem - 03_hs_to_settdefcap.py: PASS > HostSystem - 04_hs_to_EAPF.py: SKIP > HostSystem - 05_hs_gi_errs.py: PASS > HostSystem - 06_hs_to_vsms.py: PASS > HostedDependency - 01_forward.py: PASS > HostedDependency - 02_reverse.py: PASS > HostedDependency - 03_enabledstate.py: SKIP > 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: SKIP > LogicalDisk - 02_nodevs.py: SKIP > LogicalDisk - 03_ld_gi_errs.py: SKIP > Memory - 01_memory.py: PASS > Memory - 02_defgetmem.py: PASS > Memory - 03_mem_gi_errs.py: PASS > NetworkPort - 01_netport.py: SKIP > NetworkPort - 02_np_gi_errors.py: SKIP > NetworkPort - 03_user_netport.py: SKIP > Processor - 01_processor.py: SKIP > Processor - 02_definesys_get_procs.py: SKIP > Processor - 03_proc_gi_errs.py: SKIP > Profile - 01_enum.py: PASS > Profile - 02_profile_to_elec.py: SKIP > 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: SKIP > 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: SKIP > ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: SKIP > ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: SKIP > ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: SKIP > ResourcePoolConfigurationService - 07_DeleteResourcePool.py: SKIP > SettingsDefine - 01_forward.py: PASS > SettingsDefine - 02_reverse.py: PASS > SettingsDefine - 03_sds_fwd_errs.py: PASS > SettingsDefine - 04_sds_rev_errs.py: PASS > SettingsDefineCapabilities - 01_forward.py: PASS > SettingsDefineCapabilities - 03_forward_errs.py: PASS > SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS > SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS > SystemDevice - 01_forward.py: PASS > SystemDevice - 02_reverse.py: PASS > SystemDevice - 03_fwderrs.py: PASS > VSSD - 01_enum.py: PASS > VSSD - 02_bootldr.py: SKIP > VSSD - 03_vssd_gi_errs.py: PASS > VSSD - 04_vssd_to_rasd.py: PASS > VirtualSystemManagementCapabilities - 01_enum.py: PASS > VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS > VirtualSystemManagementService - 01_definesystem_name.py: PASS > VirtualSystemManagementService - 02_destroysystem.py: PASS > VirtualSystemManagementService - 03_definesystem_ess.py: PASS > VirtualSystemManagementService - 04_definesystem_ers.py: PASS > VirtualSystemManagementService - 05_destroysystem_neg.py: PASS > VirtualSystemManagementService - 06_addresource.py: SKIP > VirtualSystemManagementService - 07_addresource_neg.py: PASS > VirtualSystemManagementService - 08_modifyresource.py: SKIP > VirtualSystemManagementService - 09_procrasd_persist.py: SKIP > 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: PASS > VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS > VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS > VirtualSystemSnapshotService - 01_enum.py: PASS > VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS > VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS > VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS > > Best, > Regards > > Daisy (???) > VSM Team, China Systems & Technology Labs (CSTL) > E-mail: yunguol at cn.ibm.com > TEL: (86)-21-60922144 > Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 > _______________________________________________ > 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 kaitlin at linux.vnet.ibm.com Mon Jul 7 15:14:43 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 07 Jul 2008 08:14:43 -0700 Subject: [Libvirt-cim] Cimtest Report for LXC on F9 (2008/07/07) In-Reply-To: References: Message-ID: <487232E3.4010004@linux.vnet.ibm.com> > > ComputerSystem - 04_defineStartVS.py: FAIL > > ERROR - Error: property values are not set for VS domguest > > > I'm not sure why it fails sometimes, it pass on for me on the next > running. Have you run the test with the provider debug enabled? Does the provider debug give any hints? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From yunguol at cn.ibm.com Tue Jul 8 02:01:27 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 8 Jul 2008 10:01:27 +0800 Subject: [Libvirt-cim] Cimtest Report for LXC on F9 (2008/07/07) In-Reply-To: <487232E3.4010004@linux.vnet.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-07 23:14:43: > > > ComputerSystem - 04_defineStartVS.py: FAIL > > > ERROR - Error: property values are not set for VS domguest > > > > > I'm not sure why it fails sometimes, it pass on for me on the next > > running. > > Have you run the test with the provider debug enabled? Does the > provider debug give any hints? This fails because the defined domain isn't started successfully every time. If it can't be started, the EnabledState still equals to 3 not 2. Below is part of test case code. ...... enabState = cs.EnabledState if enabState == 2: status = PASS break ....... I try to export the debug info, it seems that there is not much useful info. misc_util.c(72): Connecting to libvirt with uri `lxc:///system' misc_util.c(199): URI of connection is: lxc:///system misc_util.c(72): Connecting to libvirt with uri `lxc:///system' misc_util.c(199): URI of connection is: lxc:///system misc_util.c(72): Connecting to libvirt with uri `lxc:///system' misc_util.c(199): URI of connection is: lxc:///system misc_util.c(199): URI of connection is: lxc:///system instance_util.c(127): Number of keys: 2 instance_util.c(140): Comparing key 0: `CreationClassName' instance_util.c(140): Comparing key 1: `Name' misc_util.c(72): Connecting to libvirt with uri `lxc:///system' misc_util.c(199): URI of connection is: lxc:///system misc_util.c(199): URI of connection is: lxc:///system instance_util.c(127): Number of keys: 2 instance_util.c(140): Comparing key 0: `CreationClassName' instance_util.c(140): Comparing key 1: `Name' misc_util.c(72): Connecting to libvirt with uri `lxc:///system' misc_util.c(199): URI of connection is: lxc:///system misc_util.c(199): URI of connection is: lxc:///system instance_util.c(127): Number of keys: 2 instance_util.c(140): Comparing key 0: `CreationClassName' instance_util.c(140): Comparing key 1: `Name' misc_util.c(72): Connecting to libvirt with uri `lxc:///system' misc_util.c(199): URI of connection is: lxc:///system misc_util.c(199): URI of connection is: lxc:///system instance_util.c(127): Number of keys: 2 instance_util.c(140): Comparing key 0: `CreationClassName' instance_util.c(140): Comparing key 1: `Name' misc_util.c(72): Connecting to libvirt with uri `lxc:///system' misc_util.c(199): URI of connection is: lxc:///system misc_util.c(199): URI of connection is: lxc:///system instance_util.c(127): Number of keys: 2 instance_util.c(140): Comparing key 0: `CreationClassName' instance_util.c(140): Comparing key 1: `Name' misc_util.c(72): Connecting to libvirt with uri `lxc:///system' misc_util.c(199): URI of connection is: lxc:///system misc_util.c(199): URI of connection is: lxc:///system instance_util.c(127): Number of keys: 2 instance_util.c(140): Comparing key 0: `CreationClassName' instance_util.c(140): Comparing key 1: `Name' misc_util.c(72): Connecting to libvirt with uri `lxc:///system' misc_util.c(199): URI of connection is: lxc:///system misc_util.c(199): URI of connection is: lxc:///system instance_util.c(127): Number of keys: 2 instance_util.c(140): Comparing key 0: `CreationClassName' instance_util.c(140): Comparing key 1: `Name' misc_util.c(72): Connecting to libvirt with uri `lxc:///system' misc_util.c(199): URI of connection is: lxc:///system misc_util.c(199): URI of connection is: lxc:///system instance_util.c(127): Number of keys: 2 instance_util.c(140): Comparing key 0: `CreationClassName' instance_util.c(140): Comparing key 1: `Name' misc_util.c(72): Connecting to libvirt with uri `lxc:///system' misc_util.c(199): URI of connection is: lxc:///system misc_util.c(199): URI of connection is: lxc:///system instance_util.c(127): Number of keys: 2 instance_util.c(140): Comparing key 0: `CreationClassName' instance_util.c(140): Comparing key 1: `Name' misc_util.c(72): Connecting to libvirt with uri `lxc:///system' misc_util.c(199): URI of connection is: lxc:///system misc_util.c(199): URI of connection is: lxc:///system instance_util.c(127): Number of keys: 2 instance_util.c(140): Comparing key 0: `CreationClassName' instance_util.c(140): Comparing key 1: `Name' > > -- > 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 kaitlin at linux.vnet.ibm.com Tue Jul 8 19:12:28 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 08 Jul 2008 12:12:28 -0700 Subject: [Libvirt-cim] [PATCH] [CU] indication_tester.py enhancements Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1215544338 25200 # Node ID be269371a819744e742c24a55d011610cf6d3485 # Parent ef4c4ae1217b6f8e0f284178e6674ce3c9322f15 [CU] indication_tester.py enhancements Add support for a port option. If nothing is supplied, port 8000 is used. Otherwise, the value supplied is added to 8000. This allows for multiple copies of the indication_tester to run at once. Update delete_inst_xml() to take an inst_name argument. The classname needs to be CIM_IndicationHandlerCIMXML, not CIM_IndicationHandler. However, the instance is created with the instance name "%s%s" % (self.name, "Handler") This has been tested with both Pegasus and sfcb. Signed-off-by: Kaitlin Rupert diff -r ef4c4ae1217b -r be269371a819 tools/indication_tester.py --- a/tools/indication_tester.py Tue Jul 01 11:25:17 2008 -0700 +++ b/tools/indication_tester.py Tue Jul 08 12:12:18 2008 -0700 @@ -169,7 +169,7 @@ """ % (sysname, name, sysname, name) -def delete_inst_xml(name, type, sysname): +def delete_inst_xml(name, type, sysname, inst_name): return """ @@ -192,7 +192,7 @@ CIM_Indication%s - %s%s + %s @@ -200,7 +200,7 @@ ; - """ % (type, sysname, type, name, type); + """ % (type, sysname, type, inst_name); def delete_sub_xml(name, sysname): return """ @@ -298,13 +298,15 @@ self.server.indications.append(indication) class CIMIndicationSubscription: - def __init__(self, name, typ, ns, print_ind, sysname): + def __init__(self, name, typ, ns, print_ind, sysname, port=0): self.name = name self.type = typ self.ns = ns self.sysname = sysname - self.server = BaseHTTPServer.HTTPServer(('', 8000), CIMSocketHandler) + self.port = 8000 + port + self.server = BaseHTTPServer.HTTPServer(('', self.port), + CIMSocketHandler) self.server.print_ind = print_ind self.port = 8000 self.server.indications = [] @@ -355,10 +357,12 @@ xml = delete_sub_xml(self.name, self.sysname) self.__do_cimpost(self.conn, xml, "DeleteInstance", auth_hdr) - xml = delete_inst_xml(self.name, "Handler", self.sysname) + xml = delete_inst_xml(self.name, "HandlerCIMXML", self.sysname, + "%sHandler" % self.name) self.__do_cimpost(self.conn, xml, "DeleteInstance", auth_hdr) - xml = delete_inst_xml(self.name, "Filter", self.sysname) + xml = delete_inst_xml(self.name, "Filter", self.sysname, + "%sFilter" % self.name) self.__do_cimpost(self.conn, xml, "DeleteInstance", auth_hdr) @@ -366,8 +370,9 @@ filter_str = filter_xml(name, typ, ns, sysname) handler_str = handler_xml(name, 8000, sysname) subscript_str = subscription_xml(name, sysname) - del_filter_str = delete_inst_xml(name, "Filter", sysname) - del_handler_str = delete_inst_xml(name, "Handler", sysname) + del_filter_str = delete_inst_xml(name, "Filter", sysname, "%sFilter" % name) + del_handler_str = delete_inst_xml(name, "HandlerCIMXML", sysname, + "%sHandler" % name) del_subscript_str = delete_sub_xml(name, sysname) print "CreateFilter:\n%s\n" % filter_str @@ -398,6 +403,8 @@ help="HTTP Auth username") parser.add_option("-P", "--pass", dest="password", default=None, help="HTTP Auth password") + parser.add_option("--port", dest="port", default=0, type=int, + help="Port increment value (server default: 8000)") (options, args) = parser.parse_args() @@ -420,7 +427,7 @@ sys.exit(0) sub = CIMIndicationSubscription(options.name, args[0], options.ns, - options.print_ind, sysname) + options.print_ind, sysname, options.port) sub.subscribe(options.url, auth) print "Watching for %s" % args[0] From yunguol at cn.ibm.com Wed Jul 9 05:06:15 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 9 Jul 2008 13:06:15 +0800 Subject: [Libvirt-cim] Cimtest Report for Xen on RHEL5.2 (2008/07/09) Message-ID: Distro : RHEL 5.2 Beta Kernel : kernel-2.6.18-92.el5 Xen version : xen-3.0.3-64.el5 Libvirt : libvirt-0.3.3-7.el5 CIMOM : pegasus PyWBEM : pywbem-3.14 CIM Schema : cimv216Experimental LibCMPIutil : 79 LibVirtCIM : 634 CIMTEST : 240 ========================================================= PASS : 114 FAILED : 8 XFAIL : 7 SKIP : 1 Total : 130 =======================FAILED (8)======================== LogicalDisk - 03_ld_gi_errs.py: FAIL ERROR - Failed to get instance by the class of Xen_LogicalDisk ERROR - Exception: (6, u'CIM_ERR_NOT_FOUND: No such instance (hd_domain/xvda)') Memory - 01_memory.py: FAIL ERROR - Capacity should be 262144 MB instead of 131072 MB NetworkPort - 01_netport.py: FAIL ERROR - Exception: (6, u'CIM_ERR_NOT_FOUND: No such instance (test_domain/00:11:22:33:44:55)') VSSD - 02_bootldr.py: FAIL ERROR - NameError : global name 'BaseException' is not defined CIM_ERR_NOT_FOUND: No such instance (dom) VSSD - 04_vssd_to_rasd.py: FAIL ERROR - Xen_VirtualSystemSettingData with VSSDC_dom was not returned ERROR - Xen_VirtualSystemSettingData returned 0 VSSD objects, expected only 1 VirtualSystemManagementService - 02_destroysystem.py: FAIL ERROR - Unknow exception happened ERROR - (1, u'CIM_ERR_FAILED: Unable to retrieve domain name.') InvokeMethod(DestroySystem): CIM_ERR_FAILED: Unable to retrieve domain name. VirtualSystemManagementService - 08_modifyresource.py: FAIL ERROR - Got 2, exp 1. ERROR - Error invoking ModifyRS: mod_vcpu_res ERROR - Error changing rs for vcpu VirtualSystemManagementService - 09_procrasd_persist.py: FAIL ERROR - limit is 0, expected 256 ERROR - rstest_domain CPU scheduling not set properly =======================CIMTEST============================= 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: 00002 ERROR - ERROR: VS DomST1 transition from Defined State to Activate state was not Successful Bug:<00002> ComputerSystem - 06_paused_active_suspend.py: XFAIL Bug: 00002 ERROR - ERROR: VS DomST1 transition from suspend State to Activate state was not Successful Bug:<00002> ComputerSystem - 22_define_suspend.py: PASS ComputerSystem - 23_suspend_suspend.py: XFAIL Bug: 00002 ERROR - RequestedState should be 2 not 12 ERROR - Attributes for dom test_domain not set as expected. Bug:<00002> ComputerSystem - 27_define_suspend_errs.py: PASS ComputerSystem - 32_start_reboot.py: XFAIL Bug: 00002 ERROR - RequestedState should be 2 not 12 ERROR - Attributes for dom test_domain not set as expected. Bug:<00002> ComputerSystem - 33_suspend_reboot.py: XFAIL Bug: 00002 ERROR - RequestedState should be 2 not 12 ERROR - Attributes for dom test_domain not set as expected. Bug:<00002> ComputerSystem - 35_start_reset.py: XFAIL Bug: 00002 ERROR - RequestedState should be 2 not 12 ERROR - Attributes for dom test_domain not set as expected. Bug:<00002> ComputerSystem - 40_RSC_start.py: XFAIL Bug: 00002 ERROR - RequestedState should be 2 not 12 ERROR - Exception: Attributes were not set as expected for domain: 'test_domain' Bug:<00002> ComputerSystem - 41_cs_to_settingdefinestate.py: PASS ComputerSystem - 42_cs_gi_errs.py: PASS ComputerSystemIndication - 01_created_indication.py: PASS ElementAllocatedFromPool - 01_forward.py: PASS ElementAllocatedFromPool - 02_reverse.py: PASS ElementAllocatedFromPool - 03_reverse_errs.py: PASS ElementAllocatedFromPool - 04_forward_errs.py: PASS ElementCapabilities - 01_forward.py: PASS ElementCapabilities - 02_reverse.py: PASS ElementCapabilities - 03_forward_errs.py: PASS ElementCapabilities - 04_reverse_errs.py: PASS ElementCapabilities - 05_hostsystem_cap.py: PASS ElementConforms - 01_forward.py: PASS ElementConforms - 02_reverse.py: PASS ElementConforms - 03_ectp_fwd_errs.py: PASS ElementConforms - 04_ectp_rev_errs.py: PASS ElementSettingData - 01_forward.py: PASS ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS EnabledLogicalElementCapabilities - 01_enum.py: PASS EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS HostSystem - 01_enum.py: PASS HostSystem - 02_hostsystem_to_rasd.py: PASS HostSystem - 03_hs_to_settdefcap.py: PASS HostSystem - 04_hs_to_EAPF.py: PASS HostSystem - 05_hs_gi_errs.py: PASS HostSystem - 06_hs_to_vsms.py: PASS HostedDependency - 01_forward.py: PASS HostedDependency - 02_reverse.py: PASS HostedDependency - 03_enabledstate.py: PASS HostedDependency - 04_reverse_errs.py: PASS HostedResourcePool - 01_forward.py: PASS HostedResourcePool - 02_reverse.py: PASS HostedResourcePool - 03_forward_errs.py: PASS HostedResourcePool - 04_reverse_errs.py: PASS HostedService - 01_forward.py: PASS HostedService - 02_reverse.py: PASS HostedService - 03_forward_errs.py: PASS HostedService - 04_reverse_errs.py: PASS LogicalDisk - 01_disk.py: PASS LogicalDisk - 02_nodevs.py: PASS LogicalDisk - 03_ld_gi_errs.py: FAIL ERROR - Failed to get instance by the class of Xen_LogicalDisk ERROR - Exception: (6, u'CIM_ERR_NOT_FOUND: No such instance (hd_domain/xvda)') Memory - 01_memory.py: FAIL ERROR - Capacity should be 262144 MB instead of 131072 MB Memory - 02_defgetmem.py: PASS Memory - 03_mem_gi_errs.py: PASS NetworkPort - 01_netport.py: FAIL ERROR - Exception: (6, u'CIM_ERR_NOT_FOUND: No such instance (test_domain/00:11:22:33:44:55)') NetworkPort - 02_np_gi_errors.py: PASS NetworkPort - 03_user_netport.py: SKIP Processor - 01_processor.py: PASS Processor - 02_definesys_get_procs.py: PASS Processor - 03_proc_gi_errs.py: PASS Profile - 01_enum.py: PASS Profile - 02_profile_to_elec.py: PASS Profile - 03_rprofile_gi_errs.py: PASS RASD - 01_verify_rasd_fields.py: PASS RASD - 02_enum.py: PASS RASD - 03_rasd_errs.py: PASS ReferencedProfile - 01_verify_refprof.py: PASS ReferencedProfile - 02_refprofile_errs.py: PASS ResourceAllocationFromPool - 01_forward.py: PASS ResourceAllocationFromPool - 02_reverse.py: PASS ResourceAllocationFromPool - 03_forward_errs.py: PASS ResourceAllocationFromPool - 04_reverse_errs.py: PASS ResourceAllocationFromPool - 05_RAPF_err.py: PASS ResourcePool - 01_enum.py: PASS ResourcePool - 02_rp_gi_errors.py: PASS ResourcePoolConfigurationCapabilities - 01_enum.py: PASS ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS ResourcePoolConfigurationService - 01_enum.py: PASS ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS SettingsDefine - 01_forward.py: PASS SettingsDefine - 02_reverse.py: PASS SettingsDefine - 03_sds_fwd_errs.py: PASS SettingsDefine - 04_sds_rev_errs.py: PASS SettingsDefineCapabilities - 01_forward.py: PASS SettingsDefineCapabilities - 03_forward_errs.py: PASS SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS SystemDevice - 01_forward.py: PASS SystemDevice - 02_reverse.py: PASS SystemDevice - 03_fwderrs.py: PASS VSSD - 01_enum.py: PASS VSSD - 02_bootldr.py: FAIL ERROR - NameError : global name 'BaseException' is not defined CIM_ERR_NOT_FOUND: No such instance (dom) VSSD - 03_vssd_gi_errs.py: PASS VSSD - 04_vssd_to_rasd.py: FAIL ERROR - Xen_VirtualSystemSettingData with VSSDC_dom was not returned ERROR - Xen_VirtualSystemSettingData returned 0 VSSD objects, expected only 1 VirtualSystemManagementCapabilities - 01_enum.py: PASS VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS VirtualSystemManagementService - 01_definesystem_name.py: PASS VirtualSystemManagementService - 02_destroysystem.py: FAIL ERROR - Unknow exception happened ERROR - (1, u'CIM_ERR_FAILED: Unable to retrieve domain name.') InvokeMethod(DestroySystem): CIM_ERR_FAILED: Unable to retrieve domain name. 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: FAIL ERROR - Got 2, exp 1. ERROR - Error invoking ModifyRS: mod_vcpu_res ERROR - Error changing rs for vcpu VirtualSystemManagementService - 09_procrasd_persist.py: FAIL ERROR - limit is 0, expected 256 ERROR - rstest_domain CPU scheduling not set properly VirtualSystemMigrationCapabilities - 01_enum.py: PASS VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS VirtualSystemMigrationService - 01_migratable_host.py: PASS VirtualSystemMigrationService - 02_host_migrate_type.py: PASS VirtualSystemMigrationService - 05_migratable_host_errs.py: PASS VirtualSystemMigrationSettingData - 01_enum.py: PASS VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS VirtualSystemSettingDataComponent - 01_forward.py: PASS VirtualSystemSettingDataComponent - 02_reverse.py: PASS VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS VirtualSystemSnapshotService - 01_enum.py: PASS VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922144 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kaitlin at linux.vnet.ibm.com Wed Jul 9 21:04:03 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 09 Jul 2008 14:04:03 -0700 Subject: [Libvirt-cim] [PATCH] Convert capacity and reserved to megabytes Message-ID: <5bc5dc103a569a07ee8a.1215637443@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1215636494 25200 # Node ID 5bc5dc103a569a07ee8a120285af1573f77942a3 # Parent bbcd58a5a44acdf91df2c220f2d3698809669301 Convert capacity and reserved to megabytes. This only affects the case where diskpool support is available in libvirt. Signed-off-by: Kaitlin Rupert diff -r bbcd58a5a44a -r 5bc5dc103a56 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Thu Jul 03 10:16:40 2008 -0700 +++ b/src/Virt_DevicePool.c Wed Jul 09 13:48:14 2008 -0700 @@ -108,6 +108,8 @@ bool result = false; virStoragePoolPtr pool; virStoragePoolInfo info; + uint64_t cap; + uint64_t res; pool = virStoragePoolLookupByName(conn, _pool->tag); if (pool == NULL) { @@ -120,11 +122,14 @@ goto out; } + cap = info.capacity >> 20; + res = info.allocation >> 20; + CMSetProperty(inst, "Capacity", - (CMPIValue *)&info.capacity, CMPI_uint64); + (CMPIValue *)&cap, CMPI_uint64); CMSetProperty(inst, "Reserved", - (CMPIValue *)&info.allocation, CMPI_uint64); + (CMPIValue *)&res, CMPI_uint64); result = true; out: From deeptik at linux.vnet.ibm.com Thu Jul 10 12:48:26 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 10 Jul 2008 18:18:26 +0530 Subject: [Libvirt-cim] CimTest Report on XenFV 10-07-2008 Message-ID: <4876051A.1000504@linux.vnet.ibm.com> ====================================== CIM Test Report for XenFV ====================================== Distro : RHEL 5.2 Beta Kernel : 2.6.18-88.el5xen Xen version : 3.1.2-88.el5 Libvirt : libvirt-0.3.3-7.el5 CIMOM : pegasus PyWBEM : pywbem-3.14 CIM Schema : cimv216Experimental LibCMPIutil : 79 LibVirtCIM : 634 CIMTEST : 240 ====================================== PASS : 94 TOTAL FAILED : 7[5 test cases passed when ran manually] ACTUAL FAILED : 2 XFAIL : 6 SKIP : 23 ------------------- Total : 130 ====================================== List of tc that are failing: ComputerSystem - 06_paused_active_suspend.py: FAIL VirtualSystemManagementService - 02_destroysystem.py: FAIL The following tc passed when run manually: LogicalDisk - 03_ld_gi_errs.py: FAIL Memory - 01_memory.py: FAIL NetworkPort - 01_netport.py: FAIL VSSD - 04_vssd_to_rasd.py: FAIL VirtualSystemManagementService - 02_destroysystem.py: FAIL VirtualSystemManagementService - 09_procrasd_persist.py: FAIL Please find the complete report attached with the mail. Thanks and Regards, Deepti. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Jul710-XenFV-report URL: From deeptik at linux.vnet.ibm.com Thu Jul 10 13:07:48 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 10 Jul 2008 06:07:48 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing NetXML Message-ID: <0f8b7f041b91761da40a.1215695268@elm3b217.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1215695256 25200 # Node ID 0f8b7f041b91761da40aee3f6574338de6c178fd # Parent 502dddef8c34eeb85b571df0ee97f0ee0676861b [TEST] Fixing NetXML . This is needed bcs the virt type for KVM was not getting passed properly. Without this on a system with no net-list the for KVM the tc were failing to create a virtual network. Signed-off-by: Deepti B. Kalakeri diff -r 502dddef8c34 -r 0f8b7f041b91 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Jul 01 14:12:48 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Thu Jul 10 06:07:36 2008 -0700 @@ -485,7 +485,7 @@ class VirtXML(Virsh, XMLClass): else: logger.info('No virutal network found') logger.info('Trying to create one ......') - netxml = NetXML(CIM_IP, virt_type) + netxml = NetXML(CIM_IP, virt=virt_type) ret = netxml.create_vnet() if not ret: logger.error('Failed to create the virtual network "%s"', From kaitlin at linux.vnet.ibm.com Thu Jul 10 15:46:41 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 10 Jul 2008 08:46:41 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing the 06_paused_active_suspend.py tc of ComputerSystem In-Reply-To: <16bbf4d2f48e04334471.1214925384@elm3b217.beaverton.ibm.com> References: <16bbf4d2f48e04334471.1214925384@elm3b217.beaverton.ibm.com> Message-ID: <48762EE1.2060300@linux.vnet.ibm.com> Deepti B. Kalakeri wrote: > # HG changeset patch > # User Deepti B. Kalakeri > # Date 1214925380 25200 > # Node ID 16bbf4d2f48e04334471805a524cfb653a391dd8 > # Parent cc7716fa4252235924577a0e9bb16c89fc55870b > [TEST] Fixing the 06_paused_active_suspend.py tc of ComputerSystem. Sorry for the late review on this Deepti - there's a change that needs to be done in the provider (see the "For pause, reboot, and enable add support for guests in the NOSTATE state" thread). > > 1) Updated the tc to use the poll_for_state_change() function. > 2) Included the get_state_values() functions that returns the enable_state, req_state values. > 3) Included the extra sleep bcs sometimes the provider is not > able to suspend the domain immediately even though the enable_state > is set to 2 and hence the tc was failing intermittently. This sleep is not needed. A provider change is needed so that the provider pauses the guest when the guest is in the "no sleep" state. > 4) Removed cxml.undefine() call since it was not req. > 5) Fixed Indentation. > > Signed-off-by: Deepti B. Kalakeri > > ~ > > diff -r cc7716fa4252 -r 16bbf4d2f48e suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py > --- a/suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py Mon Jun 30 23:07:06 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py Tue Jul 01 08:16:20 2008 -0700 > @@ -55,6 +55,7 @@ def main(): > raise Exception('No cs instance returned') > for dom in cs: > if dom.Name == test_dom: > + Globals.logger.error("Deepti %s", dom.Name) I think this is an extraneous debug statement. =) > enabState = dom.EnabledState > status = PASS > break > diff -r cc7716fa4252 -r 16bbf4d2f48e suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py > - > except Exception, detail: > logger.error("Exception variable: %s" % detail) > return status > + > + status = poll_for_state_change(server, virt, test_dom, > + START_STATE) > + from_State, req_state = get_state_values(server, virt) Instead of getting the CS instance again in get_state_values(), what do you think about modifying poll_for_state() so that it returns the CS reference (since poll_for_state() has to get an instance to check the state value anyway). It seems like this would be useful - in most cases, if you need to call poll_for_state(), you'll probably need the cs ref later on in the test case. > > - 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 or from_State == None or req_state == None: > + cxml.destroy(server) > + return status > + > + sleep(10) This is not needed. The test case will fail until the provider fix is in, but it's fine to note that in the commit log. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Jul 10 18:53:17 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 10 Jul 2008 11:53:17 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix potiential false positive in AC 01 Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1215715693 25200 # Node ID c09b0a978a6621139eb355079994ba3eb2847779 # Parent 502dddef8c34eeb85b571df0ee97f0ee0676861b [TEST] Fix potiential false positive in AC 01. This test needs to verify enum of AC returns the same number of instances as the number of instances returned by enum of MemoryPool + ProcessorPool + DiskPool + NetworkPool. Also, cleaned up the logic to verify that the ResourceType and the InstanceIDs of the AC instances match the Pool instances they're describing. Signed-off-by: Kaitlin Rupert diff -r 502dddef8c34 -r c09b0a978a66 suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py --- a/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Tue Jul 01 14:12:48 2008 -0700 +++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Thu Jul 10 11:48:13 2008 -0700 @@ -22,6 +22,7 @@ # import sys +from VirtLib.live import virsh_version from XenKvmLib import enumclass from CimTest.Globals import do_main from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, platform_sup @@ -32,48 +33,52 @@ def main(): options = main.options + cn = 'AllocationCapabilities' + pools = {} pt = ['MemoryPool', 'ProcessorPool', 'DiskPool', 'NetworkPool'] try: - key_list = ["InstanceID"] - ac = enumclass.enumerate(options.ip, - "AllocationCapabilities", - key_list, - options.virt) - pools['MemoryPool'] = enumclass.enumerate(options.ip, - "MemoryPool", - key_list, - options.virt) - pools['ProcessorPool'] = enumclass.enumerate(options.ip, - "ProcessorPool", - key_list, - options.virt) - pools['DiskPool'] = enumclass.enumerate(options.ip, - "DiskPool", - key_list, - options.virt) - pools['NetworkPool'] = enumclass.enumerate(options.ip, - "NetworkPool", - key_list, - options.virt) - except Exception: - logger.error(CIM_ERROR_ENUMERATE, '%s_AllocationCapabilities' % options.virt) + key = ["InstanceID"] + ac = enumclass.enumerate(options.ip, cn, key, options.virt) + + for p in pt: + enum_list = enumclass.enumerate(options.ip, p, key, options.virt) + + if len(enum_list) < 1: + # If libvirt version >= 0.4.1, libvirt-cim uses libvirt's + # disk pool support instead of creating its own diskpool. + # In this case, it's possible for a disk pool to not exist. + libvirt_version = virsh_version(options.ip, options.virt) + if p == "DiskPool" and libvirt_version >= '0.4.1': + continue + + logger.error("%s did not return any instances" % p) + return FAIL + + for pool in enum_list: + pools[pool.InstanceID] = pool + + except Exception, details: + logger.error(CIM_ERROR_ENUMERATE, cn) + logger.error(details) return FAIL - acset = set([(x.InstanceID, x.ResourceType) for x in ac]) - poolset = set() - for pl in pools.values(): - for x in pl: - poolset.add((x.InstanceID, x.ResourceType)) + if len(ac) != len(pools): + logger.error("%s returned %s instances, expected %s" % (cn, len(ac), + len(pools))) + return FAIL - if len(acset) != len(poolset): - logger.error( - 'AllocationCapabilities return %i instances, excepted %i' - % (ac_size, pool_size)) - return FAIL - zeroset = acset - poolset - if len(zeroset) != 0: - logger.error('AC is inconsistent with pools') + try: + for inst in ac: + id = inst.InstanceID + if pools[id].ResourceType != inst.ResourceType: + logger.error("%s ResourceType %s, Pool ResourceType %s" % (cn, + inst.ResourceType, pools[id].ResourceType)) + return FAIL + + except Exception, details: + logger.error("%s returned instance with unexpected InstanceID %s" % (cn, + details)) return FAIL return PASS From kaitlin at linux.vnet.ibm.com Thu Jul 10 19:40:07 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 10 Jul 2008 12:40:07 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix potiential false positive in CS 02 Message-ID: <0a4bc49a1fbde309070f.1215718807@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1215718772 25200 # Node ID 0a4bc49a1fbde309070f8cc4c8631cf4a5ad9c68 # Parent c09b0a978a6621139eb355079994ba3eb2847779 [TEST] Fix potiential false positive in CS 02. Also make it so that the test skips if domain_list() returns anything > 0. This test used to be a Xen only test, so the test was only being run if there were no other guests besides Dom0. However, CS EnumInstances treats Dom0 as any other guest, so it only makes sense to run this test on KVM and LXC. If computersystem.enumerate() encounters an exception, raise an exception so that the calling test case fail appropriately. We could return FAIL in this case, but raising an exception is more descriptive. Also, other tests that call computersystem.enumerate() don't need to be modified because the number of arguments returned doesn't change. Signed-off-by: Kaitlin Rupert diff -r c09b0a978a66 -r 0a4bc49a1fbd suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py Thu Jul 10 11:48:13 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py Thu Jul 10 12:39:32 2008 -0700 @@ -27,7 +27,7 @@ from XenKvmLib import computersystem from VirtLib import live from VirtLib import utils -from CimTest.Globals import logger +from CimTest.Globals import logger, CIM_ERROR_ENUMERATE from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL, SKIP @@ -35,7 +35,7 @@ def clean_system(host, virt): l = live.domain_list(host, virt) - if len(l) > 1: + if len(l) > 0: return False else: return True @@ -43,19 +43,31 @@ @do_main(sup_types) def main(): options = main.options - if not clean_system(options.ip, options.virt): + + rc = clean_system(options.ip, options.virt) + + if options.virt == "Xen" or options.virt == "XenFV" and rc is True: + logger.error("System has no Dom0 defined; check system health") + return FAIL + elif rc is False: logger.error("System has defined domains; unable to run") return SKIP - status = PASS + cn = "%s_ComputerSystem" % options.virt - cs = computersystem.enumerate(options.ip, options.virt) + try: + cs = computersystem.enumerate(options.ip, options.virt) - if cs.__class__ == str: - logger.error("Got error instead of empty list: %s" % cs) + except Exception, details: + logger.error(CIM_ERROR_ENUMERATE, cn) + logger.error(details) + return FAIL + + if len(cs) != 0: + logger.error("%s returned %d instead of empty list" % (cn, len(cs))) status = FAIL - return status + return PASS if __name__ == "__main__": sys.exit(main()) diff -r c09b0a978a66 -r 0a4bc49a1fbd suites/libvirt-cim/lib/XenKvmLib/computersystem.py --- a/suites/libvirt-cim/lib/XenKvmLib/computersystem.py Thu Jul 10 11:48:13 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/computersystem.py Thu Jul 10 12:39:32 2008 -0700 @@ -85,7 +85,7 @@ try: instances = conn.EnumerateInstances(classname) except pywbem.CIMError, arg: - print arg[1] + raise Exception(arg[1]) return [] list = [] From kaitlin at linux.vnet.ibm.com Thu Jul 10 21:29:07 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 10 Jul 2008 14:29:07 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix CS 22 to use providers instead of virsh Message-ID: <86285f56abcaf54595bc.1215725347@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1215725330 25200 # Node ID 86285f56abcaf54595bc2cc54c8f044ae37ccbd7 # Parent 0a4bc49a1fbde309070f8cc4c8631cf4a5ad9c68 [TEST] Fix CS 22 to use providers instead of virsh. This test was defining a guest with virsh and then suspending it with virsh, which doesn't touch the providers in anyway. Now the test calls DefineSystem() and RequestStateChange(). Signed-off-by: Kaitlin Rupert diff -r 0a4bc49a1fbd -r 86285f56abca suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Thu Jul 10 12:39:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Thu Jul 10 14:28:50 2008 -0700 @@ -32,54 +32,47 @@ from XenKvmLib import computersystem from VirtLib import utils from XenKvmLib import vxml -from XenKvmLib.test_doms import destroy_and_undefine_all -from CimTest.Globals import do_main -from CimTest import Globals +from XenKvmLib.test_doms import destroy_and_undefine_domain +from CimTest.Globals import do_main, logger from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.common_util import create_using_definesystem, \ + call_request_state_change sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "domgst" +SUSPND_STATE = 9 +TIME = "00000000000000.000000:000" + @do_main(sup_types) def main(): options = main.options - status = FAIL - cxml = vxml.get_class(options.virt)(test_dom) - -#define VS try: - ret = cxml.define(options.ip) - if not ret: - Globals.logger.error(Globals.VIRSH_ERROR_DEFINE % test_dom) - return status - - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) - if not (cs.Name == test_dom) : - Globals.logger.error("Error: VS %s not found" % test_dom) - cxml.undefine(options.ip) + # define the vs + status = create_using_definesystem(test_dom, options.ip, + virt=options.virt) + if status != PASS: + logger.error("Unable to define %s using DefineSystem()" % test_dom) return status - except Exception, detail: - Globals.logger.error("Errors: %s" % detail) - -#Suspend the defined VS - - try: - ret = cxml.run_virsh_cmd(options.ip, "suspend") - if not ret : - Globals.logger.info("Suspending defined VS %s failed, as expected" \ -% test_dom) + # suspend the vs + status = call_request_state_change(test_dom, options.ip, SUSPND_STATE, + TIME, virt=options.virt) + if status != PASS: + logger.info("Suspending define VS %s failed, as expected" \ + % test_dom) status = PASS else : - Globals.logger.info("Error: Suspending defined VS %s should not \ -have been allowed" % test_dom) + logger.error("Suspending defined VS %s should not have passed" % \ + test_dom) status = FAIL except Exception, detail: - Globals.logger.error("Error: %s" % detail) + logger.error("Error: %s" % detail) + status = FAIL - ret = cxml.undefine(options.ip) + destroy_and_undefine_domain(test_dom, options.ip, options.virt) return status if __name__ == "__main__": From yunguol at cn.ibm.com Fri Jul 11 07:42:44 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Fri, 11 Jul 2008 00:42:44 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update Profile.03 for KVM&XenFV support Message-ID: # HG changeset patch # User Guolian Yun # Date 1215762155 25200 # Node ID d8bff88e8742a055eb96975a7d8f061b2718e3b3 # Parent 0f8b7f041b91761da40aee3f6574338de6c178fd [TEST] Update Profile.03 for KVM&XenFV support Signed-off-by: Guolian Yun diff -r 0f8b7f041b91 -r d8bff88e8742 suites/libvirt-cim/cimtest/Profile/03_rprofile_gi_errs.py --- a/suites/libvirt-cim/cimtest/Profile/03_rprofile_gi_errs.py Thu Jul 10 06:07:36 2008 -0700 +++ b/suites/libvirt-cim/cimtest/Profile/03_rprofile_gi_errs.py Fri Jul 11 00:42:35 2008 -0700 @@ -57,7 +57,7 @@ from CimTest import Globals from CimTest import Globals from CimTest.Globals import do_main -sup_types = ['Xen', 'LXC'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] expr_values = { "invalid_instid_keyvalue" : { 'rc' : pywbem.CIM_ERR_NOT_FOUND, \ From yunguol at cn.ibm.com Fri Jul 11 07:45:19 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Fri, 11 Jul 2008 00:45:19 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update Profile.01 for XenFV support Message-ID: <75e19e9fca837c040099.1215762319@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1215762315 25200 # Node ID 75e19e9fca837c040099b9b35a2e1a5c233e80f4 # Parent 0f8b7f041b91761da40aee3f6574338de6c178fd [TEST] Update Profile.01 for XenFV support Signed-off-by: Guolian Yun diff -r 0f8b7f041b91 -r 75e19e9fca83 suites/libvirt-cim/cimtest/Profile/01_enum.py --- a/suites/libvirt-cim/cimtest/Profile/01_enum.py Thu Jul 10 06:07:36 2008 -0700 +++ b/suites/libvirt-cim/cimtest/Profile/01_enum.py Fri Jul 11 00:45:15 2008 -0700 @@ -33,7 +33,7 @@ from CimTest.Globals import do_main, log from CimTest.Globals import do_main, logger from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen', 'KVM', 'LXC'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] @do_main(sup_types) def main(): From deeptik at linux.vnet.ibm.com Fri Jul 11 12:21:35 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 11 Jul 2008 05:21:35 -0700 Subject: [Libvirt-cim] [PATCH 2 of 4] [TEST] Adding functions to common_util.py to support the verifications of EAFP fields In-Reply-To: Message-ID: <65b1865d10a0570ec785.1215778895@elm3b193.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1215777176 25200 # Node ID 65b1865d10a0570ec785e78affc0f69877bc8189 # Parent 25cd5c474b0797d36d67e200b4f8ed4ffa9cfedc [TEST] Adding functions to common_util.py to support the verifications of EAFP fields. Added the following functions: 1) eafp_dpool_cap_reserve_val() to get the DiskPool's Capacity and Reserved field values depending on which libvirt version is present on the machine. 2) eafp_mpool_reserve_val() to get the MemoryPool's Reserved field value. 3) Also, added get_value() function. Signed-off-by: Deepti B. Kalakeri diff -r 25cd5c474b07 -r 65b1865d10a0 suites/libvirt-cim/lib/XenKvmLib/common_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Fri Jul 11 04:42:09 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Fri Jul 11 04:52:56 2008 -0700 @@ -35,7 +35,9 @@ from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger, log_param, CIM_ERROR_ENUMERATE from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC -from VirtLib.live import diskpool_list, virsh_version, net_list +from VirtLib.live import diskpool_list, virsh_version, net_list, \ +active_domain_list, virsh_dominfo_usedmem +from VirtLib.utils import run_remote from XenKvmLib.vxml import PoolXML, NetXML test_dpath = "foo" @@ -397,3 +399,66 @@ return PASS +def get_value(server, cmd, log_msg, fieldname): + msg = log_msg % fieldname + ret, value = run_remote(server, cmd) + if ret != 0: + logger.error("%s", log_msg, fieldname) + return FAIL, value + return PASS, value + +def eafp_dpool_cap_reserve_val(server, virt, poolname): + libvirt_version = virsh_version(server, virt) + capacity = reserved = None + if libvirt_version >= '0.4.1': + # get the value from pool-info + log_msg= "Failed to get the '%s' info from pool-info" + dp_name, pname = poolname.split("/") + + cmd = "virsh pool-info %s | awk '/Capacity/ { print \$2}'" \ + % pname + status, cap_val = get_value(server, cmd, log_msg, 'Capacity') + if status != PASS: + return FAIL, capacity, reserved + cap_val = float(cap_val) + capacity = int(cap_val * 1024 * 1024 * 1024) >> 20 + + cmd = "virsh pool-info %s | awk '/Allocation/ { print \$2}'" \ + % pname + status, alloc_val = get_value(server, cmd, log_msg, 'Allocation') + if status != PASS: + return FAIL, capacity, reserved + alloc_val = float(alloc_val) + reserved = int(alloc_val * 1024 * 1024 *1024) >> 20 + + else: + # get info from stat -filesystem + log_msg = "Stat on the '%s' file failed" + + cmd = "stat -f %s | awk '/size/ {print \$7}'" % disk_file + status, f_bsize = get_value(server, cmd, log_msg, disk_file) + if status != PASS: + return FAIL, capacity, reserved + + cmd = " stat -f %s | awk '/Blocks/ {print \$3}'" % disk_file + status, b_total = get_value(server, cmd, log_msg, disk_file) + if status != PASS: + return FAIL, capacity, reserved + cap_val = (int(f_bsize) * int(b_total)) + capacity = (int(f_bsize) * int(b_total)) >> 20 + + cmd = "stat -f %s | awk '/Blocks/ {print \$5}'" % disk_file + status, b_free = get_value(server, cmd, log_msg, disk_file) + if status != PASS: + return FAIL, capacity, reserved + reserved = (cap_val - (int(f_bsize) * int(b_free))) >> 20 + + return PASS, capacity, reserved + +def eafp_mpool_reserve_val(server, virt): + reserved = 0 + doms = active_domain_list(server, virt) + for dom_name in doms: + mem = virsh_dominfo_usedmem(server, dom_name, virt) + reserved += mem + return reserved From deeptik at linux.vnet.ibm.com Fri Jul 11 12:21:33 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 11 Jul 2008 05:21:33 -0700 Subject: [Libvirt-cim] [PATCH 0 of 4] Updating 01_forward.py of EAFP. Message-ID: From deeptik at linux.vnet.ibm.com Fri Jul 11 12:21:37 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 11 Jul 2008 05:21:37 -0700 Subject: [Libvirt-cim] [PATCH 4 of 4] [TEST] Updating 01_forward.py of EAFP In-Reply-To: Message-ID: <2b57a9423f82420b3867.1215778897@elm3b193.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1215778728 25200 # Node ID 2b57a9423f82420b386775bbdf884302d7338ba8 # Parent 9155858d4e5aa69393e652e7fd340ab12a63a153 [TEST] Updating 01_forward.py of EAFP. 1) Modifying the tc to support XenFV and KVM. 2) Modified get_keys() to use proper SystemCreationClassName. 3) Added functions get_id to get the instances for different logical devices so that the DeviceID of the instances can be used in the init_list(). 4) Added init_list() function to create a list of inputs for the EAFP association. 5) Added eafp_list() to create a list of pool values that will be used to verify the return values from the EAFP association. 6) Added the function verify_eafp_values() to call assocation on EAFP and verify the return values. 7) Included cleanup_restore(). Signed-off-by: Deepti B. Kalakeri diff -r 9155858d4e5a -r 2b57a9423f82 suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py Fri Jul 11 04:59:54 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py Fri Jul 11 05:18:48 2008 -0700 @@ -44,163 +44,217 @@ import pywbem from XenKvmLib.test_xml import testxml, testxml_bridge from VirtLib import utils -from XenKvmLib import assoc -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all +from XenKvmLib.assoc import Associators +from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib import devices -from CimTest import Globals -from CimTest.Globals import do_main -from VirtLib.live import network_by_bridge -from CimTest.ReturnCodes import PASS, FAIL, SKIP +from CimTest.Globals import CIM_ERROR_ASSOCIATORS, CIM_ERROR_GETINSTANCE +from XenKvmLib.vxml import get_class +from XenKvmLib.vsms import RASD_TYPE_DISK, RASD_TYPE_PROC, \ +RASD_TYPE_MEM, RASD_TYPE_NET_ETHER, RASD_TYPE_DISK +from XenKvmLib.common_util import create_diskpool_conf, cleanup_restore, \ +eafp_dpool_cap_reserve_val, eafp_mpool_reserve_val +from XenKvmLib.classes import get_typed_class +from XenKvmLib.logicaldevices import verify_common_pool_values, \ +verify_disk_mem_proc_pool_values +from CimTest.Globals import do_main, logger +from VirtLib.live import network_by_bridge, virsh_nodeinfo_cpucount, \ +virsh_nodeinfo_memsize, virsh_dominfo_usedmem +from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV'] test_dom = "hd_domain" 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) + logger.error(CIM_ERROR_GETINSTANCE, cn) + logger.error("Exception: %s", detail) -def get_keys(cn, device_id): +def get_keys(virt, cn, device_id): id = "%s/%s" % (test_dom, device_id) + sccn = get_typed_class(virt, "ComputerSystem") key_list = { 'DeviceID' : id, 'CreationClassName' : cn, 'SystemName' : test_dom, - 'SystemCreationClassName' : "Xen_ComputerSystem" + 'SystemCreationClassName' : sccn } return key_list +def get_id(server, virt, cname, id): + dev = None + cn = get_typed_class(virt, cname) + try: + key_list = get_keys(virt, cn, id) + dev_class = devices.get_class(cn) + dev = dev_class(server, key_list) + except Exception,detail: + print_error(cn, detail) + return FAIL, dev + return PASS, dev + +def init_list(server, virt, test_disk): + lelist = {} + status, disk = get_id(server, virt, "LogicalDisk", test_disk) + if status != PASS : + return status, lelist + + status, mem = get_id(server, virt, "Memory", "mem") + if status != PASS : + return status, lelist + + status, net = get_id(server, virt, "NetworkPort", test_mac) + if status != PASS: + return status, lelist + + status, proc = get_id(server, virt, "Processor", "0") + if status != PASS: + return status, lelist + + lelist = { + disk.CreationClassName : disk.DeviceID, \ + mem.CreationClassName : mem.DeviceID, \ + net.CreationClassName : net.DeviceID, \ + proc.CreationClassName : proc.DeviceID + } + return status, lelist + +def eafp_list(server, virt, diskid, d_cap, d_reserve, test_network): + + diskpool = { + 'CCName' : get_typed_class(virt, 'DiskPool'), + 'InstanceID' : diskid, + 'PoolID' : diskid, + 'ResourceType' : RASD_TYPE_DISK, + 'Capacity' : d_cap, + 'Reserved' : d_reserve, + 'AllocationUnits' : 'Megabytes' + } + procpool = { + 'CCName' : get_typed_class(virt, 'ProcessorPool'), + 'InstanceID' : "%s/%s" % ("ProcessorPool", "0"), + 'PoolID' : "%s/%s" % ("ProcessorPool", "0"), + 'ResourceType' : RASD_TYPE_PROC, + 'Capacity' : virsh_nodeinfo_cpucount(server, virt), + 'Reserved' : 0, + 'AllocationUnits' : 'Processors' + } + netpool = { + 'CCName' : get_typed_class(virt, 'NetworkPool'), + 'InstanceID' : "%s/%s" % ("NetworkPool", test_network), + 'PoolID' : "%s/%s" % ("NetworkPool", test_network), + 'ResourceType' : RASD_TYPE_NET_ETHER + } + mempool = { + 'CCName' : get_typed_class(virt, 'MemoryPool'), + 'InstanceID' : "%s/%s" % ("MemoryPool", "0"), + 'PoolID' : "%s/%s" % ("MemoryPool", "0"), + 'ResourceType' : RASD_TYPE_MEM, + 'Reserved' : eafp_mpool_reserve_val(server, virt), + 'Capacity' : virsh_nodeinfo_memsize(server, virt), + 'AllocationUnits' :'KiloBytes' + } + eafp_values = { 'procpool' : procpool, + 'diskpool' : diskpool, + 'netpool' : netpool, + 'mempool' : mempool + } + return eafp_values + +def verify_eafp_values(server, virt, diskid, test_network, in_pllist): + # Looping through the in_pllist to get association for devices. + an = get_typed_class(virt, "ElementAllocatedFromPool") + sccn = get_typed_class(virt, "ComputerSystem") + status, d_cap, d_reserve = eafp_dpool_cap_reserve_val(server, virt, + diskid) + if status != PASS: + return FAIL + + eafp_values = eafp_list(server, virt, diskid, d_cap, d_reserve, test_network) + for cn, devid in sorted(in_pllist.items()): + try: + assoc_info = Associators(server, an, cn, + DeviceID = devid, + CreationClassName = cn, + SystemName = test_dom, + SystemCreationClassName = sccn, + virt=virt) + if len(assoc_info) != 1: + logger.error("%s returned %i ResourcePool objects for " + "domain '%s'", an, len(assoc_info), + test_dom) + status = FAIL + break + assoc_eafp_info = assoc_info[0] + CCName = assoc_eafp_info.classname + if CCName == eafp_values['procpool']['CCName']: + list_values = eafp_values['procpool'] + status = verify_disk_mem_proc_pool_values(assoc_eafp_info, + list_values) + elif CCName == eafp_values['netpool']['CCName']: + list_values = eafp_values['netpool'] + status = verify_common_pool_values(assoc_eafp_info, + list_values) + elif CCName == eafp_values['diskpool']['CCName']: + list_values = eafp_values['diskpool'] + status = verify_disk_mem_proc_pool_values(assoc_eafp_info, + list_values) + elif CCName == eafp_values['mempool']['CCName']: + list_values = eafp_values['mempool'] + status = verify_disk_mem_proc_pool_values(assoc_eafp_info, + list_values) + else: + status = FAIL + if status != PASS: + break + except Exception, detail: + logger.error(CIM_ERROR_ASSOCIATORS, an) + logger.error("Exception: %s", detail) + cleanup_restore(server, virt) + status = FAIL + return status + + @do_main(sup_types) def main(): options = main.options + server = options.ip + virt = options.virt status = PASS - idx = 0 + if virt == 'Xen': + test_disk = 'xvda' + else: + test_disk = 'hda' + # Getting the VS list and deleting the test_dom if it already exists. + destroy_and_undefine_all(server) + virt_type = get_class(virt) + vsxml = virt_type(test_dom, vcpus = test_vcpus, mac = test_mac, + disk = test_disk) -# Getting the VS list and deleting the test_dom if it already exists. - destroy_and_undefine_all(options.ip) + # Verify DiskPool on machine + status, diskid = create_diskpool_conf(server, virt) + if status != PASS: + return status - test_xml, bridge = testxml_bridge(test_dom, vcpus = test_vcpus, \ - mac = test_mac, disk = test_disk, \ - server = options.ip) - if bridge == None: - Globals.logger.error("Unable to find virtual bridge") - return SKIP - - if test_xml == None: - Globals.logger.error("Guest xml not created properly") - return FAIL - - virt_network = network_by_bridge(bridge, options.ip) - if virt_network == None: - Globals.logger.error("No virtual network found for bridge %s", bridge) - return SKIP - - ret = test_domain_function(test_xml, options.ip, cmd = "create") + ret = vsxml.create(server) if not ret: - Globals.logger.error("Failed to Create the dom: %s", test_dom) + 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 + status, lelist = init_list(server, virt, test_disk) + if status != PASS: + cleanup_restore(server, virt) + vsxml.destroy(server) + return status - 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 - - 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 - - netpool_id = "NetworkPool/%s" % virt_network - - lelist = { - "Xen_LogicalDisk" : disk.DeviceID, \ - "Xen_Memory" : mem.DeviceID, \ - "Xen_NetworkPort" : net.DeviceID, \ - "Xen_Processor" : proc.DeviceID - } - poollist = [ - "Xen_DiskPool", \ - "Xen_MemoryPool", \ - "Xen_NetworkPool", \ - "Xen_ProcessorPool" - ] - poolval = [ - "DiskPool/foo", \ - "MemoryPool/0", \ - netpool_id, \ - "ProcessorPool/0" - ] - - sccn = "Xen_ComputerSystem" - for cn, devid in sorted(lelist.items()): - try: - assoc_info = assoc.Associators(options.ip, \ - "Xen_ElementAllocatedFromPool", - cn, - DeviceID = devid, - CreationClassName = cn, - SystemName = test_dom, - SystemCreationClassName = sccn) - if len(assoc_info) != 1: - Globals.logger.error("Xen_ElementAllocatedFromPool returned %i\ - ResourcePool objects for domain '%s'", len(assoc_info), test_dom) - status = FAIL - break - - if assoc_info[0].classname != poollist[idx]: - Globals.logger.error("Classname Mismatch") - Globals.logger.error("Returned %s instead of %s", \ - assoc_info[0].classname, \ - poollist[idx]) - status = FAIL - - if assoc_info[0]['InstanceID'] != poolval[idx]: - Globals.logger.error("InstanceID Mismatch") - Globals.logger.error("Returned %s instead of %s", \ - assoc_info[0]['InstanceID'], \ - poolval[idx]) - status = FAIL - - if status != PASS: - break - else: - idx = idx + 1 - - except Exception, detail: - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, \ - 'Xen_ElementAllocatedFromPool') - Globals.logger.error("Exception: %s", detail) - status = FAIL - - ret = test_domain_function(test_dom, options.ip, \ - cmd = "destroy") + virt_network = vsxml.xml_get_net_network() + status = verify_eafp_values(server, virt, diskid, virt_network, lelist) + + cleanup_restore(server, virt) + vsxml.destroy(server) return status if __name__ == "__main__": From deeptik at linux.vnet.ibm.com Fri Jul 11 12:21:36 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 11 Jul 2008 05:21:36 -0700 Subject: [Libvirt-cim] [PATCH 3 of 4] [TEST] Adding functions to live.py In-Reply-To: Message-ID: <9155858d4e5aa69393e6.1215778896@elm3b193.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1215777594 25200 # Node ID 9155858d4e5aa69393e652e7fd340ab12a63a153 # Parent 65b1865d10a0570ec785e78affc0f69877bc8189 [TEST] Adding functions to live.py. Added the following functions: 1) virsh_nodeinfo_cpucount() to get the number of processors on the machine. 2) virsh_nodeinfo_memsize() to get the memory capacity on the machine. 3) virsh_dominfo_usedmem() to get the memory used by the guest. Signed-off-by: Deepti B. Kalakeri diff -r 65b1865d10a0 -r 9155858d4e5a lib/VirtLib/live.py --- a/lib/VirtLib/live.py Fri Jul 11 04:52:56 2008 -0700 +++ b/lib/VirtLib/live.py Fri Jul 11 04:59:54 2008 -0700 @@ -347,3 +347,56 @@ return out return None +def virsh_nodeinfo_cpucount(server, virt="Xen"): + """ + Returns the number of processors on the machine. + """ + + cmd = "virsh -c %s nodeinfo | awk '/CPU\(s\)/ { print \$2 }'" \ + % (utils.virt2uri(virt)) + + rc, out = utils.run_remote(server, cmd) + if rc != 0: + return -1 + + try: + cpus = int(out) + return cpus + except ValueError: + return -1 + +def virsh_nodeinfo_memsize(server, virt="Xen"): + """ + Returns the memory capacity on the machine. + """ + + cmd = "virsh -c %s nodeinfo | awk '/Memory size/ { print \$3 }'" \ + % (utils.virt2uri(virt)) + + rc, out = utils.run_remote(server, cmd) + if rc != 0: + return -1 + + try: + msize = int(out) + return msize + except ValueError: + return -1 + +def virsh_dominfo_usedmem(server, vs_name, virt="Xen"): + """ + Returns the memory used by the guest. + """ + + guest_cmd = "virsh -c %s dominfo %s | awk '/Used memory/ { print \$3 }'" \ + % (utils.virt2uri(virt), vs_name) + + rc, out = utils.run_remote(server, guest_cmd) + if rc != 0: + return -1 + + try: + usedmem = int(out) + return usedmem + except ValueError: + return -1 From deeptik at linux.vnet.ibm.com Fri Jul 11 12:21:34 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 11 Jul 2008 05:21:34 -0700 Subject: [Libvirt-cim] [PATCH 1 of 4] [TEST] Adding functions to verify the EAFP fields In-Reply-To: Message-ID: <25cd5c474b0797d36d67.1215778894@elm3b193.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1215776529 25200 # Node ID 25cd5c474b0797d36d67e200b4f8ed4ffa9cfedc # Parent 0f8b7f041b91761da40aee3f6574338de6c178fd [TEST] Adding functions to verify the EAFP fields . Added functions verify_common_pool_values(), verify_specific_fields() and verify_disk_mem_proc_pool_values() to be helpful to verify the EAFP fields returned when queried with Logicaldevices. Signed-off-by: Deepti B. Kalakeri diff -r 0f8b7f041b91 -r 25cd5c474b07 suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py --- a/suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py Thu Jul 10 06:07:36 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py Fri Jul 11 04:42:09 2008 -0700 @@ -123,3 +123,34 @@ return FAIL return PASS +def verify_common_pool_values(assoc_info, list_values): + if assoc_info['InstanceID'] != list_values['InstanceID']: + field_err(assoc_info, list_values, fieldname = 'InstanceID') + return FAIL + if assoc_info['PoolID'] != list_values['PoolID']: + field_err(assoc_info, list_values, fieldname = 'PoolID') + return FAIL + if assoc_info['ResourceType'] != list_values['ResourceType']: + field_err(assoc_info, list_values, fieldname = 'ResourceType') + return FAIL + return PASS + +def verify_specific_fields(assoc_info, list_values): + if assoc_info['Capacity'] != list_values['Capacity']: + field_err(assoc_info, list_values, fieldname = 'Capacity') + return FAIL + if assoc_info['Reserved'] != list_values['Reserved']: + field_err(assoc_info, list_values, fieldname = 'Reserved') + return FAIL + if assoc_info['AllocationUnits'] != list_values['AllocationUnits']: + field_err(assoc_info, list_values, fieldname = 'AllocationUnits') + return FAIL + return PASS + +def verify_disk_mem_proc_pool_values(assoc_info, list_values): + status = verify_common_pool_values(assoc_info, list_values) + if status != PASS: + return status + status = verify_specific_fields(assoc_info, list_values) + return status + From kaitlin at linux.vnet.ibm.com Fri Jul 11 20:28:28 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Jul 2008 13:28:28 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] Fix getInstance in enumclass.py to return matching type on error In-Reply-To: Message-ID: <6fe68391f0c820e81525.1215808108@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1212719310 25200 # Node ID 6fe68391f0c820e815251022bfe8469a0a93115b # Parent 27d89d4b1ea884a49da6ce4fd93e0f7c71a6b36b Fix getInstance in enumclass.py to return matching type on error. getInstance() returns a single element, so if the call encounters an error, it should return None instead of []. Signed-off-by: Kaitlin Rupert diff -r 27d89d4b1ea8 -r 6fe68391f0c8 suites/libvirt-cim/lib/XenKvmLib/enumclass.py --- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Fri Jul 11 13:26:03 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Thu Jun 05 19:28:30 2008 -0700 @@ -320,6 +320,6 @@ except pywbem.CIMError, arg: print arg[1] - return [] + return None return inst From kaitlin at linux.vnet.ibm.com Fri Jul 11 20:28:29 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Jul 2008 13:28:29 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] Add compare_all_prop() In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1215806699 25200 # Node ID ee18f55760d08d21cd8f9809293d972b4a0b4549 # Parent 6fe68391f0c820e815251022bfe8469a0a93115b [TEST] Add compare_all_prop(). This function takes an instance from the list returned bu the Associators() call and an instance from a getInstance() / enumerate_instances() call. It compares all of the property values to ensure the instances are identical. This function could probably be added to a fair number of tests as an additional verification check. Signed-off-by: Kaitlin Rupert diff -r 6fe68391f0c8 -r ee18f55760d0 suites/libvirt-cim/lib/XenKvmLib/assoc.py --- a/suites/libvirt-cim/lib/XenKvmLib/assoc.py Thu Jun 05 19:28:30 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/assoc.py Fri Jul 11 13:04:59 2008 -0700 @@ -27,6 +27,7 @@ import pywbem from pywbem.cim_obj import CIMInstanceName from XenKvmLib.classes import get_typed_class +from CimTest.ReturnCodes import PASS def AssociatorNames(host, basetype, baseobj, virt="Xen", **keys): '''Resolve the association specified by @type, given the @@ -139,3 +140,17 @@ return new_list +def compare_all_prop(inst, exp_inst): + prop_vals = inst.items() + + for i in range(0, len(prop_vals)): + key = prop_vals[i][0] + val = eval('exp_inst.' + key) + + if prop_vals[i][1] != val: + logger.error("%s val mismatch: got %s, expected %s" % (key, + prop_vals[i][1], val)) + return FAIL + + return PASS + From kaitlin at linux.vnet.ibm.com Fri Jul 11 20:28:30 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Jul 2008 13:28:30 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] Fix potiential false positive in ESD 01 In-Reply-To: Message-ID: <463274d67d8f35ac562c.1215808110@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1215806699 25200 # Node ID 463274d67d8f35ac562c5665e561ab970ddc55c1 # Parent ee18f55760d08d21cd8f9809293d972b4a0b4549 [TEST] Fix potiential false positive in ESD 01. Test needs to verify the number of VSSD and RASD elemnts returned were the values expected. Instead of calling EnumerateInstances() for the VSSD and RASD instances, this test should call getInstance() to get the expected instances. Most of this test was written to support that. Test now also supports XenFV. Signed-off-by: Kaitlin Rupert diff -r ee18f55760d0 -r 463274d67d8f suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Fri Jul 11 13:04:59 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Fri Jul 11 13:04:59 2008 -0700 @@ -49,82 +49,114 @@ import sys 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 +from XenKvmLib.enumclass import getInstance +from XenKvmLib.assoc import Associators, compare_all_prop +from XenKvmLib.classes import get_typed_class +from CimTest.Globals import do_main, logger, CIM_ERROR_ASSOCIATORS +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.vxml import get_class +from XenKvmLib import const -sup_types = ['Xen', 'KVM', 'LXC'] -esd_cn = 'ElementSettingData' -vssd_cn = 'VirtualSystemSettingData' -vssdc_cn = 'VirtualSystemSettingDataComponent' -rasd_cn = 'ResourceAllocationSettingData' +sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] -def test_assoc(host, class_name, id, virt): +test_dom = "esd_dom" +vmac = "00:11:22:33:44:aa" + +def get_inst(ip, virt, cn, key): + inst = None + try: - ret_inst = assoc.AssociatorNames(host,esd_cn, class_name, virt, - InstanceID = id) + key_list = {"InstanceID" : key } + + inst = getInstance(ip, cn, key_list, virt) + + except Exception, details: + logger.error("Exception %s" % details) + return None + + if inst is None: + logger.error("Expected at least one %s instance" % cn) + return None + + return inst + + +def test_assoc(host, acn, cn, virt, inst): + id = inst.InstanceID + + try: + ret_inst = Associators(host, acn, cn, virt, InstanceID=id) + except Exception: - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, esd_cn) - return 1 + logger.error(CIM_ERROR_ASSOCIATORS, acn) + return FAIL if len(ret_inst) != 1: - Globals.logger.error("%s returned %i %s instances", esd_cn, - len(ret_inst), class_name) - return 1 + logger.error("%s returned %i %s instances" % (an, len(ret_inst), cn)) + return FAIL - ret_id = ret_inst[0].keybindings["InstanceID"] + ret_id = ret_inst[0]['InstanceID'] if ret_id != id: - Globals.logger.error("%s returned %s instance with wrong id %s", - esd_cn, class_name, ret_id) - return 1 + logger.error("%s returned %s inst with wrong id %s" % (acn, cn, ret_id)) + return FAIL - return 0; + status = compare_all_prop(ret_inst[0], inst) + + return status @do_main(sup_types) def main(): options = main.options - try: - key_list = ["InstanceID"] - vssd_lst = enumclass.enumerate(options.ip, vssd_cn, key_list, - options.virt) + esd_cn = 'ElementSettingData' - except Exception, details: - Globals.logger.error("Exception %s", details) - return 1 + if options.virt == 'XenFV': + virt_type = 'Xen' + else: + virt_type = options.virt - for vssd in vssd_lst: + keys = { 'VirtualSystemSettingData' : "%s:%s" % (virt_type, test_dom), + 'MemResourceAllocationSettingData' : "%s/mem" % test_dom, + } + - rc = test_assoc(options.ip, vssd_cn, vssd.InstanceID, options.virt) - if rc != 0: - Globals.logger.error("Unable to get associated %s from %s", - vssd_cn, esd_cn) - return 1 + if options.virt == "Xen": + vdisk = "xvda" + else: + vdisk = "hda" + + virt_class = get_class(options.virt) + if options.virt == 'LXC': + cxml = virt_class(test_dom) + else: + cxml = virt_class(test_dom, mac = vmac, disk = vdisk) + keys['ProcResourceAllocationSettingData'] = "%s/proc" % test_dom + keys['DiskResourceAllocationSettingData'] = "%s/%s" % (test_dom, vdisk) + keys['NetResourceAllocationSettingData'] = "%s/%s" % (test_dom, vmac) + + ret = cxml.define(options.ip) + if not ret: + logger.error("Failed to define the dom: %s", test_dom) + return FAIL + + inst_list = {} + + for cn, k in keys.iteritems(): + inst_list[cn] = get_inst(options.ip, options.virt, cn, k) + if inst_list[cn] is None: + #cxml.undefine(options.ip) + return FAIL + + status = FAIL + for cn, inst in inst_list.iteritems(): + status = test_assoc(options.ip, esd_cn, cn, options.virt, inst) + if status != PASS: + logger.error("Unable to get %s insts from %s" % (cn, esd_cn)) + break - try: - rasd_list = assoc.Associators(options.ip, vssdc_cn, vssd_cn, - options.virt, - InstanceID = vssd.InstanceID) - except Exception: - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, vssdc_cn) - return 1 - - if len(rasd_list) == 0: - 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, get_class_basename(rasd.classname), - rasd["InstanceID"], options.virt) - if rc != 0: - Globals.logger.error("Unable to get associated %s from %s", - rasd_cn, esd_cn) - return 1 + cxml.undefine(options.ip) - return 0 + return status if __name__ == "__main__": sys.exit(main()) From kaitlin at linux.vnet.ibm.com Fri Jul 11 20:28:27 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Jul 2008 13:28:27 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] Fix test issues with ESD 01 Message-ID: From kaitlin at linux.vnet.ibm.com Fri Jul 11 21:28:28 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Jul 2008 14:28:28 -0700 Subject: [Libvirt-cim] [PATCH 0 of 4] Updating 01_forward.py of EAFP. In-Reply-To: References: Message-ID: <4877D07C.1000405@linux.vnet.ibm.com> Checking the capabilities and reserved of the resource pools is a good idea, but I think it might be a better approach to put these checks in ResourcePool/enum_01.py. EAFP tests should be concerned with verifying that the pool returned by the association is the pool we expected for the given device. While the properties of the resource pool instance need to be valid, I think checking these values clutters this test and makes it difficult to read. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Jul 11 21:04:13 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Jul 2008 14:04:13 -0700 Subject: [Libvirt-cim] [PATCH 1 of 4] [TEST] Adding functions to verify the EAFP fields In-Reply-To: <25cd5c474b0797d36d67.1215778894@elm3b193.beaverton.ibm.com> References: <25cd5c474b0797d36d67.1215778894@elm3b193.beaverton.ibm.com> Message-ID: <4877CACD.7030701@linux.vnet.ibm.com> > +def verify_common_pool_values(assoc_info, list_values): > + if assoc_info['InstanceID'] != list_values['InstanceID']: > + field_err(assoc_info, list_values, fieldname = 'InstanceID') > + return FAIL > + if assoc_info['PoolID'] != list_values['PoolID']: > + field_err(assoc_info, list_values, fieldname = 'PoolID') > + return FAIL > + if assoc_info['ResourceType'] != list_values['ResourceType']: > + field_err(assoc_info, list_values, fieldname = 'ResourceType') > + return FAIL > + return PASS > + > +def verify_specific_fields(assoc_info, list_values): I'd suggest combining this functionality into the function above. The only case where you need to ignore these properties is in the NetworkPool case, so I'd have verify_common_pool_values() take the class name. After checking the common values, check to see if the class name is "NetworkPool" and return from the function if is. > + if assoc_info['Capacity'] != list_values['Capacity']: > + field_err(assoc_info, list_values, fieldname = 'Capacity') > + return FAIL > + if assoc_info['Reserved'] != list_values['Reserved']: > + field_err(assoc_info, list_values, fieldname = 'Reserved') > + return FAIL > + if assoc_info['AllocationUnits'] != list_values['AllocationUnits']: > + field_err(assoc_info, list_values, fieldname = 'AllocationUnits') > + return FAIL > + return PASS > + > +def verify_disk_mem_proc_pool_values(assoc_info, list_values): I don't think this function is needed. This function only calls two other function - it doesn't do any other tasks. Plus, if you make the changes suggested above, then this function becomes obsolete. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Jul 11 21:57:50 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Jul 2008 14:57:50 -0700 Subject: [Libvirt-cim] [PATCH 2 of 4] [TEST] Adding functions to common_util.py to support the verifications of EAFP fields In-Reply-To: <65b1865d10a0570ec785.1215778895@elm3b193.beaverton.ibm.com> References: <65b1865d10a0570ec785.1215778895@elm3b193.beaverton.ibm.com> Message-ID: <4877D75E.8090903@linux.vnet.ibm.com> > > +def get_value(server, cmd, log_msg, fieldname): I wouldn't make a separate function out of this. it probably won't be used except by the eafp_dpool_cap_reserve_val() function. > + msg = log_msg % fieldname > + ret, value = run_remote(server, cmd) > + if ret != 0: > + logger.error("%s", log_msg, fieldname) > + return FAIL, value > + return PASS, value > + > +def eafp_dpool_cap_reserve_val(server, virt, poolname): The capabilities and reserved values are properties of the ResourcePools - I'd drop eafp from the name since these values aren't related to the EAFP association. Also, I'd move these functions to the logicaldevices.py file. Or, you could create a resourcepool.py file and add the verify_common_pool_values() function to it. The common_util.py is becoming quite large - so, it might be a good idea to try to place more specific functions like these (that deal with a specific provider's values) into a file specific for that provider. > + libvirt_version = virsh_version(server, virt) > + capacity = reserved = None > + if libvirt_version >= '0.4.1': > + # get the value from pool-info > + log_msg= "Failed to get the '%s' info from pool-info" > + dp_name, pname = poolname.split("/") > + > + cmd = "virsh pool-info %s | awk '/Capacity/ { print \$2}'" \ > + % pname > + status, cap_val = get_value(server, cmd, log_msg, 'Capacity') > + if status != PASS: > + return FAIL, capacity, reserved > + cap_val = float(cap_val) > + capacity = int(cap_val * 1024 * 1024 * 1024) >> 20 This calculation is odd. You're converting GB into bytes and then from bytes into megabytes. You can instead convert straight to megabytes: capacity = int(cap_val * 1024) > + > + cmd = "virsh pool-info %s | awk '/Allocation/ { print \$2}'" \ > + % pname > + status, alloc_val = get_value(server, cmd, log_msg, 'Allocation') > + if status != PASS: > + return FAIL, capacity, reserved > + alloc_val = float(alloc_val) > + reserved = int(alloc_val * 1024 * 1024 *1024) >> 20 Same here - convert straight to megabytes > + > + else: > + # get info from stat -filesystem > + log_msg = "Stat on the '%s' file failed" > + > + cmd = "stat -f %s | awk '/size/ {print \$7}'" % disk_file > + status, f_bsize = get_value(server, cmd, log_msg, disk_file) > + if status != PASS: > + return FAIL, capacity, reserved > + > + cmd = " stat -f %s | awk '/Blocks/ {print \$3}'" % disk_file > + status, b_total = get_value(server, cmd, log_msg, disk_file) > + if status != PASS: > + return FAIL, capacity, reserved > + cap_val = (int(f_bsize) * int(b_total)) > + capacity = (int(f_bsize) * int(b_total)) >> 20 > + > + cmd = "stat -f %s | awk '/Blocks/ {print \$5}'" % disk_file > + status, b_free = get_value(server, cmd, log_msg, disk_file) > + if status != PASS: > + return FAIL, capacity, reserved > + reserved = (cap_val - (int(f_bsize) * int(b_free))) >> 20 > + > + return PASS, capacity, reserved If you want to break up the size of this function some, you could do something like: dpool_cap_reserve_val(): libvirt_version = virsh_version(server, virt) capacity = reserved = None if libvirt_version >= '0.4.1': libvirt_dpool_cap_res() else: fs_dpool_cap_res() Having sub functions for each of these breaks up the work nicely, and it's possible (although unlikely) that a test would need to call one of these functions explicitly. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Jul 11 22:26:53 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 11 Jul 2008 15:26:53 -0700 Subject: [Libvirt-cim] [PATCH 4 of 4] [TEST] Updating 01_forward.py of EAFP In-Reply-To: <2b57a9423f82420b3867.1215778897@elm3b193.beaverton.ibm.com> References: <2b57a9423f82420b3867.1215778897@elm3b193.beaverton.ibm.com> Message-ID: <4877DE2D.9040209@linux.vnet.ibm.com> > +def init_list(server, virt, test_disk): > + lelist = {} > + status, disk = get_id(server, virt, "LogicalDisk", test_disk) > + if status != PASS : > + return status, lelist > + > + status, mem = get_id(server, virt, "Memory", "mem") > + if status != PASS : > + return status, lelist > + > + status, net = get_id(server, virt, "NetworkPort", test_mac) > + if status != PASS: > + return status, lelist > + > + status, proc = get_id(server, virt, "Processor", "0") > + if status != PASS: > + return status, lelist > + > + lelist = { > + disk.CreationClassName : disk.DeviceID, \ > + mem.CreationClassName : mem.DeviceID, \ > + net.CreationClassName : net.DeviceID, \ > + proc.CreationClassName : proc.DeviceID > + } > + return status, lelist I'd suggest condensing the 4 get_id() calls into a loop. In actuality, you don't need to have this function at all. If you know the 4 values for the reference (CCN, SCCN, DeviceID, and SystemName), then you don't really need to get the individual device instances at all. However, I suspect most CIM clients will do similar step, so this is a reasonable to do in the test. > + > +def eafp_list(server, virt, diskid, d_cap, d_reserve, test_network): > + I'd remove this function all together. > + > +def verify_eafp_values(server, virt, diskid, test_network, in_pllist): > + # Looping through the in_pllist to get association for devices. > + an = get_typed_class(virt, "ElementAllocatedFromPool") > + sccn = get_typed_class(virt, "ComputerSystem") > + status, d_cap, d_reserve = eafp_dpool_cap_reserve_val(server, virt, > + diskid) > + if status != PASS: > + return FAIL > + > + eafp_values = eafp_list(server, virt, diskid, d_cap, d_reserve, test_network) > + for cn, devid in sorted(in_pllist.items()): > + try: > + assoc_info = Associators(server, an, cn, > + DeviceID = devid, > + CreationClassName = cn, > + SystemName = test_dom, > + SystemCreationClassName = sccn, > + virt=virt) > + if len(assoc_info) != 1: > + logger.error("%s returned %i ResourcePool objects for " > + "domain '%s'", an, len(assoc_info), > + test_dom) > + status = FAIL > + break > + assoc_eafp_info = assoc_info[0] > + CCName = assoc_eafp_info.classname > + if CCName == eafp_values['procpool']['CCName']: > + list_values = eafp_values['procpool'] > + status = verify_disk_mem_proc_pool_values(assoc_eafp_info, > + list_values) Instead of verifying the values of the host pool returned, I'd determine which pool instances you expect to see (get the instance values by doing GetInstance() calls). Then verify that the pool instance returned by the Associators() call is the same instance your as the pool instance you got using the GetInstance() call. I did something similar for this in the ESD patch I recently sent out. I'd move these resource pool checks to a resource pool specific test. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From yunguol at cn.ibm.com Mon Jul 14 02:39:13 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 14 Jul 2008 10:39:13 +0800 Subject: [Libvirt-cim] Cimtest Report for LXC on F9 (2008/07/14) Message-ID: stro: Fedora 9 Beta kernel-2.6.25-0.218.rc8.git7.fc9.x86_64 CIMOM: tog-pegasus-2.7.0-6.fc9.x86_64 cimtest: changeset-240 ================================================================== PASS : 91 XFAIL : 1 SKIP : 38 ----------------- Total : 130 ======================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: 00002 ComputerSystem - 06_paused_active_suspend.py: SKIP ComputerSystem - 22_define_suspend.py: PASS ComputerSystem - 23_suspend_suspend.py: SKIP ComputerSystem - 27_define_suspend_errs.py: PASS ComputerSystem - 32_start_reboot.py: SKIP ComputerSystem - 33_suspend_reboot.py: SKIP ComputerSystem - 35_start_reset.py: SKIP ComputerSystem - 40_RSC_start.py: SKIP ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP ComputerSystem - 42_cs_gi_errs.py: PASS ComputerSystemIndication - 01_created_indication.py: SKIP ElementAllocatedFromPool - 01_forward.py: SKIP ElementAllocatedFromPool - 02_reverse.py: SKIP ElementAllocatedFromPool - 03_reverse_errs.py: SKIP ElementAllocatedFromPool - 04_forward_errs.py: SKIP ElementCapabilities - 01_forward.py: PASS ElementCapabilities - 02_reverse.py: PASS ElementCapabilities - 03_forward_errs.py: PASS ElementCapabilities - 04_reverse_errs.py: PASS ElementCapabilities - 05_hostsystem_cap.py: PASS ElementConforms - 01_forward.py: PASS ElementConforms - 02_reverse.py: PASS ElementConforms - 03_ectp_fwd_errs.py: PASS ElementConforms - 04_ectp_rev_errs.py: PASS ElementSettingData - 01_forward.py: PASS ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS EnabledLogicalElementCapabilities - 01_enum.py: PASS EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS HostSystem - 01_enum.py: PASS HostSystem - 02_hostsystem_to_rasd.py: PASS HostSystem - 03_hs_to_settdefcap.py: PASS HostSystem - 04_hs_to_EAPF.py: SKIP HostSystem - 05_hs_gi_errs.py: PASS HostSystem - 06_hs_to_vsms.py: PASS HostedDependency - 01_forward.py: PASS HostedDependency - 02_reverse.py: PASS HostedDependency - 03_enabledstate.py: SKIP 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: SKIP LogicalDisk - 02_nodevs.py: SKIP LogicalDisk - 03_ld_gi_errs.py: SKIP Memory - 01_memory.py: PASS Memory - 02_defgetmem.py: PASS Memory - 03_mem_gi_errs.py: PASS NetworkPort - 01_netport.py: SKIP NetworkPort - 02_np_gi_errors.py: SKIP NetworkPort - 03_user_netport.py: SKIP Processor - 01_processor.py: SKIP Processor - 02_definesys_get_procs.py: SKIP Processor - 03_proc_gi_errs.py: SKIP Profile - 01_enum.py: PASS Profile - 02_profile_to_elec.py: SKIP 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: SKIP 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: SKIP ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: SKIP ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: SKIP ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: SKIP ResourcePoolConfigurationService - 07_DeleteResourcePool.py: SKIP SettingsDefine - 01_forward.py: PASS SettingsDefine - 02_reverse.py: PASS SettingsDefine - 03_sds_fwd_errs.py: PASS SettingsDefine - 04_sds_rev_errs.py: PASS SettingsDefineCapabilities - 01_forward.py: PASS SettingsDefineCapabilities - 03_forward_errs.py: PASS SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS SystemDevice - 01_forward.py: PASS SystemDevice - 02_reverse.py: PASS SystemDevice - 03_fwderrs.py: PASS VSSD - 01_enum.py: PASS VSSD - 02_bootldr.py: SKIP VSSD - 03_vssd_gi_errs.py: PASS VSSD - 04_vssd_to_rasd.py: PASS VirtualSystemManagementCapabilities - 01_enum.py: PASS VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS VirtualSystemManagementService - 01_definesystem_name.py: PASS VirtualSystemManagementService - 02_destroysystem.py: PASS VirtualSystemManagementService - 03_definesystem_ess.py: PASS VirtualSystemManagementService - 04_definesystem_ers.py: PASS VirtualSystemManagementService - 05_destroysystem_neg.py: PASS VirtualSystemManagementService - 06_addresource.py: SKIP VirtualSystemManagementService - 07_addresource_neg.py: PASS VirtualSystemManagementService - 08_modifyresource.py: SKIP VirtualSystemManagementService - 09_procrasd_persist.py: SKIP 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: PASS VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS VirtualSystemSnapshotService - 01_enum.py: PASS VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922144 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 -------------- next part -------------- An HTML attachment was scrubbed... URL: From yunguol at cn.ibm.com Mon Jul 14 02:45:54 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 14 Jul 2008 10:45:54 +0800 Subject: [Libvirt-cim] Cimtest Report for LXC on F9 (2008/07/14) In-Reply-To: Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-14 10:39:13: > > stro: Fedora 9 Beta > kernel-2.6.25-0.218.rc8.git7.fc9.x86_64 > CIMOM: tog-pegasus-2.7.0-6.fc9.x86_64 > cimtest: changeset-243 > > ================================================================== > PASS : 91 > XFAIL : 1 > SKIP : 38 > ----------------- > Total : 130 > Kaitlin -- All test case pass for LXC now, maybe we don't need to run the cimtest for LXC from next week. On the next, I will focus on converting the KVM / XenFV tests that are currently SKIPPING. Thoughts? > ======================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: 00002 > ComputerSystem - 06_paused_active_suspend.py: SKIP > ComputerSystem - 22_define_suspend.py: PASS > ComputerSystem - 23_suspend_suspend.py: SKIP > ComputerSystem - 27_define_suspend_errs.py: PASS > ComputerSystem - 32_start_reboot.py: SKIP > ComputerSystem - 33_suspend_reboot.py: SKIP > ComputerSystem - 35_start_reset.py: SKIP > ComputerSystem - 40_RSC_start.py: SKIP > ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP > ComputerSystem - 42_cs_gi_errs.py: PASS > ComputerSystemIndication - 01_created_indication.py: SKIP > ElementAllocatedFromPool - 01_forward.py: SKIP > ElementAllocatedFromPool - 02_reverse.py: SKIP > ElementAllocatedFromPool - 03_reverse_errs.py: SKIP > ElementAllocatedFromPool - 04_forward_errs.py: SKIP > ElementCapabilities - 01_forward.py: PASS > ElementCapabilities - 02_reverse.py: PASS > ElementCapabilities - 03_forward_errs.py: PASS > ElementCapabilities - 04_reverse_errs.py: PASS > ElementCapabilities - 05_hostsystem_cap.py: PASS > ElementConforms - 01_forward.py: PASS > ElementConforms - 02_reverse.py: PASS > ElementConforms - 03_ectp_fwd_errs.py: PASS > ElementConforms - 04_ectp_rev_errs.py: PASS > ElementSettingData - 01_forward.py: PASS > ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS > EnabledLogicalElementCapabilities - 01_enum.py: PASS > EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS > HostSystem - 01_enum.py: PASS > HostSystem - 02_hostsystem_to_rasd.py: PASS > HostSystem - 03_hs_to_settdefcap.py: PASS > HostSystem - 04_hs_to_EAPF.py: SKIP > HostSystem - 05_hs_gi_errs.py: PASS > HostSystem - 06_hs_to_vsms.py: PASS > HostedDependency - 01_forward.py: PASS > HostedDependency - 02_reverse.py: PASS > HostedDependency - 03_enabledstate.py: SKIP > 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: SKIP > LogicalDisk - 02_nodevs.py: SKIP > LogicalDisk - 03_ld_gi_errs.py: SKIP > Memory - 01_memory.py: PASS > Memory - 02_defgetmem.py: PASS > Memory - 03_mem_gi_errs.py: PASS > NetworkPort - 01_netport.py: SKIP > NetworkPort - 02_np_gi_errors.py: SKIP > NetworkPort - 03_user_netport.py: SKIP > Processor - 01_processor.py: SKIP > Processor - 02_definesys_get_procs.py: SKIP > Processor - 03_proc_gi_errs.py: SKIP > Profile - 01_enum.py: PASS > Profile - 02_profile_to_elec.py: SKIP > 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: SKIP > 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: SKIP > ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: SKIP > ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: SKIP > ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: SKIP > ResourcePoolConfigurationService - 07_DeleteResourcePool.py: SKIP > SettingsDefine - 01_forward.py: PASS > SettingsDefine - 02_reverse.py: PASS > SettingsDefine - 03_sds_fwd_errs.py: PASS > SettingsDefine - 04_sds_rev_errs.py: PASS > SettingsDefineCapabilities - 01_forward.py: PASS > SettingsDefineCapabilities - 03_forward_errs.py: PASS > SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS > SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS > SystemDevice - 01_forward.py: PASS > SystemDevice - 02_reverse.py: PASS > SystemDevice - 03_fwderrs.py: PASS > VSSD - 01_enum.py: PASS > VSSD - 02_bootldr.py: SKIP > VSSD - 03_vssd_gi_errs.py: PASS > VSSD - 04_vssd_to_rasd.py: PASS > VirtualSystemManagementCapabilities - 01_enum.py: PASS > VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS > VirtualSystemManagementService - 01_definesystem_name.py: PASS > VirtualSystemManagementService - 02_destroysystem.py: PASS > VirtualSystemManagementService - 03_definesystem_ess.py: PASS > VirtualSystemManagementService - 04_definesystem_ers.py: PASS > VirtualSystemManagementService - 05_destroysystem_neg.py: PASS > VirtualSystemManagementService - 06_addresource.py: SKIP > VirtualSystemManagementService - 07_addresource_neg.py: PASS > VirtualSystemManagementService - 08_modifyresource.py: SKIP > VirtualSystemManagementService - 09_procrasd_persist.py: SKIP > 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: PASS > VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS > VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS > VirtualSystemSnapshotService - 01_enum.py: PASS > VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS > VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS > VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS > > Best, > Regards > > Daisy (???) > VSM Team, China Systems & Technology Labs (CSTL) > E-mail: yunguol at cn.ibm.com > TEL: (86)-21-60922144 > Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 > _______________________________________________ > 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 Jul 14 02:50:23 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 14 Jul 2008 10:50:23 +0800 Subject: [Libvirt-cim] Cimtest Report for Xen on RHEL5.2 (2008/07/14) Message-ID: Distro : RHEL 5.2 Beta Kernel : kernel-2.6.18-92.el5 Xen version : xen-3.0.3-64.el5 Libvirt : libvirt-0.3.3-7.el5 CIMOM : pegasus PyWBEM : pywbem-3.14 CIM Schema : cimv216Experimental LibCMPIutil : 79 LibVirtCIM : 634 CIMTEST : 243 ========================================================= PASS : 108 FAILED : 15 XFAIL : 6 SKIP : 1 Total : 130 =======================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: FAIL ComputerSystem - 06_paused_active_suspend.py: XFAIL Bug: 00002 ComputerSystem - 22_define_suspend.py: PASS ComputerSystem - 23_suspend_suspend.py: XFAIL Bug: 00002 ComputerSystem - 27_define_suspend_errs.py: PASS ComputerSystem - 32_start_reboot.py: XFAIL Bug: 00002 ComputerSystem - 33_suspend_reboot.py: XFAIL Bug: 00002 ComputerSystem - 35_start_reset.py: XFAIL Bug: 00002 ComputerSystem - 40_RSC_start.py: XFAIL Bug: 00002 ComputerSystem - 41_cs_to_settingdefinestate.py: PASS ComputerSystem - 42_cs_gi_errs.py: PASS ComputerSystemIndication - 01_created_indication.py: PASS ElementAllocatedFromPool - 01_forward.py: PASS ElementAllocatedFromPool - 02_reverse.py: PASS ElementAllocatedFromPool - 03_reverse_errs.py: PASS ElementAllocatedFromPool - 04_forward_errs.py: PASS ElementCapabilities - 01_forward.py: PASS ElementCapabilities - 02_reverse.py: PASS ElementCapabilities - 03_forward_errs.py: PASS ElementCapabilities - 04_reverse_errs.py: PASS ElementCapabilities - 05_hostsystem_cap.py: PASS ElementConforms - 01_forward.py: FAIL ElementConforms - 02_reverse.py: FAIL ElementConforms - 03_ectp_fwd_errs.py: PASS ElementConforms - 04_ectp_rev_errs.py: PASS ElementSettingData - 01_forward.py: PASS ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS EnabledLogicalElementCapabilities - 01_enum.py: PASS EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS HostSystem - 01_enum.py: PASS HostSystem - 02_hostsystem_to_rasd.py: FAIL HostSystem - 03_hs_to_settdefcap.py: PASS 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: PASS LogicalDisk - 03_ld_gi_errs.py: FAIL Memory - 01_memory.py: FAIL Memory - 02_defgetmem.py: PASS 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: PASS Processor - 03_proc_gi_errs.py: PASS Profile - 01_enum.py: PASS Profile - 02_profile_to_elec.py: PASS Profile - 03_rprofile_gi_errs.py: PASS RASD - 01_verify_rasd_fields.py: PASS RASD - 02_enum.py: PASS RASD - 03_rasd_errs.py: PASS 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: FAIL ResourcePool - 02_rp_gi_errors.py: PASS ResourcePoolConfigurationCapabilities - 01_enum.py: PASS ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS ResourcePoolConfigurationService - 01_enum.py: PASS ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS SettingsDefine - 01_forward.py: PASS SettingsDefine - 02_reverse.py: PASS SettingsDefine - 03_sds_fwd_errs.py: PASS SettingsDefine - 04_sds_rev_errs.py: PASS SettingsDefineCapabilities - 01_forward.py: PASS SettingsDefineCapabilities - 03_forward_errs.py: PASS SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS SystemDevice - 01_forward.py: PASS SystemDevice - 02_reverse.py: PASS SystemDevice - 03_fwderrs.py: PASS VSSD - 01_enum.py: PASS VSSD - 02_bootldr.py: FAIL CIM_ERR_NOT_FOUND: No such instance (dom) VSSD - 03_vssd_gi_errs.py: PASS 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 InvokeMethod(DestroySystem): CIM_ERR_FAILED: Unable to retrieve domain name. 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: FAIL VirtualSystemManagementService - 09_procrasd_persist.py: FAIL VirtualSystemMigrationCapabilities - 01_enum.py: PASS VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS VirtualSystemMigrationService - 01_migratable_host.py: PASS VirtualSystemMigrationService - 02_host_migrate_type.py: PASS VirtualSystemMigrationService - 05_migratable_host_errs.py: PASS VirtualSystemMigrationSettingData - 01_enum.py: PASS VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS VirtualSystemSettingDataComponent - 01_forward.py: PASS VirtualSystemSettingDataComponent - 02_reverse.py: PASS VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS VirtualSystemSnapshotService - 01_enum.py: PASS VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922144 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 -------------- next part -------------- An HTML attachment was scrubbed... URL: From yunguol at cn.ibm.com Mon Jul 14 04:49:07 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Sun, 13 Jul 2008 21:49:07 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update Profile.02 for KVM/XenFV/LXC support Message-ID: <472b025c9fb6b5f59302.1216010947@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1216010940 25200 # Node ID 472b025c9fb6b5f59302ce36d95d5f930b1f4ebb # Parent 64abdd1495dc05e69061151baf2ea25a682e8d8d [TEST] Update Profile.02 for KVM/XenFV/LXC support Signed-off-by: Guolian Yun diff -r 64abdd1495dc -r 472b025c9fb6 suites/libvirt-cim/cimtest/Profile/02_profile_to_elec.py --- a/suites/libvirt-cim/cimtest/Profile/02_profile_to_elec.py Fri Jul 11 00:42:35 2008 -0700 +++ b/suites/libvirt-cim/cimtest/Profile/02_profile_to_elec.py Sun Jul 13 21:49:00 2008 -0700 @@ -42,16 +42,17 @@ from XenKvmLib.assoc import Associators from XenKvmLib.assoc import Associators from XenKvmLib.vxml import get_class from XenKvmLib.test_doms import destroy_and_undefine_all +from XenKvmLib.classes import get_typed_class from CimTest import Globals from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORNAMES from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "domguest" -def setup_env(server): +def setup_env(server, virt='Xen'): rc = -1 status = PASS csxml_info = None @@ -59,10 +60,10 @@ def setup_env(server): destroy_and_undefine_all(server) virt_xml = get_class(virt) csxml_info = virt_xml(test_dom) - rc = csxml_info.cim_define(server) + rc = csxml_info.define(server) if not rc: - logger.error("Unable define domain %s using DefineSystem() " % test_dom) + logger.error("Unable define domain %s" % test_dom) status = FAIL except Exception, detail: @@ -96,15 +97,16 @@ def get_inst_from_list(server, cn, qcn, return PASS, inst -def get_profile(server): +def get_profile(server, virt='Xen'): registeredname = 'Virtual System Profile' - cn = 'Xen_RegisteredProfile' + cn = get_typed_class(virt, 'RegisteredProfile') status = PASS profile = None try: proflist = enumclass.enumerate_inst(server, - enumclass.Xen_RegisteredProfile) + 'RegisteredProfile', + virt) filter = {"key" : "RegisteredName"} status, profile = get_inst_from_list(server, @@ -120,9 +122,9 @@ def get_profile(server): return status, profile -def get_cs(server, profile): - cn = 'Xen_RegisteredProfile' - an = 'Xen_ElementConformsToProfile' +def get_cs(server, profile, virt='Xen'): + cn = get_typed_class(virt, 'RegisteredProfile') + an = get_typed_class(virt, 'ElementConformsToProfile') status = PASS cs = None @@ -130,9 +132,10 @@ def get_cs(server, profile): assoc_info = Associators(server, an, cn, + virt, InstanceID = profile['InstanceID']) - cn = 'Xen_ComputerSystem' + cn = get_typed_class(virt, 'ComputerSystem') filter = {"key" : "Name"} status, cs = get_inst_from_list(server, cn, @@ -147,9 +150,9 @@ def get_cs(server, profile): return status, cs -def get_elec(server, cs): - cn = 'Xen_ComputerSystem' - an = 'Xen_ElementCapabilities' +def get_elec(server, cs, virt='Xen'): + cn = get_typed_class(virt, 'ComputerSystem') + an = get_typed_class(virt, 'ElementCapabilities') status = FAIL elec = None @@ -158,10 +161,11 @@ def get_elec(server, cs): assoc_info = Associators(server, an, cn, + virt, Name = cs['Name'], CreationClassName = ccn) - cn = 'Xen_EnabledLogicalElementCapabilities' + cn = get_typed_class(virt, 'EnabledLogicalElementCapabilities') filter = {"key" : "InstanceID"} status, elec = get_inst_from_list(server, cn, @@ -185,27 +189,27 @@ def main(): server = options.ip status = PASS - - status, csxml = setup_env(server) + + status, csxml = setup_env(server, virt) if status != PASS: return status prev_namespace = Globals.CIM_NS Globals.CIM_NS = 'root/interop' - status, prof = get_profile(server) + status, prof = get_profile(server, virt) if status != PASS or prof == None: csxml.undefine(server) return status - status, cs = get_cs(server, prof) + status, cs = get_cs(server, prof, virt) if status != PASS or cs == None: csxml.undefine(server) return status Globals.CIM_NS = prev_namespace - status, elec = get_elec(server, cs) + status, elec = get_elec(server, cs, virt) if status != PASS or elec == None: return status From deeptik at linux.vnet.ibm.com Mon Jul 14 05:51:41 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Mon, 14 Jul 2008 11:21:41 +0530 Subject: [Libvirt-cim] [PATCH 1 of 3] Fix getInstance in enumclass.py to return matching type on error In-Reply-To: <6fe68391f0c820e81525.1215808108@elm3b41.beaverton.ibm.com> References: <6fe68391f0c820e81525.1215808108@elm3b41.beaverton.ibm.com> Message-ID: <487AE96D.2020305@linux.vnet.ibm.com> Yes thats correct. +1 for me . Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1212719310 25200 > # Node ID 6fe68391f0c820e815251022bfe8469a0a93115b > # Parent 27d89d4b1ea884a49da6ce4fd93e0f7c71a6b36b > Fix getInstance in enumclass.py to return matching type on error. > > getInstance() returns a single element, so if the call encounters an error, it should return None instead of []. > > Signed-off-by: Kaitlin Rupert > > diff -r 27d89d4b1ea8 -r 6fe68391f0c8 suites/libvirt-cim/lib/XenKvmLib/enumclass.py > --- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Fri Jul 11 13:26:03 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Thu Jun 05 19:28:30 2008 -0700 > @@ -320,6 +320,6 @@ > > except pywbem.CIMError, arg: > print arg[1] > - return [] > + return None > > return inst > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From yunguol at cn.ibm.com Mon Jul 14 08:52:27 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 14 Jul 2008 16:52:27 +0800 Subject: [Libvirt-cim] test list in SKIPPING status for KVM Message-ID: Floks, Here are the tests that are currently in SKIPPING status for KVM. Y - Needs to be implemented N - Does not to be implemented If there is any misktake please let me know. Test KVM ComputerSystem - 23_suspend_suspend.py: SKIP Y ComputerSystem - 27_define_suspend_errs.py Y ComputerSystem - 32_start_reboot.py Y ComputerSystem - 33_suspend_reboot.py Y ComputerSystem - 35_start_reset.py Y ComputerSystem - 41_cs_to_settingdefinestate.py Y ElementAllocatedFromPool - 01_forward.py Y ElementAllocatedFromPool - 02_reverse.py Y HostSystem - 04_hs_to_EAPF.py Y VSSD - 02_bootldr.py N VirtualSystemMigrationService - 01_migratable_host.py Y VirtualSystemMigrationService - 02_host_migrate_type.py Y VirtualSystemMigrationService - 05_migratable_host_errs.py Y VirtualSystemSettingDataComponent - 01_forward.py N Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922144 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kaitlin at linux.vnet.ibm.com Mon Jul 14 14:00:46 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Jul 2008 07:00:46 -0700 Subject: [Libvirt-cim] Cimtest Report for LXC on F9 (2008/07/14) In-Reply-To: References: Message-ID: <487B5C0E.1020900@linux.vnet.ibm.com> Guo Lian Yun wrote: > > libvirt-cim-bounces at redhat.com wrote on 2008-07-14 10:39:13: > > > > > stro: Fedora 9 Beta > > kernel-2.6.25-0.218.rc8.git7.fc9.x86_64 > > CIMOM: tog-pegasus-2.7.0-6.fc9.x86_64 > > cimtest: changeset-243 > > > > ================================================================== > > PASS : 91 > > XFAIL : 1 > > SKIP : 38 > > ----------------- > > Total : 130 > > > Kaitlin -- All test case pass for LXC now, maybe we don't need > to run the cimtest for LXC from next week. On the next, I will focus on > converting the KVM / XenFV tests that are currently SKIPPING. > > Thoughts? I would like to continue the test runs on LXC - the test runs also serve as regression testing. The providers do change, and a weekly test run helps verify those changes. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Jul 14 14:07:00 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Jul 2008 07:07:00 -0700 Subject: [Libvirt-cim] test list in SKIPPING status for KVM In-Reply-To: References: Message-ID: <487B5D84.8090304@linux.vnet.ibm.com> > VirtualSystemSettingDataComponent - 01_forward.py > N > This test should be converted as well. You can either: A) Remove the part of the test that verifies the bootloader - no need to define a guest with a bootloader in this case. B) In the Xen case, define the guest with a bootloader. Define non-bootloader guests for all other cases. Since the bootloader is verified in VSSD 02, I would opt for the second choice. But either choice is fine. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Jul 14 14:15:34 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Jul 2008 07:15:34 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update Profile.02 for KVM/XenFV/LXC support In-Reply-To: <472b025c9fb6b5f59302.1216010947@elm3b197.beaverton.ibm.com> References: <472b025c9fb6b5f59302.1216010947@elm3b197.beaverton.ibm.com> Message-ID: <487B5F86.7060902@linux.vnet.ibm.com> > diff -r 64abdd1495dc -r 472b025c9fb6 suites/libvirt-cim/cimtest/Profile/02_profile_to_elec.py > @@ -59,10 +60,10 @@ def setup_env(server): > destroy_and_undefine_all(server) > virt_xml = get_class(virt) > csxml_info = virt_xml(test_dom) > - rc = csxml_info.cim_define(server) > + rc = csxml_info.define(server) I'd like more tests to use cim_define() instead of define(), so I don't want to change this - even if it means this test only supports Xen for now. Before converting this test, cim_define() support for KVM, XenFV, and LXC needs to be in place. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Jul 14 15:14:05 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Jul 2008 08:14:05 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix potiential false positive with HostSystem 01 Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1216048393 25200 # Node ID b5d2f6621f5731e5a6508cdd6e7b82bfba0ff9df # Parent 463274d67d8f35ac562c5665e561ab970ddc55c1 [TEST] Fix potiential false positive with HostSystem 01. This test doesn't verify that exactly one instances was returned from the EnumerateInstances() call. Also, if the EnumerateInstance() call doesn't return any instances, then the test falls through the loop and returns PASS. Signed-off-by: Kaitlin Rupert diff -r 463274d67d8f -r b5d2f6621f57 suites/libvirt-cim/cimtest/HostSystem/01_enum.py --- a/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Fri Jul 11 13:04:59 2008 -0700 +++ b/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Mon Jul 14 08:13:13 2008 -0700 @@ -26,13 +26,11 @@ # and verifies the hostname returned by the provider import sys -from CimTest.Globals import do_main from XenKvmLib import hostsystem from XenKvmLib.classes import get_typed_class from VirtLib import live from VirtLib import utils -from CimTest import Globals -from CimTest.Globals import logger +from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, do_main from CimTest.ReturnCodes import PASS, FAIL SUPPORTED_TYPES = ['Xen', 'KVM', 'XenFV', 'LXC'] @@ -40,22 +38,29 @@ @do_main(SUPPORTED_TYPES) def main(): options = main.options - status = PASS host = live.hostname(options.ip) + status = FAIL try: hs = hostsystem.enumerate(options.ip, options.virt) name = get_typed_class(options.virt, 'HostSystem') - for system in hs: - if system.CreationClassName != name and system.Name != host: - logger.error("%s Enumerate Instance error" % name) - status = FAIL - else: - logger.info("%s is %s" % (name, host)) + if len(hs) != 1: + logger.error("Expected 1 %s instance returned" % name) + return FAIL + + system = hs[0] - except BaseException: - logger.error(Globals.CIM_ERROR_ENUMERATE % hostsystem.CIM_System) + if system.CreationClassName != name and system.Name != host: + logger.error("Exp %s, got %s" % (name, system.CreationClassName)) + logger.error("Exp %s, got %s" % (host, system.Name)) + status = FAIL + else: + logger.info("%s is %s" % (name, host)) + status = PASS + + except Exception, details: + logger.error("%s %s: %s" % (CIM_ERROR_ENUMERATE, name, details)) status = FAIL return status From kaitlin at linux.vnet.ibm.com Mon Jul 14 16:07:54 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Jul 2008 09:07:54 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Remove guest creation from LogicalDisk - 02_nodevs.py Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1216051613 25200 # Node ID d44423ea6fcf1af4d75ccc69caa3fd727459a770 # Parent 7caeda6d0b06d47dd3e1b2758db16954e09725ce [TEST] Remove guest creation from LogicalDisk - 02_nodevs.py. The point of this test is to ensure no devices are returned from EnumerateInstances() in the case where no guest is defined (or in the case where only Domain-0 is defined). Also add support for LXC. In the case where devices.enumerate() encountered a CIM error, raise an exception instead of printing an error. Signed-off-by: Kaitlin Rupert diff -r 7caeda6d0b06 -r d44423ea6fcf suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py --- a/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Mon Jul 14 08:42:34 2008 -0700 +++ b/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Mon Jul 14 09:06:53 2008 -0700 @@ -25,21 +25,23 @@ 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.test_doms import define_test_domain, undefine_test_domain -from XenKvmLib.test_xml import testxml -from CimTest.Globals import logger, do_main +from CimTest.Globals import logger, do_main, CIM_ERROR_ENUMERATE +from CimTest.ReturnCodes import PASS, FAIL, SKIP -sup_types = ['Xen', 'KVM', 'XenFV'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "test_domain" def clean_system(host, virt='Xen'): l = live.domain_list(host, virt) - if len(l) > 1: + + if virt == "XenFV" or virt == "Xen": + if len(l) > 1: + return False + else: + return True + elif len(l) > 0: return False else: return True @@ -49,31 +51,27 @@ options = main.options if not clean_system(options.ip, options.virt): logger.error("System has defined domains; unable to run") - return 2 + return SKIP - if options.virt == 'Xen': - test_dev = 'xvda' - else: - test_dev = 'hda' + key_list = ["DeviceID", "CreationClassName", "SystemName", + "SystemCreationClassName"] - vsxml = get_class(options.virt)(test_dom, disk=test_dev) - ret = vsxml.define(options.ip) - if not ret: - logger.error("Failed to Define the dom: %s", test_dom) + cn = "LogicalDisk" + + try: + devs = devices.enumerate(options.ip, cn, key_list, options.virt) + + except Exception, details: + logger.error(CIM_ERROR_ENUMERATE, cn) + logger.error(details) return FAIL - devid = "%s/%s" % (test_dom, test_dev) + if len(devs) != 0: + logger.error("%s returned %d instead of empty list" % (cn, len(devs))) + status = FAIL + else: + status = PASS - status = 0 - key_list = ["DeviceID", "CreationClassName", "SystemName", "SystemCreationClassName"] - - devs = devices.enumerate(options.ip, 'LogicalDisk', key_list) - if devs.__class__ == str: - logger.error("Got error instead of empty list: %s" % devs) - status = 1 - - vsxml.undefine(options.ip) - return status if __name__ == "__main__": diff -r 7caeda6d0b06 -r d44423ea6fcf suites/libvirt-cim/lib/XenKvmLib/devices.py --- a/suites/libvirt-cim/lib/XenKvmLib/devices.py Mon Jul 14 08:42:34 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py Mon Jul 14 09:06:53 2008 -0700 @@ -85,6 +85,9 @@ class KVM_LogicalDisk(CIM_LogicalDisk): pass +class LXC_LogicalDisk(CIM_LogicalDisk): + pass + class Xen_NetworkPort(CIM_NetworkPort): pass @@ -123,7 +126,7 @@ try: names = conn.EnumerateInstanceNames(devtype.__name__) except pywbem.CIMError, arg: - print arg[1] + raise Exception("%s" % arg[1]) return list for name in names: From kaitlin at linux.vnet.ibm.com Mon Jul 14 22:33:11 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 14 Jul 2008 15:33:11 -0700 Subject: [Libvirt-cim] [PATCH] [CU] Remove statement to set the port equal to 8000 Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1216074765 25200 # Node ID b27fbfbc713cae6807aa9ecc97ae6de34cc5d5d2 # Parent be269371a819744e742c24a55d011610cf6d3485 [CU] Remove statement to set the port equal to 8000. The port is set prior to the BaseHTTPServer.HTTPServer() call. Signed-off-by: Kaitlin Rupert diff -r be269371a819 -r b27fbfbc713c tools/indication_tester.py --- a/tools/indication_tester.py Tue Jul 08 12:12:18 2008 -0700 +++ b/tools/indication_tester.py Mon Jul 14 15:32:45 2008 -0700 @@ -308,7 +308,6 @@ class CIMIndicationSubscription: self.server = BaseHTTPServer.HTTPServer(('', self.port), CIMSocketHandler) self.server.print_ind = print_ind - self.port = 8000 self.server.indications = [] self.filter_xml = filter_xml(name, typ, ns, sysname) From yunguol at cn.ibm.com Tue Jul 15 01:35:43 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 15 Jul 2008 09:35:43 +0800 Subject: [Libvirt-cim] Cimtest Report for LXC on F9 (2008/07/14) In-Reply-To: <487B5C0E.1020900@linux.vnet.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-14 22:00:46: > Guo Lian Yun wrote: > > > > libvirt-cim-bounces at redhat.com wrote on 2008-07-14 10:39:13: > > > > > > > > stro: Fedora 9 Beta > > > kernel-2.6.25-0.218.rc8.git7.fc9.x86_64 > > > CIMOM: tog-pegasus-2.7.0-6.fc9.x86_64 > > > cimtest: changeset-243 > > > > > > ================================================================== > > > PASS : 91 > > > XFAIL : 1 > > > SKIP : 38 > > > ----------------- > > > Total : 130 > > > > > Kaitlin -- All test case pass for LXC now, maybe we don't need > > to run the cimtest for LXC from next week. On the next, I will focus on > > converting the KVM / XenFV tests that are currently SKIPPING. > > > > Thoughts? > > I would like to continue the test runs on LXC - the test runs also serve > as regression testing. The providers do change, and a weekly test run > helps verify those changes. I know, I will keep on running the test on LXC every week. Thanks! > -- > 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 Tue Jul 15 01:45:46 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 15 Jul 2008 09:45:46 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] Fix potiential false positive with HostSystem 01 In-Reply-To: Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-14 23:14:05: > # HG changeset patch > # User Kaitlin Rupert > # Date 1216048393 25200 > # Node ID b5d2f6621f5731e5a6508cdd6e7b82bfba0ff9df > # Parent 463274d67d8f35ac562c5665e561ab970ddc55c1 > [TEST] Fix potiential false positive with HostSystem 01. > > This test doesn't verify that exactly one instances was returned > from the EnumerateInstances() call. > > Also, if the EnumerateInstance() call doesn't return any instances, > then the test falls through the loop and returns PASS. > > Signed-off-by: Kaitlin Rupert > > diff -r 463274d67d8f -r b5d2f6621f57 suites/libvirt- > cim/cimtest/HostSystem/01_enum.py > --- a/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Fri Jul 11 > 13:04:59 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Mon Jul 14 > 08:13:13 2008 -0700 > @@ -26,13 +26,11 @@ > # and verifies the hostname returned by the provider > > import sys > -from CimTest.Globals import do_main > from XenKvmLib import hostsystem > from XenKvmLib.classes import get_typed_class > from VirtLib import live > from VirtLib import utils > -from CimTest import Globals > -from CimTest.Globals import logger > +from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, do_main > from CimTest.ReturnCodes import PASS, FAIL > > SUPPORTED_TYPES = ['Xen', 'KVM', 'XenFV', 'LXC'] > @@ -40,22 +38,29 @@ > @do_main(SUPPORTED_TYPES) > def main(): > options = main.options > - status = PASS > host = live.hostname(options.ip) > > + status = FAIL > try: > hs = hostsystem.enumerate(options.ip, options.virt) > name = get_typed_class(options.virt, 'HostSystem') > > - for system in hs: > - if system.CreationClassName != name and system.Name != host: > - logger.error("%s Enumerate Instance error" % name) > - status = FAIL > - else: > - logger.info("%s is %s" % (name, host)) > + if len(hs) != 1: > + logger.error("Expected 1 %s instance returned" % name) > + return FAIL > + > + system = hs[0] > > - except BaseException: > - logger.error(Globals.CIM_ERROR_ENUMERATE % hostsystem.CIM_System) > + if system.CreationClassName != name and system.Name != host: I think either one fails, we should report error. Maybe we can change it to below: if system.CreationClassName != name or system.Name != host: > + logger.error("Exp %s, got %s" % (name, system.CreationClassName)) > + logger.error("Exp %s, got %s" % (host, system.Name)) > + status = FAIL > + else: > + logger.info("%s is %s" % (name, host)) > + status = PASS > + > + except Exception, details: > + logger.error("%s %s: %s" % (CIM_ERROR_ENUMERATE, name, details)) > status = FAIL > > return status > > _______________________________________________ > 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 Jul 15 01:57:59 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 15 Jul 2008 09:57:59 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] Remove guest creation from LogicalDisk - 02_nodevs.py In-Reply-To: Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-15 00:07:54: > # HG changeset patch > # User Kaitlin Rupert > # Date 1216051613 25200 > # Node ID d44423ea6fcf1af4d75ccc69caa3fd727459a770 > # Parent 7caeda6d0b06d47dd3e1b2758db16954e09725ce > [TEST] Remove guest creation from LogicalDisk - 02_nodevs.py. > > The point of this test is to ensure no devices are returned from > EnumerateInstances() in the case where no guest is defined (or in > the case where only Domain-0 is defined). > > Also add support for LXC. > > In the case where devices.enumerate() encountered a CIM error, raise > an exception instead of printing an error. > > Signed-off-by: Kaitlin Rupert > > diff -r 7caeda6d0b06 -r d44423ea6fcf suites/libvirt- > cim/cimtest/LogicalDisk/02_nodevs.py > --- a/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Mon Jul > 14 08:42:34 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Mon Jul > 14 09:06:53 2008 -0700 > @@ -25,21 +25,23 @@ > > 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.test_doms import define_test_domain, undefine_test_domain > -from XenKvmLib.test_xml import testxml > -from CimTest.Globals import logger, do_main > +from CimTest.Globals import logger, do_main, CIM_ERROR_ENUMERATE > +from CimTest.ReturnCodes import PASS, FAIL, SKIP > > -sup_types = ['Xen', 'KVM', 'XenFV'] > +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > > test_dom = "test_domain" > def clean_system(host, virt='Xen'): > l = live.domain_list(host, virt) > - if len(l) > 1: > + > + if virt == "XenFV" or virt == "Xen": > + if len(l) > 1: > + return False > + else: > + return True Typos error, it takes four spaces. > + elif len(l) > 0: > return False > else: > return True > @@ -49,31 +51,27 @@ > options = main.options > if not clean_system(options.ip, options.virt): > logger.error("System has defined domains; unable to run") > - return 2 > + return SKIP > > - if options.virt == 'Xen': > - test_dev = 'xvda' > - else: > - test_dev = 'hda' > + key_list = ["DeviceID", "CreationClassName", "SystemName", > + "SystemCreationClassName"] > > - vsxml = get_class(options.virt)(test_dom, disk=test_dev) > - ret = vsxml.define(options.ip) > - if not ret: > - logger.error("Failed to Define the dom: %s", test_dom) > + cn = "LogicalDisk" > + > + try: > + devs = devices.enumerate(options.ip, cn, key_list, options.virt) > + > + except Exception, details: > + logger.error(CIM_ERROR_ENUMERATE, cn) > + logger.error(details) > return FAIL > > - devid = "%s/%s" % (test_dom, test_dev) > + if len(devs) != 0: > + logger.error("%s returned %d instead of empty list" % (cn, > len(devs))) > + status = FAIL > + else: > + status = PASS > > - status = 0 > - key_list = ["DeviceID", "CreationClassName", "SystemName", > "SystemCreationClassName"] > - > - devs = devices.enumerate(options.ip, 'LogicalDisk', key_list) > - if devs.__class__ == str: > - logger.error("Got error instead of empty list: %s" % devs) > - status = 1 > - > - vsxml.undefine(options.ip) > - > return status > > if __name__ == "__main__": > diff -r 7caeda6d0b06 -r d44423ea6fcf suites/libvirt- > cim/lib/XenKvmLib/devices.py > --- a/suites/libvirt-cim/lib/XenKvmLib/devices.py Mon Jul 14 08: > 42:34 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py Mon Jul 14 09: > 06:53 2008 -0700 > @@ -85,6 +85,9 @@ > class KVM_LogicalDisk(CIM_LogicalDisk): > pass > > +class LXC_LogicalDisk(CIM_LogicalDisk): > + pass > + > class Xen_NetworkPort(CIM_NetworkPort): > pass > > @@ -123,7 +126,7 @@ > try: > names = conn.EnumerateInstanceNames(devtype.__name__) > except pywbem.CIMError, arg: > - print arg[1] > + raise Exception("%s" % arg[1]) > return list > > for name in names: > > _______________________________________________ > 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 Jul 15 04:48:35 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 14 Jul 2008 21:48:35 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update VirtualSystemSettingDataComponent.01 for KVM/XenFV/LXC support Message-ID: # HG changeset patch # User Guolian Yun # Date 1216097308 25200 # Node ID c8a06679508f8aca9e64f911864bad3c71f4cf6b # Parent 64abdd1495dc05e69061151baf2ea25a682e8d8d [TEST] Update VirtualSystemSettingDataComponent.01 for KVM/XenFV/LXC support The test defines non-bootloader guests for all platform types, also remove the part of thet test that verifies the bootloader Signed-off-by: Guolian Yun diff -r 64abdd1495dc -r c8a06679508f suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Fri Jul 11 00:42:35 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Mon Jul 14 21:48:28 2008 -0700 @@ -53,32 +53,36 @@ from XenKvmLib import enumclass from XenKvmLib import enumclass from VirtLib import utils from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all -from XenKvmLib.test_xml import testxml_bl -from XenKvmLib.test_xml import xml_get_dom_bootloader from CimTest import Globals from XenKvmLib import assoc +from XenKvmLib import vxml +from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger, do_main from CimTest.ReturnCodes import FAIL, PASS -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "VSSDC_dom" test_vcpus = 2 -test_mac = "00:11:22:33:44:aa" -test_disk = 'xvda' -status = 0 -VSType = "Xen" - -def init_list(): +status = PASS + +def init_list(virt='Xen'): """ Creating the lists that will be used for comparisons. """ - rlist = ['Xen_DiskResourceAllocationSettingData', - 'Xen_MemResourceAllocationSettingData', - 'Xen_NetResourceAllocationSettingData', - 'Xen_ProcResourceAllocationSettingData' + rlist = [get_typed_class(virt, 'DiskResourceAllocationSettingData'), + get_typed_class(virt, 'MemResourceAllocationSettingData'), + get_typed_class(virt, 'NetResourceAllocationSettingData'), + get_typed_class(virt, 'ProcResourceAllocationSettingData') ] + + if virt == 'Xen' or virt == 'XenFV': + test_disk = 'xvda' + test_mac = "00:11:22:33:44:aa" + else: + test_disk = 'hda' + test_mac = '11:22:33:aa:bb:cc' prop_list = {rlist[0] : "%s/%s" % (test_dom, test_disk), rlist[1] : "%s/%s" % (test_dom, "mem"), @@ -86,21 +90,25 @@ def init_list(): rlist[3] : "%s/%s" % (test_dom, "proc") } - return prop_list + if virt == 'LXC': + rlist = [get_typed_class(virt, 'MemResourceAllocationSettingData')] + prop_list = {rlist[0] : "%s/%s" % (test_dom, "mem")} + + return prop_list, test_disk, test_mac def build_vssd_info(ip, vssd): """ Creating the vssd fileds lists that will be used for comparisons. """ - if vssd.Bootloader == "" or vssd.Caption == "" or \ - vssd.InstanceID == "" or vssd.ElementName == "" or \ - vssd.VirtualSystemIdentifier == "" or vssd.VirtualSystemType == "": + if vssd.Caption == "" or \ + vssd.InstanceID == "" or vssd.ElementName == "" or \ + vssd.VirtualSystemIdentifier == "" or vssd.VirtualSystemType == "": logger.error("One of the required VSSD details seems to be empty") test_domain_function(test_dom, ip, "undefine") return FAIL - vssd_vals = {'Bootloader' : vssd.Bootloader, + vssd_vals = { 'Caption' : vssd.Caption, 'InstanceID' : vssd.InstanceID, 'ElementName' : vssd.ElementName, @@ -143,46 +151,53 @@ def main(): status = FAIL destroy_and_undefine_all(options.ip) - test_xml = testxml_bl(test_dom, vcpus = test_vcpus, \ - mac = test_mac, disk = test_disk, \ - server = options.ip,\ - gtype = 0) - ret = test_domain_function(test_xml, options.ip, cmd = "define") + + prop_list, test_disk, test_mac = init_list(options.virt) + virt_xml = vxml.get_class(options.virt) + if options.virt == 'LXC': + cxml = virt_xml(test_dom) + else: + cxml = virt_xml(test_dom, vcpus = test_vcpus, \ + mac = test_mac, disk = test_disk) + ret = cxml.define(options.ip) if not ret: - logger.error("Failed to define the dom: %s", test_dom) - return FAIL - - instIdval = "%s:%s" % (VSType, test_dom) + logger.error('Unable to define domain %s' % test_dom) + return FAIL + + if options.virt == 'XenFV': + instIdval = "Xen:%s" % test_dom + else: + instIdval = "%s:%s" % (options.virt, test_dom) keyname = "InstanceID" key_list = { 'InstanceID' : instIdval } + vssd_cn = get_typed_class(options.virt, 'VirtualSystemSettingData') try: vssd = enumclass.getInstance(options.ip, \ - enumclass.Xen_VirtualSystemSettingData, \ - key_list) + 'VirtualSystemSettingData', \ + key_list, \ + options.virt) if vssd is None: logger.error("VSSD instance for %s not found" % test_dom) - test_domain_function(test_dom, options.ip, "undefine") + cxml.undefine(options.ip) return FAIL vssd_vals = build_vssd_info(options.ip, vssd) except Exception, detail : - logger.error(Globals.CIM_ERROR_GETINSTANCE, \ - 'Xen_VirtualSystemSettingData') + logger.error(Globals.CIM_ERROR_GETINSTANCE, vssd_cn) logger.error("Exception : %s" % detail) - test_domain_function(test_dom, options.ip, "undefine") + cxml.undefine(options.ip) return FAIL - prop_list = init_list() try: # Looping through the RASD_cllist, call association # Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist - an = 'Xen_VirtualSystemSettingDataComponent' + an = get_typed_class(options.virt, 'VirtualSystemSettingDataComponent') for rasd_cname, prop in prop_list.iteritems(): assoc_info = assoc.Associators(options.ip, an, rasd_cname, - InstanceID = prop) + options.virt, InstanceID = prop) # Verify the association fields returned for particular rasd_cname. status = assoc_values(options.ip, assoc_info, rasd_cname, an, vssd_vals) @@ -194,7 +209,7 @@ def main(): logger.error("Exception : %s" % detail) status = FAIL - test_domain_function(test_dom, options.ip, "undefine") + cxml.undefine(options.ip) return status if __name__ == "__main__": From yunguol at cn.ibm.com Tue Jul 15 05:39:42 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 15 Jul 2008 13:39:42 +0800 Subject: [Libvirt-cim] test list in SKIPPING status for KVM In-Reply-To: Message-ID: Libvirt-cim-bounces at redhat.com wrote on 2008-07-14 16:52:27: > > Floks, > > Here are the tests that are currently in SKIPPING status for KVM. > > Y - Needs to be implemented > N - Does not to be implemented > > If there is any misktake please let me know. > > Test > > KVM > > ComputerSystem - 23_suspend_suspend.py: SKIP > > Y > > ComputerSystem - 27_define_suspend_errs.py > > Y > > ComputerSystem - 32_start_reboot.py > > Y > > ComputerSystem - 33_suspend_reboot.py > > Y > > ComputerSystem - 35_start_reset.py > > Y > > ComputerSystem - 41_cs_to_settingdefinestate.py > > Y > Deepti - You're working on ElementAllocatedFromPool now, would you be interested in working ComputerSystem for KVM/XenFV support on the next? > ElementAllocatedFromPool - 01_forward.py > > Y > > ElementAllocatedFromPool - 02_reverse.py > > Y > > HostSystem - 04_hs_to_EAPF.py > > Y > > VSSD - 02_bootldr.py > > N > > VirtualSystemMigrationService - 01_migratable_host.py > > Y > > VirtualSystemMigrationService - 02_host_migrate_type.py > > Y > > VirtualSystemMigrationService - 05_migratable_host_errs.py > > Y On the next, I will update VirtualSystemMigrationService for KVM/XenFV support. Kaitlin -- It doesn't support for LXC, right? > > VirtualSystemSettingDataComponent - 01_forward.py > > N > This test should be converted as well. And I've sent a patch that updated it for KVM/XenFV/LXC support. > > > > > > Best, > Regards > > Daisy (???) > VSM Team, China Systems & Technology Labs (CSTL) > E-mail: yunguol at cn.ibm.com > TEL: (86)-21-60922144 > Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 > _______________________________________________ > 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 Jul 15 06:20:37 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 15 Jul 2008 14:20:37 +0800 Subject: [Libvirt-cim] Update tests in skip status for KVM and on the next work Message-ID: I'd talked to Deepti about test for KVM/XenFV support. She is working on EAFP now, and she would like to work on cim_Define() because Zhengang is quite busy with VSM work. Also she will start to work on ComputerSystem tests that are currently in SKIP status for KVM/XenFV, which depend on cim_Define(). I've complete Profile.01&03 for KVM/XenFV support, and just sent a patch of VSSDC for KVM/XenFV/LXC support. On the next I will work on VirtualSystemMigrationService for KVM/XenFV support, which maybe takes much time. Below is the details for the tests to convert to support KVM. Y - Needs to be implemented Test KVM Person Responsible ComputerSystem - 23_suspend_suspend.py Y Deepti ComputerSystem - 27_define_suspend_errs.py Y Deepti ComputerSystem - 32_start_reboot.py Y Deepti ComputerSystem - 33_suspend_reboot.py Y Deepti ComputerSystem - 35_start_reset.py Y Deepti ComputerSystem - 41_cs_to_settingdefinestate.py Y Deepti ElementAllocatedFromPool - 01_forward.py Working Deepti ElementAllocatedFromPool - 02_reverse.py Working Deepti HostSystem - 04_hs_to_EAPF.py Y Who is interested in working on this? Profile - 01_enum.py Implementation completed Daisy Profile - 02_profile_to_elec.py Y Deepti Profile - 03_rprofile_gi_errs.py Implementation completed Daisy VirtualSystemMigrationService - 01_migratable_host.py Y Daisy VirtualSystemMigrationService - 02_host_migrate_type.py Y Daisy VirtualSystemMigrationService - 05_migratable_host_errs.py Y Daisy VirtualSystemSettingDataComponent - 01_forward.py Working Daisy Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922144 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 -------------- next part -------------- An HTML attachment was scrubbed... URL: From deeptik at linux.vnet.ibm.com Tue Jul 15 10:49:44 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 15 Jul 2008 03:49:44 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Updating 01_forward.py of EAFP Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1216118958 25200 # Node ID a379943366703def9ecfe0a03779f91d3556a244 # Parent 64abdd1495dc05e69061151baf2ea25a682e8d8d [TEST] #2 Updating 01_forward.py of EAFP Changes: -------- >From 1 to 2: ------------ 1) Added support for LXC. 2) Made only EAFP pool specific checks. 3) Removed eafp_list() used previously, instead added get_id to create the pool list . 4) Removed print_error(). 5) Removed get_id instead used get_inst. 6) Added support for Memory, Processor, NetworkPort to enumclass.py. Patch 1: ------- 1) Modifying the tc to support XenFV and KVM. 2) Modified get_keys() to use proper SystemCreationClassName. 3) Added functions get_id to get the instances for different logical devices so that the DeviceID of the instances can be used in the init_list(). 4) Added init_list() function to create a list of inputs for the EAFP association. 5) Added eafp_list() to create a list of pool values that will be used to verify the return values from the EAFP association. 6) Added the function verify_eafp_values() to call assocation on EAFP and verify the return values. 7) Included cleanup_restore(). Signed-off-by: Deepti B. Kalakeri diff -r 64abdd1495dc -r a37994336670 suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py Fri Jul 11 00:42:35 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py Tue Jul 15 03:49:18 2008 -0700 @@ -42,165 +42,178 @@ import sys import pywbem -from XenKvmLib.test_xml import testxml, testxml_bridge -from VirtLib import utils -from XenKvmLib import assoc -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all +from XenKvmLib.assoc import Associators +from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib import devices -from CimTest import Globals -from CimTest.Globals import do_main -from VirtLib.live import network_by_bridge -from CimTest.ReturnCodes import PASS, FAIL, SKIP +from XenKvmLib.enumclass import getInstance +from CimTest.Globals import CIM_ERROR_ASSOCIATORS, CIM_ERROR_GETINSTANCE +from XenKvmLib.vxml import get_class +from XenKvmLib.common_util import create_diskpool_conf, cleanup_restore +from XenKvmLib.classes import get_typed_class +from XenKvmLib.logicaldevices import field_err +from CimTest.Globals import do_main, logger +from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "hd_domain" test_mac = "00:11:22:33:44:aa" test_vcpus = 1 -test_disk = 'xvda' +def get_keys(virt, cn, id): + sccn = get_typed_class(virt, "ComputerSystem") + cn = get_typed_class(virt, cn) + key_list = { 'DeviceID' : id, + 'CreationClassName' : cn, + 'SystemName' : test_dom, + 'SystemCreationClassName' : sccn + } + return key_list -def print_error(cn, detail): - Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE, cn) - Globals.logger.error("Exception: %s", detail) +def get_inst(server, virt, cn, key, key_list): + inst = None + try: + inst = getInstance(server, cn, key_list, virt) -def get_keys(cn, device_id): - id = "%s/%s" % (test_dom, device_id) + except Exception, details: + logger.error("Exception %s" % details) + return None - key_list = { 'DeviceID' : id, - 'CreationClassName' : cn, - 'SystemName' : test_dom, - 'SystemCreationClassName' : "Xen_ComputerSystem" - } + if inst is None: + logger.error("Expected at least one %s instance" % cn) + return None - return key_list + return inst + +def init_list(server, virt, vsxml, test_disk): + lelist = {} + if virt != 'LXC': + cn_keys_list = { + "LogicalDisk" : "%s/%s" % (test_dom, test_disk), + "Memory" : "%s/%s" % (test_dom, "mem"), + "NetworkPort" : "%s/%s" % (test_dom, test_mac), + "Processor" : "%s/%s" % (test_dom, "0") + } + else: + cn_keys_list = { + "Memory" : "%s/%s" % (test_dom, "mem"), + } + + for cname, id in cn_keys_list.items(): + key_list = get_keys(virt, cname, id) + inst = get_inst(server, virt, cname, id, key_list) + if inst is None : + cleanup_restore(server, virt) + vsxml.destroy(server) + return FAIL, lelist + lelist [inst.CreationClassName] = inst.DeviceID + return PASS, lelist + +def get_pool_details(server, virt, vsxml, diskid): + gi_inst_list = {} + inst = None + if virt != 'LXC': + virt_network = vsxml.xml_get_net_network() + keys = { + 'DiskPool' : diskid, + 'ProcessorPool' : 'ProcessorPool/0' , + 'MemoryPool' : 'MemoryPool/0', + 'NetworkPool' : 'NetworkPool/%s' %virt_network + } + else: + keys = { + 'MemoryPool' : 'MemoryPool/0', + } + + for cn, k in keys.iteritems(): + key_list = {"InstanceID" : k} + inst = get_inst(server, virt, cn, k, key_list) + if inst is None: + cleanup_restore(server, virt) + vsxml.destroy(server) + return FAIL, gi_inst_list + cn = get_typed_class(virt, cn) + gi_inst_list[cn] = { 'InstanceID' : inst.InstanceID, + 'PoolID' : inst.PoolID + } + return PASS, gi_inst_list + +def verify_eafp_values(server, virt, in_pllist, gi_inst_list): + # Looping through the in_pllist to get association for devices. + status = PASS + an = get_typed_class(virt, "ElementAllocatedFromPool") + sccn = get_typed_class(virt, "ComputerSystem") + for cn, devid in sorted(in_pllist.iteritems()): + try: + assoc_info = Associators(server, an, cn, + DeviceID = devid, + CreationClassName = cn, + SystemName = test_dom, + SystemCreationClassName = sccn, + virt=virt) + if len(assoc_info) != 1: + logger.error("%s returned %i ResourcePool objects for " + "domain '%s'", an, len(assoc_info), + test_dom) + status = FAIL + break + assoc_eafp_info = assoc_info[0] + CCName = assoc_eafp_info.classname + gi_inst = gi_inst_list[CCName] + if assoc_eafp_info['InstanceID'] != gi_inst['InstanceID']: + field_err(assoc_eafp_info, gi_inst, 'InstanceID') + return FAIL + if assoc_eafp_info['PoolID'] != gi_inst['PoolID']: + field_err(assoc_eafp_info, gi_inst, 'PoolID') + return FAIL + except Exception, detail: + logger.error(CIM_ERROR_ASSOCIATORS, an) + logger.error("Exception: %s", detail) + cleanup_restore(server, virt) + status = FAIL + return status + @do_main(sup_types) def main(): options = main.options + server = options.ip + virt = options.virt status = PASS - idx = 0 + if virt == 'Xen': + test_disk = 'xvda' + else: + test_disk = 'hda' -# Getting the VS list and deleting the test_dom if it already exists. - destroy_and_undefine_all(options.ip) + # Getting the VS list and deleting the test_dom if it already exists. + destroy_and_undefine_all(server) + virt_type = get_class(virt) + if virt == 'LXC': + vsxml = virt_type(test_dom) + else: + vsxml = virt_type(test_dom, vcpus = test_vcpus, mac = test_mac, + disk = test_disk) - test_xml, bridge = testxml_bridge(test_dom, vcpus = test_vcpus, \ - mac = test_mac, disk = test_disk, \ - server = options.ip) - if bridge == None: - Globals.logger.error("Unable to find virtual bridge") - return SKIP - - if test_xml == None: - Globals.logger.error("Guest xml not created properly") - return FAIL - - virt_network = network_by_bridge(bridge, options.ip) - if virt_network == None: - Globals.logger.error("No virtual network found for bridge %s", bridge) - return SKIP - - ret = test_domain_function(test_xml, options.ip, cmd = "create") + # Verify DiskPool on machine + status, diskid = create_diskpool_conf(server, virt) + if status != PASS: + return status + ret = vsxml.create(server) if not ret: - Globals.logger.error("Failed to Create the dom: %s", test_dom) + 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 + status, lelist = init_list(server, virt, vsxml, test_disk) + if status != PASS: + return status - 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 - - 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 - - netpool_id = "NetworkPool/%s" % virt_network - - lelist = { - "Xen_LogicalDisk" : disk.DeviceID, \ - "Xen_Memory" : mem.DeviceID, \ - "Xen_NetworkPort" : net.DeviceID, \ - "Xen_Processor" : proc.DeviceID - } - poollist = [ - "Xen_DiskPool", \ - "Xen_MemoryPool", \ - "Xen_NetworkPool", \ - "Xen_ProcessorPool" - ] - poolval = [ - "DiskPool/foo", \ - "MemoryPool/0", \ - netpool_id, \ - "ProcessorPool/0" - ] - - sccn = "Xen_ComputerSystem" - for cn, devid in sorted(lelist.items()): - try: - assoc_info = assoc.Associators(options.ip, \ - "Xen_ElementAllocatedFromPool", - cn, - DeviceID = devid, - CreationClassName = cn, - SystemName = test_dom, - SystemCreationClassName = sccn) - if len(assoc_info) != 1: - Globals.logger.error("Xen_ElementAllocatedFromPool returned %i\ - ResourcePool objects for domain '%s'", len(assoc_info), test_dom) - status = FAIL - break - - if assoc_info[0].classname != poollist[idx]: - Globals.logger.error("Classname Mismatch") - Globals.logger.error("Returned %s instead of %s", \ - assoc_info[0].classname, \ - poollist[idx]) - status = FAIL - - if assoc_info[0]['InstanceID'] != poolval[idx]: - Globals.logger.error("InstanceID Mismatch") - Globals.logger.error("Returned %s instead of %s", \ - assoc_info[0]['InstanceID'], \ - poolval[idx]) - status = FAIL - - if status != PASS: - break - else: - idx = idx + 1 - - except Exception, detail: - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, \ - 'Xen_ElementAllocatedFromPool') - Globals.logger.error("Exception: %s", detail) - status = FAIL - - ret = test_domain_function(test_dom, options.ip, \ - cmd = "destroy") + status, gi_inst_list = get_pool_details(server, virt, vsxml, diskid) + if status != PASS: + return status + + status = verify_eafp_values(server, virt, lelist, gi_inst_list) + cleanup_restore(server, virt) + vsxml.destroy(server) return status if __name__ == "__main__": diff -r 64abdd1495dc -r a37994336670 suites/libvirt-cim/lib/XenKvmLib/enumclass.py --- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Fri Jul 11 00:42:35 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Tue Jul 15 03:49:18 2008 -0700 @@ -117,6 +117,30 @@ class Xen_LogicalDisk(CIM_LogicalDevice) pass class KVM_LogicalDisk(CIM_LogicalDevice): + pass + +class Xen_Memory(CIM_LogicalDevice): + pass + +class KVM_Memory(CIM_LogicalDevice): + pass + +class LXC_Memory(CIM_LogicalDevice): + pass + +class LXC_Memory(CIM_LogicalDevice): + pass + +class Xen_Processor(CIM_LogicalDevice): + pass + +class KVM_Processor(CIM_LogicalDevice): + pass + +class Xen_NetworkPort(CIM_LogicalDevice): + pass + +class KVM_NetworkPort(CIM_LogicalDevice): pass class Xen_MemoryPool(CIM_ResourcePool): From 072021096 at fudan.edu.cn Tue Jul 15 11:40:06 2008 From: 072021096 at fudan.edu.cn (072021096) Date: Tue, 15 Jul 2008 19:40:06 +0800 Subject: [Libvirt-cim] help for libvirt-cim Message-ID: dear everyone, I am a student from china, i am studying the SVPC and libvirt-cim, I have successed in installing the Xen, libvirt API and openwbem on Ubuntu, but when I tried to compile the libvirt-cim, I got some problems. First, when I carried out the ./configure, it tells CANNOT FIND THE CMPI HEADERS, I tried to add the header files to the corresponding lib folder, and it's OK. Next, when i carry out "make" instruction, i met another problem, i lis ted here... gcc -DHAVE_CONFIG_H -I. -I.. -DCMPI_VERSION=100 -I/usr/include/openwbem -I/usr/include/libxml2 -I/usr/local/include/libcmpiutil -g -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wpointer-arith -Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-format-y2k -Wcast-align -Wno-unused-value -DLIBVIRT_CIM_CS=\"\" -DLIBVIRT_CIM_RV=\"\" -I../libxkutil -Werror -c Virt_ComputerSystem.c -fPIC -DPIC -o .libs/Virt_ComputerSystem.o Virt_ComputerSystem.c:903: error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?CMPIInstanceMI? Virt_ComputerSystem.c:922: error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?CMPIMethodMI? make[3]: *** [Virt_ComputerSystem.lo] Error 1 make[3]: Leaving directory `/opt/libvirt-cim-bbcd58a5a44a/src' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/opt/libvirt-cim-bbcd58a5a44a/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/opt/libvirt-cim-bbcd58a5a44a' make: *** [all] Error 2 i am eager to solve the problem, thank all of you for your kind advices! best wishes! hope good health! sinceresly sean_ggz from Shanghai China From deeptik at linux.vnet.ibm.com Tue Jul 15 12:20:40 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 15 Jul 2008 17:50:40 +0530 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] Fix potiential false positive in ESD 01 In-Reply-To: <463274d67d8f35ac562c.1215808110@elm3b41.beaverton.ibm.com> References: <463274d67d8f35ac562c.1215808110@elm3b41.beaverton.ibm.com> Message-ID: <487C9618.6090509@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1215806699 25200 > # Node ID 463274d67d8f35ac562c5665e561ab970ddc55c1 > # Parent ee18f55760d08d21cd8f9809293d972b4a0b4549 > [TEST] Fix potiential false positive in ESD 01. > > Test needs to verify the number of VSSD and RASD elemnts returned were the values expected. > > Instead of calling EnumerateInstances() for the VSSD and RASD instances, this test should call getInstance() to get the expected instances. Most of this test was written to support that. > > Test now also supports XenFV. > > Signed-off-by: Kaitlin Rupert > > diff -r ee18f55760d0 -r 463274d67d8f suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py > --- a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Fri Jul 11 13:04:59 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Fri Jul 11 13:04:59 2008 -0700 > @@ -49,82 +49,114 @@ > > import sys > 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 > +from XenKvmLib.enumclass import getInstance > +from XenKvmLib.assoc import Associators, compare_all_prop > +from XenKvmLib.classes import get_typed_class > +from CimTest.Globals import do_main, logger, CIM_ERROR_ASSOCIATORS > +from CimTest.ReturnCodes import PASS, FAIL > +from XenKvmLib.vxml import get_class > +from XenKvmLib import const > > -sup_types = ['Xen', 'KVM', 'LXC'] > -esd_cn = 'ElementSettingData' > -vssd_cn = 'VirtualSystemSettingData' > -vssdc_cn = 'VirtualSystemSettingDataComponent' > -rasd_cn = 'ResourceAllocationSettingData' > +sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] > > -def test_assoc(host, class_name, id, virt): > +test_dom = "esd_dom" > +vmac = "00:11:22:33:44:aa" > + > +def get_inst(ip, virt, cn, key): > + inst = None > + > try: > - ret_inst = assoc.AssociatorNames(host,esd_cn, class_name, virt, > - InstanceID = id) > + key_list = {"InstanceID" : key } > + > + inst = getInstance(ip, cn, key_list, virt) > + > + except Exception, details: > + logger.error("Exception %s" % details) > + return None > + > + if inst is None: > + logger.error("Expected at least one %s instance" % cn) > + return None > + > + return inst > + > + > +def test_assoc(host, acn, cn, virt, inst): > + id = inst.InstanceID > + > + try: > + ret_inst = Associators(host, acn, cn, virt, InstanceID=id) > + > except Exception: > - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, esd_cn) > - return 1 > + logger.error(CIM_ERROR_ASSOCIATORS, acn) > + return FAIL > > if len(ret_inst) != 1: > - Globals.logger.error("%s returned %i %s instances", esd_cn, > - len(ret_inst), class_name) > - return 1 > + logger.error("%s returned %i %s instances" % (an, len(ret_inst), cn)) > + return FAIL > > - ret_id = ret_inst[0].keybindings["InstanceID"] > + ret_id = ret_inst[0]['InstanceID'] > if ret_id != id: > - Globals.logger.error("%s returned %s instance with wrong id %s", > - esd_cn, class_name, ret_id) > - return 1 > + logger.error("%s returned %s inst with wrong id %s" % (acn, cn, ret_id)) > + return FAIL > > - return 0; > + status = compare_all_prop(ret_inst[0], inst) > + > + return status > > @do_main(sup_types) > def main(): > options = main.options > > - try: > - key_list = ["InstanceID"] > - vssd_lst = enumclass.enumerate(options.ip, vssd_cn, key_list, > - options.virt) > + esd_cn = 'ElementSettingData' > > - except Exception, details: > - Globals.logger.error("Exception %s", details) > - return 1 > + if options.virt == 'XenFV': > + virt_type = 'Xen' > + else: > + virt_type = options.virt > > - for vssd in vssd_lst: > + keys = { 'VirtualSystemSettingData' : "%s:%s" % (virt_type, test_dom), > + 'MemResourceAllocationSettingData' : "%s/mem" % test_dom, > + } > + > > - rc = test_assoc(options.ip, vssd_cn, vssd.InstanceID, options.virt) > - if rc != 0: > - Globals.logger.error("Unable to get associated %s from %s", > - vssd_cn, esd_cn) > - return 1 > + if options.virt == "Xen": > + vdisk = "xvda" > + else: > + vdisk = "hda" > + > + virt_class = get_class(options.virt) > + if options.virt == 'LXC': > + cxml = virt_class(test_dom) > + else: > + cxml = virt_class(test_dom, mac = vmac, disk = vdisk) > + keys['ProcResourceAllocationSettingData'] = "%s/proc" % test_dom > + keys['DiskResourceAllocationSettingData'] = "%s/%s" % (test_dom, vdisk) > + keys['NetResourceAllocationSettingData'] = "%s/%s" % (test_dom, vmac) > + > + ret = cxml.define(options.ip) > + if not ret: > + logger.error("Failed to define the dom: %s", test_dom) > + return FAIL > + > + inst_list = {} > + > + for cn, k in keys.iteritems(): > + inst_list[cn] = get_inst(options.ip, options.virt, cn, k) > + if inst_list[cn] is None: > + #cxml.undefine(options.ip) > I think you need to uncomment this ? otherwise +1 for me. > + return FAIL > + > + status = FAIL > + for cn, inst in inst_list.iteritems(): > + status = test_assoc(options.ip, esd_cn, cn, options.virt, inst) > + if status != PASS: > + logger.error("Unable to get %s insts from %s" % (cn, esd_cn)) > + break > > - try: > - rasd_list = assoc.Associators(options.ip, vssdc_cn, vssd_cn, > - options.virt, > - InstanceID = vssd.InstanceID) > - except Exception: > - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, vssdc_cn) > - return 1 > - > - if len(rasd_list) == 0: > - 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, get_class_basename(rasd.classname), > - rasd["InstanceID"], options.virt) > - if rc != 0: > - Globals.logger.error("Unable to get associated %s from %s", > - rasd_cn, esd_cn) > - return 1 > + cxml.undefine(options.ip) > > - return 0 > + 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 > From deeptik at linux.vnet.ibm.com Tue Jul 15 12:21:16 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 15 Jul 2008 17:51:16 +0530 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] Add compare_all_prop() In-Reply-To: References: Message-ID: <487C963C.8010308@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1215806699 25200 > # Node ID ee18f55760d08d21cd8f9809293d972b4a0b4549 > # Parent 6fe68391f0c820e815251022bfe8469a0a93115b > [TEST] Add compare_all_prop(). > > This function takes an instance from the list returned bu the Associators() call and an instance from a getInstance() / enumerate_instances() call. It compares all of the property values to ensure the instances are identical. > > This function could probably be added to a fair number of tests as an additional verification check. > > > Signed-off-by: Kaitlin Rupert > > diff -r 6fe68391f0c8 -r ee18f55760d0 suites/libvirt-cim/lib/XenKvmLib/assoc.py > --- a/suites/libvirt-cim/lib/XenKvmLib/assoc.py Thu Jun 05 19:28:30 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/assoc.py Fri Jul 11 13:04:59 2008 -0700 > @@ -27,6 +27,7 @@ > import pywbem > from pywbem.cim_obj import CIMInstanceName > from XenKvmLib.classes import get_typed_class > +from CimTest.ReturnCodes import PASS > Need to import logger. otherwise +1 for me. I liked the approach. :) > def AssociatorNames(host, basetype, baseobj, virt="Xen", **keys): > '''Resolve the association specified by @type, given the > @@ -139,3 +140,17 @@ > > return new_list > > +def compare_all_prop(inst, exp_inst): > + prop_vals = inst.items() > + > + for i in range(0, len(prop_vals)): > + key = prop_vals[i][0] > + val = eval('exp_inst.' + key) > + > + if prop_vals[i][1] != val: > + logger.error("%s val mismatch: got %s, expected %s" % (key, > + prop_vals[i][1], val)) > + return FAIL > + > + return PASS > + > > _______________________________________________ > 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 Jul 15 12:27:43 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 15 Jul 2008 17:57:43 +0530 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] Fix potiential false positive in ESD 01 In-Reply-To: <463274d67d8f35ac562c.1215808110@elm3b41.beaverton.ibm.com> References: <463274d67d8f35ac562c.1215808110@elm3b41.beaverton.ibm.com> Message-ID: <487C97BF.6070306@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1215806699 25200 > # Node ID 463274d67d8f35ac562c5665e561ab970ddc55c1 > # Parent ee18f55760d08d21cd8f9809293d972b4a0b4549 > [TEST] Fix potiential false positive in ESD 01. > > Test needs to verify the number of VSSD and RASD elemnts returned were the values expected. > > Instead of calling EnumerateInstances() for the VSSD and RASD instances, this test should call getInstance() to get the expected instances. Most of this test was written to support that. > > Test now also supports XenFV. > > Signed-off-by: Kaitlin Rupert > > diff -r ee18f55760d0 -r 463274d67d8f suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py > --- a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Fri Jul 11 13:04:59 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Fri Jul 11 13:04:59 2008 -0700 > @@ -49,82 +49,114 @@ > > import sys > 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 > +from XenKvmLib.enumclass import getInstance > +from XenKvmLib.assoc import Associators, compare_all_prop > +from XenKvmLib.classes import get_typed_class > +from CimTest.Globals import do_main, logger, CIM_ERROR_ASSOCIATORS > +from CimTest.ReturnCodes import PASS, FAIL > +from XenKvmLib.vxml import get_class > +from XenKvmLib import const > > -sup_types = ['Xen', 'KVM', 'LXC'] > -esd_cn = 'ElementSettingData' > -vssd_cn = 'VirtualSystemSettingData' > -vssdc_cn = 'VirtualSystemSettingDataComponent' > -rasd_cn = 'ResourceAllocationSettingData' > +sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] > > -def test_assoc(host, class_name, id, virt): > +test_dom = "esd_dom" > +vmac = "00:11:22:33:44:aa" > + > +def get_inst(ip, virt, cn, key): > + inst = None > + > try: > - ret_inst = assoc.AssociatorNames(host,esd_cn, class_name, virt, > - InstanceID = id) > + key_list = {"InstanceID" : key } > + > + inst = getInstance(ip, cn, key_list, virt) > + > + except Exception, details: > + logger.error("Exception %s" % details) > + return None > + > + if inst is None: > + logger.error("Expected at least one %s instance" % cn) > + return None > + > + return inst > + > The above function can be moved to a library . We can probably pass the key_list to get_inst() fn. > + > +def test_assoc(host, acn, cn, virt, inst): > + id = inst.InstanceID > + > + try: > + ret_inst = Associators(host, acn, cn, virt, InstanceID=id) > + > except Exception: > - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, esd_cn) > - return 1 > + logger.error(CIM_ERROR_ASSOCIATORS, acn) > + return FAIL > > if len(ret_inst) != 1: > - Globals.logger.error("%s returned %i %s instances", esd_cn, > - len(ret_inst), class_name) > - return 1 > + logger.error("%s returned %i %s instances" % (an, len(ret_inst), cn)) > + return FAIL > > - ret_id = ret_inst[0].keybindings["InstanceID"] > + ret_id = ret_inst[0]['InstanceID'] > if ret_id != id: > - Globals.logger.error("%s returned %s instance with wrong id %s", > - esd_cn, class_name, ret_id) > - return 1 > + logger.error("%s returned %s inst with wrong id %s" % (acn, cn, ret_id)) > + return FAIL > > - return 0; > + status = compare_all_prop(ret_inst[0], inst) > + > + return status > > @do_main(sup_types) > def main(): > options = main.options > > - try: > - key_list = ["InstanceID"] > - vssd_lst = enumclass.enumerate(options.ip, vssd_cn, key_list, > - options.virt) > + esd_cn = 'ElementSettingData' > > - except Exception, details: > - Globals.logger.error("Exception %s", details) > - return 1 > + if options.virt == 'XenFV': > + virt_type = 'Xen' > + else: > + virt_type = options.virt > > - for vssd in vssd_lst: > + keys = { 'VirtualSystemSettingData' : "%s:%s" % (virt_type, test_dom), > + 'MemResourceAllocationSettingData' : "%s/mem" % test_dom, > + } > + > > - rc = test_assoc(options.ip, vssd_cn, vssd.InstanceID, options.virt) > - if rc != 0: > - Globals.logger.error("Unable to get associated %s from %s", > - vssd_cn, esd_cn) > - return 1 > + if options.virt == "Xen": > + vdisk = "xvda" > + else: > + vdisk = "hda" > + > + virt_class = get_class(options.virt) > + if options.virt == 'LXC': > + cxml = virt_class(test_dom) > + else: > + cxml = virt_class(test_dom, mac = vmac, disk = vdisk) > + keys['ProcResourceAllocationSettingData'] = "%s/proc" % test_dom > + keys['DiskResourceAllocationSettingData'] = "%s/%s" % (test_dom, vdisk) > + keys['NetResourceAllocationSettingData'] = "%s/%s" % (test_dom, vmac) > + > + ret = cxml.define(options.ip) > + if not ret: > + logger.error("Failed to define the dom: %s", test_dom) > + return FAIL > + > + inst_list = {} > + > + for cn, k in keys.iteritems(): > + inst_list[cn] = get_inst(options.ip, options.virt, cn, k) > + if inst_list[cn] is None: > + #cxml.undefine(options.ip) > + return FAIL > + > + status = FAIL > + for cn, inst in inst_list.iteritems(): > + status = test_assoc(options.ip, esd_cn, cn, options.virt, inst) > + if status != PASS: > + logger.error("Unable to get %s insts from %s" % (cn, esd_cn)) > + break > > - try: > - rasd_list = assoc.Associators(options.ip, vssdc_cn, vssd_cn, > - options.virt, > - InstanceID = vssd.InstanceID) > - except Exception: > - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, vssdc_cn) > - return 1 > - > - if len(rasd_list) == 0: > - 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, get_class_basename(rasd.classname), > - rasd["InstanceID"], options.virt) > - if rc != 0: > - Globals.logger.error("Unable to get associated %s from %s", > - rasd_cn, esd_cn) > - return 1 > + cxml.undefine(options.ip) > > - return 0 > + 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 > From danms at us.ibm.com Tue Jul 15 13:39:44 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 15 Jul 2008 06:39:44 -0700 Subject: [Libvirt-cim] help for libvirt-cim In-Reply-To: (072021096@fudan.edu.cn's message of "Tue, 15 Jul 2008 19:40:06 +0800") References: Message-ID: <87r69vb71b.fsf@caffeine.beaverton.ibm.com> SG> Virt_ComputerSystem.c:903: error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?CMPIInstanceMI? SG> Virt_ComputerSystem.c:922: error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?CMPIMethodMI? Both of these errors are pointing to the MI macros, which makes it hard to determine what the problem is without closer inspection. Do you need to use openwbem? Someone fixed up some openwbem issues for us at one point, so it used to work, but a lot has changed since then. Can you try Pegasus or SFCB? Those are the two we test on regularly. 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 Jul 15 15:14:18 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 15 Jul 2008 08:14:18 -0700 Subject: [Libvirt-cim] test list in SKIPPING status for KVM In-Reply-To: References: Message-ID: <487CBECA.40407@linux.vnet.ibm.com> > > VirtualSystemMigrationService - 01_migratable_host.py > > > > Y > > > > VirtualSystemMigrationService - 02_host_migrate_type.py > > > > Y > > > > VirtualSystemMigrationService - 05_migratable_host_errs.py > > > > Y > > On the next, I will update VirtualSystemMigrationService for KVM/XenFV > support. > Kaitlin -- It doesn't support for LXC, right? Libvirt doesn't support LXC or KVM migration yet. I saw some initial libvirt patches for KVM support, but it's not fully baked yet. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 15 15:34:12 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 15 Jul 2008 08:34:12 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] Fix potiential false positive in ESD 01 In-Reply-To: <487C9618.6090509@linux.vnet.ibm.com> References: <463274d67d8f35ac562c.1215808110@elm3b41.beaverton.ibm.com> <487C9618.6090509@linux.vnet.ibm.com> Message-ID: <487CC374.5020004@linux.vnet.ibm.com> >> + >> + for cn, k in keys.iteritems(): >> + inst_list[cn] = get_inst(options.ip, options.virt, cn, k) >> + if inst_list[cn] is None: >> + #cxml.undefine(options.ip) >> > I think you need to uncomment this ? > otherwise +1 for me. > Good catch! Yes, I had this commented out for testing purposes. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 15 15:53:53 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 15 Jul 2008 08:53:53 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] Fix potiential false positive in ESD 01 In-Reply-To: <487C97BF.6070306@linux.vnet.ibm.com> References: <463274d67d8f35ac562c.1215808110@elm3b41.beaverton.ibm.com> <487C97BF.6070306@linux.vnet.ibm.com> Message-ID: <487CC811.2040103@linux.vnet.ibm.com> >> +def get_inst(ip, virt, cn, key): >> + inst = None + >> try: >> - ret_inst = assoc.AssociatorNames(host,esd_cn, class_name, virt, >> - InstanceID = id) >> + key_list = {"InstanceID" : key } >> + >> + inst = getInstance(ip, cn, key_list, virt) >> + >> + except Exception, details: >> + logger.error("Exception %s" % details) >> + return None + >> + if inst is None: >> + logger.error("Expected at least one %s instance" % cn) >> + return None + >> + return inst + >> > The above function can be moved to a library . We can probably pass the > key_list to get_inst() fn. I think I'll leave this as is. Having a getInstance() function, and then another, similar, get_inst() function is confusing. The only thing this function adds is trapping of the exception and some additional error checking. It's not much extra work to have the test case trap the exception and test for error conditions. It's possible that the calling function will want to trap the exception differently or return a different error message. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 15 16:05:49 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 15 Jul 2008 09:05:49 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] Add compare_all_prop() In-Reply-To: <487C963C.8010308@linux.vnet.ibm.com> References: <487C963C.8010308@linux.vnet.ibm.com> Message-ID: <487CCADD.2060705@linux.vnet.ibm.com> >> --- a/suites/libvirt-cim/lib/XenKvmLib/assoc.py Thu Jun 05 19:28:30 >> 2008 -0700 >> +++ b/suites/libvirt-cim/lib/XenKvmLib/assoc.py Fri Jul 11 13:04:59 >> 2008 -0700 >> @@ -27,6 +27,7 @@ >> import pywbem >> from pywbem.cim_obj import CIMInstanceName >> from XenKvmLib.classes import get_typed_class >> +from CimTest.ReturnCodes import PASS >> > Need to import logger. otherwise +1 for me. > I liked the approach. :) Oops, I originally had this function in the test case, and I tested the failure path there. I forgot to retest the failure path when I moved the function to assoc.py. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 15 16:10:45 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 15 Jul 2008 09:10:45 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] Fix getInstance in enumclass.py to return matching type on error In-Reply-To: Message-ID: <7ea2f4ed91cd8b69bc0b.1216138245@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1212719310 25200 # Node ID 7ea2f4ed91cd8b69bc0b8c34304cf3ef870a1b05 # Parent 8f450e62922d9b07896c2c505ae0b565a4097c9c Fix getInstance in enumclass.py to return matching type on error. getInstance() returns a single element, so if the call encounters an error, it should return None instead of []. Signed-off-by: Kaitlin Rupert diff -r 8f450e62922d -r 7ea2f4ed91cd suites/libvirt-cim/lib/XenKvmLib/enumclass.py --- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Mon Jul 14 09:09:29 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Thu Jun 05 19:28:30 2008 -0700 @@ -320,6 +320,6 @@ except pywbem.CIMError, arg: print arg[1] - return [] + return None return inst From kaitlin at linux.vnet.ibm.com Tue Jul 15 16:10:46 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 15 Jul 2008 09:10:46 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] #2 Add compare_all_prop() In-Reply-To: Message-ID: <30509a2ca9f2c68bf925.1216138246@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1215806699 25200 # Node ID 30509a2ca9f2c68bf925f0d5fa2a3a65c602073f # Parent 7ea2f4ed91cd8b69bc0b8c34304cf3ef870a1b05 [TEST] #2 Add compare_all_prop(). This function takes an instance from the list returned bu the Associators() call and an instance from a getInstance() / enumerate_instances() call. It compares all of the property values to ensure the instances are identical. This function could probably be added to a fair number of tests as an additional verification check. Updates from 1 to 2: -Added logger import statement -Included FAIL in the ReturnCodes import. -Tested failure path to be sure error message is logged and FAIL is returned properly. Signed-off-by: Kaitlin Rupert diff -r 7ea2f4ed91cd -r 30509a2ca9f2 suites/libvirt-cim/lib/XenKvmLib/assoc.py --- a/suites/libvirt-cim/lib/XenKvmLib/assoc.py Thu Jun 05 19:28:30 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/assoc.py Fri Jul 11 13:04:59 2008 -0700 @@ -27,6 +27,8 @@ import pywbem from pywbem.cim_obj import CIMInstanceName from XenKvmLib.classes import get_typed_class +from CimTest.ReturnCodes import PASS, FAIL +from CimTest.Globals import logger def AssociatorNames(host, basetype, baseobj, virt="Xen", **keys): '''Resolve the association specified by @type, given the @@ -139,3 +141,17 @@ return new_list +def compare_all_prop(inst, exp_inst): + prop_vals = inst.items() + + for i in range(0, len(prop_vals)): + key = prop_vals[i][0] + val = eval('exp_inst.' + key) + + if prop_vals[i][1] != val: + logger.error("%s val mismatch: got %s, expected %s" % (key, + prop_vals[i][1], val)) + return FAIL + + return PASS + From kaitlin at linux.vnet.ibm.com Tue Jul 15 16:10:44 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 15 Jul 2008 09:10:44 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] [TEST] #2 Fix test issues with ESD 01 Message-ID: From kaitlin at linux.vnet.ibm.com Tue Jul 15 16:10:47 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 15 Jul 2008 09:10:47 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] #2 Fix potiential false positive in ESD 01 In-Reply-To: Message-ID: <7e91a4012131a1200f9d.1216138247@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1215806699 25200 # Node ID 7e91a4012131a1200f9d25711061a61f009bb4bc # Parent 30509a2ca9f2c68bf925f0d5fa2a3a65c602073f [TEST] #2 Fix potiential false positive in ESD 01. Test needs to verify the number of VSSD and RASD elemnts returned were the values expected. Instead of calling EnumerateInstances() for the VSSD and RASD instances, this test should call getInstance() to get the expected instances. Most of this test was written to support that. Test now also supports XenFV. Updates 1 to 2: -Uncomment cxml.undefine() on line 147. Signed-off-by: Kaitlin Rupert diff -r 30509a2ca9f2 -r 7e91a4012131 suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Fri Jul 11 13:04:59 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Fri Jul 11 13:04:59 2008 -0700 @@ -49,82 +49,114 @@ import sys 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 +from XenKvmLib.enumclass import getInstance +from XenKvmLib.assoc import Associators, compare_all_prop +from XenKvmLib.classes import get_typed_class +from CimTest.Globals import do_main, logger, CIM_ERROR_ASSOCIATORS +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.vxml import get_class +from XenKvmLib import const -sup_types = ['Xen', 'KVM', 'LXC'] -esd_cn = 'ElementSettingData' -vssd_cn = 'VirtualSystemSettingData' -vssdc_cn = 'VirtualSystemSettingDataComponent' -rasd_cn = 'ResourceAllocationSettingData' +sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] -def test_assoc(host, class_name, id, virt): +test_dom = "esd_dom" +vmac = "00:11:22:33:44:aa" + +def get_inst(ip, virt, cn, key): + inst = None + try: - ret_inst = assoc.AssociatorNames(host,esd_cn, class_name, virt, - InstanceID = id) + key_list = {"InstanceID" : key } + + inst = getInstance(ip, cn, key_list, virt) + + except Exception, details: + logger.error("Exception %s" % details) + return None + + if inst is None: + logger.error("Expected at least one %s instance" % cn) + return None + + return inst + + +def test_assoc(host, acn, cn, virt, inst): + id = inst.InstanceID + + try: + ret_inst = Associators(host, acn, cn, virt, InstanceID=id) + except Exception: - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, esd_cn) - return 1 + logger.error(CIM_ERROR_ASSOCIATORS, acn) + return FAIL if len(ret_inst) != 1: - Globals.logger.error("%s returned %i %s instances", esd_cn, - len(ret_inst), class_name) - return 1 + logger.error("%s returned %i %s instances" % (an, len(ret_inst), cn)) + return FAIL - ret_id = ret_inst[0].keybindings["InstanceID"] + ret_id = ret_inst[0]['InstanceID'] if ret_id != id: - Globals.logger.error("%s returned %s instance with wrong id %s", - esd_cn, class_name, ret_id) - return 1 + logger.error("%s returned %s inst with wrong id %s" % (acn, cn, ret_id)) + return FAIL - return 0; + status = compare_all_prop(ret_inst[0], inst) + + return status @do_main(sup_types) def main(): options = main.options - try: - key_list = ["InstanceID"] - vssd_lst = enumclass.enumerate(options.ip, vssd_cn, key_list, - options.virt) + esd_cn = 'ElementSettingData' - except Exception, details: - Globals.logger.error("Exception %s", details) - return 1 + if options.virt == 'XenFV': + virt_type = 'Xen' + else: + virt_type = options.virt - for vssd in vssd_lst: + keys = { 'VirtualSystemSettingData' : "%s:%s" % (virt_type, test_dom), + 'MemResourceAllocationSettingData' : "%s/mem" % test_dom, + } + - rc = test_assoc(options.ip, vssd_cn, vssd.InstanceID, options.virt) - if rc != 0: - Globals.logger.error("Unable to get associated %s from %s", - vssd_cn, esd_cn) - return 1 + if options.virt == "Xen": + vdisk = "xvda" + else: + vdisk = "hda" + + virt_class = get_class(options.virt) + if options.virt == 'LXC': + cxml = virt_class(test_dom) + else: + cxml = virt_class(test_dom, mac = vmac, disk = vdisk) + keys['ProcResourceAllocationSettingData'] = "%s/proc" % test_dom + keys['DiskResourceAllocationSettingData'] = "%s/%s" % (test_dom, vdisk) + keys['NetResourceAllocationSettingData'] = "%s/%s" % (test_dom, vmac) + + ret = cxml.define(options.ip) + if not ret: + logger.error("Failed to define the dom: %s", test_dom) + return FAIL + + inst_list = {} + + for cn, k in keys.iteritems(): + inst_list[cn] = get_inst(options.ip, options.virt, cn, k) + if inst_list[cn] is None: + cxml.undefine(options.ip) + return FAIL + + status = FAIL + for cn, inst in inst_list.iteritems(): + status = test_assoc(options.ip, esd_cn, cn, options.virt, inst) + if status != PASS: + logger.error("Unable to get %s insts from %s" % (cn, esd_cn)) + break - try: - rasd_list = assoc.Associators(options.ip, vssdc_cn, vssd_cn, - options.virt, - InstanceID = vssd.InstanceID) - except Exception: - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, vssdc_cn) - return 1 - - if len(rasd_list) == 0: - 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, get_class_basename(rasd.classname), - rasd["InstanceID"], options.virt) - if rc != 0: - Globals.logger.error("Unable to get associated %s from %s", - rasd_cn, esd_cn) - return 1 + cxml.undefine(options.ip) - return 0 + return status if __name__ == "__main__": sys.exit(main()) From kaitlin at linux.vnet.ibm.com Tue Jul 15 16:12:33 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 15 Jul 2008 09:12:33 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix potiential false positive with HostSystem 01 In-Reply-To: References: Message-ID: <487CCC71.9040103@linux.vnet.ibm.com> > > > > - except BaseException: > > - logger.error(Globals.CIM_ERROR_ENUMERATE % > hostsystem.CIM_System) > > + if system.CreationClassName != name and system.Name != host: > > I think either one fails, we should report error. Maybe we > can change it to below: > > if system.CreationClassName != name or system.Name != host: Yep - good catch, thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 15 16:17:20 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 15 Jul 2008 09:17:20 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix potiential false positive with HostSystem 01 Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1216138460 25200 # Node ID aee2bda69644fbf01ec3fbe038ecf6c52d63555a # Parent 7e91a4012131a1200f9d25711061a61f009bb4bc [TEST] #2 Fix potiential false positive with HostSystem 01. This test doesn't verify that exactly one instances was returned from the EnumerateInstances() call. Also, if the EnumerateInstance() call doesn't return any instances, then the test falls through the loop and returns PASS. Updates from 1 to 2: -If either the CreationClassName or Name properties don't match, return a failure. Signed-off-by: Kaitlin Rupert diff -r 7e91a4012131 -r aee2bda69644 suites/libvirt-cim/cimtest/HostSystem/01_enum.py --- a/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Fri Jul 11 13:04:59 2008 -0700 +++ b/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Tue Jul 15 09:14:20 2008 -0700 @@ -26,13 +26,11 @@ # and verifies the hostname returned by the provider import sys -from CimTest.Globals import do_main from XenKvmLib import hostsystem from XenKvmLib.classes import get_typed_class from VirtLib import live from VirtLib import utils -from CimTest import Globals -from CimTest.Globals import logger +from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, do_main from CimTest.ReturnCodes import PASS, FAIL SUPPORTED_TYPES = ['Xen', 'KVM', 'XenFV', 'LXC'] @@ -40,22 +38,29 @@ @do_main(SUPPORTED_TYPES) def main(): options = main.options - status = PASS host = live.hostname(options.ip) + status = FAIL try: hs = hostsystem.enumerate(options.ip, options.virt) name = get_typed_class(options.virt, 'HostSystem') - for system in hs: - if system.CreationClassName != name and system.Name != host: - logger.error("%s Enumerate Instance error" % name) - status = FAIL - else: - logger.info("%s is %s" % (name, host)) + if len(hs) != 1: + logger.error("Expected 1 %s instance returned" % name) + return FAIL + + system = hs[0] - except BaseException: - logger.error(Globals.CIM_ERROR_ENUMERATE % hostsystem.CIM_System) + if system.CreationClassName != name or system.Name != host: + logger.error("Exp %s, got %s" % (name, system.CreationClassName)) + logger.error("Exp %s, got %s" % (host, system.Name)) + status = FAIL + else: + logger.info("%s is %s" % (name, host)) + status = PASS + + except Exception, details: + logger.error("%s %s: %s" % (CIM_ERROR_ENUMERATE, name, details)) status = FAIL return status From kaitlin at linux.vnet.ibm.com Tue Jul 15 16:31:05 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 15 Jul 2008 09:31:05 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Remove guest creation from LogicalDisk - 02_nodevs.py In-Reply-To: References: Message-ID: <487CD0C9.3040709@linux.vnet.ibm.com> > > def clean_system(host, virt='Xen'): > > l = live.domain_list(host, virt) > > - if len(l) > 1: > > + > > + if virt == "XenFV" or virt == "Xen": > > + if len(l) > 1: > > + return False > > + else: > > + return True > Typos error, it takes four spaces. > Thanks! I forgot to test the case where the Xen system had Domain-0 plus a guest defined. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 15 16:32:15 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 15 Jul 2008 09:32:15 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Remove guest creation from LogicalDisk - 02_nodevs.py Message-ID: <329b99c8516d4f0ae9ae.1216139535@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1216138782 25200 # Node ID 329b99c8516d4f0ae9ae49ed63ac0f4469917931 # Parent aee2bda69644fbf01ec3fbe038ecf6c52d63555a [TEST] #2 Remove guest creation from LogicalDisk - 02_nodevs.py. The point of this test is to ensure no devices are returned from EnumerateInstances() in the case where no guest is defined (or in the case where only Domain-0 is defined). Also add support for LXC. In the case where devices.enumerate() encountered a CIM error, raise an exception instead of printing an error. Updates from 1 to 2: -Fix spacing in clean_system() Signed-off-by: Kaitlin Rupert diff -r aee2bda69644 -r 329b99c8516d suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py --- a/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Tue Jul 15 09:14:20 2008 -0700 +++ b/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Tue Jul 15 09:19:42 2008 -0700 @@ -25,21 +25,23 @@ 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.test_doms import define_test_domain, undefine_test_domain -from XenKvmLib.test_xml import testxml -from CimTest.Globals import logger, do_main +from CimTest.Globals import logger, do_main, CIM_ERROR_ENUMERATE +from CimTest.ReturnCodes import PASS, FAIL, SKIP -sup_types = ['Xen', 'KVM', 'XenFV'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "test_domain" def clean_system(host, virt='Xen'): l = live.domain_list(host, virt) - if len(l) > 1: + + if virt == "XenFV" or virt == "Xen": + if len(l) > 1: + return False + else: + return True + elif len(l) > 0: return False else: return True @@ -49,31 +51,27 @@ options = main.options if not clean_system(options.ip, options.virt): logger.error("System has defined domains; unable to run") - return 2 + return SKIP - if options.virt == 'Xen': - test_dev = 'xvda' - else: - test_dev = 'hda' + key_list = ["DeviceID", "CreationClassName", "SystemName", + "SystemCreationClassName"] - vsxml = get_class(options.virt)(test_dom, disk=test_dev) - ret = vsxml.define(options.ip) - if not ret: - logger.error("Failed to Define the dom: %s", test_dom) + cn = "LogicalDisk" + + try: + devs = devices.enumerate(options.ip, cn, key_list, options.virt) + + except Exception, details: + logger.error(CIM_ERROR_ENUMERATE, cn) + logger.error(details) return FAIL - devid = "%s/%s" % (test_dom, test_dev) + if len(devs) != 0: + logger.error("%s returned %d instead of empty list" % (cn, len(devs))) + status = FAIL + else: + status = PASS - status = 0 - key_list = ["DeviceID", "CreationClassName", "SystemName", "SystemCreationClassName"] - - devs = devices.enumerate(options.ip, 'LogicalDisk', key_list) - if devs.__class__ == str: - logger.error("Got error instead of empty list: %s" % devs) - status = 1 - - vsxml.undefine(options.ip) - return status if __name__ == "__main__": diff -r aee2bda69644 -r 329b99c8516d suites/libvirt-cim/lib/XenKvmLib/devices.py --- a/suites/libvirt-cim/lib/XenKvmLib/devices.py Tue Jul 15 09:14:20 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py Tue Jul 15 09:19:42 2008 -0700 @@ -85,6 +85,9 @@ class KVM_LogicalDisk(CIM_LogicalDisk): pass +class LXC_LogicalDisk(CIM_LogicalDisk): + pass + class Xen_NetworkPort(CIM_NetworkPort): pass @@ -123,7 +126,7 @@ try: names = conn.EnumerateInstanceNames(devtype.__name__) except pywbem.CIMError, arg: - print arg[1] + raise Exception("%s" % arg[1]) return list for name in names: From kaitlin at linux.vnet.ibm.com Tue Jul 15 17:13:03 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 15 Jul 2008 10:13:03 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update VirtualSystemSettingDataComponent.01 for KVM/XenFV/LXC support In-Reply-To: References: Message-ID: <487CDA9F.2010406@linux.vnet.ibm.com> > - > -def init_list(): > +status = PASS No need to define status here - define it as needed in main(). > + > +def init_list(virt='Xen'): > + > + if virt == 'Xen' or virt == 'XenFV': > + test_disk = 'xvda' > + test_mac = "00:11:22:33:44:aa" > + else: > + test_disk = 'hda' > + test_mac = '11:22:33:aa:bb:cc' Are different values for test_mac needed? It seems like you can use the same value for all virtualization types. You could then define test_mac in main() and pass test_mac as a parameter into this function. I'd do the same with test_disk. Define it in main() and pass it into this function. This helps reduce the number of values the function returns. > > key_list = { 'InstanceID' : instIdval } > + vssd_cn = get_typed_class(options.virt, 'VirtualSystemSettingData') > try: > vssd = enumclass.getInstance(options.ip, \ > - enumclass.Xen_VirtualSystemSettingData, \ > - key_list) > + 'VirtualSystemSettingData', \ > + key_list, \ > + options.virt) > if vssd is None: > logger.error("VSSD instance for %s not found" % test_dom) > - test_domain_function(test_dom, options.ip, "undefine") > + cxml.undefine(options.ip) > return FAIL > > vssd_vals = build_vssd_info(options.ip, vssd) I'd remove this function all together. In assoc_values(), you can call compare_all_prop(). See the ESD patch I recently sent. This patch isn't in the tree yet, but should be soon. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 15 18:06:20 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 15 Jul 2008 11:06:20 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Updating 01_forward.py of EAFP In-Reply-To: References: Message-ID: <487CE71C.2000309@linux.vnet.ibm.com> > +def get_inst(server, virt, cn, key, key_list): The key param is never used in this function. > + inst = None > + try: > + inst = getInstance(server, cn, key_list, virt) > > + > +def init_list(server, virt, vsxml, test_disk): > + lelist = {} > + if virt != 'LXC': > + cn_keys_list = { > + "LogicalDisk" : "%s/%s" % (test_dom, test_disk), > + "Memory" : "%s/%s" % (test_dom, "mem"), > + "NetworkPort" : "%s/%s" % (test_dom, test_mac), > + "Processor" : "%s/%s" % (test_dom, "0") > + } > + else: > + cn_keys_list = { > + "Memory" : "%s/%s" % (test_dom, "mem"), > + } > + > + for cname, id in cn_keys_list.items(): > + key_list = get_keys(virt, cname, id) Since the SSN and SN don't change, you could do the following instead: 1) Declare ssn somewhere before the for loop. 2) Declare the following above the for loop: key_list = { 'DeviceID' : None, 'CreationClassName' : None, 'SystemName' : test_dom, 'SystemCreationClassName' : sccn } 3) In the for loop: cn = get_typed_class(virt, cname) key_list['DeviceID'] = id key_list['CreationClassName'] = cn Or you can leave it as is. Either way is fine. > + inst = get_inst(server, virt, cname, id, key_list) You don't really need to call get_inst() here, unless you just want to verify the instances exist. The list you build below (lelist) should be identical to cn_keys_list (except for the key value of the list, lelist uses full CIM class names and the other does not). > + > +def verify_eafp_values(server, virt, in_pllist, gi_inst_list): > + # Looping through the in_pllist to get association for devices. > + status = PASS > + an = get_typed_class(virt, "ElementAllocatedFromPool") > + sccn = get_typed_class(virt, "ComputerSystem") > + for cn, devid in sorted(in_pllist.iteritems()): > + try: > + assoc_info = Associators(server, an, cn, > + DeviceID = devid, > + CreationClassName = cn, > + SystemName = test_dom, > + SystemCreationClassName = sccn, > + virt=virt) > + if len(assoc_info) != 1: > + logger.error("%s returned %i ResourcePool objects for " > + "domain '%s'", an, len(assoc_info), > + test_dom) > + status = FAIL > + break You can just return FAIL here. > + assoc_eafp_info = assoc_info[0] > + CCName = assoc_eafp_info.classname > + gi_inst = gi_inst_list[CCName] > + if assoc_eafp_info['InstanceID'] != gi_inst['InstanceID']: > + field_err(assoc_eafp_info, gi_inst, 'InstanceID') > + return FAIL > + if assoc_eafp_info['PoolID'] != gi_inst['PoolID']: > + field_err(assoc_eafp_info, gi_inst, 'PoolID') > + return FAIL If you wanted, instead of building the gi_inst_list, you could pass in the instances returned from the get_inst() call in get_pool_details(). You could then call compare_all_prop(). Either way is fine though. > + except Exception, detail: > + logger.error(CIM_ERROR_ASSOCIATORS, an) > + logger.error("Exception: %s", detail) > + cleanup_restore(server, virt) > + status = FAIL > + return status > + > > @do_main(sup_types) > def main(): > options = main.options > + server = options.ip > + virt = options.virt > status = PASS I know this was already part of the test, but can you remove this line? Or can you set status = FAIL instead? If all of the failure paths aren't carefully checked, then having status = PASS can lead to returning a false positive. > > - 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 > + status, lelist = init_list(server, virt, vsxml, test_disk) > + if status != PASS: > + return status Need to call cleanup_restore() and destroy() here. > - > - ret = test_domain_function(test_dom, options.ip, \ > - cmd = "destroy") > + status, gi_inst_list = get_pool_details(server, virt, vsxml, diskid) > + if status != PASS: > + return status Need to call cleanup_restore() and destroy() here. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From 072021096 at fudan.edu.cn Wed Jul 16 00:51:21 2008 From: 072021096 at fudan.edu.cn (072021096) Date: Wed, 16 Jul 2008 08:51:21 +0800 Subject: =?gb2312?B?u9i4tDogUmU6IFtMaWJ2aXJ0LWNpbV0gaGVscCBmb3IgbGlidmk=?= =?gb2312?Q?rt-cim?= In-Reply-To: <87r69vb71b.fsf@caffeine.beaverton.ibm.com> References: <87r69vb71b.fsf@caffeine.beaverton.ibm.com> Message-ID: Dear sir Thank you for your reply, and I will try it using SFCB. Appreciate your help, thanks again! Sean_ggz ----- ???? ----- ???: Dan Smith ??: 2008? 7? 15?, ???, ??9:37 ??: Re: [Libvirt-cim] help for libvirt-cim ???: List for discussion and development of libvirt CIM > SG> Virt_ComputerSystem.c:903: error: expected ?=?, ?,?, ?;?, ?asm? or > ?__attribute__? before ?CMPIInstanceMI? > SG> Virt_ComputerSystem.c:922: error: expected ?=?, ?,?, ?;?, ?asm? or > ?__attribute__? before ?CMPIMethodMI? > > Both of these errors are pointing to the MI macros, which makes it > hard to determine what the problem is without closer inspection. > > Do you need to use openwbem? Someone fixed up some openwbem issues > for us at one point, so it used to work, but a lot has changed since > then. Can you try Pegasus or SFCB? Those are the two we test on > regularly. > > Thanks! > > -- > Dan Smith > IBM Linux Technology Center > Open Hypervisor Team > email: danms at us.ibm.com > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim From yunguol at cn.ibm.com Wed Jul 16 02:14:15 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 16 Jul 2008 10:14:15 +0800 Subject: [Libvirt-cim] test list in SKIPPING status for KVM In-Reply-To: <487CBECA.40407@linux.vnet.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-15 23:14:18: > > > VirtualSystemMigrationService - 01_migratable_host.py > > > > > > Y > > > > > > VirtualSystemMigrationService - 02_host_migrate_type.py > > > > > > Y > > > > > > VirtualSystemMigrationService - 05_migratable_host_errs.py > > > > > > Y > > > > On the next, I will update VirtualSystemMigrationService for KVM/XenFV > > support. > > Kaitlin -- It doesn't support for LXC, right? > > Libvirt doesn't support LXC or KVM migration yet. I saw some initial > libvirt patches for KVM support, but it's not fully baked yet. > And XenFV support? Do I have to convert it for XenFV support? Thanks! > -- > 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 Wed Jul 16 02:16:56 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 16 Jul 2008 10:16:56 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix potiential false positive with HostSystem 01 In-Reply-To: Message-ID: +1) for me libvirt-cim-bounces at redhat.com wrote on 2008-07-16 00:17:20: > # HG changeset patch > # User Kaitlin Rupert > # Date 1216138460 25200 > # Node ID aee2bda69644fbf01ec3fbe038ecf6c52d63555a > # Parent 7e91a4012131a1200f9d25711061a61f009bb4bc > [TEST] #2 Fix potiential false positive with HostSystem 01. > > This test doesn't verify that exactly one instances was returned > from the EnumerateInstances() call. > > Also, if the EnumerateInstance() call doesn't return any instances, > then the test falls through the loop and returns PASS. > > Updates from 1 to 2: > -If either the CreationClassName or Name properties don't match, > return a failure. > > Signed-off-by: Kaitlin Rupert > > diff -r 7e91a4012131 -r aee2bda69644 suites/libvirt- > cim/cimtest/HostSystem/01_enum.py > --- a/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Fri Jul 11 > 13:04:59 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Tue Jul 15 > 09:14:20 2008 -0700 > @@ -26,13 +26,11 @@ > # and verifies the hostname returned by the provider > > import sys > -from CimTest.Globals import do_main > from XenKvmLib import hostsystem > from XenKvmLib.classes import get_typed_class > from VirtLib import live > from VirtLib import utils > -from CimTest import Globals > -from CimTest.Globals import logger > +from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, do_main > from CimTest.ReturnCodes import PASS, FAIL > > SUPPORTED_TYPES = ['Xen', 'KVM', 'XenFV', 'LXC'] > @@ -40,22 +38,29 @@ > @do_main(SUPPORTED_TYPES) > def main(): > options = main.options > - status = PASS > host = live.hostname(options.ip) > > + status = FAIL > try: > hs = hostsystem.enumerate(options.ip, options.virt) > name = get_typed_class(options.virt, 'HostSystem') > > - for system in hs: > - if system.CreationClassName != name and system.Name != host: > - logger.error("%s Enumerate Instance error" % name) > - status = FAIL > - else: > - logger.info("%s is %s" % (name, host)) > + if len(hs) != 1: > + logger.error("Expected 1 %s instance returned" % name) > + return FAIL > + > + system = hs[0] > > - except BaseException: > - logger.error(Globals.CIM_ERROR_ENUMERATE % hostsystem.CIM_System) > + if system.CreationClassName != name or system.Name != host: > + logger.error("Exp %s, got %s" % (name, system.CreationClassName)) > + logger.error("Exp %s, got %s" % (host, system.Name)) > + status = FAIL > + else: > + logger.info("%s is %s" % (name, host)) > + status = PASS > + > + except Exception, details: > + logger.error("%s %s: %s" % (CIM_ERROR_ENUMERATE, name, details)) > status = FAIL > > return status > > _______________________________________________ > 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 Jul 16 02:25:40 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 16 Jul 2008 10:25:40 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Remove guest creation from LogicalDisk - 02_nodevs.py In-Reply-To: <329b99c8516d4f0ae9ae.1216139535@elm3b41.beaverton.ibm.com> Message-ID: +1 from me =) Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922144 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 libvirt-cim-bounces at redhat.com wrote on 2008-07-16 00:32:15: > # HG changeset patch > # User Kaitlin Rupert > # Date 1216138782 25200 > # Node ID 329b99c8516d4f0ae9ae49ed63ac0f4469917931 > # Parent aee2bda69644fbf01ec3fbe038ecf6c52d63555a > [TEST] #2 Remove guest creation from LogicalDisk - 02_nodevs.py. > > The point of this test is to ensure no devices are returned from > EnumerateInstances() in the case where no guest is defined (or in > the case where only Domain-0 is defined). > > Also add support for LXC. > > In the case where devices.enumerate() encountered a CIM error, raise > an exception instead of printing an error. > > Updates from 1 to 2: > -Fix spacing in clean_system() > > Signed-off-by: Kaitlin Rupert > > diff -r aee2bda69644 -r 329b99c8516d suites/libvirt- > cim/cimtest/LogicalDisk/02_nodevs.py > --- a/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Tue Jul > 15 09:14:20 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Tue Jul > 15 09:19:42 2008 -0700 > @@ -25,21 +25,23 @@ > > 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.test_doms import define_test_domain, undefine_test_domain > -from XenKvmLib.test_xml import testxml > -from CimTest.Globals import logger, do_main > +from CimTest.Globals import logger, do_main, CIM_ERROR_ENUMERATE > +from CimTest.ReturnCodes import PASS, FAIL, SKIP > > -sup_types = ['Xen', 'KVM', 'XenFV'] > +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > > test_dom = "test_domain" > def clean_system(host, virt='Xen'): > l = live.domain_list(host, virt) > - if len(l) > 1: > + > + if virt == "XenFV" or virt == "Xen": > + if len(l) > 1: > + return False > + else: > + return True > + elif len(l) > 0: > return False > else: > return True > @@ -49,31 +51,27 @@ > options = main.options > if not clean_system(options.ip, options.virt): > logger.error("System has defined domains; unable to run") > - return 2 > + return SKIP > > - if options.virt == 'Xen': > - test_dev = 'xvda' > - else: > - test_dev = 'hda' > + key_list = ["DeviceID", "CreationClassName", "SystemName", > + "SystemCreationClassName"] > > - vsxml = get_class(options.virt)(test_dom, disk=test_dev) > - ret = vsxml.define(options.ip) > - if not ret: > - logger.error("Failed to Define the dom: %s", test_dom) > + cn = "LogicalDisk" > + > + try: > + devs = devices.enumerate(options.ip, cn, key_list, options.virt) > + > + except Exception, details: > + logger.error(CIM_ERROR_ENUMERATE, cn) > + logger.error(details) > return FAIL > > - devid = "%s/%s" % (test_dom, test_dev) > + if len(devs) != 0: > + logger.error("%s returned %d instead of empty list" % (cn, > len(devs))) > + status = FAIL > + else: > + status = PASS > > - status = 0 > - key_list = ["DeviceID", "CreationClassName", "SystemName", > "SystemCreationClassName"] > - > - devs = devices.enumerate(options.ip, 'LogicalDisk', key_list) > - if devs.__class__ == str: > - logger.error("Got error instead of empty list: %s" % devs) > - status = 1 > - > - vsxml.undefine(options.ip) > - > return status > > if __name__ == "__main__": > diff -r aee2bda69644 -r 329b99c8516d suites/libvirt- > cim/lib/XenKvmLib/devices.py > --- a/suites/libvirt-cim/lib/XenKvmLib/devices.py Tue Jul 15 09: > 14:20 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py Tue Jul 15 09: > 19:42 2008 -0700 > @@ -85,6 +85,9 @@ > class KVM_LogicalDisk(CIM_LogicalDisk): > pass > > +class LXC_LogicalDisk(CIM_LogicalDisk): > + pass > + > class Xen_NetworkPort(CIM_NetworkPort): > pass > > @@ -123,7 +126,7 @@ > try: > names = conn.EnumerateInstanceNames(devtype.__name__) > except pywbem.CIMError, arg: > - print arg[1] > + raise Exception("%s" % arg[1]) > return list > > for name in names: > > _______________________________________________ > 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 Jul 16 07:22:41 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 16 Jul 2008 00:22:41 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] 2# Update VirtualSystemSettingDataComponent.01 for LXC support Message-ID: <4fab30cea82ff4b689b1.1216192961@elm3b197.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1216192956 25200 # Node ID 4fab30cea82ff4b689b16594e0db865a5366ec65 # Parent 64abdd1495dc05e69061151baf2ea25a682e8d8d [TEST] 2# Update VirtualSystemSettingDataComponent.01 for LXC support The test defines non-bootloader guests for all platform types, also remove the part of thet test that verifies the bootloader Updates from 1 to 2: Pass test_disk and test_mac as parameters into init_list() function. On the assoc_values(), I will update it to call compare_all_prop() when Kaitlin's patch applied in the tree. diff -r 64abdd1495dc -r 4fab30cea82f suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Fri Jul 11 00:42:35 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Wed Jul 16 00:22:36 2008 -0700 @@ -53,31 +53,29 @@ from XenKvmLib import enumclass from XenKvmLib import enumclass from VirtLib import utils from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all -from XenKvmLib.test_xml import testxml_bl -from XenKvmLib.test_xml import xml_get_dom_bootloader from CimTest import Globals from XenKvmLib import assoc +from XenKvmLib import vxml +from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger, do_main from CimTest.ReturnCodes import FAIL, PASS -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "VSSDC_dom" test_vcpus = 2 test_mac = "00:11:22:33:44:aa" test_disk = 'xvda' -status = 0 -VSType = "Xen" - -def init_list(): + +def init_list(test_disk, test_mac, virt='Xen'): """ Creating the lists that will be used for comparisons. """ - rlist = ['Xen_DiskResourceAllocationSettingData', - 'Xen_MemResourceAllocationSettingData', - 'Xen_NetResourceAllocationSettingData', - 'Xen_ProcResourceAllocationSettingData' + rlist = [get_typed_class(virt, 'DiskResourceAllocationSettingData'), + get_typed_class(virt, 'MemResourceAllocationSettingData'), + get_typed_class(virt, 'NetResourceAllocationSettingData'), + get_typed_class(virt, 'ProcResourceAllocationSettingData') ] prop_list = {rlist[0] : "%s/%s" % (test_dom, test_disk), @@ -85,7 +83,10 @@ def init_list(): rlist[2] : "%s/%s" % (test_dom, test_mac), rlist[3] : "%s/%s" % (test_dom, "proc") } - + if virt == 'LXC': + rlist = [get_typed_class(virt, 'MemResourceAllocationSettingData')] + prop_list = {rlist[0] : "%s/%s" % (test_dom, "mem")} + return prop_list def build_vssd_info(ip, vssd): @@ -93,14 +94,14 @@ def build_vssd_info(ip, vssd): Creating the vssd fileds lists that will be used for comparisons. """ - if vssd.Bootloader == "" or vssd.Caption == "" or \ + if vssd.Caption == "" or \ vssd.InstanceID == "" or vssd.ElementName == "" or \ vssd.VirtualSystemIdentifier == "" or vssd.VirtualSystemType == "": logger.error("One of the required VSSD details seems to be empty") test_domain_function(test_dom, ip, "undefine") return FAIL - vssd_vals = {'Bootloader' : vssd.Bootloader, + vssd_vals = { 'Caption' : vssd.Caption, 'InstanceID' : vssd.InstanceID, 'ElementName' : vssd.ElementName, @@ -143,23 +144,33 @@ def main(): status = FAIL destroy_and_undefine_all(options.ip) - test_xml = testxml_bl(test_dom, vcpus = test_vcpus, \ - mac = test_mac, disk = test_disk, \ - server = options.ip,\ - gtype = 0) - ret = test_domain_function(test_xml, options.ip, cmd = "define") + prop_list = init_list(test_disk, test_mac, options.virt) + virt_xml = vxml.get_class(options.virt) + if options.virt == 'LXC': + cxml = virt_xml(test_dom) + else: + cxml = virt_xml(test_dom, vcpus = test_vcpus, \ + mac = test_mac, disk = test_disk) + ret = cxml.define(options.ip) if not ret: logger.error("Failed to define the dom: %s", test_dom) return FAIL - instIdval = "%s:%s" % (VSType, test_dom) + if options.virt == 'XenFV': + instIdval = "Xen:%s" % test_dom + else: + instIdval = "%s:%s" % (options.virt, test_dom) + keyname = "InstanceID" key_list = { 'InstanceID' : instIdval } + vssd_cn = get_typed_class(options.virt, 'VirtualSystemSettingData') + try: vssd = enumclass.getInstance(options.ip, \ - enumclass.Xen_VirtualSystemSettingData, \ - key_list) + 'VirtualSystemSettingData', \ + key_list, + options.virt) if vssd is None: logger.error("VSSD instance for %s not found" % test_dom) test_domain_function(test_dom, options.ip, "undefine") @@ -168,21 +179,19 @@ def main(): vssd_vals = build_vssd_info(options.ip, vssd) except Exception, detail : - logger.error(Globals.CIM_ERROR_GETINSTANCE, \ - 'Xen_VirtualSystemSettingData') + logger.error(Globals.CIM_ERROR_GETINSTANCE, vssd_cn) logger.error("Exception : %s" % detail) - test_domain_function(test_dom, options.ip, "undefine") - return FAIL - - prop_list = init_list() + cxml.undefine(options.ip) + return FAIL + try: # Looping through the RASD_cllist, call association # Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist - an = 'Xen_VirtualSystemSettingDataComponent' + an = get_typed_class(options.virt, 'VirtualSystemSettingDataComponent') for rasd_cname, prop in prop_list.iteritems(): assoc_info = assoc.Associators(options.ip, an, rasd_cname, - InstanceID = prop) + options.virt, InstanceID = prop) # Verify the association fields returned for particular rasd_cname. status = assoc_values(options.ip, assoc_info, rasd_cname, an, vssd_vals) @@ -194,7 +203,7 @@ def main(): logger.error("Exception : %s" % detail) status = FAIL - test_domain_function(test_dom, options.ip, "undefine") + cxml.undefine(options.ip) return status if __name__ == "__main__": From yunguol at cn.ibm.com Wed Jul 16 08:10:37 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 16 Jul 2008 16:10:37 +0800 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] #2 Add compare_all_prop() In-Reply-To: <30509a2ca9f2c68bf925.1216138246@elm3b41.beaverton.ibm.com> Message-ID: +1 from me Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922144 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 libvirt-cim-bounces at redhat.com wrote on 2008-07-16 00:10:46: > # HG changeset patch > # User Kaitlin Rupert > # Date 1215806699 25200 > # Node ID 30509a2ca9f2c68bf925f0d5fa2a3a65c602073f > # Parent 7ea2f4ed91cd8b69bc0b8c34304cf3ef870a1b05 > [TEST] #2 Add compare_all_prop(). > > This function takes an instance from the list returned bu the > Associators() call and an instance from a getInstance() / > enumerate_instances() call. It compares all of the property values > to ensure the instances are identical. > > This function could probably be added to a fair number of tests as > an additional verification check. > > Updates from 1 to 2: > -Added logger import statement > -Included FAIL in the ReturnCodes import. > -Tested failure path to be sure error message is logged and FAIL > is returned properly. > > > Signed-off-by: Kaitlin Rupert > > diff -r 7ea2f4ed91cd -r 30509a2ca9f2 suites/libvirt-cim/lib/XenKvmLib/assoc.py > --- a/suites/libvirt-cim/lib/XenKvmLib/assoc.py Thu Jun 05 19:28: > 30 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/assoc.py Fri Jul 11 13:04: > 59 2008 -0700 > @@ -27,6 +27,8 @@ > import pywbem > from pywbem.cim_obj import CIMInstanceName > from XenKvmLib.classes import get_typed_class > +from CimTest.ReturnCodes import PASS, FAIL > +from CimTest.Globals import logger > > def AssociatorNames(host, basetype, baseobj, virt="Xen", **keys): > '''Resolve the association specified by @type, given the > @@ -139,3 +141,17 @@ > > return new_list > > +def compare_all_prop(inst, exp_inst): > + prop_vals = inst.items() > + > + for i in range(0, len(prop_vals)): > + key = prop_vals[i][0] > + val = eval('exp_inst.' + key) > + > + if prop_vals[i][1] != val: > + logger.error("%s val mismatch: got %s, expected %s" % (key, > + prop_vals[i][1], val)) > + return FAIL > + > + return PASS > + > > _______________________________________________ > 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 Jul 16 08:10:51 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 16 Jul 2008 16:10:51 +0800 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] #2 Fix potiential false positive in ESD 01 In-Reply-To: <7e91a4012131a1200f9d.1216138247@elm3b41.beaverton.ibm.com> Message-ID: +1 from me. Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922144 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 libvirt-cim-bounces at redhat.com wrote on 2008-07-16 00:10:47: > # HG changeset patch > # User Kaitlin Rupert > # Date 1215806699 25200 > # Node ID 7e91a4012131a1200f9d25711061a61f009bb4bc > # Parent 30509a2ca9f2c68bf925f0d5fa2a3a65c602073f > [TEST] #2 Fix potiential false positive in ESD 01. > > Test needs to verify the number of VSSD and RASD elemnts returned > were the values expected. > > Instead of calling EnumerateInstances() for the VSSD and RASD > instances, this test should call getInstance() to get the expected > instances. Most of this test was written to support that. > > Test now also supports XenFV. > > Updates 1 to 2: > -Uncomment cxml.undefine() on line 147. > > Signed-off-by: Kaitlin Rupert > > diff -r 30509a2ca9f2 -r 7e91a4012131 suites/libvirt- > cim/cimtest/ElementSettingData/01_forward.py > --- a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py > Fri Jul 11 13:04:59 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py > Fri Jul 11 13:04:59 2008 -0700 > @@ -49,82 +49,114 @@ > > import sys > 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 > +from XenKvmLib.enumclass import getInstance > +from XenKvmLib.assoc import Associators, compare_all_prop > +from XenKvmLib.classes import get_typed_class > +from CimTest.Globals import do_main, logger, CIM_ERROR_ASSOCIATORS > +from CimTest.ReturnCodes import PASS, FAIL > +from XenKvmLib.vxml import get_class > +from XenKvmLib import const > > -sup_types = ['Xen', 'KVM', 'LXC'] > -esd_cn = 'ElementSettingData' > -vssd_cn = 'VirtualSystemSettingData' > -vssdc_cn = 'VirtualSystemSettingDataComponent' > -rasd_cn = 'ResourceAllocationSettingData' > +sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] > > -def test_assoc(host, class_name, id, virt): > +test_dom = "esd_dom" > +vmac = "00:11:22:33:44:aa" > + > +def get_inst(ip, virt, cn, key): > + inst = None > + > try: > - ret_inst = assoc.AssociatorNames(host,esd_cn, class_name, virt, > - InstanceID = id) > + key_list = {"InstanceID" : key } > + > + inst = getInstance(ip, cn, key_list, virt) > + > + except Exception, details: > + logger.error("Exception %s" % details) > + return None > + > + if inst is None: > + logger.error("Expected at least one %s instance" % cn) > + return None > + > + return inst > + > + > +def test_assoc(host, acn, cn, virt, inst): > + id = inst.InstanceID > + > + try: > + ret_inst = Associators(host, acn, cn, virt, InstanceID=id) > + > except Exception: > - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, esd_cn) > - return 1 > + logger.error(CIM_ERROR_ASSOCIATORS, acn) > + return FAIL > > if len(ret_inst) != 1: > - Globals.logger.error("%s returned %i %s instances", esd_cn, > - len(ret_inst), class_name) > - return 1 > + logger.error("%s returned %i %s instances" % (an, len(ret_inst), cn)) > + return FAIL > > - ret_id = ret_inst[0].keybindings["InstanceID"] > + ret_id = ret_inst[0]['InstanceID'] > if ret_id != id: > - Globals.logger.error("%s returned %s instance with wrong id %s", > - esd_cn, class_name, ret_id) > - return 1 > + logger.error("%s returned %s inst with wrong id %s" % (acn, > cn, ret_id)) > + return FAIL > > - return 0; > + status = compare_all_prop(ret_inst[0], inst) > + > + return status > > @do_main(sup_types) > def main(): > options = main.options > > - try: > - key_list = ["InstanceID"] > - vssd_lst = enumclass.enumerate(options.ip, vssd_cn, key_list, > - options.virt) > + esd_cn = 'ElementSettingData' > > - except Exception, details: > - Globals.logger.error("Exception %s", details) > - return 1 > + if options.virt == 'XenFV': > + virt_type = 'Xen' > + else: > + virt_type = options.virt > > - for vssd in vssd_lst: > + keys = { 'VirtualSystemSettingData' : "%s:%s" % (virt_type, test_dom), > + 'MemResourceAllocationSettingData' : "%s/mem" % test_dom, > + } > + > > - rc = test_assoc(options.ip, vssd_cn, vssd.InstanceID, options.virt) > - if rc != 0: > - Globals.logger.error("Unable to get associated %s from %s", > - vssd_cn, esd_cn) > - return 1 > + if options.virt == "Xen": > + vdisk = "xvda" > + else: > + vdisk = "hda" > + > + virt_class = get_class(options.virt) > + if options.virt == 'LXC': > + cxml = virt_class(test_dom) > + else: > + cxml = virt_class(test_dom, mac = vmac, disk = vdisk) > + keys['ProcResourceAllocationSettingData'] = "%s/proc" % test_dom > + keys['DiskResourceAllocationSettingData'] = "%s/%s" % > (test_dom, vdisk) > + keys['NetResourceAllocationSettingData'] = "%s/%s" % (test_dom, vmac) > + > + ret = cxml.define(options.ip) > + if not ret: > + logger.error("Failed to define the dom: %s", test_dom) > + return FAIL > + > + inst_list = {} > + > + for cn, k in keys.iteritems(): > + inst_list[cn] = get_inst(options.ip, options.virt, cn, k) > + if inst_list[cn] is None: > + cxml.undefine(options.ip) > + return FAIL > + > + status = FAIL > + for cn, inst in inst_list.iteritems(): > + status = test_assoc(options.ip, esd_cn, cn, options.virt, inst) > + if status != PASS: > + logger.error("Unable to get %s insts from %s" % (cn, esd_cn)) > + break > > - try: > - rasd_list = assoc.Associators(options.ip, vssdc_cn, vssd_cn, > - options.virt, > - InstanceID = vssd.InstanceID) > - except Exception: > - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, vssdc_cn) > - return 1 > - > - if len(rasd_list) == 0: > - 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, get_class_basename(rasd.classname), > - rasd["InstanceID"], options.virt) > - if rc != 0: > - Globals.logger.error("Unable to get associated %s from %s", > - rasd_cn, esd_cn) > - return 1 > + cxml.undefine(options.ip) > > - return 0 > + 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From deeptik at linux.vnet.ibm.com Wed Jul 16 14:13:31 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 16 Jul 2008 19:43:31 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Updating 01_forward.py of EAFP In-Reply-To: <487CE71C.2000309@linux.vnet.ibm.com> References: <487CE71C.2000309@linux.vnet.ibm.com> Message-ID: <487E020B.6050901@linux.vnet.ibm.com> Kaitlin Rupert wrote: >> +def get_inst(server, virt, cn, key, key_list): > > The key param is never used in this function. > >> + inst = None + try: >> + inst = getInstance(server, cn, key_list, virt) >> > >> + >> +def init_list(server, virt, vsxml, test_disk): >> + lelist = {} >> + if virt != 'LXC': >> + cn_keys_list = { + "LogicalDisk" : "%s/%s" % (test_dom, test_disk), >> + "Memory" : "%s/%s" % (test_dom, "mem"), >> + "NetworkPort" : "%s/%s" % (test_dom, test_mac), >> + "Processor" : "%s/%s" % (test_dom, "0") >> + } >> + else: >> + cn_keys_list = { + "Memory" : "%s/%s" % (test_dom, "mem"), >> + } >> + >> + for cname, id in cn_keys_list.items(): >> + key_list = get_keys(virt, cname, id) > > Since the SSN and SN don't change, you could do the following instead: > > 1) Declare ssn somewhere before the for loop. > 2) Declare the following above the for loop: > > key_list = { 'DeviceID' : None, > 'CreationClassName' : None, > 'SystemName' : test_dom, > 'SystemCreationClassName' : sccn > } > > 3) In the for loop: > cn = get_typed_class(virt, cname) > key_list['DeviceID'] = id > key_list['CreationClassName'] = cn > > Or you can leave it as is. Either way is fine. > > >> + inst = get_inst(server, virt, cname, id, key_list) > > You don't really need to call get_inst() here, unless you just want to > verify the instances exist. > > The list you build below (lelist) should be identical to cn_keys_list > (except for the key value of the list, lelist uses full CIM class > names and the other does not). > >> + >> +def verify_eafp_values(server, virt, in_pllist, gi_inst_list): >> + # Looping through the in_pllist to get association for devices. >> + status = PASS >> + an = get_typed_class(virt, "ElementAllocatedFromPool") >> + sccn = get_typed_class(virt, "ComputerSystem") >> + for cn, devid in sorted(in_pllist.iteritems()): >> + try: >> + assoc_info = Associators(server, an, cn, + DeviceID = devid, + >> CreationClassName = cn, + SystemName = test_dom, >> + SystemCreationClassName = sccn, + virt=virt) >> + if len(assoc_info) != 1: >> + logger.error("%s returned %i ResourcePool objects for " >> + "domain '%s'", an, len(assoc_info), + test_dom) >> + status = FAIL >> + break > > You can just return FAIL here. > >> + assoc_eafp_info = assoc_info[0] + CCName = assoc_eafp_info.classname >> + gi_inst = gi_inst_list[CCName] >> + if assoc_eafp_info['InstanceID'] != gi_inst['InstanceID']: >> + field_err(assoc_eafp_info, gi_inst, 'InstanceID') >> + return FAIL >> + if assoc_eafp_info['PoolID'] != gi_inst['PoolID']: >> + field_err(assoc_eafp_info, gi_inst, 'PoolID') >> + return FAIL > > If you wanted, instead of building the gi_inst_list, you could pass in > the instances returned from the get_inst() call in get_pool_details(). > You could then call compare_all_prop(). > > Either way is fine though. I prefer using compare_all_prop() in the ResourcePool related tc and would want to check only the ID's here. > >> + except Exception, detail: >> + logger.error(CIM_ERROR_ASSOCIATORS, an) >> + logger.error("Exception: %s", detail) >> + cleanup_restore(server, virt) >> + status = FAIL >> + return status >> + >> >> @do_main(sup_types) >> def main(): >> options = main.options >> + server = options.ip >> + virt = options.virt status = PASS > > I know this was already part of the test, but can you remove this > line? Or can you set status = FAIL instead? If all of the failure > paths aren't carefully checked, then having status = PASS can lead to > returning a false positive. > >> >> - 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 >> + status, lelist = init_list(server, virt, vsxml, test_disk) >> + if status != PASS: >> + return status > > Need to call cleanup_restore() and destroy() here. > The call to cleanup_restore() and destroy() is done before the above function returns failure. >> - >> - ret = test_domain_function(test_dom, options.ip, \ >> - cmd = "destroy") >> + status, gi_inst_list = get_pool_details(server, virt, vsxml, diskid) >> + if status != PASS: >> + return status > > Need to call cleanup_restore() and destroy() here. > The call to cleanup_restore() and destroy() is done before the above function returns failure. Thanks and Regards, Deepti. From deeptik at linux.vnet.ibm.com Wed Jul 16 14:24:09 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 16 Jul 2008 07:24:09 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #3 Updating 01_forward.py of EAFP Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1216218212 25200 # Node ID c2a1ddb060ced4b86c1624681500efcf87bb667b # Parent 64abdd1495dc05e69061151baf2ea25a682e8d8d [TEST] #3 Updating 01_forward.py of EAFP Changes: -------- >From 2 to 3: ------------ 1) Removed the key param for get_inst() 2) Removed the init_list() , instead hardcoded the list. 3) Removed get_keys()which is no longer needed. 4) Removed the break stmt and returned FAIL directly. 5) Removed unnecessary status variables. >From 1 to 2: ------------ 1) Added support for LXC. 2) Made only EAFP pool specific checks. 3) Removed eafp_list() used previously, instead added get_id to create the pool list . 4) Removed print_error(). 5) Removed get_id instead used get_inst. 6) Added support for Memory, Processor, NetworkPort to enumclass.py. Patch 1: ------- 1) Modifying the tc to support XenFV and KVM. 2) Modified get_keys() to use proper SystemCreationClassName. 3) Added functions get_id to get the instances for different logical devices so that the DeviceID of the instances can be used in the init_list(). 4) Added init_list() function to create a list of inputs for the EAFP association. 5) Added eafp_list() to create a list of pool values that will be used to verify the return values from the EAFP association. 6) Added the function verify_eafp_values() to call assocation on EAFP and verify the return values. 7) Included cleanup_restore(). Signed-off-by: Deepti B. Kalakeri diff -r 64abdd1495dc -r c2a1ddb060ce suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py Fri Jul 11 00:42:35 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py Wed Jul 16 07:23:32 2008 -0700 @@ -42,165 +42,150 @@ import sys import pywbem -from XenKvmLib.test_xml import testxml, testxml_bridge -from VirtLib import utils -from XenKvmLib import assoc -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all +from XenKvmLib.assoc import Associators +from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib import devices -from CimTest import Globals -from CimTest.Globals import do_main -from VirtLib.live import network_by_bridge -from CimTest.ReturnCodes import PASS, FAIL, SKIP +from XenKvmLib.enumclass import getInstance +from CimTest.Globals import CIM_ERROR_ASSOCIATORS, CIM_ERROR_GETINSTANCE +from XenKvmLib.vxml import get_class +from XenKvmLib.common_util import create_diskpool_conf, cleanup_restore +from XenKvmLib.classes import get_typed_class +from XenKvmLib.logicaldevices import field_err +from CimTest.Globals import do_main, logger +from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "hd_domain" test_mac = "00:11:22:33:44:aa" test_vcpus = 1 -test_disk = 'xvda' +def get_inst(server, virt, cn, key_list): + inst = None + try: + inst = getInstance(server, cn, key_list, virt) -def print_error(cn, detail): - Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE, cn) - Globals.logger.error("Exception: %s", detail) + except Exception, details: + logger.error("Exception %s" % details) + return None -def get_keys(cn, device_id): - id = "%s/%s" % (test_dom, device_id) + if inst is None: + logger.error("Expected at least one %s instance" % cn) + return None - key_list = { 'DeviceID' : id, - 'CreationClassName' : cn, - 'SystemName' : test_dom, - 'SystemCreationClassName' : "Xen_ComputerSystem" - } + return inst - return key_list +def get_pool_details(server, virt, vsxml, diskid): + gi_inst_list = {} + inst = None + if virt != 'LXC': + virt_network = vsxml.xml_get_net_network() + keys = { + 'DiskPool' : diskid, + 'ProcessorPool' : 'ProcessorPool/0' , + 'MemoryPool' : 'MemoryPool/0', + 'NetworkPool' : 'NetworkPool/%s' %virt_network + } + else: + keys = { + 'MemoryPool' : 'MemoryPool/0', + } + + for cn, k in keys.iteritems(): + key_list = {"InstanceID" : k} + inst = get_inst(server, virt, cn, key_list) + if inst is None: + cleanup_restore(server, virt) + vsxml.destroy(server) + return FAIL, gi_inst_list + cn = get_typed_class(virt, cn) + gi_inst_list[cn] = { 'InstanceID' : inst.InstanceID, + 'PoolID' : inst.PoolID + } + return PASS, gi_inst_list + +def verify_eafp_values(server, virt, in_pllist, gi_inst_list): + # Looping through the in_pllist to get association for devices. + an = get_typed_class(virt, "ElementAllocatedFromPool") + sccn = get_typed_class(virt, "ComputerSystem") + for cn, devid in sorted(in_pllist.iteritems()): + try: + assoc_info = Associators(server, an, cn, + DeviceID = devid, + CreationClassName = cn, + SystemName = test_dom, + SystemCreationClassName = sccn, + virt=virt) + if len(assoc_info) != 1: + logger.error("%s returned %i ResourcePool objects for " + "domain '%s'", an, len(assoc_info), + test_dom) + return FAIL + assoc_eafp_info = assoc_info[0] + CCName = assoc_eafp_info.classname + gi_inst = gi_inst_list[CCName] + if assoc_eafp_info['InstanceID'] != gi_inst['InstanceID']: + field_err(assoc_eafp_info, gi_inst, 'InstanceID') + return FAIL + if assoc_eafp_info['PoolID'] != gi_inst['PoolID']: + field_err(assoc_eafp_info, gi_inst, 'PoolID') + return FAIL + except Exception, detail: + logger.error(CIM_ERROR_ASSOCIATORS, an) + logger.error("Exception: %s", detail) + cleanup_restore(server, virt) + return FAIL + return PASS + @do_main(sup_types) def main(): options = main.options - status = PASS - idx = 0 + server = options.ip + virt = options.virt + if virt == 'Xen': + test_disk = 'xvda' + else: + test_disk = 'hda' -# Getting the VS list and deleting the test_dom if it already exists. - destroy_and_undefine_all(options.ip) + # Getting the VS list and deleting the test_dom if it already exists. + destroy_and_undefine_all(server) + virt_type = get_class(virt) + if virt == 'LXC': + vsxml = virt_type(test_dom) + else: + vsxml = virt_type(test_dom, vcpus = test_vcpus, mac = test_mac, + disk = test_disk) - test_xml, bridge = testxml_bridge(test_dom, vcpus = test_vcpus, \ - mac = test_mac, disk = test_disk, \ - server = options.ip) - if bridge == None: - Globals.logger.error("Unable to find virtual bridge") - return SKIP + # Verify DiskPool on machine + status, diskid = create_diskpool_conf(server, virt) + if status != PASS: + return status + ret = vsxml.create(server) + if not ret: + logger.error("Failed to Create the dom: '%s'", test_dom) + return FAIL + + mem_cn = get_typed_class(virt, "Memory") + ldlist = { + mem_cn : "%s/%s" % (test_dom, "mem"), + } - if test_xml == None: - Globals.logger.error("Guest xml not created properly") - return FAIL + if virt != 'LXC': + disk_cn = get_typed_class(virt, "LogicalDisk") + net_cn = get_typed_class(virt, "NetworkPort") + proc_cn = get_typed_class(virt, "Processor") + ldlist[disk_cn] = "%s/%s" % (test_dom, test_disk) + ldlist[net_cn] = "%s/%s" % (test_dom, test_mac) + ldlist[proc_cn] = "%s/%s" % (test_dom, "0") - virt_network = network_by_bridge(bridge, options.ip) - if virt_network == None: - Globals.logger.error("No virtual network found for bridge %s", bridge) - return SKIP - - ret = test_domain_function(test_xml, options.ip, cmd = "create") - 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 - - 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 - - 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 - - netpool_id = "NetworkPool/%s" % virt_network - - lelist = { - "Xen_LogicalDisk" : disk.DeviceID, \ - "Xen_Memory" : mem.DeviceID, \ - "Xen_NetworkPort" : net.DeviceID, \ - "Xen_Processor" : proc.DeviceID - } - poollist = [ - "Xen_DiskPool", \ - "Xen_MemoryPool", \ - "Xen_NetworkPool", \ - "Xen_ProcessorPool" - ] - poolval = [ - "DiskPool/foo", \ - "MemoryPool/0", \ - netpool_id, \ - "ProcessorPool/0" - ] - - sccn = "Xen_ComputerSystem" - for cn, devid in sorted(lelist.items()): - try: - assoc_info = assoc.Associators(options.ip, \ - "Xen_ElementAllocatedFromPool", - cn, - DeviceID = devid, - CreationClassName = cn, - SystemName = test_dom, - SystemCreationClassName = sccn) - if len(assoc_info) != 1: - Globals.logger.error("Xen_ElementAllocatedFromPool returned %i\ - ResourcePool objects for domain '%s'", len(assoc_info), test_dom) - status = FAIL - break - - if assoc_info[0].classname != poollist[idx]: - Globals.logger.error("Classname Mismatch") - Globals.logger.error("Returned %s instead of %s", \ - assoc_info[0].classname, \ - poollist[idx]) - status = FAIL - - if assoc_info[0]['InstanceID'] != poolval[idx]: - Globals.logger.error("InstanceID Mismatch") - Globals.logger.error("Returned %s instead of %s", \ - assoc_info[0]['InstanceID'], \ - poolval[idx]) - status = FAIL - - if status != PASS: - break - else: - idx = idx + 1 - - except Exception, detail: - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, \ - 'Xen_ElementAllocatedFromPool') - Globals.logger.error("Exception: %s", detail) - status = FAIL - - ret = test_domain_function(test_dom, options.ip, \ - cmd = "destroy") + status, gi_inst_list = get_pool_details(server, virt, vsxml, diskid) + if status != PASS: + return status + + status = verify_eafp_values(server, virt, ldlist, gi_inst_list) + cleanup_restore(server, virt) + vsxml.destroy(server) return status if __name__ == "__main__": diff -r 64abdd1495dc -r c2a1ddb060ce suites/libvirt-cim/lib/XenKvmLib/enumclass.py --- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Fri Jul 11 00:42:35 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Wed Jul 16 07:23:32 2008 -0700 @@ -117,6 +117,30 @@ class Xen_LogicalDisk(CIM_LogicalDevice) pass class KVM_LogicalDisk(CIM_LogicalDevice): + pass + +class Xen_Memory(CIM_LogicalDevice): + pass + +class KVM_Memory(CIM_LogicalDevice): + pass + +class LXC_Memory(CIM_LogicalDevice): + pass + +class LXC_Memory(CIM_LogicalDevice): + pass + +class Xen_Processor(CIM_LogicalDevice): + pass + +class KVM_Processor(CIM_LogicalDevice): + pass + +class Xen_NetworkPort(CIM_LogicalDevice): + pass + +class KVM_NetworkPort(CIM_LogicalDevice): pass class Xen_MemoryPool(CIM_ResourcePool): From deeptik at linux.vnet.ibm.com Wed Jul 16 14:17:12 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 16 Jul 2008 19:47:12 +0530 Subject: [Libvirt-cim] CimTest Report for KVM on F9 16-07-2008 Message-ID: <487E02E8.8060400@linux.vnet.ibm.com> ======================================================================== CIM Test Report for KVM on F9 with latest libvirt-cim and libcmpiutil ======================================================================== Distro : Fedora 9 Beta Kernel : 2.6.25-0.121.rc5.git4.fc9 Libvirt : libvirt-0.4.2-1.fc9.x86_64 CIMOM : pegasus PyWBEM : pywbem-0.6 CIM Schema : cimv216Experimental LibCMPIutil : 79 LibVirtCIM : 637 CIMTEST : 243 ======================================================= PASS : 110 FAIL : 1 XFAIL : 4 SKIP : 15 ----------------- Total : 130 ======================================================= Here is one of the tc that failed ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for indication Please find the complete report attached with the mail. Thanks and Regards, Deepti. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: July16-KVM-report URL: From kaitlin at linux.vnet.ibm.com Wed Jul 16 16:20:58 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 16 Jul 2008 09:20:58 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] 2# Update VirtualSystemSettingDataComponent.01 for LXC support In-Reply-To: <4fab30cea82ff4b689b1.1216192961@elm3b197.beaverton.ibm.com> References: <4fab30cea82ff4b689b1.1216192961@elm3b197.beaverton.ibm.com> Message-ID: <487E1FEA.3070400@linux.vnet.ibm.com> Guo Lian Yun wrote: > # HG changeset patch > # User Guolian Yun > # Date 1216192956 25200 > # Node ID 4fab30cea82ff4b689b16594e0db865a5366ec65 > # Parent 64abdd1495dc05e69061151baf2ea25a682e8d8d > [TEST] 2# Update VirtualSystemSettingDataComponent.01 for LXC support > > The test defines non-bootloader guests for all platform types, also remove the > part of thet test that verifies the bootloader > > Updates from 1 to 2: > Pass test_disk and test_mac as parameters into init_list() function. > > On the assoc_values(), I will update it to call compare_all_prop() when > Kaitlin's patch applied in the tree. All patches must have a DCO. > > diff -r 64abdd1495dc -r 4fab30cea82f suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py > --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Fri Jul 11 00:42:35 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Wed Jul 16 00:22:36 2008 -0700 > try: > vssd = enumclass.getInstance(options.ip, \ > - enumclass.Xen_VirtualSystemSettingData, \ > - key_list) > + 'VirtualSystemSettingData', \ > + key_list, > + options.virt) > if vssd is None: > logger.error("VSSD instance for %s not found" % test_dom) > test_domain_function(test_dom, options.ip, "undefine") I missed this last time, but this should be cxml.undefine(). -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 16 16:29:59 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 16 Jul 2008 09:29:59 -0700 Subject: [Libvirt-cim] test list in SKIPPING status for KVM In-Reply-To: References: Message-ID: <487E2207.2000400@linux.vnet.ibm.com> Guo Lian Yun wrote: > > libvirt-cim-bounces at redhat.com wrote on 2008-07-15 23:14:18: > > > > > VirtualSystemMigrationService - 01_migratable_host.py > > > > > > > > Y > > > > > > > > VirtualSystemMigrationService - 02_host_migrate_type.py > > > > > > > > Y > > > > > > > > VirtualSystemMigrationService - 05_migratable_host_errs.py > > > > > > > > Y > > > > > > On the next, I will update VirtualSystemMigrationService for > KVM/XenFV > > > support. > > > Kaitlin -- It doesn't support for LXC, right? > > > > Libvirt doesn't support LXC or KVM migration yet. I saw some initial > > libvirt patches for KVM support, but it's not fully baked yet. > > > And XenFV support? Do I have to convert it for XenFV support? > XenFV support would be great. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Jul 17 06:35:31 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 17 Jul 2008 12:05:31 +0530 Subject: [Libvirt-cim] CimTest Report on XenFV 17-07-2008 Message-ID: <487EE833.30200@linux.vnet.ibm.com> ====================================== CIM Test Report for XenFV ====================================== Distro : RHEL 5.2 Beta Kernel : 2.6.18-88.el5xen Xen version : 3.1.2-88.el5 Libvirt : libvirt-0.3.3-7.el5 CIMOM : pegasus PyWBEM : pywbem-3.14 CIM Schema : cimv216Experimental LibCMPIutil : 79 LibVirtCIM : 637 CIMTEST : 249 ====================================== PASS : 92 TOTAL FAILED : 14 [13 test cases passed when ran manually] ACTUAL FAILED : 1 XFAIL : 6 SKIP : 18 ------------------- Total : 130 ====================================== List of tc that are failing: ComputerSystem - 06_paused_active_suspend.py: FAIL The following tc passed when run manually: ComputerSystem - 03_defineVS.py ComputerSystem - 42_cs_gi_errs.py ElementConforms - 01_forward.py ElementConforms - 02_reverse.py ElementSettingData - 01_forward.py EnabledLogicalElementCapabilities - 01_enum.py LogicalDisk - 02_nodevs.py LogicalDisk - 03_ld_gi_errs.py Memory - 01_memory.py NetworkPort - 01_netport.py VSSD - 04_vssd_to_rasd.py VirtualSystemManagementService - 08_modifyresource.py VirtualSystemManagementService - 09_procrasd_persist.py Please find the complete report attached with the mail. Thanks and Regards, Deepti. ComputerSystem - 03_defineVS.py: FAIL ComputerSystem - 06_paused_active_suspend.py: FAIL ComputerSystem - 42_cs_gi_errs.py: FAIL ElementConforms - 01_forward.py: FAIL ElementConforms - 02_reverse.py: FAIL ElementSettingData - 01_forward.py: FAIL EnabledLogicalElementCapabilities - 01_enum.py: FAIL LogicalDisk - 02_nodevs.py: FAIL LogicalDisk - 03_ld_gi_errs.py: FAIL Memory - 01_memory.py: FAIL NetworkPort - 01_netport.py: FAIL VSSD - 04_vssd_to_rasd.py: FAIL VirtualSystemManagementService - 08_modifyresource.py: FAIL VirtualSystemManagementService - 09_procrasd_persist.py: FAIL -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: July17-XenFV-report URL: From deeptik at linux.vnet.ibm.com Thu Jul 17 09:31:44 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 17 Jul 2008 15:01:44 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fix potiential false positive in AC 01 In-Reply-To: References: Message-ID: <487F1180.7070705@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1215715693 25200 > # Node ID c09b0a978a6621139eb355079994ba3eb2847779 > # Parent 502dddef8c34eeb85b571df0ee97f0ee0676861b > [TEST] Fix potiential false positive in AC 01. > > This test needs to verify enum of AC returns the same number of instances as the number of instances returned by enum of MemoryPool + ProcessorPool + DiskPool + NetworkPool. > > Also, cleaned up the logic to verify that the ResourceType and the InstanceIDs of the AC instances match the Pool instances they're describing. > > > Signed-off-by: Kaitlin Rupert > > diff -r 502dddef8c34 -r c09b0a978a66 suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py > --- a/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Tue Jul 01 14:12:48 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Thu Jul 10 11:48:13 2008 -0700 > @@ -22,6 +22,7 @@ > # > > import sys > +from VirtLib.live import virsh_version > from XenKvmLib import enumclass > from CimTest.Globals import do_main > from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, platform_sup > @@ -32,48 +33,52 @@ > def main(): > options = main.options > > + cn = 'AllocationCapabilities' > + > pools = {} > pt = ['MemoryPool', 'ProcessorPool', 'DiskPool', 'NetworkPool'] > try: > - key_list = ["InstanceID"] > - ac = enumclass.enumerate(options.ip, > - "AllocationCapabilities", > - key_list, > - options.virt) > - pools['MemoryPool'] = enumclass.enumerate(options.ip, > - "MemoryPool", > - key_list, > - options.virt) > - pools['ProcessorPool'] = enumclass.enumerate(options.ip, > - "ProcessorPool", > - key_list, > - options.virt) > - pools['DiskPool'] = enumclass.enumerate(options.ip, > - "DiskPool", > - key_list, > - options.virt) > - pools['NetworkPool'] = enumclass.enumerate(options.ip, > - "NetworkPool", > - key_list, > - options.virt) > - except Exception: > - logger.error(CIM_ERROR_ENUMERATE, '%s_AllocationCapabilities' % options.virt) > + key = ["InstanceID"] > + ac = enumclass.enumerate(options.ip, cn, key, options.virt) > + > + for p in pt: > + enum_list = enumclass.enumerate(options.ip, p, key, options.virt) > + > + if len(enum_list) < 1: > + # If libvirt version >= 0.4.1, libvirt-cim uses libvirt's > + # disk pool support instead of creating its own diskpool. > + # In this case, it's possible for a disk pool to not exist. > + libvirt_version = virsh_version(options.ip, options.virt) > + if p == "DiskPool" and libvirt_version >= '0.4.1': > + continue > + > + logger.error("%s did not return any instances" % p) > + return FAIL > The tc will fail in the following conditions: 1) if p == "DiskPool" and libvirt_version < '0.4.1' and when there is no diskpool on the machines. 2) Also, when the NetworkPool does not exist OR when the existing NetworkPool are in inactive states. We can improve the test case by making sure we have atleast one of each type of the pool and then verify that the AC and the various pools return the similar results. Also, Can we include the comment that you have in the patch in the test case as it does not have any comments as of now and also, it will provide as a reference for maintenance of the tc. > + > + for pool in enum_list: > + pools[pool.InstanceID] = pool > + > + except Exception, details: > + logger.error(CIM_ERROR_ENUMERATE, cn) > + logger.error(details) > return FAIL > > - acset = set([(x.InstanceID, x.ResourceType) for x in ac]) > - poolset = set() > - for pl in pools.values(): > - for x in pl: > - poolset.add((x.InstanceID, x.ResourceType)) > + if len(ac) != len(pools): > + logger.error("%s returned %s instances, expected %s" % (cn, len(ac), > + len(pools))) > + return FAIL > > - if len(acset) != len(poolset): > - logger.error( > - 'AllocationCapabilities return %i instances, excepted %i' > - % (ac_size, pool_size)) > - return FAIL > - zeroset = acset - poolset > - if len(zeroset) != 0: > - logger.error('AC is inconsistent with pools') > + try: > + for inst in ac: > + id = inst.InstanceID > + if pools[id].ResourceType != inst.ResourceType: > + logger.error("%s ResourceType %s, Pool ResourceType %s" % (cn, > + inst.ResourceType, pools[id].ResourceType)) > + return FAIL > + > + except Exception, details: > + logger.error("%s returned instance with unexpected InstanceID %s" % (cn, > + details)) > return FAIL > > return PASS > > _______________________________________________ > 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 Jul 17 10:08:29 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 17 Jul 2008 15:38:29 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fix potiential false positive in CS 02 In-Reply-To: <0a4bc49a1fbde309070f.1215718807@elm3b41.beaverton.ibm.com> References: <0a4bc49a1fbde309070f.1215718807@elm3b41.beaverton.ibm.com> Message-ID: <487F1A1D.70500@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1215718772 25200 > # Node ID 0a4bc49a1fbde309070f8cc4c8631cf4a5ad9c68 > # Parent c09b0a978a6621139eb355079994ba3eb2847779 > [TEST] Fix potiential false positive in CS 02. > > Also make it so that the test skips if domain_list() returns anything > 0. > > This test used to be a Xen only test, so the test was only being run if there were no other guests besides Dom0. However, CS EnumInstances treats Dom0 as any other guest, so it only makes sense to run this test on KVM and LXC. > Why don't we just remove Dom-0 from the list and then carry on with the test case for Xen and XenFV ? > If computersystem.enumerate() encounters an exception, raise an exception so that the calling test case fail appropriately. We could return FAIL in this case, but raising an exception is more descriptive. Also, other tests that call computersystem.enumerate() don't need to be modified because the number of arguments returned doesn't change. > > Signed-off-by: Kaitlin Rupert > > diff -r c09b0a978a66 -r 0a4bc49a1fbd suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py > --- a/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py Thu Jul 10 11:48:13 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py Thu Jul 10 12:39:32 2008 -0700 > @@ -27,7 +27,7 @@ > from XenKvmLib import computersystem > from VirtLib import live > from VirtLib import utils > -from CimTest.Globals import logger > +from CimTest.Globals import logger, CIM_ERROR_ENUMERATE > from CimTest.Globals import do_main > from CimTest.ReturnCodes import PASS, FAIL, SKIP > > @@ -35,7 +35,7 @@ > > def clean_system(host, virt): > l = live.domain_list(host, virt) > - if len(l) > 1: > + if len(l) > 0: > return False > else: > return True > @@ -43,19 +43,31 @@ > @do_main(sup_types) > def main(): > options = main.options > - if not clean_system(options.ip, options.virt): > + > + rc = clean_system(options.ip, options.virt) > + > + if options.virt == "Xen" or options.virt == "XenFV" and rc is True: > + logger.error("System has no Dom0 defined; check system health") > + return FAIL > + elif rc is False: > logger.error("System has defined domains; unable to run") > return SKIP > > - status = PASS > + cn = "%s_ComputerSystem" % options.virt > Instead of cn = "%s_ComputerSystem" % options.virt We can use the standard get_typed_class(virt, "ComputerSystem"). Either ways is fine. Otherwise +1 for me. > - cs = computersystem.enumerate(options.ip, options.virt) > + try: > + cs = computersystem.enumerate(options.ip, options.virt) > > - if cs.__class__ == str: > - logger.error("Got error instead of empty list: %s" % cs) > + except Exception, details: > + logger.error(CIM_ERROR_ENUMERATE, cn) > + logger.error(details) > + return FAIL > + > + if len(cs) != 0: > + logger.error("%s returned %d instead of empty list" % (cn, len(cs))) > status = FAIL > > - return status > + return PASS > > if __name__ == "__main__": > sys.exit(main()) > diff -r c09b0a978a66 -r 0a4bc49a1fbd suites/libvirt-cim/lib/XenKvmLib/computersystem.py > --- a/suites/libvirt-cim/lib/XenKvmLib/computersystem.py Thu Jul 10 11:48:13 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/computersystem.py Thu Jul 10 12:39:32 2008 -0700 > @@ -85,7 +85,7 @@ > try: > instances = conn.EnumerateInstances(classname) > except pywbem.CIMError, arg: > - print arg[1] > + raise Exception(arg[1]) > return [] > > list = [] > > _______________________________________________ > 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 Jul 17 10:35:36 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 17 Jul 2008 16:05:36 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fix CS 22 to use providers instead of virsh In-Reply-To: <86285f56abcaf54595bc.1215725347@elm3b41.beaverton.ibm.com> References: <86285f56abcaf54595bc.1215725347@elm3b41.beaverton.ibm.com> Message-ID: <487F2078.2030101@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1215725330 25200 > # Node ID 86285f56abcaf54595bc2cc54c8f044ae37ccbd7 > # Parent 0a4bc49a1fbde309070f8cc4c8631cf4a5ad9c68 > [TEST] Fix CS 22 to use providers instead of virsh. > > This test was defining a guest with virsh and then suspending it with virsh, which doesn't touch the providers in anyway. Now the test calls DefineSystem() and RequestStateChange(). > > Signed-off-by: Kaitlin Rupert > > diff -r 0a4bc49a1fbd -r 86285f56abca suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py > --- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Thu Jul 10 12:39:32 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Thu Jul 10 14:28:50 2008 -0700 > @@ -32,54 +32,47 @@ > from XenKvmLib import computersystem > from VirtLib import utils > from XenKvmLib import vxml > -from XenKvmLib.test_doms import destroy_and_undefine_all > -from CimTest.Globals import do_main > -from CimTest import Globals > +from XenKvmLib.test_doms import destroy_and_undefine_domain > +from CimTest.Globals import do_main, logger > from CimTest.ReturnCodes import PASS, FAIL > +from XenKvmLib.common_util import create_using_definesystem, \ > + call_request_state_change > > sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > test_dom = "domgst" > > +SUSPND_STATE = 9 > +TIME = "00000000000000.000000:000" > + > @do_main(sup_types) > def main(): > options = main.options > - status = FAIL > > - cxml = vxml.get_class(options.virt)(test_dom) > - > -#define VS > try: > - ret = cxml.define(options.ip) > - if not ret: > - Globals.logger.error(Globals.VIRSH_ERROR_DEFINE % test_dom) > - return status > - > - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) > - if not (cs.Name == test_dom) : > - Globals.logger.error("Error: VS %s not found" % test_dom) > - cxml.undefine(options.ip) > + # define the vs > + status = create_using_definesystem(test_dom, options.ip, > + virt=options.virt) > + if status != PASS: > + logger.error("Unable to define %s using DefineSystem()" % test_dom) > return status > > - except Exception, detail: > - Globals.logger.error("Errors: %s" % detail) > - > -#Suspend the defined VS > - > - try: > - ret = cxml.run_virsh_cmd(options.ip, "suspend") > - if not ret : > - Globals.logger.info("Suspending defined VS %s failed, as expected" \ > -% test_dom) > + # suspend the vs > + status = call_request_state_change(test_dom, options.ip, SUSPND_STATE, > + TIME, virt=options.virt) > + if status != PASS: > + logger.info("Suspending define VS %s failed, as expected" \ > + % test_dom) > status = PASS > Is it just sufficient to check if the status value is set to FAIL by the call_request_state_change() function, should we not check for "Domain not running" specifically so that we are sure the tc is flagged as pass because of no other Exception that might have occured. Thoughts ?? otherwise +1 for me. > else : > - Globals.logger.info("Error: Suspending defined VS %s should not \ > -have been allowed" % test_dom) > + logger.error("Suspending defined VS %s should not have passed" % \ > + test_dom) > status = FAIL > > except Exception, detail: > - Globals.logger.error("Error: %s" % detail) > + logger.error("Error: %s" % detail) > + status = FAIL > > - ret = cxml.undefine(options.ip) > + destroy_and_undefine_domain(test_dom, options.ip, options.virt) > return status > > if __name__ == "__main__": > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From 072021096 at fudan.edu.cn Fri Jul 18 02:18:26 2008 From: 072021096 at fudan.edu.cn (072021096) Date: Fri, 18 Jul 2008 10:18:26 +0800 Subject: [Libvirt-cim] simple question! Message-ID: Hello every i am new here, so I want to ask a simple. It must be simple for you, but it bothered me so much. When I ./configure the libvirt-cim, it said cannot find the CMPI header, how should I do. PS: I use sfcb. but when i insall sfcb i cannot find the CMPI headers installed! what is wrong? Thank you!!! From deeptik at linux.vnet.ibm.com Fri Jul 18 05:38:34 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 18 Jul 2008 11:08:34 +0530 Subject: [Libvirt-cim] simple question! In-Reply-To: References: Message-ID: <48802C5A.7020402@linux.vnet.ibm.com> 072021096 wrote: > Hello every > i am new here, so I want to ask a simple. It must be simple for you, but it bothered me so much. When I ./configure the libvirt-cim, it said cannot find the CMPI header, how should I do. PS: I use sfcb. but when i insall sfcb i cannot find the CMPI headers installed! what is wrong? > > > Can you verify if you have either sblim-cmpi-devel and tog-pegasus-devel packages installed on your machine? Regards, Deepti. > Thank you!!! > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From veillard at redhat.com Fri Jul 18 07:43:41 2008 From: veillard at redhat.com (Daniel Veillard) Date: Fri, 18 Jul 2008 03:43:41 -0400 Subject: [Libvirt-cim] simple question! In-Reply-To: <48802C5A.7020402@linux.vnet.ibm.com> References: <48802C5A.7020402@linux.vnet.ibm.com> Message-ID: <20080718074341.GA9329@redhat.com> On Fri, Jul 18, 2008 at 11:08:34AM +0530, Deepti B Kalakeri wrote: > > > 072021096 wrote: > >Hello every > > i am new here, so I want to ask a simple. It must be simple for you, > > but it bothered me so much. When I ./configure the libvirt-cim, it said > > cannot find the CMPI header, how should I do. PS: I use sfcb. but when > > i insall sfcb i cannot find the CMPI headers installed! what is wrong? > > > > > > > Can you verify if you have either sblim-cmpi-devel and tog-pegasus-devel > packages installed on your machine? And don't forget to install libcmpi[-devel] too 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 deeptik at linux.vnet.ibm.com Fri Jul 18 12:29:46 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 18 Jul 2008 05:29:46 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Enabling 02_reverse.py with XenFV, KVM, LXC and modified logicaldevices.py to work for all virt types Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1216384179 25200 # Node ID f8f6995ce08915d738d82600b15559c81fc40095 # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] Enabling 02_reverse.py with XenFV, KVM, LXC and modified logicaldevices.py to work for all virt types. Changes: ------- 1) Removed unnecessary import statements. 2) Updated verify_proc_values, verify_mem_values, verify_net_values, verify_disk_values function of logicaldevices to work with all virt types. 3) Used verify_proc_values, verify_mem_values, verify_net_values, verify_disk_values fn. 4) Removed conf_file(), clean_up_restore(), get_or_bail(), print_error(), init_list(), get_spec_fields_list(), assoc_values() fns. 5) Removed global status variable. 6) Added verify_eafp_values(), init_pllist(), create_diskpool_conf() fn. 7) Included create_diskpool_conf(), cleanup_restore() fn. Tested on KVM on rpm, KVM current sources, LXC, XenFV, Xen. Signed-off-by: Deepti B. Kalakeri diff -r 3703b7be5a10 -r f8f6995ce089 suites/libvirt-cim/cimtest/ElementAllocatedFromPool/02_reverse.py --- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/02_reverse.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/02_reverse.py Fri Jul 18 05:29:39 2008 -0700 @@ -20,9 +20,8 @@ # 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 classname, InstanceID and certian prop are -# are appropriately set for the domains when verified using the +# appropriately set for the domains when verified using the # Xen_ElementAllocatedFromPool asscoiation. # # Example command for LogicalDisk w.r.t to Xen_ElementAllocatedFromPool \ @@ -47,111 +46,80 @@ import sys import os -from distutils.file_util import move_file import pywbem -from VirtLib import utils -from VirtLib import live -from XenKvmLib import assoc -from XenKvmLib import enumclass -from CimTest import Globals -from CimTest.Globals import do_main -from CimTest.ReturnCodes import PASS, FAIL, SKIP -from XenKvmLib.test_xml import testxml_bridge -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all -from VirtLib.live import network_by_bridge +from XenKvmLib.assoc import Associators +from XenKvmLib.vxml import get_class +from CimTest.Globals import do_main, logger, CIM_ERROR_ASSOCIATORS +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.test_doms import destroy_and_undefine_all +from XenKvmLib.classes import get_typed_class +from XenKvmLib.common_util import create_diskpool_conf, cleanup_restore +from XenKvmLib.logicaldevices import verify_proc_values, verify_mem_values, \ +verify_net_values, verify_disk_values -sup_types = ['Xen'] +sup_types = ['Xen' , 'KVM', 'XenFV', 'LXC'] -status = PASS -test_dom = "hd_domain" +test_dom = "eafp_domain" test_mac = "00:11:22:33:44:aa" test_mem = 128 test_vcpus = 4 -test_disk = "xvdb" -test_dpath = "foo" -disk_file = '/tmp/diskpool.conf' -back_disk_file = disk_file + "." + "02_reverse" -diskid = "%s/%s" % ("DiskPool", test_dpath) -memid = "%s/%s" % ("MemoryPool", 0) -procid = "%s/%s" % ("ProcessorPool", 0) -def conf_file(): - """ - Creating diskpool.conf file. - """ - try: - f = open(disk_file, 'w') - f.write('%s %s' % (test_dpath, '/')) - f.close() - except Exception,detail: - Globals.logger.error("Exception: %s", detail) - status = SKIP - sys.exit(status) +def init_pllist(virt, vsxml, diskid): + keys = { + 'MemoryPool' : 'MemoryPool/0', + } + if virt != 'LXC': + virt_network = vsxml.xml_get_net_network() + keys['DiskPool'] = diskid + keys['ProcessorPool'] = 'ProcessorPool/0' + keys['NetworkPool'] = 'NetworkPool/%s' %virt_network -def clean_up_restore(ip): - """ - Restoring back the original diskpool.conf - file. - """ - try: - if os.path.exists(back_disk_file): - os.remove(disk_file) - move_file(back_disk_file, disk_file) - except Exception, detail: - Globals.logger.error("Exception: %s", detail) - status = SKIP - ret = test_domain_function(test_dom, ip, \ - cmd = "destroy") - sys.exit(status) - + pllist = { } + for cn, k in keys.iteritems(): + cn = get_typed_class(virt, cn) + pllist[cn] = k -def get_or_bail(ip, id, pool_class): - """ - Getinstance for the CLass and return instance on success, otherwise - exit after cleanup_restore and destroying the guest. - """ - key_list = { 'InstanceID' : id } - try: - instance = enumclass.getInstance(ip, pool_class, key_list) - except Exception, detail: - Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE, '%s', pool_class) - Globals.logger.error("Exception: %s", detail) - clean_up_restore(ip) - status = FAIL - ret = test_domain_function(test_dom, ip, \ - cmd = "destroy") - sys.exit(status) - return instance + return pllist -def print_error(field, ret_val, req_val): - Globals.logger.error("%s Mismatch", field) - Globals.logger.error("Returned %s instead of %s", ret_val, req_val) +def eafp_list(virt, test_disk): + mcn = get_typed_class(virt, "Memory") + mem = { + 'SystemName' : test_dom, + 'CreationClassName' : mcn, + 'DeviceID' : "%s/%s" % (test_dom, "mem"), + 'NumberOfBlocks' : test_mem * 1024 + } -def init_list(ip, disk, mem, net, proc): - """ - Creating the lists that will be used for comparisons. - """ + eaf_values = { mcn : mem } - pllist = { - "Xen_DiskPool" : disk.InstanceID, \ - "Xen_MemoryPool" : mem.InstanceID, \ - "Xen_NetworkPool" : net.InstanceID, \ - "Xen_ProcessorPool": proc.InstanceID - } - cllist = [ - "Xen_LogicalDisk", \ - "Xen_Memory", \ - "Xen_NetworkPort", \ - "Xen_Processor" - ] - prop_list = ["%s/%s" % (test_dom, test_disk), test_disk, \ - "%s/%s" % (test_dom, "mem"), test_mem, \ - "%s/%s" % (test_dom, test_mac), test_mac - ] - proc_prop = [] - for i in range(test_vcpus): - proc_prop.append("%s/%s" % (test_dom, i)) - return pllist, cllist, prop_list, proc_prop + if virt != 'LXC': + dcn = get_typed_class(virt, "LogicalDisk") + pcn = get_typed_class(virt, "Processor") + ncn = get_typed_class(virt, "NetworkPort") + + disk = { + 'SystemName' : test_dom, + 'CreationClassName' : dcn, + 'DeviceID' : "%s/%s" % (test_dom, test_disk), + 'Name' : test_disk + } + proc = { + 'SystemName' : test_dom, + 'CreationClassName' : pcn, + 'DeviceID' : None + } + net = { + 'SystemName' : test_dom, + 'CreationClassName' : ncn, + 'DeviceID' : "%s/%s" % (test_dom, test_mac), + 'NetworkAddresses' : test_mac + } + + eaf_values[pcn] = proc + eaf_values[dcn] = disk + eaf_values[ncn] = net + + return eaf_values def get_inst_for_dom(assoc_val): list = [] @@ -162,196 +130,87 @@ def get_inst_for_dom(assoc_val): return list -def get_spec_fields_list(inst_list, field_name): - global status - specific_fields = { } - if (len(inst_list)) != 1: - Globals.logger.error("Got %s record for Memory/Network/LogicalDisk instead of \ -1", len(inst_list)) - status = FAIL - return -# verifying the Name field for LogicalDisk - try: - if inst_list[0]['CreationClassName'] != 'Xen_Memory': - field_value = inst_list[0][field_name] - if field_name == 'NetworkAddresses': -# For network we NetworkAddresses is a list of addresses, since we -# are assigning only one address we are taking field_value[0] - field_value = field_value[0] - else: - field_value = ((int(inst_list[0]['NumberOfBlocks'])*4096)/1024) - specific_fields = { - "field_name" : field_name,\ - "field_value" : field_value - } - except Exception, detail: - Globals.logger.error("Exception in get_spec_fields_list(): %s", detail) - status = FAIL - return specific_fields +def verify_eafp_values(server, virt, in_pllist, test_disk): + # Looping through the in_pllist to get association for various pools. + eafp_values = eafp_list(virt, test_disk) + an = get_typed_class(virt, "ElementAllocatedFromPool") + for cn, instid in sorted(in_pllist.iteritems()): + try: + assoc_info = Associators(server, an, cn, virt, InstanceID = instid) + assoc_inst_list = get_inst_for_dom(assoc_info) + if len(assoc_inst_list) < 1 : + logger.error("'%s' with '%s' did not return any records for" + " domain: '%s'", an, cn, test_dom) + return FAIL -def assoc_values(assoc_list, field , list, index, specific_fields_list=""): - """ - Verifying the records retruned by the associations. - """ - global status - if field == "CreationClassName": - for i in range(len(assoc_list)): - if assoc_list[i][field] != list[index]: - print_error(field, assoc_list[i][field], list[index]) + assoc_eafp_info = assoc_inst_list[0] + CCName = assoc_eafp_info['CreationClassName'] + if CCName == get_typed_class(virt, 'Processor'): + if len(assoc_inst_list) != test_vcpus: + logger.error("'%s' should have returned '%i' Processor" + " details, got '%i'", an, test_vcpus, + len(assoc_inst_list)) + return FAIL + for i in range(test_vcpus): + eafp_values[CCName]['DeviceID'] = "%s/%s" % (test_dom,i) + status = verify_proc_values(assoc_inst_list[i], + eafp_values, virt) + elif CCName == get_typed_class(virt, 'NetworkPort'): + status = verify_net_values(assoc_eafp_info, eafp_values, virt) + elif CCName == get_typed_class(virt, 'LogicalDisk'): + status = verify_disk_values(assoc_eafp_info, eafp_values, virt) + elif CCName == get_typed_class(virt, 'Memory'): + status = verify_mem_values(assoc_eafp_info, eafp_values, virt) + else: status = FAIL if status != PASS: break - elif field == "DeviceID": - if assoc_list[0]['CreationClassName'] == 'Xen_Processor': -# Verifying the list of DeviceId returned by the association -# against the list created intially . - for i in range(len(list)): - if assoc_list[i]['DeviceID'] != list[i]: - print_error(field, assoc_list[i]['DeviceID'], list[i]) - status = FAIL - else: -# Except for Xen_Processor, we get only once record for a domain for -# other classes. - if assoc_list[0]['DeviceID'] != list[index]: - print_error(field, assoc_list[0]['DeviceID'] , list[index]) - status = FAIL - else: - # other specific fields verification - if assoc_list[0]['CreationClassName'] != 'Xen_Processor': - spec_field_name = specific_fields_list['field_name'] - spec_field_value = specific_fields_list['field_value'] - if spec_field_value != list[index]: - print_error(field, spec_field_value, list[index]) - status = FAIL - + except Exception, detail: + logger.error(CIM_ERROR_ASSOCIATORS, an) + logger.error("Exception: %s", detail) + status = FAIL + return status @do_main(sup_types) def main(): options = main.options - global status loop = 0 server = options.ip - destroy_and_undefine_all(options.ip) - test_xml, bridge = testxml_bridge(test_dom, mem = test_mem, vcpus = test_vcpus, \ - mac = test_mac, disk = test_disk, server = options.ip) - if bridge == None: - Globals.logger.error("Unable to find virtual bridge") - return SKIP + virt = options.virt + if virt == 'Xen': + test_disk = 'xvdb' + else: + test_disk = 'hda' - if test_xml == None: - Globals.logger.error("Guest xml was not created properly") + # Getting the VS list and deleting the test_dom if it already exists. + destroy_and_undefine_all(server) + virt_type = get_class(virt) + if virt == 'LXC': + vsxml = virt_type(test_dom, vcpus = test_vcpus) + else: + vsxml = virt_type(test_dom, mem = test_mem, vcpus = test_vcpus, + mac = test_mac, disk = test_disk) + + # Verify DiskPool on machine + status, diskid = create_diskpool_conf(server, virt) + if status != PASS: + return status + + ret = vsxml.create(server) + if not ret: + logger.error("Failed to Create the dom: '%s'", test_dom) return FAIL - virt_network = network_by_bridge(bridge, server) - if virt_network == None: - Globals.logger.error("No virtual network found for bridge %s", bridge) - return SKIP + # Get pool list against which the EAFP should be queried + pllist = init_pllist(virt, vsxml, diskid) - ret = test_domain_function(test_xml, server, cmd = "create") - if not ret: - Globals.logger.error("Failed to Create the dom: %s", test_dom) - return FAIL + + status = verify_eafp_values(server, virt, pllist, test_disk) + vsxml.destroy(server) + cleanup_restore(server, virt) + return status - # Taking care of already existing diskconf file - # Creating diskpool.conf if it does not exist - # Otherwise backing up the prev file and create new one. - os.system("rm -f %s" % back_disk_file ) - if not (os.path.exists(disk_file)): - conf_file() - else: - move_file(disk_file, back_disk_file) - conf_file() - try : - disk = get_or_bail(server, id=diskid, \ - pool_class=enumclass.Xen_DiskPool) - mem = get_or_bail(server, id = memid, \ - pool_class=enumclass.Xen_MemoryPool) - netid = "%s/%s" % ("NetworkPool", virt_network) - net = get_or_bail(server, id = netid, \ - pool_class=enumclass.Xen_NetworkPool) - proc = get_or_bail(server, id = procid, \ - pool_class=enumclass.Xen_ProcessorPool) - - except Exception, detail: - Globals.logger.error("Exception: %s", detail) - clean_up_restore(server) - status = FAIL - ret = test_domain_function(test_dom, server, \ - cmd = "destroy") - return status - - pllist, cllist, prop_list, proc_prop = init_list(server, disk, mem, net, proc) - -# Looping through the pllist to get association for various pools. - for cn, instid in sorted(pllist.items()): - try: - assoc_info = assoc.Associators(server, \ - "Xen_ElementAllocatedFromPool", \ - cn, \ - InstanceID = instid) -# Verifying the Creation Class name for all the records returned for each -# pool class queried - inst_list = get_inst_for_dom(assoc_info) - if (len(inst_list)) == 0: - Globals.logger.error("Association did not return any records for \ -the specified domain: %s", test_dom) - status = FAIL - break - - assoc_values(assoc_list=inst_list, field="CreationClassName", \ - list=cllist, \ - index=loop) -# verifying the DeviceID - if inst_list[0]['CreationClassName'] == 'Xen_Processor': -# The DeviceID for the processor varies from 0 to (vcpu - 1 ) - list_index = 0 - assoc_values(assoc_list=inst_list, field="DeviceID", \ - list=proc_prop, \ - index=list_index) - else: -# For LogicalDisk, Memory and NetworkPort - if inst_list[0]['CreationClassName'] == 'Xen_LogicalDisk': - list_index = 0 - elif inst_list[0]['CreationClassName'] == 'Xen_Memory': - list_index = 2 - else: - list_index = 4 # NetworkPort - assoc_values(assoc_list=inst_list, field="DeviceID", \ - list=prop_list, \ - index=list_index) - if inst_list[0]['CreationClassName'] == 'Xen_LogicalDisk': -# verifying the Name field for LogicalDisk - specific_fields = get_spec_fields_list(inst_list,field_name="Name") - list_index = 1 - elif inst_list[0]['CreationClassName'] == 'Xen_Memory': -# verifying the NumberOfBlocks allocated for Memory - specific_fields = get_spec_fields_list(inst_list,field_name="NumberOfBlocks") - list_index = 3 - else: -# verifying the NetworkAddresses for the NetworkPort - specific_fields = get_spec_fields_list(inst_list,field_name="NetworkAddresses") - list_index = 5 # NetworkPort - assoc_values(assoc_list=inst_list, field="Other", \ - list=prop_list, \ - index=list_index, \ - specific_fields_list=specific_fields) - if status != PASS: - break - else: -# The loop variable is used to index the cllist to verify the creationclassname - loop = loop + 1 - except Exception, detail: - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, \ - 'Xen_ElementAllocatedFromPool') - Globals.logger.error("Exception: %s", detail) - clean_up_restore(server) - status = FAIL - - ret = test_domain_function(test_dom, server, \ - cmd = "destroy") - clean_up_restore(server) - return status if __name__ == "__main__": sys.exit(main()) diff -r 3703b7be5a10 -r f8f6995ce089 suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py --- a/suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py Fri Jul 18 05:29:39 2008 -0700 @@ -23,6 +23,7 @@ import os import os from CimTest.Globals import logger from CimTest.ReturnCodes import PASS, FAIL, SKIP +from XenKvmLib.vxml import get_typed_class # The list_values that is passed should be of the type .. # disk = { @@ -53,8 +54,9 @@ def spec_err(fieldvalue, field_list, fie logger.error("%s Mismatch", fieldname) logger.error("Returned %s instead of %s", fieldvalue, field_list[fieldname]) -def verify_proc_values(assoc_info, list_values): - proc_values = list_values['Xen_Processor'] +def verify_proc_values(assoc_info, list_values, virt='Xen'): + cn = get_typed_class(virt, 'Processor') + proc_values = list_values[cn] if assoc_info['CreationClassName'] != proc_values['CreationClassName']: field_err(assoc_info, proc_values, fieldname = 'CreationClassName') return FAIL @@ -67,8 +69,9 @@ def verify_proc_values(assoc_info, list_ return FAIL return PASS -def verify_mem_values(assoc_info, list_values): - mem_values = list_values['Xen_Memory'] +def verify_mem_values(assoc_info, list_values, virt='Xen'): + cn = get_typed_class(virt, 'Memory') + mem_values = list_values[cn] if assoc_info['CreationClassName'] != mem_values['CreationClassName']: field_err(assoc_info, mem_values, fieldname = 'CreationClassName') return FAIL @@ -85,8 +88,9 @@ def verify_mem_values(assoc_info, list_v return FAIL return PASS -def verify_net_values(assoc_info, list_values): - net_values = list_values['Xen_NetworkPort'] +def verify_net_values(assoc_info, list_values, virt='Xen'): + cn = get_typed_class(virt, 'NetworkPort') + net_values = list_values[cn] if assoc_info['CreationClassName'] != net_values['CreationClassName']: field_err(assoc_info, net_values, fieldname = 'CreationClassName') return FAIL @@ -97,16 +101,17 @@ def verify_net_values(assoc_info, list_v if sysname != net_values['SystemName']: spec_err(sysname, net_values, fieldname = 'SystemName') return FAIL -# We are assinging only one mac address and hence we expect only one -# address in the list + # We are assinging only one mac address and hence we expect only one + # address in the list netadd = assoc_info['NetworkAddresses'][0] if netadd != net_values['NetworkAddresses']: spec_err(netadd, net_values, fieldname = 'NetworkAddresses') return FAIL return PASS -def verify_disk_values(assoc_info, list_values): - disk_values = list_values['Xen_LogicalDisk'] +def verify_disk_values(assoc_info, list_values, virt='Xen'): + cn = get_typed_class(virt, 'LogicalDisk') + disk_values = list_values[cn] if assoc_info['CreationClassName'] != disk_values['CreationClassName']: field_err(assoc_info, disk_values, fieldname = 'CreationClassName') return FAIL From danms at us.ibm.com Fri Jul 18 13:42:12 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 18 Jul 2008 06:42:12 -0700 Subject: [Libvirt-cim] simple question! In-Reply-To: (072021096@fudan.edu.cn's message of "Fri, 18 Jul 2008 10:18:26 +0800") References: Message-ID: <873am7s40b.fsf@caffeine.beaverton.ibm.com> SZ> I use sfcb. but when i insall sfcb i cannot find the CMPI headers SZ> installed! what is wrong? If you're installing from source, sfcb won't install the headers. You can manually copy cmpi*.h from the sfcb source tree to /usr/local/include, which should fix up the problem. It would be better to install sblim-cmpi-devel if you can, but not all systems have this package. -- 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 Jul 18 14:02:54 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 18 Jul 2008 07:02:54 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix potiential false positive in CS 02 In-Reply-To: <487F1A1D.70500@linux.vnet.ibm.com> (Deepti B. Kalakeri's message of "Thu, 17 Jul 2008 15:38:29 +0530") References: <0a4bc49a1fbde309070f.1215718807@elm3b41.beaverton.ibm.com> <487F1A1D.70500@linux.vnet.ibm.com> Message-ID: <87wsjjqohd.fsf@caffeine.beaverton.ibm.com> DK> Why don't we just remove Dom-0 from the list and then carry on DK> with the test case for Xen and XenFV ? Agreed. At one point, this test did exactly that, and worked on Xen systems with no (other) guests defined. -- 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 Jul 18 14:16:42 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 18 Jul 2008 07:16:42 -0700 Subject: [Libvirt-cim] [PATCH] Persist RequestedState in infostore Message-ID: <18eab14c82590e3a31ec.1216390602@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1216390592 25200 # Node ID 18eab14c82590e3a31ec1fa2f789173061ddca97 # Parent ec88dc805bcdc63d30b866e3e527208fa684e274 Persist RequestedState in infostore This allows the ComputerSystem object to correctly expose the state last requested in addition to the actual current state. Signed-off-by: Dan Smith diff -r ec88dc805bcd -r 18eab14c8259 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Wed Jul 09 13:48:14 2008 -0700 +++ b/src/Virt_ComputerSystem.c Fri Jul 18 07:16:32 2008 -0700 @@ -237,9 +237,11 @@ int ret; uint16_t cim_state; uint16_t health_state; + uint16_t req_state; uint16_t op_status; CMPIArray *array; CMPIStatus s; + struct infostore_ctx *infostore = NULL; ret = virDomainGetInfo(dom, &info); if (ret != 0) @@ -262,6 +264,17 @@ CMSetProperty(instance, "OperationalStatus", (CMPIValue *)&array, CMPI_uint16A); + + infostore = infostore_open(dom); + if (infostore != NULL) + req_state = (uint16_t)infostore_get_u64(infostore, "reqstate"); + else + req_state = CIM_STATE_UNKNOWN; + + CMSetProperty(instance, "RequestedState", + (CMPIValue *)&req_state, CMPI_uint16); + + infostore_close(infostore); return 1; } @@ -809,6 +822,7 @@ virConnectPtr conn = NULL; virDomainPtr dom = NULL; virDomainInfo info; + struct infostore_ctx *infostore = NULL; conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) @@ -843,6 +857,12 @@ cu_statusf(_BROKER, &s, CMPI_RC_ERR_NOT_SUPPORTED, "State not supported"); + + infostore = infostore_open(dom); + if (infostore != NULL) { + infostore_set_u64(infostore, "reqstate", (uint64_t)state); + infostore_close(infostore); + } out: virDomainFree(dom); From kaitlin at linux.vnet.ibm.com Fri Jul 18 22:41:01 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 18 Jul 2008 15:41:01 -0700 Subject: [Libvirt-cim] [PATCH] Add CMSetObjectPath macro Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1216418936 25200 # Node ID abbc6e3b451614f7bd2965f95d70b6695ad25968 # Parent ec88dc805bcdc63d30b866e3e527208fa684e274 Add CMSetObjectPath macro. This is a work around. SFCB currently doesn't implement CMSetObjectPath, so the VSMS provider seg faults. Signed-off-by: Kaitlin Rupert diff -r ec88dc805bcd -r abbc6e3b4516 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Jul 09 13:48:14 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Fri Jul 18 15:08:56 2008 -0700 @@ -58,6 +58,12 @@ #define DEFAULT_XEN_WEIGHT 1024 const static CMPIBroker *_BROKER; + +#undef CMSetObjectPath +#define CMSetObjectPath(i,p) do { \ + if (i->ft->setObjectPath != NULL) \ + i->ft->setObjectPath(i, p); \ + } while (0); enum ResourceAction { RESOURCE_ADD, From kaitlin at linux.vnet.ibm.com Fri Jul 18 23:22:47 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 18 Jul 2008 16:22:47 -0700 Subject: [Libvirt-cim] [PATCH] Persist RequestedState in infostore In-Reply-To: <18eab14c82590e3a31ec.1216390602@guaranine.danplanet.com> References: <18eab14c82590e3a31ec.1216390602@guaranine.danplanet.com> Message-ID: <488125C7.4090406@linux.vnet.ibm.com> > + > + infostore = infostore_open(dom); > + if (infostore != NULL) { > + infostore_set_u64(infostore, "reqstate", (uint64_t)state); > + infostore_close(infostore); > + } > Was going to comment that infostore_close() should go outside the if, but I'd forgotten that infostore_open() cleanups before the return if the call fails. I tested this out and it looks good. +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Sat Jul 19 20:14:24 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Sat, 19 Jul 2008 13:14:24 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix potiential false positive in AC 01 In-Reply-To: <487F1180.7070705@linux.vnet.ibm.com> References: <487F1180.7070705@linux.vnet.ibm.com> Message-ID: <48824B20.7090804@linux.vnet.ibm.com> >> + ac = enumclass.enumerate(options.ip, cn, key, options.virt) >> + >> + for p in pt: >> + enum_list = enumclass.enumerate(options.ip, p, key, >> options.virt) >> + >> + if len(enum_list) < 1: >> + # If libvirt version >= 0.4.1, libvirt-cim uses >> libvirt's >> + # disk pool support instead of creating its own >> diskpool. >> + # In this case, it's possible for a disk pool to not >> exist. + libvirt_version = virsh_version(options.ip, >> options.virt) >> + if p == "DiskPool" and libvirt_version >= '0.4.1': >> + continue >> + >> + logger.error("%s did not return any instances" % p) >> + return FAIL >> > The tc will fail in the following conditions: > > 1) if p == "DiskPool" and libvirt_version < '0.4.1' and when there is no > diskpool on the machines. > 2) Also, when the NetworkPool does not exist OR when the existing > NetworkPool are in inactive states. Yep! Good call on both of these. I forgot to test these cases. > We can improve the test case by making sure we have atleast one of each > type of the pool and then verify that the AC and the various pools > return the similar results. Agreed. It's a better way of handling the test. > Also, Can we include the comment that you have in the patch in the test > case as it does not have any comments as of now and also, it will > provide as a reference for maintenance of the tc. Sure. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Sat Jul 19 21:17:48 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Sat, 19 Jul 2008 14:17:48 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix potiential false positive in AC 01 Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1216502229 25200 # Node ID de486893703609719ea79d53ee64828537826211 # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] #2 Fix potiential false positive in AC 01. This test needs to verify enum of AC returns the same number of instances as the number of instances returned by enum of MemoryPool + ProcessorPool + DiskPool + NetworkPool. Also, cleaned up the logic to verify that the ResourceType and the InstanceIDs of the AC instances match the Pool instances they're describing. Updates form 1 to 2: -Create a disk pool and network pool to ensure there is an instance for each pool type. -Add comment explaining the purpose of the test. Signed-off-by: Kaitlin Rupert diff -r 3703b7be5a10 -r de4868937036 suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py --- a/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Sat Jul 19 14:17:09 2008 -0700 @@ -20,63 +20,97 @@ # 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 verifies the enum of AC returns the same number of instances as +# the number of instances returned by enum of: +# MemoryPool + ProcessorPool + DiskPool + NetworkPool. +# import sys +from VirtLib.live import virsh_version from XenKvmLib import enumclass from CimTest.Globals import do_main from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, platform_sup from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ + create_netpool_conf, destroy_netpool sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] + +def enum_pools_and_ac(ip, virt, cn): + pools = {} + ac = [] + + pt = ['MemoryPool', 'ProcessorPool', 'DiskPool', 'NetworkPool'] + + try: + key = ["InstanceID"] + ac = enumclass.enumerate(ip, cn, key, virt) + + for p in pt: + enum_list = enumclass.enumerate(ip, p, key, virt) + + if len(enum_list) < 1: + logger.error("%s did not return any instances" % p) + return pools, ac + + for pool in enum_list: + pools[pool.InstanceID] = pool + + except Exception, details: + logger.error(CIM_ERROR_ENUMERATE, cn) + logger.error(details) + return pools, ac + + if len(ac) != len(pools): + logger.error("%s returned %s instances, expected %s" % (cn, len(ac), + len(pools))) + return pools, ac + +def compare_pool_to_ac(ac, pools, cn): + try: + for inst in ac: + id = inst.InstanceID + if pools[id].ResourceType != inst.ResourceType: + logger.error("%s ResourceType %s, Pool ResourceType %s" % (cn, + inst.ResourceType, pools[id].ResourceType)) + return FAIL + + except Exception, details: + logger.error("%s returned instance with unexpected InstanceID %s" % (cn, + details)) + return FAIL + + return PASS + @do_main(sup_types) def main(): options = main.options - pools = {} - pt = ['MemoryPool', 'ProcessorPool', 'DiskPool', 'NetworkPool'] - try: - key_list = ["InstanceID"] - ac = enumclass.enumerate(options.ip, - "AllocationCapabilities", - key_list, - options.virt) - pools['MemoryPool'] = enumclass.enumerate(options.ip, - "MemoryPool", - key_list, - options.virt) - pools['ProcessorPool'] = enumclass.enumerate(options.ip, - "ProcessorPool", - key_list, - options.virt) - pools['DiskPool'] = enumclass.enumerate(options.ip, - "DiskPool", - key_list, - options.virt) - pools['NetworkPool'] = enumclass.enumerate(options.ip, - "NetworkPool", - key_list, - options.virt) - except Exception: - logger.error(CIM_ERROR_ENUMERATE, '%s_AllocationCapabilities' % options.virt) - return FAIL - - acset = set([(x.InstanceID, x.ResourceType) for x in ac]) - poolset = set() - for pl in pools.values(): - for x in pl: - poolset.add((x.InstanceID, x.ResourceType)) + cn = 'AllocationCapabilities' - if len(acset) != len(poolset): - logger.error( - 'AllocationCapabilities return %i instances, excepted %i' - % (ac_size, pool_size)) - return FAIL - zeroset = acset - poolset - if len(zeroset) != 0: - logger.error('AC is inconsistent with pools') + status, diskid = create_diskpool_conf(options.ip, options.virt) + if status != PASS: + cleanup_restore(options.ip, options.virt) + return FAIL + + status, test_network = create_netpool_conf(options.ip, options.virt) + if status != PASS: + cleanup_restore(options.ip, options.virt) + destroy_netpool(options.ip, options.virt, test_network) + return FAIL + + pools, ac = enum_pools_and_ac(options.ip, options.virt, cn) + if len(pools) < 1: + cleanup_restore(options.ip, options.virt) + destroy_netpool(options.ip, options.virt, test_network) return FAIL - return PASS + status = compare_pool_to_ac(ac, pools, cn) + + cleanup_restore(options.ip, options.virt) + destroy_netpool(options.ip, options.virt, test_network) + + return status if __name__ == "__main__": sys.exit(main()) From kaitlin at linux.vnet.ibm.com Sat Jul 19 21:25:43 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Sat, 19 Jul 2008 14:25:43 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix potiential false positive in CS 02 In-Reply-To: <87wsjjqohd.fsf@caffeine.beaverton.ibm.com> References: <0a4bc49a1fbde309070f.1215718807@elm3b41.beaverton.ibm.com> <487F1A1D.70500@linux.vnet.ibm.com> <87wsjjqohd.fsf@caffeine.beaverton.ibm.com> Message-ID: <48825BD7.3070501@linux.vnet.ibm.com> Dan Smith wrote: > DK> Why don't we just remove Dom-0 from the list and then carry on > DK> with the test case for Xen and XenFV ? > > Agreed. At one point, this test did exactly that, and worked on Xen > systems with no (other) guests defined. > My thinking was that the purpose was to verify the EnumInstance() of CS returned no instances when no guests were defined on the system. I'm not sure I understand the purpose of testing with no other guests defined on Xen, because Dom0 is treated as a guest by the providers. The original code was: cs = computersystem.enumerate(options.ip, options.virt) if cs.__class__ == str: logger.error("Got error instead of empty list: %s" % cs) status = FAIL The error message here is misleading - EnumInstances() won't return an empty list on Xen because an instance for Dom0 is returned. And we're not really checking for an empty list anyway. Is this test really checking to make sure EnumInstances() doesn't return an error? If so, the name of the test is misleading. And other tests cover this already (CS 01_enum.py). -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Sat Jul 19 22:38:41 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Sat, 19 Jul 2008 15:38:41 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix CS 22 to use providers instead of virsh Message-ID: <26723e615b002509d1a9.1216507121@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1216507114 25200 # Node ID 26723e615b002509d1a91b5669d463b8132fadfc # Parent 0ebcf05bf74b7a798e99afc8c4361b183fbfc6ee [TEST] #2 Fix CS 22 to use providers instead of virsh. This test was defining a guest with virsh and then suspending it with virsh, which doesn't touch the providers in anyway. Now the test calls DefineSystem() and RequestStateChange(). Updates from 1 to 2: -Add check to verify guest is the expected state after the RequestStateChange() call. -Create a network pool because the VSMS provider requires a network pool to exist in order to create a guest. Signed-off-by: Kaitlin Rupert diff -r 0ebcf05bf74b -r 26723e615b00 suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Sat Jul 19 15:14:33 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Sat Jul 19 15:38:34 2008 -0700 @@ -32,54 +32,72 @@ from XenKvmLib import computersystem from VirtLib import utils from XenKvmLib import vxml -from XenKvmLib.test_doms import destroy_and_undefine_all -from CimTest.Globals import do_main -from CimTest import Globals +from XenKvmLib.test_doms import destroy_and_undefine_domain +from CimTest.Globals import do_main, logger from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.common_util import create_using_definesystem, \ + call_request_state_change, get_cs_instance, \ + create_netpool_conf, destroy_netpool sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "domgst" +DEFINE_STATE = 3 +SUSPND_STATE = 9 +TIME = "00000000000000.000000:000" + +def chk_state(domain_name, ip, en_state, virt): + rc, cs = get_cs_instance(domain_name, ip, virt) + if rc != 0: + return rc + + if cs.EnabledState != en_state: + logger.error("EnabledState should be %d not %d", + en_state, cs.EnabledState) + return FAIL + + return PASS + @do_main(sup_types) def main(): options = main.options - status = FAIL - - cxml = vxml.get_class(options.virt)(test_dom) -#define VS + status, test_network = create_netpool_conf(options.ip, options.virt) + if status != PASS: + destroy_netpool(options.ip, options.virt, test_network) + return FAIL + try: - ret = cxml.define(options.ip) - if not ret: - Globals.logger.error(Globals.VIRSH_ERROR_DEFINE % test_dom) - return status - - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) - if not (cs.Name == test_dom) : - Globals.logger.error("Error: VS %s not found" % test_dom) - cxml.undefine(options.ip) + # define the vs + status = create_using_definesystem(test_dom, options.ip, + virt=options.virt) + if status != PASS: + logger.error("Unable to define %s using DefineSystem()" % test_dom) + destroy_netpool(options.ip, options.virt, test_network) return status - except Exception, detail: - Globals.logger.error("Errors: %s" % detail) + # suspend the vs + status = call_request_state_change(test_dom, options.ip, SUSPND_STATE, + TIME, virt=options.virt) + if status != PASS: + logger.info("Suspending defined %s failed, as expected" % test_dom) + status = PASS -#Suspend the defined VS - - try: - ret = cxml.run_virsh_cmd(options.ip, "suspend") - if not ret : - Globals.logger.info("Suspending defined VS %s failed, as expected" \ -% test_dom) - status = PASS + status = chk_state(test_dom, options.ip, DEFINE_STATE, options.virt) + if status != PASS: + logger.error("%s not in defined state as expected." % test_dom) + status = FAIL + else : - Globals.logger.info("Error: Suspending defined VS %s should not \ -have been allowed" % test_dom) + logger.error("Suspending defined %s should have failed" % test_dom) status = FAIL except Exception, detail: - Globals.logger.error("Error: %s" % detail) + logger.error("Error: %s" % detail) + status = FAIL - ret = cxml.undefine(options.ip) + destroy_netpool(options.ip, options.virt, test_network) + destroy_and_undefine_domain(test_dom, options.ip, options.virt) return status if __name__ == "__main__": From 072021096 at fudan.edu.cn Sun Jul 20 04:52:05 2008 From: 072021096 at fudan.edu.cn (072021096) Date: Sun, 20 Jul 2008 12:52:05 +0800 Subject: [Libvirt-cim] problem for Message-ID: Hi,everyone I got another problem, When i compile the libvirt-cim, it said that i have not installed libcmpiutil package, but i have installed infact. maybe i have to install the libcmpiutil-devel but i can not find it in the libvirt.org website, and other resources are all rpm for fc9, i uses centOS. so, what should i do! Thank you all! Best wishes! Sean_Ggz From kaitlin at linux.vnet.ibm.com Sun Jul 20 20:32:19 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Sun, 20 Jul 2008 13:32:19 -0700 Subject: [Libvirt-cim] problem for In-Reply-To: References: Message-ID: <4883A0D3.6040605@linux.vnet.ibm.com> 072021096 wrote: > Hi,everyone > I got another problem, When i compile the libvirt-cim, it said that i have not installed libcmpiutil package, but i have installed infact. maybe i have to install the libcmpiutil-devel but i can not find it in the libvirt.org website, and other resources are all rpm for fc9, i uses centOS. so, what should i do! > If you've installed libcmpiutil from source, then all the pieces needed to build libvirt-cim should be installed. You'll need to configure libvirt-cim to pick up the pkgconfig info: ./configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Sun Jul 20 21:32:24 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Sun, 20 Jul 2008 14:32:24 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Enabling 02_reverse.py with XenFV, KVM, LXC and modified logicaldevices.py to work for all virt types In-Reply-To: References: Message-ID: <4883AEE8.9040202@linux.vnet.ibm.com> > +def verify_eafp_values(server, virt, in_pllist, test_disk): > + # Looping through the in_pllist to get association for various pools. > + eafp_values = eafp_list(virt, test_disk) > + an = get_typed_class(virt, "ElementAllocatedFromPool") > + for cn, instid in sorted(in_pllist.iteritems()): > + try: > + assoc_info = Associators(server, an, cn, virt, InstanceID = instid) > + assoc_inst_list = get_inst_for_dom(assoc_info) > + if len(assoc_inst_list) < 1 : > + logger.error("'%s' with '%s' did not return any records for" > + " domain: '%s'", an, cn, test_dom) This should be; logger.error("'%s' should have returned '%i' Processor" " details, got '%i'" % (an, test_vcpus, len(assoc_inst_list))) If you use commas instead, the formatting of the string is off. > + return FAIL > > -def assoc_values(assoc_list, field , list, index, specific_fields_list=""): > - """ > - Verifying the records retruned by the associations. > - """ > - global status > - if field == "CreationClassName": > - for i in range(len(assoc_list)): > - if assoc_list[i][field] != list[index]: > - print_error(field, assoc_list[i][field], list[index]) > + assoc_eafp_info = assoc_inst_list[0] > + CCName = assoc_eafp_info['CreationClassName'] > + if CCName == get_typed_class(virt, 'Processor'): > + if len(assoc_inst_list) != test_vcpus: > + logger.error("'%s' should have returned '%i' Processor" > + " details, got '%i'", an, test_vcpus, > + len(assoc_inst_list)) Same here - format the log message using % (an, test_vcpus, len(assoc_inst_list)) > + > + # Verify DiskPool on machine > + status, diskid = create_diskpool_conf(server, virt) > + if status != PASS: > + return status > + > + ret = vsxml.create(server) > + if not ret: > + logger.error("Failed to Create the dom: '%s'", test_dom) Will need to call cleanup_restore() in case of error. > return FAIL > > sys.exit(main()) > diff -r 3703b7be5a10 -r f8f6995ce089 suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py > --- a/suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py Wed Jul 16 07:23:32 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py Fri Jul 18 05:29:39 2008 -0700 > @@ -23,6 +23,7 @@ import os > > -def verify_proc_values(assoc_info, list_values): Instead of having a verify_<>_values function for each device type, could these be condensed into one function? All of them check the CreationClassName and the DeviceID, which isn't needed. The function could take the classname, which would enable you to determine with values need to be checked. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From yunguol at cn.ibm.com Mon Jul 21 06:32:00 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 21 Jul 2008 14:32:00 +0800 Subject: [Libvirt-cim] [TEST] Cimtest Report for LXC on F9 (2008/07/21) Message-ID: stro: Fedora 9 Beta kernel-2.6.25-0.218.rc8.git7.fc9.x86_64 CIMOM: tog-pegasus-2.7.0-6.fc9.x86_64 cimtest: changeset-249 ================================================================== PASS : 90 XFAIL : 1 FAIL : 1 SKIP : 38 ----------------- Total : 130 ======================CIMTEST FULL REPORT================================== AllocationCapabilities - 01_enum.py: PASS AllocationCapabilities - 02_alloccap_gi_errs.py: PASS ComputerSystem - 01_enum.py: PASS ComputerSystem - 02_nosystems.py: SKIP ERROR - System has defined domains; unable to run ComputerSystem - 03_defineVS.py: PASS ComputerSystem - 04_defineStartVS.py: FAIL ERROR - Error: property values are not set for VS domguest ComputerSystem - 05_activate_defined_start.py: XFAIL Bug: 00002 ERROR - ERROR: VS DomST1 transition from Defined State to Activate state was not Successful Bug:<00002> ComputerSystem - 06_paused_active_suspend.py: SKIP ComputerSystem - 22_define_suspend.py: PASS ComputerSystem - 23_suspend_suspend.py: SKIP ComputerSystem - 27_define_suspend_errs.py: PASS ComputerSystem - 32_start_reboot.py: SKIP ComputerSystem - 33_suspend_reboot.py: SKIP ComputerSystem - 35_start_reset.py: SKIP ComputerSystem - 40_RSC_start.py: SKIP ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP ComputerSystem - 42_cs_gi_errs.py: PASS ComputerSystemIndication - 01_created_indication.py: SKIP ElementAllocatedFromPool - 01_forward.py: PASS ElementAllocatedFromPool - 02_reverse.py: SKIP ElementAllocatedFromPool - 03_reverse_errs.py: SKIP ElementAllocatedFromPool - 04_forward_errs.py: SKIP ElementCapabilities - 01_forward.py: PASS ElementCapabilities - 02_reverse.py: PASS ElementCapabilities - 03_forward_errs.py: PASS ElementCapabilities - 04_reverse_errs.py: PASS ElementCapabilities - 05_hostsystem_cap.py: PASS ElementConforms - 01_forward.py: PASS ElementConforms - 02_reverse.py: PASS ElementConforms - 03_ectp_fwd_errs.py: PASS ElementConforms - 04_ectp_rev_errs.py: PASS ElementSettingData - 01_forward.py: PASS ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS EnabledLogicalElementCapabilities - 01_enum.py: PASS EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS HostSystem - 01_enum.py: PASS HostSystem - 02_hostsystem_to_rasd.py: PASS HostSystem - 03_hs_to_settdefcap.py: PASS HostSystem - 04_hs_to_EAPF.py: SKIP HostSystem - 05_hs_gi_errs.py: PASS HostSystem - 06_hs_to_vsms.py: PASS HostedDependency - 01_forward.py: PASS HostedDependency - 02_reverse.py: PASS HostedDependency - 03_enabledstate.py: SKIP 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: SKIP LogicalDisk - 02_nodevs.py: SKIP ERROR - System has defined domains; unable to run LogicalDisk - 03_ld_gi_errs.py: SKIP Memory - 01_memory.py: PASS Memory - 02_defgetmem.py: PASS Memory - 03_mem_gi_errs.py: PASS NetworkPort - 01_netport.py: SKIP NetworkPort - 02_np_gi_errors.py: SKIP NetworkPort - 03_user_netport.py: SKIP Processor - 01_processor.py: SKIP Processor - 02_definesys_get_procs.py: SKIP Processor - 03_proc_gi_errs.py: SKIP Profile - 01_enum.py: PASS Profile - 02_profile_to_elec.py: SKIP 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: SKIP 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: SKIP ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: SKIP ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: SKIP ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: SKIP ResourcePoolConfigurationService - 07_DeleteResourcePool.py: SKIP SettingsDefine - 01_forward.py: PASS SettingsDefine - 02_reverse.py: PASS SettingsDefine - 03_sds_fwd_errs.py: PASS SettingsDefine - 04_sds_rev_errs.py: PASS SettingsDefineCapabilities - 01_forward.py: PASS SettingsDefineCapabilities - 03_forward_errs.py: PASS SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS SystemDevice - 01_forward.py: PASS SystemDevice - 02_reverse.py: PASS SystemDevice - 03_fwderrs.py: PASS VSSD - 01_enum.py: PASS VSSD - 02_bootldr.py: SKIP VSSD - 03_vssd_gi_errs.py: PASS VSSD - 04_vssd_to_rasd.py: PASS VirtualSystemManagementCapabilities - 01_enum.py: PASS VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS VirtualSystemManagementService - 01_definesystem_name.py: PASS VirtualSystemManagementService - 02_destroysystem.py: PASS VirtualSystemManagementService - 03_definesystem_ess.py: PASS VirtualSystemManagementService - 04_definesystem_ers.py: PASS VirtualSystemManagementService - 05_destroysystem_neg.py: PASS VirtualSystemManagementService - 06_addresource.py: SKIP VirtualSystemManagementService - 07_addresource_neg.py: PASS VirtualSystemManagementService - 08_modifyresource.py: SKIP VirtualSystemManagementService - 09_procrasd_persist.py: SKIP 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: PASS VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS VirtualSystemSnapshotService - 01_enum.py: PASS VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922403 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 -------------- next part -------------- An HTML attachment was scrubbed... URL: From yunguol at cn.ibm.com Mon Jul 21 06:42:25 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 21 Jul 2008 14:42:25 +0800 Subject: [Libvirt-cim] Cimtest Report for Xen on RHEL5.2 (2008/07/21) Message-ID: Distro : RHEL 5.2 Beta Kernel : kernel-2.6.18-92.el5 Xen version : xen-3.0.3-64.el5 Libvirt : libvirt-0.3.3-7.el5 CIMOM : pegasus PyWBEM : pywbem-3.14 CIM Schema : cimv216Experimental LibCMPIutil : 83 LibVirtCIM : 637 CIMTEST : 249 ========================================================= PASS : 113 FAILED : 9 XFAIL : 7 SKIP : 1 Total : 130 =======================FAILED============================== ElementAllocatedFromPool - 02_reverse.py: FAIL ERROR - AttributeError : 'NoneType' object has no attribute 'InstanceID' CIM_ERR_NOT_FOUND: No such instance (foo) LogicalDisk - 02_nodevs.py: FAIL ERROR - LogicalDisk returned 1 instead of empty list LogicalDisk - 03_ld_gi_errs.py: FAIL ERROR - Failed to get instance by the class of Xen_LogicalDisk ERROR - Exception: (6, u'CIM_ERR_NOT_FOUND: No such instance (hd_domain/xvda)') Memory - 01_memory.py: FAIL ERROR - Capacity should be 262144 MB instead of 131072 MB NetworkPort - 01_netport.py: FAIL ERROR - Exception: (6, u'CIM_ERR_NOT_FOUND: No such instance (test_domain/00:11:22:33:44:55)') RASD - 02_enum.py: FAIL ERROR - Xen_DiskResourceAllocationSettingData with VSSDC_dom was not returned VSSD - 02_bootldr.py: FAIL ERROR - NameError : global name 'BaseException' is not defined CIM_ERR_NOT_FOUND: No such instance (dom) VSSD - 04_vssd_to_rasd.py: FAIL ERROR - Xen_VirtualSystemSettingData with VSSDC_dom was not returned ERROR - Xen_VirtualSystemSettingData returned 0 VSSD objects, expected only 1 VirtualSystemManagementService - 09_procrasd_persist.py: FAIL ERROR - limit is 0, expected 256 ERROR - rstest_domain CPU scheduling not set properly =======================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: 00002 ERROR - ERROR: VS DomST1 transition from Defined State to Activate state was not Successful Bug:<00002> ComputerSystem - 06_paused_active_suspend.py: XFAIL Bug: 00002 ERROR - ERROR: VS DomST1 transition from suspend State to Activate state was not Successful Bug:<00002> ComputerSystem - 22_define_suspend.py: PASS ComputerSystem - 23_suspend_suspend.py: XFAIL Bug: 00002 ERROR - RequestedState should be 2 not 12 ERROR - Attributes for dom test_domain not set as expected. Bug:<00002> ComputerSystem - 27_define_suspend_errs.py: PASS ComputerSystem - 32_start_reboot.py: XFAIL Bug: 00002 ERROR - RequestedState should be 2 not 12 ERROR - Attributes for dom test_domain not set as expected. Bug:<00002> ComputerSystem - 33_suspend_reboot.py: XFAIL Bug: 00002 ERROR - RequestedState should be 2 not 12 ERROR - Attributes for dom test_domain not set as expected. Bug:<00002> ComputerSystem - 35_start_reset.py: XFAIL Bug: 00002 ERROR - RequestedState should be 2 not 12 ERROR - Attributes for dom test_domain not set as expected. Bug:<00002> ComputerSystem - 40_RSC_start.py: XFAIL Bug: 00002 ERROR - RequestedState should be 2 not 12 ERROR - Exception: Attributes were not set as expected for domain: 'test_domain' Bug:<00002> ComputerSystem - 41_cs_to_settingdefinestate.py: PASS ComputerSystem - 42_cs_gi_errs.py: PASS ComputerSystemIndication - 01_created_indication.py: PASS ElementAllocatedFromPool - 01_forward.py: PASS ElementAllocatedFromPool - 02_reverse.py: FAIL ERROR - AttributeError : 'NoneType' object has no attribute 'InstanceID' CIM_ERR_NOT_FOUND: 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: PASS ElementConforms - 02_reverse.py: PASS ElementConforms - 03_ectp_fwd_errs.py: PASS ElementConforms - 04_ectp_rev_errs.py: PASS ElementSettingData - 01_forward.py: PASS ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS EnabledLogicalElementCapabilities - 01_enum.py: PASS EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS HostSystem - 01_enum.py: PASS HostSystem - 02_hostsystem_to_rasd.py: PASS HostSystem - 03_hs_to_settdefcap.py: PASS HostSystem - 04_hs_to_EAPF.py: PASS HostSystem - 05_hs_gi_errs.py: PASS HostSystem - 06_hs_to_vsms.py: PASS HostedDependency - 01_forward.py: PASS HostedDependency - 02_reverse.py: PASS HostedDependency - 03_enabledstate.py: PASS HostedDependency - 04_reverse_errs.py: PASS HostedResourcePool - 01_forward.py: PASS HostedResourcePool - 02_reverse.py: PASS HostedResourcePool - 03_forward_errs.py: PASS HostedResourcePool - 04_reverse_errs.py: PASS HostedService - 01_forward.py: PASS HostedService - 02_reverse.py: PASS HostedService - 03_forward_errs.py: PASS HostedService - 04_reverse_errs.py: PASS LogicalDisk - 01_disk.py: PASS LogicalDisk - 02_nodevs.py: FAIL ERROR - LogicalDisk returned 1 instead of empty list LogicalDisk - 03_ld_gi_errs.py: FAIL ERROR - Failed to get instance by the class of Xen_LogicalDisk ERROR - Exception: (6, u'CIM_ERR_NOT_FOUND: No such instance (hd_domain/xvda)') Memory - 01_memory.py: FAIL ERROR - Capacity should be 262144 MB instead of 131072 MB Memory - 02_defgetmem.py: PASS Memory - 03_mem_gi_errs.py: PASS NetworkPort - 01_netport.py: FAIL ERROR - Exception: (6, u'CIM_ERR_NOT_FOUND: No such instance (test_domain/00:11:22:33:44:55)') NetworkPort - 02_np_gi_errors.py: PASS NetworkPort - 03_user_netport.py: SKIP Processor - 01_processor.py: PASS Processor - 02_definesys_get_procs.py: PASS Processor - 03_proc_gi_errs.py: PASS Profile - 01_enum.py: PASS Profile - 02_profile_to_elec.py: PASS Profile - 03_rprofile_gi_errs.py: PASS RASD - 01_verify_rasd_fields.py: PASS RASD - 02_enum.py: FAIL ERROR - Xen_DiskResourceAllocationSettingData with VSSDC_dom was not returned 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: PASS ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS SettingsDefine - 01_forward.py: PASS SettingsDefine - 02_reverse.py: PASS SettingsDefine - 03_sds_fwd_errs.py: PASS SettingsDefine - 04_sds_rev_errs.py: PASS SettingsDefineCapabilities - 01_forward.py: PASS SettingsDefineCapabilities - 03_forward_errs.py: PASS SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS SystemDevice - 01_forward.py: PASS SystemDevice - 02_reverse.py: PASS SystemDevice - 03_fwderrs.py: PASS VSSD - 01_enum.py: PASS VSSD - 02_bootldr.py: FAIL ERROR - NameError : global name 'BaseException' is not defined CIM_ERR_NOT_FOUND: No such instance (dom) VSSD - 03_vssd_gi_errs.py: PASS VSSD - 04_vssd_to_rasd.py: FAIL ERROR - Xen_VirtualSystemSettingData with VSSDC_dom was not returned ERROR - Xen_VirtualSystemSettingData returned 0 VSSD objects, expected only 1 VirtualSystemManagementCapabilities - 01_enum.py: PASS VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS VirtualSystemManagementService - 01_definesystem_name.py: PASS VirtualSystemManagementService - 02_destroysystem.py: PASS VirtualSystemManagementService - 03_definesystem_ess.py: PASS VirtualSystemManagementService - 04_definesystem_ers.py: PASS VirtualSystemManagementService - 05_destroysystem_neg.py: PASS VirtualSystemManagementService - 06_addresource.py: PASS VirtualSystemManagementService - 07_addresource_neg.py: PASS VirtualSystemManagementService - 08_modifyresource.py: PASS VirtualSystemManagementService - 09_procrasd_persist.py: FAIL ERROR - limit is 0, expected 256 ERROR - rstest_domain CPU scheduling not set properly VirtualSystemMigrationCapabilities - 01_enum.py: PASS VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS VirtualSystemMigrationService - 01_migratable_host.py: PASS VirtualSystemMigrationService - 02_host_migrate_type.py: PASS VirtualSystemMigrationService - 05_migratable_host_errs.py: PASS VirtualSystemMigrationSettingData - 01_enum.py: PASS VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS VirtualSystemSettingDataComponent - 01_forward.py: PASS VirtualSystemSettingDataComponent - 02_reverse.py: PASS VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS VirtualSystemSnapshotService - 01_enum.py: PASS VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922403 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 -------------- next part -------------- An HTML attachment was scrubbed... URL: From deeptik at linux.vnet.ibm.com Mon Jul 21 10:27:35 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Mon, 21 Jul 2008 15:57:35 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Enabling 02_reverse.py with XenFV, KVM, LXC and modified logicaldevices.py to work for all virt types In-Reply-To: <4883AEE8.9040202@linux.vnet.ibm.com> References: <4883AEE8.9040202@linux.vnet.ibm.com> Message-ID: <48846497.3080907@linux.vnet.ibm.com> Kaitlin Rupert wrote: > >> +def verify_eafp_values(server, virt, in_pllist, test_disk): >> + # Looping through the in_pllist to get association for various pools. >> + eafp_values = eafp_list(virt, test_disk) >> + an = get_typed_class(virt, "ElementAllocatedFromPool") >> + for cn, instid in sorted(in_pllist.iteritems()): >> + try: >> + assoc_info = Associators(server, an, cn, virt, InstanceID = instid) >> + assoc_inst_list = get_inst_for_dom(assoc_info) >> + if len(assoc_inst_list) < 1 : >> + logger.error("'%s' with '%s' did not return any records for" >> + " domain: '%s'", an, cn, test_dom) > > This should be; > > logger.error("'%s' should have returned '%i' Processor" > " details, got '%i'" % (an, test_vcpus, > len(assoc_inst_list))) > > If you use commas instead, the formatting of the string is off. > The above log stmt is just not for Processor. I will try to make it better. I did not find any formatting difference by using Commas and I got the same o/p for with/without commas. Did I misunderstand something ? >> + return FAIL >> >> -def assoc_values(assoc_list, field , list, index, >> specific_fields_list=""): >> - """ >> - Verifying the records retruned by the associations. >> - """ >> - global status >> - if field == "CreationClassName": >> - for i in range(len(assoc_list)): >> - if assoc_list[i][field] != list[index]: >> - print_error(field, assoc_list[i][field], list[index]) >> + assoc_eafp_info = assoc_inst_list[0] >> + CCName = assoc_eafp_info['CreationClassName'] >> + if CCName == get_typed_class(virt, 'Processor'): >> + if len(assoc_inst_list) != test_vcpus: >> + logger.error("'%s' should have returned '%i' Processor" >> + " details, got '%i'", an, test_vcpus, + len(assoc_inst_list)) > > Same here - format the log message using % (an, test_vcpus, > len(assoc_inst_list)) > >> + >> + # Verify DiskPool on machine >> + status, diskid = create_diskpool_conf(server, virt) >> + if status != PASS: >> + return status >> + >> + ret = vsxml.create(server) >> + if not ret: >> + logger.error("Failed to Create the dom: '%s'", test_dom) > > Will need to call cleanup_restore() in case of error. > Yes, I missed this one. I will include this as well. >> return FAIL >> > >> sys.exit(main()) >> diff -r 3703b7be5a10 -r f8f6995ce089 >> suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py >> --- a/suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py Wed Jul 16 >> 07:23:32 2008 -0700 >> +++ b/suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py Fri Jul 18 >> 05:29:39 2008 -0700 >> @@ -23,6 +23,7 @@ import os > >> >> -def verify_proc_values(assoc_info, list_values): > > Instead of having a verify_<>_values function for each device type, > could these be condensed into one function? All of them check the > CreationClassName and the DeviceID, which isn't needed. The function > could take the classname, which would enable you to determine with > values need to be checked. > > > I think DeviceID is a very important field that needs to be checked. Did you mean I should skip checking CreationClassName and DeviceID and check only Device specific details ? Thanks and Regards, Deepti. From deeptik at linux.vnet.ibm.com Mon Jul 21 12:22:31 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Mon, 21 Jul 2008 17:52:31 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix potiential false positive in AC 01 In-Reply-To: References: Message-ID: <48847F87.7000102@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1216502229 25200 > # Node ID de486893703609719ea79d53ee64828537826211 > # Parent 3703b7be5a107c67e901546978e974546b3d5562 > [TEST] #2 Fix potiential false positive in AC 01. > > This test needs to verify enum of AC returns the same number of instances as the number of instances returned by enum of MemoryPool + ProcessorPool + DiskPool + NetworkPool. > > Also, cleaned up the logic to verify that the ResourceType and the InstanceIDs of the AC instances match the Pool instances they're describing. > > Updates form 1 to 2: > -Create a disk pool and network pool to ensure there is an instance for each pool type. > -Add comment explaining the purpose of the test. > > Signed-off-by: Kaitlin Rupert > > diff -r 3703b7be5a10 -r de4868937036 suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py > --- a/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Wed Jul 16 07:23:32 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Sat Jul 19 14:17:09 2008 -0700 > @@ -20,63 +20,97 @@ > # 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 verifies the enum of AC returns the same number of instances as > +# the number of instances returned by enum of: > +# MemoryPool + ProcessorPool + DiskPool + NetworkPool. > +# > > import sys > +from VirtLib.live import virsh_version > from XenKvmLib import enumclass > from CimTest.Globals import do_main > from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, platform_sup > from CimTest.ReturnCodes import PASS, FAIL > +from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ > + create_netpool_conf, destroy_netpool > > sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > + > +def enum_pools_and_ac(ip, virt, cn): > + pools = {} > + ac = [] > + > + pt = ['MemoryPool', 'ProcessorPool', 'DiskPool', 'NetworkPool'] > + > + try: > + key = ["InstanceID"] > + ac = enumclass.enumerate(ip, cn, key, virt) > + > + for p in pt: > + enum_list = enumclass.enumerate(ip, p, key, virt) > + > + if len(enum_list) < 1: > + logger.error("%s did not return any instances" % p) > + return pools, ac > + > + for pool in enum_list: > + pools[pool.InstanceID] = pool > + > + except Exception, details: > + logger.error(CIM_ERROR_ENUMERATE, cn) > + logger.error(details) > + return pools, ac > + > + if len(ac) != len(pools): > + logger.error("%s returned %s instances, expected %s" % (cn, len(ac), > + len(pools))) > + return pools, ac > + > +def compare_pool_to_ac(ac, pools, cn): > + try: > + for inst in ac: > + id = inst.InstanceID > + if pools[id].ResourceType != inst.ResourceType: > + logger.error("%s ResourceType %s, Pool ResourceType %s" % (cn, > + inst.ResourceType, pools[id].ResourceType)) > + return FAIL > + > + except Exception, details: > + logger.error("%s returned instance with unexpected InstanceID %s" % (cn, > + details)) > + return FAIL > + > + return PASS > + > @do_main(sup_types) > def main(): > options = main.options > > - pools = {} > - pt = ['MemoryPool', 'ProcessorPool', 'DiskPool', 'NetworkPool'] > - try: > - key_list = ["InstanceID"] > - ac = enumclass.enumerate(options.ip, > - "AllocationCapabilities", > - key_list, > - options.virt) > - pools['MemoryPool'] = enumclass.enumerate(options.ip, > - "MemoryPool", > - key_list, > - options.virt) > - pools['ProcessorPool'] = enumclass.enumerate(options.ip, > - "ProcessorPool", > - key_list, > - options.virt) > - pools['DiskPool'] = enumclass.enumerate(options.ip, > - "DiskPool", > - key_list, > - options.virt) > - pools['NetworkPool'] = enumclass.enumerate(options.ip, > - "NetworkPool", > - key_list, > - options.virt) > - except Exception: > - logger.error(CIM_ERROR_ENUMERATE, '%s_AllocationCapabilities' % options.virt) > - return FAIL > - > - acset = set([(x.InstanceID, x.ResourceType) for x in ac]) > - poolset = set() > - for pl in pools.values(): > - for x in pl: > - poolset.add((x.InstanceID, x.ResourceType)) > + cn = 'AllocationCapabilities' > > - if len(acset) != len(poolset): > - logger.error( > - 'AllocationCapabilities return %i instances, excepted %i' > - % (ac_size, pool_size)) > - return FAIL > - zeroset = acset - poolset > - if len(zeroset) != 0: > - logger.error('AC is inconsistent with pools') > + status, diskid = create_diskpool_conf(options.ip, options.virt) > + if status != PASS: > + cleanup_restore(options.ip, options.virt) > + return FAIL > + > + status, test_network = create_netpool_conf(options.ip, options.virt) > + if status != PASS: > + cleanup_restore(options.ip, options.virt) > + destroy_netpool(options.ip, options.virt, test_network) > + return FAIL > + > + pools, ac = enum_pools_and_ac(options.ip, options.virt, cn) > + if len(pools) < 1: > + cleanup_restore(options.ip, options.virt) > + destroy_netpool(options.ip, options.virt, test_network) > return FAIL > I think the check used in the prev patch, len(ac) != len(pools) is better and also we should be checking len(ac) != 4 to make sure that AC values == enum of MemoryPool + ProcessorPool + DiskPool + NetworkPool. Any specific reason for not doing this ? otherwise +1 for me. Thanks and Regards, Deepti. > - return PASS > + status = compare_pool_to_ac(ac, pools, cn) > + > + cleanup_restore(options.ip, options.virt) > + destroy_netpool(options.ip, options.virt, test_network) > + > + 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 > From 072021096 at fudan.edu.cn Mon Jul 21 12:30:28 2008 From: 072021096 at fudan.edu.cn (072021096) Date: Mon, 21 Jul 2008 20:30:28 +0800 Subject: [Libvirt-cim] Look for offical realease of libvirt-cim Message-ID: Hi, everyone Because I am at school,so I can not log on to the FTP of libvirt.org, so I can not get the offical realease of libvirt-cim, and I can only get the versions with bugs, is there another way to get a offical realease tarball libvirt-cim? Thank you all respectful engineers for your previous kind reply and you really help me solve a lot problems! Best Wishes! Sean_Ggz from China From veillard at redhat.com Mon Jul 21 13:08:52 2008 From: veillard at redhat.com (Daniel Veillard) Date: Mon, 21 Jul 2008 09:08:52 -0400 Subject: [Libvirt-cim] Look for offical realease of libvirt-cim In-Reply-To: References: Message-ID: <20080721130851.GG16644@redhat.com> On Mon, Jul 21, 2008 at 08:30:28PM +0800, 072021096 wrote: > Hi, everyone > Because I am at school,so I can not log on to the FTP of libvirt.org, so I can not get the offical realease of libvirt-cim, and I can only get the versions with bugs, is there another way to get a offical realease tarball libvirt-cim? > Thank you all respectful engineers for your previous kind reply and you really help me solve a lot problems! I don't know what you mean by 'versions with bugs', if you find bugs you should report them, and i didn't see any such report and your compilation problems are not libvirt-cim bugs, really ! If you can't get FTP to work, I assume HTTP does work even from Shanghai: http://libvirt.org/sources/CIM/ 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 kaitlin at linux.vnet.ibm.com Mon Jul 21 14:30:23 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 07:30:23 -0700 Subject: [Libvirt-cim] Cimtest Report for Xen on RHEL5.2 (2008/07/21) In-Reply-To: References: Message-ID: <48849D7F.7020307@linux.vnet.ibm.com> > LogicalDisk - 02_nodevs.py: FAIL > ERROR - LogicalDisk returned 1 instead of empty list > Memory - 01_memory.py: FAIL > ERROR - Capacity should be 262144 MB instead of 131072 MB > VirtualSystemManagementService - 09_procrasd_persist.py: FAIL > ERROR - limit is 0, expected 256 > ERROR - rstest_domain CPU scheduling not set properly Hi Daisy, These look like they failed for a reason other than the libvirt caching issue. Can you look into why they failed? Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Mon Jul 21 14:43:07 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 21 Jul 2008 07:43:07 -0700 Subject: [Libvirt-cim] [PATCH] Add CMSetObjectPath macro In-Reply-To: (Kaitlin Rupert's message of "Fri, 18 Jul 2008 15:41:01 -0700") References: Message-ID: <87k5ffnvr8.fsf@caffeine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1216418936 25200 KR> # Node ID abbc6e3b451614f7bd2965f95d70b6695ad25968 KR> # Parent ec88dc805bcdc63d30b866e3e527208fa684e274 KR> Add CMSetObjectPath macro. KR> This is a work around. SFCB currently doesn't implement KR> CMSetObjectPath, so the VSMS provider seg faults. Perhaps this should go in a header somewhere so that further attempts to use CMSetObjectPath() don't fail when testing on SFCB down the road? -- 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 Jul 21 14:52:09 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 07:52:09 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix potiential false positive in AC 01 In-Reply-To: <48847F87.7000102@linux.vnet.ibm.com> References: <48847F87.7000102@linux.vnet.ibm.com> Message-ID: <4884A299.7050701@linux.vnet.ibm.com> >> +def enum_pools_and_ac(ip, virt, cn): >> + pools = {} >> + ac = [] >> + >> + pt = ['MemoryPool', 'ProcessorPool', 'DiskPool', 'NetworkPool'] >> + >> + try: >> + key = ["InstanceID"] >> + ac = enumclass.enumerate(ip, cn, key, virt) >> + >> + for p in pt: >> + enum_list = enumclass.enumerate(ip, p, key, virt) >> + >> + if len(enum_list) < 1: >> + logger.error("%s did not return any instances" % p) >> + return pools, ac + >> + for pool in enum_list: >> + pools[pool.InstanceID] = pool + >> + except Exception, details: >> + logger.error(CIM_ERROR_ENUMERATE, cn) >> + logger.error(details) >> + return pools, ac + >> + if len(ac) != len(pools): >> + logger.error("%s returned %s instances, expected %s" % (cn, >> len(ac), + len(pools))) >> + return pools, ac + >> enum_pools_and_ac(options.ip, options.virt, cn) >> + if len(pools) < 1: >> + cleanup_restore(options.ip, options.virt) >> + destroy_netpool(options.ip, options.virt, test_network) >> return FAIL >> > I think the check used in the prev patch, len(ac) != len(pools) is > better This check is still here - it's included in the enum_pools_and_ac() function. See the piece quoted above. It can be moved outside of this function to help with clarity. and also we should be checking len(ac) != 4 to make sure that AC > values == enum of MemoryPool + ProcessorPool + DiskPool + NetworkPool. > Any specific reason for not doing this ? > otherwise +1 for me. You can't guarantee 4 pools. The test creates a disk pool and a network pool, but it's possible for additional net and disk pools to exist on the system. That's why you want to check len(ac) != len(pools). -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Mon Jul 21 15:07:35 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 21 Jul 2008 08:07:35 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix potiential false positive in CS 02 In-Reply-To: <48825BD7.3070501@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Sat, 19 Jul 2008 14:25:43 -0700") References: <0a4bc49a1fbde309070f.1215718807@elm3b41.beaverton.ibm.com> <487F1A1D.70500@linux.vnet.ibm.com> <87wsjjqohd.fsf@caffeine.beaverton.ibm.com> <48825BD7.3070501@linux.vnet.ibm.com> Message-ID: <87fxq3numg.fsf@caffeine.beaverton.ibm.com> KR> Is this test really checking to make sure EnumInstances() doesn't KR> return an error? If so, the name of the test is misleading. And KR> other tests cover this already (CS 01_enum.py). Well, I looked at the current test, as well as the original version of it and I'm all confused now. I thought it was doing something different than it is (and was). So, as you say, I think it makes sense to remove Xen and XenFV from the list of runnable platforms and let this test ensure that the providers can handle the case where there are no domains on the system for LXC and KVM. -- 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 Jul 21 15:13:59 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 08:13:59 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Enabling 02_reverse.py with XenFV, KVM, LXC and modified logicaldevices.py to work for all virt types In-Reply-To: <48846497.3080907@linux.vnet.ibm.com> References: <4883AEE8.9040202@linux.vnet.ibm.com> <48846497.3080907@linux.vnet.ibm.com> Message-ID: <4884A7B7.7080502@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > > > Kaitlin Rupert wrote: >> >>> +def verify_eafp_values(server, virt, in_pllist, test_disk): >>> + # Looping through the in_pllist to get association for various pools. >>> + eafp_values = eafp_list(virt, test_disk) >>> + an = get_typed_class(virt, "ElementAllocatedFromPool") >>> + for cn, instid in sorted(in_pllist.iteritems()): >>> + try: >>> + assoc_info = Associators(server, an, cn, virt, InstanceID = instid) >>> + assoc_inst_list = get_inst_for_dom(assoc_info) >>> + if len(assoc_inst_list) < 1 : >>> + logger.error("'%s' with '%s' did not return any records for" >>> + " domain: '%s'", an, cn, test_dom) >> >> This should be; >> >> logger.error("'%s' should have returned '%i' Processor" >> " details, got '%i'" % (an, test_vcpus, >> len(assoc_inst_list))) >> >> If you use commas instead, the formatting of the string is off. >> > The above log stmt is just not for Processor. Oops, you are right. Sorry, I had copied this from a different part of the code and pasted it here accidentally. It should be: logger.error("'%s' with '%s' did not return any records for" " domain: '%s'" % (an, cn, test_dom)) I will try to make it better. > I did not find any formatting difference by using Commas and I got the > same o/p for with/without commas. > Did I misunderstand something ? You're right, it is printing correctly. In the past, I'd seen the string not be formatted correctly with the arguments passed this way. But maybe that was an old issue. It appears to be working fine now. You can ignore this comment. =) >>> >>> -def verify_proc_values(assoc_info, list_values): >> >> Instead of having a verify_<>_values function for each device type, >> could these be condensed into one function? All of them check the >> CreationClassName and the DeviceID, which isn't needed. The function >> could take the classname, which would enable you to determine with >> values need to be checked. >> >> >> > I think DeviceID is a very important field that needs to be checked. Did > you mean I should skip checking CreationClassName and DeviceID and check > only Device specific details ? I agree - I think checking the DeviceID is important. What I meant is that it's redundant to have each function checking the same value. I think these could be consolidated into something like: def verify_device_values(assoc_info, list_values, cn, virt='Xen'): values = list_values[cn] if assoc_info['CreationClassName'] != values['CreationClassName']: field_err(assoc_info, values, fieldname = 'CreationClassName') return FAIL if assoc_info['DeviceID'] != values['DeviceID']: field_err(assoc_info, values, fieldname = 'DeviceID') return FAIL if cn == get_typed_class(virt, 'Processor'): sysname = assoc_info['SystemName'] if sysname != values['SystemName']: spec_err(sysname, values, fieldname = 'SystemName') return FAIL # Handle other device types here return PASS If you think it's cleaner, you could have something like: if cn == get_typed_class(virt, 'Processor'): return verify_proc_values() Either approach is fine. Creating one function (or a wrapper function) will clean up the elif portion of verify_eafp_values() some. Thoughts? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Jul 21 15:16:14 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 08:16:14 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix potiential false positive in CS 02 In-Reply-To: <87fxq3numg.fsf@caffeine.beaverton.ibm.com> References: <0a4bc49a1fbde309070f.1215718807@elm3b41.beaverton.ibm.com> <487F1A1D.70500@linux.vnet.ibm.com> <87wsjjqohd.fsf@caffeine.beaverton.ibm.com> <48825BD7.3070501@linux.vnet.ibm.com> <87fxq3numg.fsf@caffeine.beaverton.ibm.com> Message-ID: <4884A83E.7080207@linux.vnet.ibm.com> Dan Smith wrote: > KR> Is this test really checking to make sure EnumInstances() doesn't > KR> return an error? If so, the name of the test is misleading. And > KR> other tests cover this already (CS 01_enum.py). > > Well, I looked at the current test, as well as the original version of > it and I'm all confused now. I thought it was doing something > different than it is (and was). So, as you say, I think it makes > sense to remove Xen and XenFV from the list of runnable platforms and > let this test ensure that the providers can handle the case where > there are no domains on the system for LXC and KVM. > Sure, that works for me. Right now, I have Xen and XenFV in the list (the test should always skip on them). I'll send an updated patch that fixes this test so that it is KVM and LXC only. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Jul 21 15:35:55 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 08:35:55 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix potiential false positive in CS 02 Message-ID: <29ede6f3ff473886fa92.1216654555@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1216654535 25200 # Node ID 29ede6f3ff473886fa928a83fd62a0a192493b7e # Parent de486893703609719ea79d53ee64828537826211 [TEST] #2 Fix potiential false positive in CS 02. Also make it so that the test skips if domain_list() returns anything > 0. This test used to be a Xen only test, so the test was only being run if there were no other guests besides Dom0. However, CS EnumInstances treats Dom0 as any other guest, so it only makes sense to run this test on KVM and LXC. If computersystem.enumerate() encounters an exception, raise an exception so that the calling test case fail appropriately. We could return FAIL in this case, but raising an exception is more descriptive. Also, other tests that call computersystem.enumerate() don't need to be modified because the number of arguments returned doesn't change. Updates from 1 to 2: -Remove Xen and XenFV from the supported platforms list. Signed-off-by: Kaitlin Rupert diff -r de4868937036 -r 29ede6f3ff47 suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py Sat Jul 19 14:17:09 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py Mon Jul 21 08:35:35 2008 -0700 @@ -27,15 +27,15 @@ from XenKvmLib import computersystem from VirtLib import live from VirtLib import utils -from CimTest.Globals import logger +from CimTest.Globals import logger, CIM_ERROR_ENUMERATE from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL, SKIP -sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] +sup_types = ['KVM', 'LXC'] def clean_system(host, virt): l = live.domain_list(host, virt) - if len(l) > 1: + if len(l) > 0: return False else: return True @@ -43,19 +43,28 @@ @do_main(sup_types) def main(): options = main.options + if not clean_system(options.ip, options.virt): logger.error("System has defined domains; unable to run") return SKIP - status = PASS + cn = "%s_ComputerSystem" % options.virt - cs = computersystem.enumerate(options.ip, options.virt) + try: + cs = computersystem.enumerate(options.ip, options.virt) - if cs.__class__ == str: - logger.error("Got error instead of empty list: %s" % cs) + except Exception, details: + logger.error(CIM_ERROR_ENUMERATE, cn) + logger.error(details) + return FAIL + + if len(cs) != 0: + logger.error("%s returned %d instead of empty list" % (cn, len(cs))) status = FAIL + else: + status = PASS - return status + return status if __name__ == "__main__": sys.exit(main()) diff -r de4868937036 -r 29ede6f3ff47 suites/libvirt-cim/lib/XenKvmLib/computersystem.py --- a/suites/libvirt-cim/lib/XenKvmLib/computersystem.py Sat Jul 19 14:17:09 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/computersystem.py Mon Jul 21 08:35:35 2008 -0700 @@ -85,7 +85,7 @@ try: instances = conn.EnumerateInstances(classname) except pywbem.CIMError, arg: - print arg[1] + raise Exception(arg[1]) return [] list = [] From danms at us.ibm.com Mon Jul 21 15:46:23 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 21 Jul 2008 08:46:23 -0700 Subject: [Libvirt-cim] [TEST] Cimtest Report for LXC on F9 (2008/07/21) In-Reply-To: (Guo Lian Yun's message of "Mon, 21 Jul 2008 14:32:00 +0800") References: Message-ID: <873am3nsts.fsf@caffeine.beaverton.ibm.com> GY> NetworkPort - 01_netport.py: SKIP GY> NetworkPort - 02_np_gi_errors.py: SKIP GY> NetworkPort - 03_user_netport.py: SKIP Can you run these tests against a CVS snapshot of libvirt to see if they pass? There should be enough network support in the CVS tree to support running these 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 Mon Jul 21 16:16:10 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 09:16:10 -0700 Subject: [Libvirt-cim] [TEST] Cimtest Report for LXC on F9 (2008/07/21) In-Reply-To: <873am3nsts.fsf@caffeine.beaverton.ibm.com> References: <873am3nsts.fsf@caffeine.beaverton.ibm.com> Message-ID: <4884B64A.2070109@linux.vnet.ibm.com> Dan Smith wrote: > GY> NetworkPort - 01_netport.py: SKIP > GY> NetworkPort - 02_np_gi_errors.py: SKIP > GY> NetworkPort - 03_user_netport.py: SKIP > > Can you run these tests against a CVS snapshot of libvirt to see if > they pass? There should be enough network support in the CVS tree to > support running these > 03_user_netport.py should pass. It's KVM only currently. I don't see LXC_NET_USER in the lxc_conf.h. Do you know if LXC supports the user interface type? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Jul 21 16:18:14 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 09:18:14 -0700 Subject: [Libvirt-cim] [TEST] Cimtest Report for LXC on F9 (2008/07/21) In-Reply-To: <4884B64A.2070109@linux.vnet.ibm.com> References: <873am3nsts.fsf@caffeine.beaverton.ibm.com> <4884B64A.2070109@linux.vnet.ibm.com> Message-ID: <4884B6C6.1020208@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Dan Smith wrote: >> GY> NetworkPort - 01_netport.py: SKIP >> GY> NetworkPort - 02_np_gi_errors.py: SKIP >> GY> NetworkPort - 03_user_netport.py: SKIP >> >> Can you run these tests against a CVS snapshot of libvirt to see if >> they pass? There should be enough network support in the CVS tree to >> support running these >> > > 03_user_netport.py should pass. It's KVM only currently. I don't see > LXC_NET_USER in the lxc_conf.h. Do you know if LXC supports the user > interface type? > Sorry, for the typo. That should be "03_user_netport.py should skip". -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Jul 21 16:25:19 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 09:25:19 -0700 Subject: [Libvirt-cim] [PATCH] (#2) Add CMSetObjectPath macro Message-ID: <6e310fe7bde3d3a43740.1216657519@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1216656146 25200 # Node ID 6e310fe7bde3d3a43740b1d2a155c8503b25bcc7 # Parent ec88dc805bcdc63d30b866e3e527208fa684e274 (#2) Add CMSetObjectPath macro. This is a work around. SFCB currently doesn't implement CMSetObjectPath, so the VSMS provider seg faults. Updates: -Place CMSetObjectPath define in misc_util.h Signed-off-by: Kaitlin Rupert diff -r ec88dc805bcd -r 6e310fe7bde3 libxkutil/misc_util.h --- a/libxkutil/misc_util.h Wed Jul 09 13:48:14 2008 -0700 +++ b/libxkutil/misc_util.h Mon Jul 21 09:02:26 2008 -0700 @@ -33,6 +33,12 @@ #include #include + +#undef CMSetObjectPath +#define CMSetObjectPath(i,p) do { \ + if (i->ft->setObjectPath != NULL) \ + i->ft->setObjectPath(i, p); \ + } while (0); /* Check if the provider is reponsible for the given class: * e.g. Xen is running on the system and KVM_... is asked for, From danms at us.ibm.com Mon Jul 21 16:30:30 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 21 Jul 2008 09:30:30 -0700 Subject: [Libvirt-cim] [TEST] Cimtest Report for LXC on F9 (2008/07/21) In-Reply-To: <4884B64A.2070109@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Mon, 21 Jul 2008 09:16:10 -0700") References: <873am3nsts.fsf@caffeine.beaverton.ibm.com> <4884B64A.2070109@linux.vnet.ibm.com> Message-ID: <87vdyzmc7t.fsf@caffeine.beaverton.ibm.com> KR> 03_user_netport.py should pass. It's KVM only currently. I don't see KR> LXC_NET_USER in the lxc_conf.h. Do you know if LXC supports the user KR> interface type? No, that wouldn't make much sense in an LXC environment. I can't really see libvirt supporting anything other than the 'network' type. -- 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 Jul 21 16:38:46 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 09:38:46 -0700 Subject: [Libvirt-cim] Cimtest Report for LXC on F9 (2008/07/07) In-Reply-To: References: Message-ID: <4884BB96.1060202@linux.vnet.ibm.com> Guo Lian Yun wrote: > > libvirt-cim-bounces at redhat.com wrote on 2008-07-07 23:14:43: > > > > > ComputerSystem - 04_defineStartVS.py: FAIL > > > > ERROR - Error: property values are not set for VS domguest > > > > > > > I'm not sure why it fails sometimes, it pass on for me on the next > > > running. > > > > Have you run the test with the provider debug enabled? Does the > > provider debug give any hints? > > This fails because the defined domain isn't started successfully every > time. > If it can't be started, the EnabledState still equals to 3 not 2. Below > is part of test case code. > > ...... > enabState = cs.EnabledState > if enabState == 2: > status = PASS > break > ....... > > I try to export the debug info, it seems that there is not much useful > info. The guest isn't starting because the console is defined in the following manner: /dev/ptmx It should be defined as: Daisy, can you work up a patch for this? Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Mon Jul 21 12:37:16 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Mon, 21 Jul 2008 18:07:16 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix CS 22 to use providers instead of virsh In-Reply-To: <26723e615b002509d1a9.1216507121@elm3b41.beaverton.ibm.com> References: <26723e615b002509d1a9.1216507121@elm3b41.beaverton.ibm.com> Message-ID: <488482FC.2070901@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1216507114 25200 > # Node ID 26723e615b002509d1a91b5669d463b8132fadfc > # Parent 0ebcf05bf74b7a798e99afc8c4361b183fbfc6ee > [TEST] #2 Fix CS 22 to use providers instead of virsh. > > This test was defining a guest with virsh and then suspending it with virsh, which doesn't touch the providers in anyway. Now the test calls DefineSystem() and RequestStateChange(). > > Updates from 1 to 2: > -Add check to verify guest is the expected state after the RequestStateChange() call. > -Create a network pool because the VSMS provider requires a network pool to exist in order to create a guest. > > Signed-off-by: Kaitlin Rupert > > diff -r 0ebcf05bf74b -r 26723e615b00 suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py > --- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Sat Jul 19 15:14:33 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Sat Jul 19 15:38:34 2008 -0700 > @@ -32,54 +32,72 @@ > from XenKvmLib import computersystem > from VirtLib import utils > from XenKvmLib import vxml > -from XenKvmLib.test_doms import destroy_and_undefine_all > -from CimTest.Globals import do_main > -from CimTest import Globals > +from XenKvmLib.test_doms import destroy_and_undefine_domain > +from CimTest.Globals import do_main, logger > from CimTest.ReturnCodes import PASS, FAIL > +from XenKvmLib.common_util import create_using_definesystem, \ > + call_request_state_change, get_cs_instance, \ > + create_netpool_conf, destroy_netpool > > sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > test_dom = "domgst" > > +DEFINE_STATE = 3 > +SUSPND_STATE = 9 > +TIME = "00000000000000.000000:000" > + > +def chk_state(domain_name, ip, en_state, virt): > + rc, cs = get_cs_instance(domain_name, ip, virt) > + if rc != 0: > + return rc > + > + if cs.EnabledState != en_state: > + logger.error("EnabledState should be %d not %d", > + en_state, cs.EnabledState) > + return FAIL > + > + return PASS > + > @do_main(sup_types) > def main(): > options = main.options > - status = FAIL > - > - cxml = vxml.get_class(options.virt)(test_dom) > > -#define VS > + status, test_network = create_netpool_conf(options.ip, options.virt) > + if status != PASS: > + destroy_netpool(options.ip, options.virt, test_network) > Why do we require to call destroy_netpool() when it is not created successfully? > + return FAIL > + > try: > - ret = cxml.define(options.ip) > - if not ret: > - Globals.logger.error(Globals.VIRSH_ERROR_DEFINE % test_dom) > - return status > - > - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) > - if not (cs.Name == test_dom) : > - Globals.logger.error("Error: VS %s not found" % test_dom) > - cxml.undefine(options.ip) > + # define the vs > + status = create_using_definesystem(test_dom, options.ip, > + virt=options.virt) > + if status != PASS: > + logger.error("Unable to define %s using DefineSystem()" % test_dom) > + destroy_netpool(options.ip, options.virt, test_network) > return status > > - except Exception, detail: > - Globals.logger.error("Errors: %s" % detail) > + # suspend the vs > + status = call_request_state_change(test_dom, options.ip, SUSPND_STATE, > + TIME, virt=options.virt) > + if status != PASS: > + logger.info("Suspending defined %s failed, as expected" % test_dom) > + status = PASS > > -#Suspend the defined VS > - > - try: > - ret = cxml.run_virsh_cmd(options.ip, "suspend") > - if not ret : > - Globals.logger.info("Suspending defined VS %s failed, as expected" \ > -% test_dom) > - status = PASS > + status = chk_state(test_dom, options.ip, DEFINE_STATE, options.virt) > + if status != PASS: > + logger.error("%s not in defined state as expected." % test_dom) > + status = FAIL > + > I think the log stmt here is misleading. We are trying to move from Define to Suspend, aint? I think the log stmt should be as below: logger.error("%s not in suspend state as expected." % test_dom) Thanks and Regards, Deepti. > else : > - Globals.logger.info("Error: Suspending defined VS %s should not \ > -have been allowed" % test_dom) > + logger.error("Suspending defined %s should have failed" % test_dom) > status = FAIL > > except Exception, detail: > - Globals.logger.error("Error: %s" % detail) > + logger.error("Error: %s" % detail) > + status = FAIL > > - ret = cxml.undefine(options.ip) > + destroy_netpool(options.ip, options.virt, test_network) > + destroy_and_undefine_domain(test_dom, options.ip, options.virt) > 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 Mon Jul 21 17:30:13 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 10:30:13 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix CS 22 to use providers instead of virsh In-Reply-To: <488482FC.2070901@linux.vnet.ibm.com> References: <26723e615b002509d1a9.1216507121@elm3b41.beaverton.ibm.com> <488482FC.2070901@linux.vnet.ibm.com> Message-ID: <4884C7A5.4060204@linux.vnet.ibm.com> >> >> -#define VS >> + status, test_network = create_netpool_conf(options.ip, options.virt) >> + if status != PASS: >> + destroy_netpool(options.ip, options.virt, test_network) >> > Why do we require to call destroy_netpool() when it is not created > successfully? Nope, this is a good point. I'll remove it and send a new patch. >> -#Suspend the defined VS >> - - try: >> - ret = cxml.run_virsh_cmd(options.ip, "suspend") >> - if not ret : >> - Globals.logger.info("Suspending defined VS %s failed, as >> expected" \ >> -% test_dom) >> - status = PASS >> + status = chk_state(test_dom, options.ip, DEFINE_STATE, >> options.virt) >> + if status != PASS: >> + logger.error("%s not in defined state as expected." % >> test_dom) >> + status = FAIL + > I think the log stmt here is misleading. > We are trying to move from Define to Suspend, aint? Correct. However, suspending a defined guest is not supported, so we expect the call to RSC() to fail. Because of that, we expect the guest to remain in the defined state. If the guest is in some other state, then we've encountered some unknown behavior and should fail. > I think the log stmt should be as below: > > logger.error("%s not in suspend state as expected." % test_dom) The chk_state() call is verifying that the guest is in the defined state, not the suspended state. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Jul 21 17:36:35 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 10:36:35 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #3 Fix CS 22 to use providers instead of virsh Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1216661611 25200 # Node ID abcd4c8a873656b6f12c4416832d185f8c9eb151 # Parent 18d3c235f0c893f934aaf61f9a1de22ed6f3dd60 [TEST] #3 Fix CS 22 to use providers instead of virsh. This test was defining a guest with virsh and then suspending it with virsh, which doesn't touch the providers in anyway. Now the test calls DefineSystem() and RequestStateChange(). Updates from 1 to 2: -Add check to verify guest is the expected state after the RequestStateChange() call. -Create a network pool because the VSMS provider requires a network pool to exist in order to create a guest. Updates from 2 to 3: -Remove destroy_netpool() if create_netpool_conf() fails. This is not needed. Signed-off-by: Kaitlin Rupert diff -r 18d3c235f0c8 -r abcd4c8a8736 suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Mon Jul 21 09:51:33 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Mon Jul 21 10:33:31 2008 -0700 @@ -32,54 +32,71 @@ from XenKvmLib import computersystem from VirtLib import utils from XenKvmLib import vxml -from XenKvmLib.test_doms import destroy_and_undefine_all -from CimTest.Globals import do_main -from CimTest import Globals +from XenKvmLib.test_doms import destroy_and_undefine_domain +from CimTest.Globals import do_main, logger from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.common_util import create_using_definesystem, \ + call_request_state_change, get_cs_instance, \ + create_netpool_conf, destroy_netpool sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "domgst" +DEFINE_STATE = 3 +SUSPND_STATE = 9 +TIME = "00000000000000.000000:000" + +def chk_state(domain_name, ip, en_state, virt): + rc, cs = get_cs_instance(domain_name, ip, virt) + if rc != 0: + return rc + + if cs.EnabledState != en_state: + logger.error("EnabledState should be %d not %d", + en_state, cs.EnabledState) + return FAIL + + return PASS + @do_main(sup_types) def main(): options = main.options - status = FAIL - - cxml = vxml.get_class(options.virt)(test_dom) -#define VS + status, test_network = create_netpool_conf(options.ip, options.virt) + if status != PASS: + return FAIL + try: - ret = cxml.define(options.ip) - if not ret: - Globals.logger.error(Globals.VIRSH_ERROR_DEFINE % test_dom) - return status - - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) - if not (cs.Name == test_dom) : - Globals.logger.error("Error: VS %s not found" % test_dom) - cxml.undefine(options.ip) + # define the vs + status = create_using_definesystem(test_dom, options.ip, + virt=options.virt) + if status != PASS: + logger.error("Unable to define %s using DefineSystem()" % test_dom) + destroy_netpool(options.ip, options.virt, test_network) return status - except Exception, detail: - Globals.logger.error("Errors: %s" % detail) + # suspend the vs + status = call_request_state_change(test_dom, options.ip, SUSPND_STATE, + TIME, virt=options.virt) + if status != PASS: + logger.info("Suspending defined %s failed, as expected" % test_dom) + status = PASS -#Suspend the defined VS - - try: - ret = cxml.run_virsh_cmd(options.ip, "suspend") - if not ret : - Globals.logger.info("Suspending defined VS %s failed, as expected" \ -% test_dom) - status = PASS + status = chk_state(test_dom, options.ip, DEFINE_STATE, options.virt) + if status != PASS: + logger.error("%s not in defined state as expected." % test_dom) + status = FAIL + else : - Globals.logger.info("Error: Suspending defined VS %s should not \ -have been allowed" % test_dom) + logger.error("Suspending defined %s should have failed" % test_dom) status = FAIL except Exception, detail: - Globals.logger.error("Error: %s" % detail) + logger.error("Error: %s" % detail) + status = FAIL - ret = cxml.undefine(options.ip) + destroy_netpool(options.ip, options.virt, test_network) + destroy_and_undefine_domain(test_dom, options.ip, options.virt) return status if __name__ == "__main__": From danms at us.ibm.com Mon Jul 21 20:28:19 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 21 Jul 2008 13:28:19 -0700 Subject: [Libvirt-cim] [PATCH] Add ReferenceConfiguration support to VSMS Message-ID: <427e74d2c45881820ee3.1216672099@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1216672093 25200 # Node ID 427e74d2c45881820ee33b8b6cdeb9cff57a68c0 # Parent 542f77ab01389702ff1358f04b0d55c8f052067a Add ReferenceConfiguration support to VSMS This accomplishes that goal by doing a full get_dominfo() instead of a blank dominfo alloc in the event that the client passed in a ReferenceConfiguration object path. Also fix a few unchecked calloc() calls while touching them. Also make sure we're only ever editing the first memory or processor device in the list, during the domain building process. Signed-off-by: Dan Smith diff -r 542f77ab0138 -r 427e74d2c458 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Jul 21 09:02:26 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Mon Jul 21 13:28:13 2008 -0700 @@ -68,24 +68,34 @@ static CMPIStatus define_system_parse_args(const CMPIArgs *argsin, CMPIInstance **sys, const char *ns, - CMPIArray **res) + CMPIArray **res, + CMPIObjectPath **refconf) { - CMPIStatus s = {CMPI_RC_ERR_FAILED, NULL}; + CMPIStatus s = {CMPI_RC_OK, NULL}; if (cu_get_inst_arg(argsin, "SystemSettings", sys) != CMPI_RC_OK) { CU_DEBUG("No SystemSettings string argument"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_INVALID_PARAMETER, + "Missing argument `SystemSettings'"); goto out; } if (cu_get_array_arg(argsin, "ResourceSettings", res) != CMPI_RC_OK) { CU_DEBUG("Failed to get array arg"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_INVALID_PARAMETER, + "Missing argument `ResourceSettings'"); goto out; } - cu_statusf(_BROKER, &s, - CMPI_RC_OK, - ""); + if (cu_get_ref_arg(argsin, "ReferenceConfiguration", refconf) != + CMPI_RC_OK) { + CU_DEBUG("Did not get ReferenceConfiguration arg"); + *refconf = NULL; + goto out; + } out: return s; } @@ -565,6 +575,20 @@ return msg; } +static bool make_space(struct virt_device **list, int cur, int new) +{ + struct virt_device *tmp; + + tmp = calloc(cur + new, sizeof(*tmp)); + if (tmp == NULL) + return false; + + memcpy(tmp, *list, sizeof(*tmp) * cur); + *list = tmp; + + return true; +} + static const char *classify_resources(CMPIArray *resources, const char *ns, struct domain *domain) @@ -573,17 +597,21 @@ uint16_t type; int count; - domain->dev_disk_ct = domain->dev_net_ct = 0; - domain->dev_vcpu_ct = domain->dev_mem_ct = 0; - count = CMGetArrayCount(resources, NULL); if (count < 1) return "No resources specified"; - domain->dev_disk = calloc(count, sizeof(struct virt_device)); - domain->dev_vcpu = calloc(count, sizeof(struct virt_device)); - domain->dev_mem = calloc(count, sizeof(struct virt_device)); - domain->dev_net = calloc(count, sizeof(struct virt_device)); + if (!make_space(&domain->dev_disk, domain->dev_disk_ct, count)) + return "Failed to alloc disk list"; + + if (!make_space(&domain->dev_vcpu, domain->dev_vcpu_ct, count)) + return "Failed to alloc vcpu list"; + + if (!make_space(&domain->dev_mem, domain->dev_mem_ct, count)) + return "Failed to alloc mem list"; + + if (!make_space(&domain->dev_net, domain->dev_net_ct, count)) + return "Failed to alloc net list"; for (i = 0; i < count; i++) { CMPIObjectPath *op; @@ -605,27 +633,29 @@ CMPI_RC_OK) return "Unable to determine resource type"; - if (type == CIM_RES_TYPE_PROC) + if (type == CIM_RES_TYPE_PROC) { + domain->dev_vcpu_ct = 1; msg = rasd_to_vdev(inst, domain, - &domain->dev_vcpu[domain->dev_vcpu_ct++], + &domain->dev_vcpu[0], ns); - else if (type == CIM_RES_TYPE_MEM) + } else if (type == CIM_RES_TYPE_MEM) { + domain->dev_mem_ct = 1; msg = rasd_to_vdev(inst, domain, - &domain->dev_mem[domain->dev_mem_ct++], + &domain->dev_mem[0], ns); - else if (type == CIM_RES_TYPE_DISK) + } else if (type == CIM_RES_TYPE_DISK) { msg = rasd_to_vdev(inst, domain, &domain->dev_disk[domain->dev_disk_ct++], ns); - else if (type == CIM_RES_TYPE_NET) + } else if (type == CIM_RES_TYPE_NET) { msg = rasd_to_vdev(inst, domain, &domain->dev_net[domain->dev_net_ct++], ns); - + } if (msg != NULL) return msg; @@ -722,23 +752,125 @@ return s; } +static CMPIStatus match_prefixes(const CMPIObjectPath *a, + const CMPIObjectPath *b) +{ + char *pfx1; + char *pfx2; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + pfx1 = class_prefix_name(CLASSNAME(a)); + pfx2 = class_prefix_name(CLASSNAME(b)); + + if ((pfx1 == NULL) || (pfx2 == NULL)) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable compare ReferenceConfiguration prefix"); + goto out; + } + + if (!STREQ(pfx1, pfx2)) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_INVALID_CLASS, + "ReferenceConfiguration domain is not compatible"); + goto out; + } + out: + free(pfx1); + free(pfx2); + + return s; +} + +static CMPIStatus get_reference_domain(struct domain **domain, + const CMPIObjectPath *ref, + const CMPIObjectPath *refconf) +{ + virConnectPtr conn = NULL; + virDomainPtr dom = NULL; + const char *name; + CMPIStatus s; + int ret; + + s = match_prefixes(ref, refconf); + if (s.rc != CMPI_RC_OK) + return s; + + conn = connect_by_classname(_BROKER, CLASSNAME(refconf), &s); + if (conn == NULL) { + if (s.rc != CMPI_RC_OK) + return s; + else { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to connect to libvirt"); + return s; + } + } + + if (cu_get_str_path(refconf, "Name", &name) != CMPI_RC_OK) { + CU_DEBUG("Missing Name parameter"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_INVALID_PARAMETER, + "Missing `Name' from ReferenceConfiguration"); + goto out; + } + + CU_DEBUG("Referenced domain: %s", name); + + dom = virDomainLookupByName(conn, name); + if (dom == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_NOT_FOUND, + "Referenced domain `%s' does not exist", name); + goto out; + } + + ret = get_dominfo(dom, domain); + if (ret == 0) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Error getting referenced configuration"); + goto out; + } + + /* Scrub the unique bits out of the reference domain config */ + free((*domain)->name); + (*domain)->name = NULL; + free((*domain)->uuid); + (*domain)->uuid = NULL; + + out: + virDomainFree(dom); + virConnectClose(conn); + + return s; +} + static CMPIInstance *create_system(CMPIInstance *vssd, CMPIArray *resources, const CMPIObjectPath *ref, + const CMPIObjectPath *refconf, CMPIStatus *s) { CMPIInstance *inst = NULL; char *xml = NULL; const char *msg = NULL; - struct domain *domain; + struct domain *domain = NULL; - domain = calloc(1, sizeof(*domain)); - if (domain == NULL) { - cu_statusf(_BROKER, s, - CMPI_RC_ERR_FAILED, - "Failed to allocate memory"); - goto out; + if (refconf != NULL) { + *s = get_reference_domain(&domain, ref, refconf); + if (s->rc != CMPI_RC_OK) + goto out; + } else { + domain = calloc(1, sizeof(*domain)); + if (domain == NULL) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Failed to allocate memory"); + goto out; + } } if (!vssd_to_domain(vssd, domain)) { @@ -795,6 +927,7 @@ const CMPIArgs *argsin, CMPIArgs *argsout) { + CMPIObjectPath *refconf; CMPIInstance *vssd; CMPIInstance *sys; CMPIArray *res; @@ -802,11 +935,15 @@ CU_DEBUG("DefineSystem"); - s = define_system_parse_args(argsin, &vssd, NAMESPACE(reference), &res); + s = define_system_parse_args(argsin, + &vssd, + NAMESPACE(reference), + &res, + &refconf); if (s.rc != CMPI_RC_OK) goto out; - sys = create_system(vssd, res, reference, &s); + sys = create_system(vssd, res, reference, refconf, &s); if (sys == NULL) goto out; From kaitlin at linux.vnet.ibm.com Mon Jul 21 22:37:44 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 15:37:44 -0700 Subject: [Libvirt-cim] [PATCH] Add ReferenceConfiguration support to VSMS In-Reply-To: <427e74d2c45881820ee3.1216672099@guaranine.danplanet.com> References: <427e74d2c45881820ee3.1216672099@guaranine.danplanet.com> Message-ID: <48850FB8.8060104@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1216672093 25200 > # Node ID 427e74d2c45881820ee33b8b6cdeb9cff57a68c0 > # Parent 542f77ab01389702ff1358f04b0d55c8f052067a > Add ReferenceConfiguration support to VSMS > > This accomplishes that goal by doing a full get_dominfo() instead of > a blank dominfo alloc in the event that the client passed in a > ReferenceConfiguration object path. > > Also fix a few unchecked calloc() calls while touching them. Also > make sure we're only ever editing the first memory or processor device > in the list, during the domain building process. > > Signed-off-by: Dan Smith > This looks good to me. I did some testing on my system as well. +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 22 00:34:00 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 17:34:00 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Fixes to support the ReferencedConfiguration VSMS param In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1216686405 25200 # Node ID e14f791f1cb4f84ed3cad03c9099d336e232fb48 # Parent abcd4c8a873656b6f12c4416832d185f8c9eb151 [TEST] Fixes to support the ReferencedConfiguration VSMS param. These changes are needed to create a test case that tests the ReferencedConfiguration VSMS parameter. Fixes: -Add ref_config param to create_using_definesystem() - allows the caller to specify a reference for the ReferenceConfiguration param -Add enumerate_names() - Calls EnumerateInstanceNames() so the caller can get a list of CS references -Fix default_vssd_rasd_str() so that is a mac address is supplied to the function, it is used instead of one of the const.<> values. Signed-off-by: Kaitlin Rupert diff -r abcd4c8a8736 -r e14f791f1cb4 suites/libvirt-cim/lib/XenKvmLib/common_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Mon Jul 21 10:33:31 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Mon Jul 21 17:26:45 2008 -0700 @@ -64,8 +64,8 @@ return (0, cs) -def create_using_definesystem(domain_name, ip, - params=None, exp_err=None, virt='Xen'): +def create_using_definesystem(domain_name, ip, params=None, ref_config=' ', + exp_err=None, virt='Xen'): bug = "85673" try: class_vsms = eval('vsms.' + \ @@ -89,7 +89,7 @@ service.DefineSystem(SystemSettings=vssd, ResourceSettings=rasd, - ReferenceConfiguration=' ') + ReferenceConfiguration=ref_config) except pywbem.CIMError, (rc, desc): if rc == exp_rc and desc.find(exp_desc) >= 0: logger.info('Got expected rc code and error string.') diff -r abcd4c8a8736 -r e14f791f1cb4 suites/libvirt-cim/lib/XenKvmLib/computersystem.py --- a/suites/libvirt-cim/lib/XenKvmLib/computersystem.py Mon Jul 21 10:33:31 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/computersystem.py Mon Jul 21 17:26:45 2008 -0700 @@ -95,6 +95,20 @@ return list +def enumerate_names(server, virt='Xen'): + conn = pywbem.WBEMConnection('http://%s' % server, + (Globals.CIM_USER, Globals.CIM_PASS), + Globals.CIM_NS) + classname = get_typed_class(virt, 'ComputerSystem') + + try: + refs = conn.EnumerateInstanceNames(classname) + except pywbem.CIMError, arg: + raise Exception(arg[1]) + return [] + + return refs + def system_of(server, iname): t = eval(iname["CreationClassName"]) diff -r abcd4c8a8736 -r e14f791f1cb4 suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Mon Jul 21 10:33:31 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Mon Jul 21 17:26:45 2008 -0700 @@ -263,7 +263,9 @@ return vssd.mof(), [d.mof(), m.mof()] class_nasd = get_nasd_class(virt) - if virt == 'KVM': + if net_mac != const.Xen_default_mac: + pass + elif virt == 'KVM': net_mac= const.KVM_default_mac elif virt == 'XenFV': net_mac = const.XenFV_default_mac From kaitlin at linux.vnet.ibm.com Tue Jul 22 00:33:59 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 17:33:59 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Add tc for the ReferencedConfiguration param of VSMS. Message-ID: From kaitlin at linux.vnet.ibm.com Tue Jul 22 00:34:01 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 21 Jul 2008 17:34:01 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Add VSMS 10_referenced_config.py In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1216686405 25200 # Node ID c2c0ac1f88c47405a0326dc7d019bbf931870dec # Parent e14f791f1cb4f84ed3cad03c9099d336e232fb48 [TEST] Add VSMS 10_referenced_config.py. This test creates a guest using default RASDS. Then another guest is defined using a reference of the first guest an the value for the ReferencedConfiguration parameter. This second guest is created with an additional network interface. The test verifies that the second guest is defined properly. It also verifies that the second guest has 2 network interfaces: one with a mac address that matches that of the first guest and one with a different mac address. This test current fails on LXC because the test suite doesn't pass a console device to the DefineSystem(). Will fix this in a follow up patch. Signed-off-by: Kaitlin Rupert diff -r e14f791f1cb4 -r c2c0ac1f88c4 suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_referenced_config.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_referenced_config.py Mon Jul 21 17:26:45 2008 -0700 @@ -0,0 +1,169 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Kaitlin Rupert +# +# 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 pywbem +from XenKvmLib.common_util import create_using_definesystem, \ + call_request_state_change, \ + poll_for_state_change +from XenKvmLib import vsms +from VirtLib import utils +from CimTest.Globals import logger, do_main +from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib.test_doms import destroy_and_undefine_domain +from XenKvmLib.classes import get_typed_class +from XenKvmLib import computersystem + +sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] +test_dom = 'rstest_domain' +test_dom2 = 'rstest_domain2' + +mac = "aa:aa:aa:00:00:00" + +REQUESTED_STATE = 2 +TIME = "00000000000000.000000:000" + +def setup_first_guest(ip, virt): + status = create_using_definesystem(test_dom, ip, virt=virt) + if status != PASS: + logger.error("Unable to define %s using DefineSystem()" % test_dom) + return FAIL + + rc = call_request_state_change(test_dom, ip, REQUESTED_STATE, TIME, virt) + if rc != 0: + logger.error("Unable to start %s" % test_dom) + return FAIL + + status = poll_for_state_change(ip, virt, test_dom, REQUESTED_STATE) + if status != PASS: + logger.error("%s didn't change state as expected" % test_dom) + return FAIL + + return PASS + +def get_ref(ip, virt): + cs_ref = None + + cs = computersystem.enumerate_names(ip, virt) + if len(cs) < 1: + logger.error("ComputerSystem EnumerateNames() returned no instances") + return cs_ref + + for ref in cs: + for item in ref.items(): + prop, val = item + if prop == "Name" and val == test_dom: + cs_ref = ref + + return cs_ref + +def get_vssd_rasd(virt): + vssd, def_rasd = vsms.default_vssd_rasd_str(dom_name=test_dom2, + net_type='network', + net_mac=mac, virt=virt) + + rasd = [] + for inst in def_rasd: + cn = get_typed_class(virt, "NetResourceAllocationSettingData") + if cn in inst: + rasd.append(inst) + + params = {} + + if len(rasd) != 1: + return params + + params['vssd'] = vssd + params['rasd'] = rasd + + return params + +def get_dom_macs(server, dom, virt): + mac_list = [] + + cmd = "virsh -c %s dumpxml %s | grep mac" % (utils.virt2uri(virt), dom) + ret, out = utils.run_remote(server, cmd) + if ret != 0: + return mac_list + + lines = out.splitlines() + for l in lines: + mac = l.split('=')[1] + mac = mac.lstrip('\'') + mac = mac.rstrip('\'/>') + mac_list.append(mac) + + return mac_list + + at do_main(sup_types) +def main(): + options = main.options + + try: + status = setup_first_guest(options.ip, options.virt) + if status != PASS: + raise Exception("Unable to start %s" % test_dom) + + ref = get_ref(options.ip, options.virt) + if ref is None: + raise Exception("Unable to get %s reference" % test_dom) + + define_params = get_vssd_rasd(options.virt) + if len(define_params) != 2: + raise Exception("Unable to build VSSD and RASD instances for %s" % \ + test_dom2) + + status = create_using_definesystem(test_dom2, options.ip, + params=define_params, ref_config=ref, + virt=options.virt) + if status != PASS: + raise Exception("Unable to define %s" % test_dom2) + + dom1_mac_list = get_dom_macs(options.ip, test_dom, options.virt) + if len(dom1_mac_list) != 1: + raise Exception("%s has %d macs, expected 1" % (test_dom, + len(dom1_mac_list))) + + dom2_mac_list = get_dom_macs(options.ip, test_dom2, options.virt) + if len(dom2_mac_list) != 2: + raise Exception("%s has %d macs, expected 1" % (test_dom2, + len(dom2_mac_list))) + + for item in dom2_mac_list: + if item != mac and item != dom1_mac_list[0]: + raise Exception("%s has unexpected mac value, exp: %s %s" % \ + (item, mac, dom1_mac_list[0])) + + status = PASS + + except Exception, details: + logger.error(details) + status = FAIL + + destroy_and_undefine_domain(test_dom, options.ip, options.virt) + destroy_and_undefine_domain(test_dom2, options.ip, options.virt) + + return status + +if __name__ == "__main__": + sys.exit(main()) + From 072021096 at fudan.edu.cn Tue Jul 22 00:38:33 2008 From: 072021096 at fudan.edu.cn (072021096) Date: Tue, 22 Jul 2008 08:38:33 +0800 Subject: [Libvirt-cim] last problem Message-ID: Registering class LXC_VirtualSystemMigrationService Registering class Xen_ElementConformsToProfile Registering class KVM_ElementConformsToProfile Registering class Xen_VirtualSystemMigrationSettingData Registering class KVM_VirtualSystemMigrationSettingData Registering class LXC_VirtualSystemMigrationSettingData Registering class Xen_VirtualSystemSnapshotService Registering class KVM_VirtualSystemSnapshotService Registering class LXC_VirtualSystemSnapshotService Registering class Xen_VirtualSystemSnapshotServiceCapabilities Registering class KVM_VirtualSystemSnapshotServiceCapabilities Registering class LXC_VirtualSystemSnapshotServiceCapabilities Staging provider registration. Rebuilding repository. sfcbmof: error while loading shared libraries: libsfcBrokerCore.so.0: cannot open shared object file: No such file or directory Failed compiling the MOF files. make: *** [postinstall] Error 1 [root at seanggz libvirt-cim-0.4]# Hello, That's the last problem,do i need some configuration? I just use the command line in the README : make postinstall Thanks! From deeptik at linux.vnet.ibm.com Tue Jul 22 04:54:09 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 22 Jul 2008 10:24:09 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix potiential false positive in AC 01 In-Reply-To: <4884A299.7050701@linux.vnet.ibm.com> References: <48847F87.7000102@linux.vnet.ibm.com> <4884A299.7050701@linux.vnet.ibm.com> Message-ID: <488567F1.7030604@linux.vnet.ibm.com> Kaitlin Rupert wrote: >>> +def enum_pools_and_ac(ip, virt, cn): >>> + pools = {} >>> + ac = [] >>> + >>> + pt = ['MemoryPool', 'ProcessorPool', 'DiskPool', 'NetworkPool'] >>> + >>> + try: >>> + key = ["InstanceID"] >>> + ac = enumclass.enumerate(ip, cn, key, virt) >>> + >>> + for p in pt: >>> + enum_list = enumclass.enumerate(ip, p, key, virt) >>> + >>> + if len(enum_list) < 1: >>> + logger.error("%s did not return any instances" % p) >>> + return pools, ac + >>> + for pool in enum_list: >>> + pools[pool.InstanceID] = pool + >>> + except Exception, details: >>> + logger.error(CIM_ERROR_ENUMERATE, cn) >>> + logger.error(details) >>> + return pools, ac + >>> + if len(ac) != len(pools): >>> + logger.error("%s returned %s instances, expected %s" % (cn, >>> len(ac), + len(pools))) >>> + return pools, ac + > >>> enum_pools_and_ac(options.ip, options.virt, cn) >>> + if len(pools) < 1: >>> + cleanup_restore(options.ip, options.virt) >>> + destroy_netpool(options.ip, options.virt, test_network) >>> return FAIL >> I think the check used in the prev patch, len(ac) != len(pools) is >> better > > This check is still here - it's included in the enum_pools_and_ac() > function. See the piece quoted above. > > It can be moved outside of this function to help with clarity. > > > and also we should be checking len(ac) != 4 to make sure that AC >> values == enum of MemoryPool + ProcessorPool + DiskPool + >> NetworkPool. Any specific reason for not doing this ? >> otherwise +1 for me. > > You can't guarantee 4 pools. The test creates a disk pool and a > network pool, but it's possible for additional net and disk pools to > exist on the system. That's why you want to check len(ac) != len(pools). > yes I missed this scenario. yes we shld be checking for len(ac) is atleast 4 and not less than that since we are sure atleast 1 processorpool + 1 memorypool + atleast 1 networkpool + atleast 1 diskpool will exist. Thanks and Regards, Deepti. From yunguol at cn.ibm.com Tue Jul 22 06:02:25 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Mon, 21 Jul 2008 23:02:25 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #3 Update VSSDC.01 for KVM/XenFV/LXC support Message-ID: # HG changeset patch # User Guolian Yun # Date 1216706533 25200 # Node ID e32675a6d5ca7d92d0ebcd826dbf1332c3b6690f # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] #3 Update VSSDC.01 for KVM/XenFV/LXC support The test defines non-bootloader guests for all platform types, also remove the part of thet test that verifies the bootloader Updates from 2 to 3: Remove build_vssd_info() and call compare_all_prop() in assoc_values() Signed-off-by: Guolian Yun diff -r 3703b7be5a10 -r e32675a6d5ca suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Mon Jul 21 23:02:13 2008 -0700 @@ -52,32 +52,31 @@ import sys from XenKvmLib import enumclass from VirtLib import utils -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all -from XenKvmLib.test_xml import testxml_bl -from XenKvmLib.test_xml import xml_get_dom_bootloader +from XenKvmLib.test_doms import destroy_and_undefine_all +from XenKvmLib.assoc import compare_all_prop from CimTest import Globals from XenKvmLib import assoc +from XenKvmLib import vxml +from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger, do_main from CimTest.ReturnCodes import FAIL, PASS -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "VSSDC_dom" test_vcpus = 2 test_mac = "00:11:22:33:44:aa" test_disk = 'xvda' -status = 0 -VSType = "Xen" -def init_list(): +def init_list(test_disk, test_mac, virt='Xen'): """ Creating the lists that will be used for comparisons. """ - rlist = ['Xen_DiskResourceAllocationSettingData', - 'Xen_MemResourceAllocationSettingData', - 'Xen_NetResourceAllocationSettingData', - 'Xen_ProcResourceAllocationSettingData' + rlist = [get_typed_class(virt, 'DiskResourceAllocationSettingData'), + get_typed_class(virt, 'MemResourceAllocationSettingData'), + get_typed_class(virt, 'NetResourceAllocationSettingData'), + get_typed_class(virt, 'ProcResourceAllocationSettingData') ] prop_list = {rlist[0] : "%s/%s" % (test_dom, test_disk), @@ -85,32 +84,13 @@ rlist[2] : "%s/%s" % (test_dom, test_mac), rlist[3] : "%s/%s" % (test_dom, "proc") } + if virt == 'LXC': + rlist = [get_typed_class(virt, 'MemResourceAllocationSettingData')] + prop_list = {rlist[0] : "%s/%s" % (test_dom, "mem")} return prop_list -def build_vssd_info(ip, vssd): - """ - Creating the vssd fileds lists that will be used for comparisons. - """ - - if vssd.Bootloader == "" or vssd.Caption == "" or \ - vssd.InstanceID == "" or vssd.ElementName == "" or \ - vssd.VirtualSystemIdentifier == "" or vssd.VirtualSystemType == "": - logger.error("One of the required VSSD details seems to be empty") - test_domain_function(test_dom, ip, "undefine") - return FAIL - - vssd_vals = {'Bootloader' : vssd.Bootloader, - 'Caption' : vssd.Caption, - 'InstanceID' : vssd.InstanceID, - 'ElementName' : vssd.ElementName, - 'VirtualSystemIdentifier' : vssd.VirtualSystemIdentifier, - 'VirtualSystemType' : vssd.VirtualSystemType - } - - return vssd_vals - -def assoc_values(ip, assoc_info, cn, an, vals): +def assoc_values(ip, assoc_info, cn, an, vssd): """ The association info of Xen_VirtualSystemSettingDataComponent with every RASDclass is @@ -124,15 +104,8 @@ Globals.logger.error("%s returned %i resource objects for '%s'" % \ (an, len(assoc_info), cn)) return FAIL - - for prop, val in vals.iteritems(): - if assoc_info[0][prop] != val: - Globals.logger.error("%s mismatch: returned %s instead of %s" %\ - (prop, assoc_info[0][prop], val)) - return FAIL - - return PASS - + status = compare_all_prop(assoc_info[0], vssd) + return status except Exception, detail : logger.error("Exception in assoc_values function: %s" % detail) return FAIL @@ -143,49 +116,53 @@ status = FAIL destroy_and_undefine_all(options.ip) - test_xml = testxml_bl(test_dom, vcpus = test_vcpus, \ - mac = test_mac, disk = test_disk, \ - server = options.ip,\ - gtype = 0) - ret = test_domain_function(test_xml, options.ip, cmd = "define") + prop_list = init_list(test_disk, test_mac, options.virt) + virt_xml = vxml.get_class(options.virt) + if options.virt == 'LXC': + cxml = virt_xml(test_dom) + else: + cxml = virt_xml(test_dom, vcpus = test_vcpus, \ + mac = test_mac, disk = test_disk) + ret = cxml.define(options.ip) if not ret: logger.error("Failed to define the dom: %s", test_dom) return FAIL - instIdval = "%s:%s" % (VSType, test_dom) + if options.virt == 'XenFV': + instIdval = "Xen:%s" % test_dom + else: + instIdval = "%s:%s" % (options.virt, test_dom) + keyname = "InstanceID" + key_list = { 'InstanceID' : instIdval } + vssd_cn = get_typed_class(options.virt, 'VirtualSystemSettingData') - key_list = { 'InstanceID' : instIdval } try: vssd = enumclass.getInstance(options.ip, \ - enumclass.Xen_VirtualSystemSettingData, \ - key_list) + 'VirtualSystemSettingData', \ + key_list, \ + options.virt) if vssd is None: logger.error("VSSD instance for %s not found" % test_dom) - test_domain_function(test_dom, options.ip, "undefine") + cxml.undefine(options.ip) return FAIL - - vssd_vals = build_vssd_info(options.ip, vssd) - except Exception, detail : - logger.error(Globals.CIM_ERROR_GETINSTANCE, \ - 'Xen_VirtualSystemSettingData') + logger.error(Globals.CIM_ERROR_GETINSTANCE, vssd_cn) logger.error("Exception : %s" % detail) - test_domain_function(test_dom, options.ip, "undefine") + cxml.undefine(options.ip) return FAIL - prop_list = init_list() try: # Looping through the RASD_cllist, call association # Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist - an = 'Xen_VirtualSystemSettingDataComponent' + an = get_typed_class(options.virt, 'VirtualSystemSettingDataComponent') for rasd_cname, prop in prop_list.iteritems(): assoc_info = assoc.Associators(options.ip, an, rasd_cname, - InstanceID = prop) + options.virt, InstanceID = prop) # Verify the association fields returned for particular rasd_cname. status = assoc_values(options.ip, assoc_info, rasd_cname, an, - vssd_vals) + vssd) if status != PASS: break @@ -194,7 +171,7 @@ logger.error("Exception : %s" % detail) status = FAIL - test_domain_function(test_dom, options.ip, "undefine") + cxml.undefine(options.ip) return status if __name__ == "__main__": From yunguol at cn.ibm.com Tue Jul 22 06:20:50 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Mon, 21 Jul 2008 23:20:50 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix console tty define in LXCXML class Message-ID: <83b3723d0ca969293e28.1216707650@elm3b41.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1216707638 25200 # Node ID 83b3723d0ca969293e28326198a52ada74a8b753 # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] Fix console tty define in LXCXML class Modified console define as: instead of /dev/ptmx Signed-off-by: Guolian Yun diff -r 3703b7be5a10 -r 83b3723d0ca9 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Jul 21 23:20:38 2008 -0700 @@ -710,10 +710,10 @@ os = self.get_node('/domain/os') self.add_sub_node(os, 'init', os_init) - def _devices(self, tty): + def _devices(self, tty_set): devices = self.get_node('/domain/devices') - interface = self.add_sub_node(devices, 'console', tty) + interface = self.add_sub_node(devices, 'console', tty = tty_set) def create_lxc_file(self, ip, lxc_file): try: From yunguol at cn.ibm.com Tue Jul 22 06:16:57 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 22 Jul 2008 14:16:57 +0800 Subject: [Libvirt-cim] Cimtest Report for LXC on F9 (2008/07/07) In-Reply-To: <4884BB96.1060202@linux.vnet.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-22 00:38:46: > Guo Lian Yun wrote: > > > > libvirt-cim-bounces at redhat.com wrote on 2008-07-07 23:14:43: > > > > > > > ComputerSystem - 04_defineStartVS.py: FAIL > > > > > ERROR - Error: property values are not set for VS domguest > > > > > > > > > I'm not sure why it fails sometimes, it pass on for me on the next > > > > running. > > > > > > Have you run the test with the provider debug enabled? Does the > > > provider debug give any hints? > > > > This fails because the defined domain isn't started successfully every > > time. > > If it can't be started, the EnabledState still equals to 3 not 2. Below > > is part of test case code. > > > > ...... > > enabState = cs.EnabledState > > if enabState == 2: > > status = PASS > > break > > ....... > > > > I try to export the debug info, it seems that there is not much useful > > info. > > The guest isn't starting because the console is defined in the following > manner: > > /dev/ptmx > > It should be defined as: > > > > Daisy, can you work up a patch for this? Sure, good catch! > > Thanks! > -- > 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 Tue Jul 22 06:25:18 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 22 Jul 2008 14:25:18 +0800 Subject: [Libvirt-cim] [TEST] Cimtest Report for LXC on F9 (2008/07/21) In-Reply-To: <87vdyzmc7t.fsf@caffeine.beaverton.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-22 00:30:30: > KR> 03_user_netport.py should pass. It's KVM only currently. I don't see > KR> LXC_NET_USER in the lxc_conf.h. Do you know if LXC supports the user > KR> interface type? > > No, that wouldn't make much sense in an LXC environment. I can't > really see libvirt supporting anything other than the 'network' type. > Also, 02_np_gi_errors.py and 03_user_netport.py don't support LXC now. they are Xen/KVM/XenFV currently. > -- > Dan Smith > IBM Linux Technology Center > Open Hypervisor Team > email: danms at us.ibm.com > [attachment "att8afn6.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 Tue Jul 22 06:31:35 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 22 Jul 2008 12:01:35 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix potiential false positive in CS 02 In-Reply-To: <29ede6f3ff473886fa92.1216654555@elm3b41.beaverton.ibm.com> References: <29ede6f3ff473886fa92.1216654555@elm3b41.beaverton.ibm.com> Message-ID: <48857EC7.5000607@linux.vnet.ibm.com> +1 for me. Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1216654535 25200 > # Node ID 29ede6f3ff473886fa928a83fd62a0a192493b7e > # Parent de486893703609719ea79d53ee64828537826211 > [TEST] #2 Fix potiential false positive in CS 02. > > Also make it so that the test skips if domain_list() returns anything > 0. > > This test used to be a Xen only test, so the test was only being run if there were no other guests besides Dom0. However, CS EnumInstances treats Dom0 as any other guest, so it only makes sense to run this test on KVM and LXC. > > If computersystem.enumerate() encounters an exception, raise an exception so that the calling test case fail appropriately. We could return FAIL in this case, but raising an exception is more descriptive. Also, other tests that call computersystem.enumerate() don't need to be modified because the number of arguments returned doesn't change. > > Updates from 1 to 2: > -Remove Xen and XenFV from the supported platforms list. > > Signed-off-by: Kaitlin Rupert > > diff -r de4868937036 -r 29ede6f3ff47 suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py > --- a/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py Sat Jul 19 14:17:09 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py Mon Jul 21 08:35:35 2008 -0700 > @@ -27,15 +27,15 @@ > from XenKvmLib import computersystem > from VirtLib import live > from VirtLib import utils > -from CimTest.Globals import logger > +from CimTest.Globals import logger, CIM_ERROR_ENUMERATE > from CimTest.Globals import do_main > from CimTest.ReturnCodes import PASS, FAIL, SKIP > > -sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > +sup_types = ['KVM', 'LXC'] > > def clean_system(host, virt): > l = live.domain_list(host, virt) > - if len(l) > 1: > + if len(l) > 0: > return False > else: > return True > @@ -43,19 +43,28 @@ > @do_main(sup_types) > def main(): > options = main.options > + > if not clean_system(options.ip, options.virt): > logger.error("System has defined domains; unable to run") > return SKIP > > - status = PASS > + cn = "%s_ComputerSystem" % options.virt > > - cs = computersystem.enumerate(options.ip, options.virt) > + try: > + cs = computersystem.enumerate(options.ip, options.virt) > > - if cs.__class__ == str: > - logger.error("Got error instead of empty list: %s" % cs) > + except Exception, details: > + logger.error(CIM_ERROR_ENUMERATE, cn) > + logger.error(details) > + return FAIL > + > + if len(cs) != 0: > + logger.error("%s returned %d instead of empty list" % (cn, len(cs))) > status = FAIL > + else: > + status = PASS > > - return status > + return status > > if __name__ == "__main__": > sys.exit(main()) > diff -r de4868937036 -r 29ede6f3ff47 suites/libvirt-cim/lib/XenKvmLib/computersystem.py > --- a/suites/libvirt-cim/lib/XenKvmLib/computersystem.py Sat Jul 19 14:17:09 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/computersystem.py Mon Jul 21 08:35:35 2008 -0700 > @@ -85,7 +85,7 @@ > try: > instances = conn.EnumerateInstances(classname) > except pywbem.CIMError, arg: > - print arg[1] > + raise Exception(arg[1]) > return [] > > list = [] > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From yunguol at cn.ibm.com Tue Jul 22 06:30:25 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 22 Jul 2008 14:30:25 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] #3 Fix CS 22 to use providers instead of virsh In-Reply-To: Message-ID: +1 from me? Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922403 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 libvirt-cim-bounces at redhat.com wrote on 2008-07-22 01:36:35: > # HG changeset patch > # User Kaitlin Rupert > # Date 1216661611 25200 > # Node ID abcd4c8a873656b6f12c4416832d185f8c9eb151 > # Parent 18d3c235f0c893f934aaf61f9a1de22ed6f3dd60 > [TEST] #3 Fix CS 22 to use providers instead of virsh. > > This test was defining a guest with virsh and then suspending it > with virsh, which doesn't touch the providers in anyway. Now the > test calls DefineSystem() and RequestStateChange(). > > Updates from 1 to 2: > -Add check to verify guest is the expected state after the > RequestStateChange() call. > -Create a network pool because the VSMS provider requires a > network pool to exist in order to create a guest. > > Updates from 2 to 3: > -Remove destroy_netpool() if create_netpool_conf() fails. This is > not needed. > > Signed-off-by: Kaitlin Rupert > > diff -r 18d3c235f0c8 -r abcd4c8a8736 suites/libvirt- > cim/cimtest/ComputerSystem/22_define_suspend.py > --- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py > Mon Jul 21 09:51:33 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py > Mon Jul 21 10:33:31 2008 -0700 > @@ -32,54 +32,71 @@ > from XenKvmLib import computersystem > from VirtLib import utils > from XenKvmLib import vxml > -from XenKvmLib.test_doms import destroy_and_undefine_all > -from CimTest.Globals import do_main > -from CimTest import Globals > +from XenKvmLib.test_doms import destroy_and_undefine_domain > +from CimTest.Globals import do_main, logger > from CimTest.ReturnCodes import PASS, FAIL > +from XenKvmLib.common_util import create_using_definesystem, \ > + call_request_state_change, > get_cs_instance, \ > + create_netpool_conf, destroy_netpool > > sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > test_dom = "domgst" > > +DEFINE_STATE = 3 > +SUSPND_STATE = 9 > +TIME = "00000000000000.000000:000" > + > +def chk_state(domain_name, ip, en_state, virt): > + rc, cs = get_cs_instance(domain_name, ip, virt) > + if rc != 0: > + return rc > + > + if cs.EnabledState != en_state: > + logger.error("EnabledState should be %d not %d", > + en_state, cs.EnabledState) > + return FAIL > + > + return PASS > + > @do_main(sup_types) > def main(): > options = main.options > - status = FAIL > - > - cxml = vxml.get_class(options.virt)(test_dom) > > -#define VS > + status, test_network = create_netpool_conf(options.ip, options.virt) > + if status != PASS: > + return FAIL > + > try: > - ret = cxml.define(options.ip) > - if not ret: > - Globals.logger.error(Globals.VIRSH_ERROR_DEFINE % test_dom) > - return status > - > - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) > - if not (cs.Name == test_dom) : > - Globals.logger.error("Error: VS %s not found" % test_dom) > - cxml.undefine(options.ip) > + # define the vs > + status = create_using_definesystem(test_dom, options.ip, > + virt=options.virt) > + if status != PASS: > + logger.error("Unable to define %s using DefineSystem()" > % test_dom) > + destroy_netpool(options.ip, options.virt, test_network) > return status > > - except Exception, detail: > - Globals.logger.error("Errors: %s" % detail) > + # suspend the vs > + status = call_request_state_change(test_dom, options.ip, > SUSPND_STATE, > + TIME, virt=options.virt) > + if status != PASS: > + logger.info("Suspending defined %s failed, as expected" > % test_dom) > + status = PASS > > -#Suspend the defined VS > - > - try: > - ret = cxml.run_virsh_cmd(options.ip, "suspend") > - if not ret : > - Globals.logger.info("Suspending defined VS %s failed, > as expected" \ > -% test_dom) > - status = PASS > + status = chk_state(test_dom, options.ip, DEFINE_STATE, > options.virt) > + if status != PASS: > + logger.error("%s not in defined state as expected." > % test_dom) > + status = FAIL > + > else : > - Globals.logger.info("Error: Suspending defined VS %s should not \ > -have been allowed" % test_dom) > + logger.error("Suspending defined %s should have failed" > % test_dom) > status = FAIL > > except Exception, detail: > - Globals.logger.error("Error: %s" % detail) > + logger.error("Error: %s" % detail) > + status = FAIL > > - ret = cxml.undefine(options.ip) > + destroy_netpool(options.ip, options.virt, test_network) > + destroy_and_undefine_domain(test_dom, options.ip, options.virt) > return status > > if __name__ == "__main__": > > _______________________________________________ > 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 Tue Jul 22 06:53:49 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 22 Jul 2008 12:23:49 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #3 Fix CS 22 to use providers instead of virsh In-Reply-To: References: Message-ID: <488583FD.2000505@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1216661611 25200 > # Node ID abcd4c8a873656b6f12c4416832d185f8c9eb151 > # Parent 18d3c235f0c893f934aaf61f9a1de22ed6f3dd60 > [TEST] #3 Fix CS 22 to use providers instead of virsh. > > This test was defining a guest with virsh and then suspending it with virsh, which doesn't touch the providers in anyway. Now the test calls DefineSystem() and RequestStateChange(). > > Updates from 1 to 2: > -Add check to verify guest is the expected state after the RequestStateChange() call. > -Create a network pool because the VSMS provider requires a network pool to exist in order to create a guest. > > Updates from 2 to 3: > -Remove destroy_netpool() if create_netpool_conf() fails. This is not needed. > > Signed-off-by: Kaitlin Rupert > > diff -r 18d3c235f0c8 -r abcd4c8a8736 suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py > --- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Mon Jul 21 09:51:33 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Mon Jul 21 10:33:31 2008 -0700 > @@ -32,54 +32,71 @@ > from XenKvmLib import computersystem > from VirtLib import utils > from XenKvmLib import vxml > -from XenKvmLib.test_doms import destroy_and_undefine_all > -from CimTest.Globals import do_main > -from CimTest import Globals > +from XenKvmLib.test_doms import destroy_and_undefine_domain > +from CimTest.Globals import do_main, logger > from CimTest.ReturnCodes import PASS, FAIL > +from XenKvmLib.common_util import create_using_definesystem, \ > + call_request_state_change, get_cs_instance, \ > + create_netpool_conf, destroy_netpool > > sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > test_dom = "domgst" > > +DEFINE_STATE = 3 > +SUSPND_STATE = 9 > +TIME = "00000000000000.000000:000" > + > +def chk_state(domain_name, ip, en_state, virt): > + rc, cs = get_cs_instance(domain_name, ip, virt) > + if rc != 0: > + return rc > + > + if cs.EnabledState != en_state: > + logger.error("EnabledState should be %d not %d", > + en_state, cs.EnabledState) > + return FAIL > + > + return PASS > + > @do_main(sup_types) > def main(): > options = main.options > - status = FAIL > - > - cxml = vxml.get_class(options.virt)(test_dom) > > -#define VS > + status, test_network = create_netpool_conf(options.ip, options.virt) > + if status != PASS: > + return FAIL > + > try: > - ret = cxml.define(options.ip) > - if not ret: > - Globals.logger.error(Globals.VIRSH_ERROR_DEFINE % test_dom) > - return status > - > - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) > - if not (cs.Name == test_dom) : > - Globals.logger.error("Error: VS %s not found" % test_dom) > - cxml.undefine(options.ip) > + # define the vs > + status = create_using_definesystem(test_dom, options.ip, > + virt=options.virt) > + if status != PASS: > + logger.error("Unable to define %s using DefineSystem()" % test_dom) > + destroy_netpool(options.ip, options.virt, test_network) > return status > > - except Exception, detail: > - Globals.logger.error("Errors: %s" % detail) > + # suspend the vs > + status = call_request_state_change(test_dom, options.ip, SUSPND_STATE, > + TIME, virt=options.virt) > + if status != PASS: > + logger.info("Suspending defined %s failed, as expected" % test_dom) > + status = PASS > > -#Suspend the defined VS > - > - try: > - ret = cxml.run_virsh_cmd(options.ip, "suspend") > - if not ret : > - Globals.logger.info("Suspending defined VS %s failed, as expected" \ > -% test_dom) > - status = PASS > + status = chk_state(test_dom, options.ip, DEFINE_STATE, options.virt) > + if status != PASS: > + logger.error("%s not in defined state as expected." % test_dom) > The log message is misleading. It gives me a feeling that domgst is not in defined state and it is expected state for the domgst. Can we chop off the "as expected" part? or have log stmt something like "%s should have been in defined state" ?? If you still feel the log stmt which you have used is correct, then you can ignore my comment. otherwise +1 for me. Thanks and Regards, Deepti. > + status = FAIL > + > else : > - Globals.logger.info("Error: Suspending defined VS %s should not \ > -have been allowed" % test_dom) > + logger.error("Suspending defined %s should have failed" % test_dom) > status = FAIL > > except Exception, detail: > - Globals.logger.error("Error: %s" % detail) > + logger.error("Error: %s" % detail) > + status = FAIL > > - ret = cxml.undefine(options.ip) > + destroy_netpool(options.ip, options.virt, test_network) > + destroy_and_undefine_domain(test_dom, options.ip, options.virt) > return status > > if __name__ == "__main__": > > _______________________________________________ > 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 Jul 22 07:09:57 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 22 Jul 2008 12:39:57 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix CS 22 to use providers instead of virsh In-Reply-To: <4884C7A5.4060204@linux.vnet.ibm.com> References: <26723e615b002509d1a9.1216507121@elm3b41.beaverton.ibm.com> <488482FC.2070901@linux.vnet.ibm.com> <4884C7A5.4060204@linux.vnet.ibm.com> Message-ID: <488587C5.7040400@linux.vnet.ibm.com> Kaitlin Rupert wrote: >>> >>> -#define VS >>> + status, test_network = create_netpool_conf(options.ip, options.virt) >>> + if status != PASS: >>> + destroy_netpool(options.ip, options.virt, test_network) >> Why do we require to call destroy_netpool() when it is not created >> successfully? > > Nope, this is a good point. I'll remove it and send a new patch. > >>> -#Suspend the defined VS >>> - - try: >>> - ret = cxml.run_virsh_cmd(options.ip, "suspend") >>> - if not ret : >>> - Globals.logger.info("Suspending defined VS %s failed, as expected" \ >>> -% test_dom) >>> - status = PASS >>> + status = chk_state(test_dom, options.ip, DEFINE_STATE, options.virt) >>> + if status != PASS: >>> + logger.error("%s not in defined state as expected." % test_dom) >>> + status = FAIL + >> I think the log stmt here is misleading. >> We are trying to move from Define to Suspend, aint? > > Correct. However, suspending a defined guest is not supported, so we > expect the call to RSC() to fail. Because of that, we expect the guest > to remain in the defined state. If the guest is in some other state, > then we've encountered some unknown behavior and should fail. Yes I agree moving from define to suspend state is not supported state. But, the log message is misleading. It gives me a feeling that domgst is not in defined state and it is expected state for the domgst. Can we chop off the "as expected" part? or have log stmt something like "%s should have been in defined state" ?? If you still feel the log stmt which you have used is correct, then you can ignore my comment. > >> I think the log stmt should be as below: >> >> logger.error("%s not in suspend state as expected." % test_dom) > > > The chk_state() call is verifying that the guest is in the defined > state, not the suspended state. > From yunguol at cn.ibm.com Tue Jul 22 08:06:13 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 22 Jul 2008 16:06:13 +0800 Subject: [Libvirt-cim] Cimtest Report for Xen on RHEL5.2 (2008/07/21) In-Reply-To: <48849D7F.7020307@linux.vnet.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-21 22:30:23: > > LogicalDisk - 02_nodevs.py: FAIL > > ERROR - LogicalDisk returned 1 instead of empty list > It pass for me today. I will look into it when it fails again. > > Memory - 01_memory.py: FAIL > > ERROR - Capacity should be 262144 MB instead of 131072 MB > The same as above. > > VirtualSystemManagementService - 09_procrasd_persist.py: FAIL > > ERROR - limit is 0, expected 256 > > ERROR - rstest_domain CPU scheduling not set properly There is error report when I try to run "virsh -c %s schedinfo %s | awk '/%s/ { print \$3 }' manually. I define rstest_domain and test. Below is the detail cmd and output. [root at elm3b217 cimtest]# virsh -c xen:/// schedinfo rstest_domain | awk '/cap/ { print \$3 }' awk: /cap/ { print \$3 } awk: ^ backslash not last character on line When I delete '\' before $3 and run again, it outputs 0. [root at elm3b217 cimtest]# virsh -c xen:/// schedinfo rstest_domain | awk '/cap/ { print $3 }' 0 These look like it doesn't fix the failure, the test case still fails and log as follows: Tue, 22 Jul 2008 01:19:38:TEST LOG:INFO - ====09_procrasd_persist.py Log==== Tue, 22 Jul 2008 01:19:41:TEST LOG:ERROR - rstest_domain CPU scheduling not set properly Below is cimmon debug info: foo:3: parser error : Extra content at the end of the document o> ^ > > Hi Daisy, > > These look like they failed for a reason other than the libvirt caching > issue. Can you look into why they failed? > > Thanks! > -- > 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 Tue Jul 22 09:39:03 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Tue, 22 Jul 2008 02:39:03 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update VSMigrationS.05 for XenFV support, also convert test_xml call to vxml Message-ID: <5368f189cb2196ac260e.1216719543@elm3b41.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1216719536 25200 # Node ID 5368f189cb2196ac260e07c4f2ea958ffdf68807 # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] Update VSMigrationS.05 for XenFV support, also convert test_xml call to vxml Signed-off-by: Guolian Yun diff -r 3703b7be5a10 -r 5368f189cb21 suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Tue Jul 22 02:38:56 2008 -0700 @@ -24,14 +24,14 @@ import pywbem from pywbem.cim_obj import CIMInstanceName from VirtLib import utils -from XenKvmLib.test_doms import define_test_domain, start_test_domain, destroy_and_undefine_domain -from XenKvmLib.test_xml import * +from XenKvmLib.test_doms import destroy_and_undefine_domain +from XenKvmLib import vxml from XenKvmLib import computersystem from XenKvmLib import vsmigrations from CimTest.Globals import logger, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV'] test_dom = 'dom_migration' exp_rc = 1 #CIM_ERR_FAILED @@ -40,23 +40,17 @@ @do_main(sup_types) def main(): options = main.options - xmlfile = testxml(test_dom) + + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom) + ret = cxml.create(options.ip) + if not ret: + logger.error("Error create domain %s" % test_dom ) + return FAIL status = FAIL rc = -1 - try: - define_test_domain(xmlfile, options.ip) - except Exception: - logger.error("Error define domain %s" % test_dom) - return FAIL - - try: - start_test_domain(test_dom, options.ip) - except Exception: - logger.error("Error start domain %s" % test_dom) - return FAIL - try: service = vsmigrations.Xen_VirtualSystemMigrationService(options.ip) except Exception: From yunguol at cn.ibm.com Tue Jul 22 09:55:11 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Tue, 22 Jul 2008 02:55:11 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update VSMigrationS.01 for XenFV support, also convert test_xml call to vxml Message-ID: <51375198603807e18dd3.1216720511@elm3b41.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1216720500 25200 # Node ID 51375198603807e18dd34c986a03acbd2e751b32 # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] Update VSMigrationS.01 for XenFV support, also convert test_xml call to vxml Signed-off-by: Guolian Yun diff -r 3703b7be5a10 -r 513751986038 suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Tue Jul 22 02:55:00 2008 -0700 @@ -27,8 +27,8 @@ import pywbem from pywbem.cim_obj import CIMInstanceName from VirtLib import utils -from XenKvmLib.test_doms import define_test_domain, start_test_domain, destroy_and_undefine_domain -from XenKvmLib.test_xml import * +from XenKvmLib.test_doms import destroy_and_undefine_domain +from XenKvmLib import vxml from XenKvmLib import computersystem from XenKvmLib import vsmigrations from XenKvmLib.vsmigrations import check_possible_host_migration, migrate_guest_to_host, check_migration_job @@ -36,25 +36,18 @@ from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV'] dom_name = 'dom_migrate' -def start_guest_get_ref(ip, guest_name): - try: - xmlfile = testxml(guest_name) - ret = define_test_domain(xmlfile, ip) - if not ret: - return FAIL, None +def start_guest_get_ref(ip, guest_name, virt='Xen'): + virt_xml = vxml.get_class(virt) + cxml = virt_xml(guest_name) + ret = cxml.create(ip) + if not ret: + logger.error("Error create domain %s" % guest_name) + return FAIL - ret = start_test_domain(guest_name, ip) - if not ret: - return FAIL, None - - time.sleep(10) - except Exception: - logger.error("Error creating domain %s" % guest_name) - return FAIL, None - + time.sleep(10) classname = 'Xen_ComputerSystem' cs_ref = CIMInstanceName(classname, keybindings = { 'Name':guest_name, @@ -85,9 +78,9 @@ else: local_migrate = 0 - status, cs_ref = start_guest_get_ref(options.ip, dom_name) + status, cs_ref = start_guest_get_ref(options.ip, dom_name, options.virt) if status != PASS: - destroy_and_undefine_domain(guest_name, options.ip) + destroy_and_undefine_domain(dom_name, options.ip) return FAIL guest_name = cs_ref['Name'] From yunguol at cn.ibm.com Tue Jul 22 10:13:20 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Tue, 22 Jul 2008 03:13:20 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update VSMigrationS.02 for XenFV support, also convert test_xml call to vxml Message-ID: <4aecbb8cdaeef5b7c135.1216721600@elm3b41.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1216721594 25200 # Node ID 4aecbb8cdaeef5b7c13517a08cd411c27bc429ca # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] Update VSMigrationS.02 for XenFV support, also convert test_xml call to vxml Signed-off-by: Guolian Yun diff -r 3703b7be5a10 -r 4aecbb8cdaee suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Tue Jul 22 03:13:14 2008 -0700 @@ -25,8 +25,8 @@ import pywbem from pywbem.cim_obj import CIMInstanceName from VirtLib import utils -from XenKvmLib.test_doms import define_test_domain, start_test_domain, destroy_and_undefine_domain -from XenKvmLib.test_xml import * +from XenKvmLib.test_doms import destroy_and_undefine_domain +from XenKvmLib import vxml from XenKvmLib import computersystem from XenKvmLib import vsmigrations from XenKvmLib.vsmigrations import check_possible_host_migration, migrate_guest_to_host, check_migration_job @@ -34,14 +34,15 @@ from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV'] dom_name = 'dom_migrate' -def define_guest_get_ref(ip, guest_name): +def define_guest_get_ref(ip, guest_name, virt='Xen'): try: - xmlfile = testxml(guest_name) - define_test_domain(xmlfile, ip) + virt_xml = vxml.get_class(virt) + cxml = virt_xml(guest_name) + cxml.define(ip) except Exception: logger.error("Error define domain %s" % guest_name) destroy_and_undefine_domain(guest_name, options.ip) @@ -54,18 +55,18 @@ return PASS, cs_ref -def setup_env(ip, migration_list, local_migrate): +def setup_env(ip, migration_list, local_migrate, virt='Xen'): ref_list = [] if local_migrate == 1: for i in range(0, len(migration_list)): guest_name = "%s-%i" % (dom_name, i) - status, ref = define_guest_get_ref(ip, guest_name) + status, ref = define_guest_get_ref(ip, guest_name, virt) if status != PASS: return FAIL, None ref_list.append(ref) else: - status, ref = define_guest_get_ref(ip, dom_name) + status, ref = define_guest_get_ref(ip, dom_name, virt) if status != PASS: return FAIL, None ref_list.append(ref) @@ -90,10 +91,13 @@ return migration_list -def start_guest(ip, guest_name, type): +def start_guest(ip, guest_name, type, virt='Xen'): if type != "Offline": try: - start_test_domain(guest_name, ip) + virt_xml = vxml.get_class(virt) + cxml = virt_xml(guest_name) + cxml.start(ip) + time.sleep(10) except Exception: logger.error("Error start domain %s" % guest_name) @@ -126,7 +130,7 @@ ref_list = [] cs_ref = None - status, ref_list = setup_env(options.ip, mlist, local_migrate) + status, ref_list = setup_env(options.ip, mlist, local_migrate, options.virt) if status != PASS or len(ref_list) < 1: return FAIL @@ -135,7 +139,7 @@ for type, item in mlist.iteritems(): guest_name = cs_ref['Name'] - status = start_guest(options.ip, guest_name, type) + status = start_guest(options.ip, guest_name, type, options.virt) if status != PASS: break From deeptik at linux.vnet.ibm.com Tue Jul 22 13:42:56 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 22 Jul 2008 06:42:56 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Enabling 02_reverse.py with XenFV, KVM, LXC and modified logicaldevices.py to work for all virt types Message-ID: <6d1ac5c3497b95a23021.1216734176@elm3b217.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1216734147 25200 # Node ID 6d1ac5c3497b95a230217f8c5f8b226c07fb1b31 # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] #2 Enabling 02_reverse.py with XenFV, KVM, LXC and modified logicaldevices.py to work for all virt types. Changes: ------- Patch 2: ------- 1) Added the missing cleanup_restore() fn in the tc. In logicaldevices library: -------------------------- 1) Moved the common code from verify_proc_values(), verify_net_values(), verify_disk_values(), verify_mem_values() to verify_device_values(). 2) Eliminated verify_proc_values() since it did not require any processor specific checks apart from the ones included in verify_device_values(). Patch 1: -------- 1) Removed unnecessary import statements. 2) Updated verify_proc_values, verify_mem_values, verify_net_values, verify_disk_values function of logicaldevices to work with all virt types. 3) Used verify_proc_values, verify_mem_values, verify_net_values, verify_disk_values fn. 4) Removed conf_file(), clean_up_restore(), get_or_bail(), print_error(), init_list(), get_spec_fields_list(), assoc_values() fns. 5) Removed global status variable. 6) Added verify_eafp_values(), init_pllist(), create_diskpool_conf() fn. 7) Included create_diskpool_conf(), cleanup_restore() fn. Tested on KVM on rpm, KVM current sources, LXC, XenFV, Xen. Signed-off-by: Deepti B. Kalakeri diff -r 3703b7be5a10 -r 6d1ac5c3497b suites/libvirt-cim/cimtest/ElementAllocatedFromPool/02_reverse.py --- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/02_reverse.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/02_reverse.py Tue Jul 22 06:42:27 2008 -0700 @@ -20,9 +20,8 @@ # 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 classname, InstanceID and certian prop are -# are appropriately set for the domains when verified using the +# appropriately set for the domains when verified using the # Xen_ElementAllocatedFromPool asscoiation. # # Example command for LogicalDisk w.r.t to Xen_ElementAllocatedFromPool \ @@ -47,111 +46,79 @@ import sys import os -from distutils.file_util import move_file import pywbem -from VirtLib import utils -from VirtLib import live -from XenKvmLib import assoc -from XenKvmLib import enumclass -from CimTest import Globals -from CimTest.Globals import do_main -from CimTest.ReturnCodes import PASS, FAIL, SKIP -from XenKvmLib.test_xml import testxml_bridge -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all -from VirtLib.live import network_by_bridge +from XenKvmLib.assoc import Associators +from XenKvmLib.vxml import get_class +from CimTest.Globals import do_main, logger, CIM_ERROR_ASSOCIATORS +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.test_doms import destroy_and_undefine_all +from XenKvmLib.classes import get_typed_class +from XenKvmLib.common_util import create_diskpool_conf, cleanup_restore +from XenKvmLib.logicaldevices import verify_device_values -sup_types = ['Xen'] +sup_types = ['Xen' , 'KVM', 'XenFV', 'LXC'] -status = PASS -test_dom = "hd_domain" +test_dom = "eafp_domain" test_mac = "00:11:22:33:44:aa" test_mem = 128 test_vcpus = 4 -test_disk = "xvdb" -test_dpath = "foo" -disk_file = '/tmp/diskpool.conf' -back_disk_file = disk_file + "." + "02_reverse" -diskid = "%s/%s" % ("DiskPool", test_dpath) -memid = "%s/%s" % ("MemoryPool", 0) -procid = "%s/%s" % ("ProcessorPool", 0) -def conf_file(): - """ - Creating diskpool.conf file. - """ - try: - f = open(disk_file, 'w') - f.write('%s %s' % (test_dpath, '/')) - f.close() - except Exception,detail: - Globals.logger.error("Exception: %s", detail) - status = SKIP - sys.exit(status) +def init_pllist(virt, vsxml, diskid): + keys = { + 'MemoryPool' : 'MemoryPool/0', + } + if virt != 'LXC': + virt_network = vsxml.xml_get_net_network() + keys['DiskPool'] = diskid + keys['ProcessorPool'] = 'ProcessorPool/0' + keys['NetworkPool'] = 'NetworkPool/%s' %virt_network -def clean_up_restore(ip): - """ - Restoring back the original diskpool.conf - file. - """ - try: - if os.path.exists(back_disk_file): - os.remove(disk_file) - move_file(back_disk_file, disk_file) - except Exception, detail: - Globals.logger.error("Exception: %s", detail) - status = SKIP - ret = test_domain_function(test_dom, ip, \ - cmd = "destroy") - sys.exit(status) - + pllist = { } + for cn, k in keys.iteritems(): + cn = get_typed_class(virt, cn) + pllist[cn] = k -def get_or_bail(ip, id, pool_class): - """ - Getinstance for the CLass and return instance on success, otherwise - exit after cleanup_restore and destroying the guest. - """ - key_list = { 'InstanceID' : id } - try: - instance = enumclass.getInstance(ip, pool_class, key_list) - except Exception, detail: - Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE, '%s', pool_class) - Globals.logger.error("Exception: %s", detail) - clean_up_restore(ip) - status = FAIL - ret = test_domain_function(test_dom, ip, \ - cmd = "destroy") - sys.exit(status) - return instance + return pllist -def print_error(field, ret_val, req_val): - Globals.logger.error("%s Mismatch", field) - Globals.logger.error("Returned %s instead of %s", ret_val, req_val) +def eafp_list(virt, test_disk): + mcn = get_typed_class(virt, "Memory") + mem = { + 'SystemName' : test_dom, + 'CreationClassName' : mcn, + 'DeviceID' : "%s/%s" % (test_dom, "mem"), + 'NumberOfBlocks' : test_mem * 1024 + } -def init_list(ip, disk, mem, net, proc): - """ - Creating the lists that will be used for comparisons. - """ + eaf_values = { mcn : mem } - pllist = { - "Xen_DiskPool" : disk.InstanceID, \ - "Xen_MemoryPool" : mem.InstanceID, \ - "Xen_NetworkPool" : net.InstanceID, \ - "Xen_ProcessorPool": proc.InstanceID - } - cllist = [ - "Xen_LogicalDisk", \ - "Xen_Memory", \ - "Xen_NetworkPort", \ - "Xen_Processor" - ] - prop_list = ["%s/%s" % (test_dom, test_disk), test_disk, \ - "%s/%s" % (test_dom, "mem"), test_mem, \ - "%s/%s" % (test_dom, test_mac), test_mac - ] - proc_prop = [] - for i in range(test_vcpus): - proc_prop.append("%s/%s" % (test_dom, i)) - return pllist, cllist, prop_list, proc_prop + if virt != 'LXC': + dcn = get_typed_class(virt, "LogicalDisk") + pcn = get_typed_class(virt, "Processor") + ncn = get_typed_class(virt, "NetworkPort") + + disk = { + 'SystemName' : test_dom, + 'CreationClassName' : dcn, + 'DeviceID' : "%s/%s" % (test_dom, test_disk), + 'Name' : test_disk + } + proc = { + 'SystemName' : test_dom, + 'CreationClassName' : pcn, + 'DeviceID' : None + } + net = { + 'SystemName' : test_dom, + 'CreationClassName' : ncn, + 'DeviceID' : "%s/%s" % (test_dom, test_mac), + 'NetworkAddresses' : test_mac + } + + eaf_values[pcn] = proc + eaf_values[dcn] = disk + eaf_values[ncn] = net + + return eaf_values def get_inst_for_dom(assoc_val): list = [] @@ -162,196 +129,85 @@ def get_inst_for_dom(assoc_val): return list -def get_spec_fields_list(inst_list, field_name): - global status - specific_fields = { } - if (len(inst_list)) != 1: - Globals.logger.error("Got %s record for Memory/Network/LogicalDisk instead of \ -1", len(inst_list)) - status = FAIL - return -# verifying the Name field for LogicalDisk - try: - if inst_list[0]['CreationClassName'] != 'Xen_Memory': - field_value = inst_list[0][field_name] - if field_name == 'NetworkAddresses': -# For network we NetworkAddresses is a list of addresses, since we -# are assigning only one address we are taking field_value[0] - field_value = field_value[0] - else: - field_value = ((int(inst_list[0]['NumberOfBlocks'])*4096)/1024) - specific_fields = { - "field_name" : field_name,\ - "field_value" : field_value - } - except Exception, detail: - Globals.logger.error("Exception in get_spec_fields_list(): %s", detail) - status = FAIL - return specific_fields +def verify_eafp_values(server, virt, in_pllist, test_disk): + # Looping through the in_pllist to get association for various pools. + eafp_values = eafp_list(virt, test_disk) + an = get_typed_class(virt, "ElementAllocatedFromPool") + for cn, instid in sorted(in_pllist.iteritems()): + try: + assoc_info = Associators(server, an, cn, virt, InstanceID = instid) + assoc_inst_list = get_inst_for_dom(assoc_info) + if len(assoc_inst_list) < 1 : + logger.error("'%s' with '%s' did not return any records for" + " domain: '%s'", an, cn, test_dom) + return FAIL -def assoc_values(assoc_list, field , list, index, specific_fields_list=""): - """ - Verifying the records retruned by the associations. - """ - global status - if field == "CreationClassName": - for i in range(len(assoc_list)): - if assoc_list[i][field] != list[index]: - print_error(field, assoc_list[i][field], list[index]) - status = FAIL + assoc_eafp_info = assoc_inst_list[0] + CCName = assoc_eafp_info['CreationClassName'] + if CCName == get_typed_class(virt, 'Processor'): + if len(assoc_inst_list) != test_vcpus: + logger.error("'%s' should have returned '%i' Processor" + " details, got '%i'", an, test_vcpus, + len(assoc_inst_list)) + return FAIL + + for i in range(test_vcpus): + eafp_values[CCName]['DeviceID'] = "%s/%s" % (test_dom,i) + status = verify_device_values(assoc_inst_list[i], + eafp_values, virt) + else: + status = verify_device_values(assoc_eafp_info, + eafp_values, virt) + if status != PASS: - break - elif field == "DeviceID": - if assoc_list[0]['CreationClassName'] == 'Xen_Processor': -# Verifying the list of DeviceId returned by the association -# against the list created intially . - for i in range(len(list)): - if assoc_list[i]['DeviceID'] != list[i]: - print_error(field, assoc_list[i]['DeviceID'], list[i]) - status = FAIL - else: -# Except for Xen_Processor, we get only once record for a domain for -# other classes. - if assoc_list[0]['DeviceID'] != list[index]: - print_error(field, assoc_list[0]['DeviceID'] , list[index]) - status = FAIL - else: - # other specific fields verification - if assoc_list[0]['CreationClassName'] != 'Xen_Processor': - spec_field_name = specific_fields_list['field_name'] - spec_field_value = specific_fields_list['field_value'] - if spec_field_value != list[index]: - print_error(field, spec_field_value, list[index]) - status = FAIL - + return status + except Exception, detail: + logger.error(CIM_ERROR_ASSOCIATORS, an) + logger.error("Exception: %s", detail) + status = FAIL + return status @do_main(sup_types) def main(): options = main.options - global status loop = 0 server = options.ip - destroy_and_undefine_all(options.ip) - test_xml, bridge = testxml_bridge(test_dom, mem = test_mem, vcpus = test_vcpus, \ - mac = test_mac, disk = test_disk, server = options.ip) - if bridge == None: - Globals.logger.error("Unable to find virtual bridge") - return SKIP + virt = options.virt + if virt == 'Xen': + test_disk = 'xvdb' + else: + test_disk = 'hda' - if test_xml == None: - Globals.logger.error("Guest xml was not created properly") + # Getting the VS list and deleting the test_dom if it already exists. + destroy_and_undefine_all(server) + virt_type = get_class(virt) + if virt == 'LXC': + vsxml = virt_type(test_dom, vcpus = test_vcpus) + else: + vsxml = virt_type(test_dom, mem = test_mem, vcpus = test_vcpus, + mac = test_mac, disk = test_disk) + + # Verify DiskPool on machine + status, diskid = create_diskpool_conf(server, virt) + if status != PASS: + return status + + ret = vsxml.create(server) + if not ret: + logger.error("Failed to Create the dom: '%s'", test_dom) + cleanup_restore(server, virt) return FAIL - virt_network = network_by_bridge(bridge, server) - if virt_network == None: - Globals.logger.error("No virtual network found for bridge %s", bridge) - return SKIP + # Get pool list against which the EAFP should be queried + pllist = init_pllist(virt, vsxml, diskid) - ret = test_domain_function(test_xml, server, cmd = "create") - if not ret: - Globals.logger.error("Failed to Create the dom: %s", test_dom) - return FAIL + + status = verify_eafp_values(server, virt, pllist, test_disk) + vsxml.destroy(server) + cleanup_restore(server, virt) + return status - # Taking care of already existing diskconf file - # Creating diskpool.conf if it does not exist - # Otherwise backing up the prev file and create new one. - os.system("rm -f %s" % back_disk_file ) - if not (os.path.exists(disk_file)): - conf_file() - else: - move_file(disk_file, back_disk_file) - conf_file() - try : - disk = get_or_bail(server, id=diskid, \ - pool_class=enumclass.Xen_DiskPool) - mem = get_or_bail(server, id = memid, \ - pool_class=enumclass.Xen_MemoryPool) - netid = "%s/%s" % ("NetworkPool", virt_network) - net = get_or_bail(server, id = netid, \ - pool_class=enumclass.Xen_NetworkPool) - proc = get_or_bail(server, id = procid, \ - pool_class=enumclass.Xen_ProcessorPool) - - except Exception, detail: - Globals.logger.error("Exception: %s", detail) - clean_up_restore(server) - status = FAIL - ret = test_domain_function(test_dom, server, \ - cmd = "destroy") - return status - - pllist, cllist, prop_list, proc_prop = init_list(server, disk, mem, net, proc) - -# Looping through the pllist to get association for various pools. - for cn, instid in sorted(pllist.items()): - try: - assoc_info = assoc.Associators(server, \ - "Xen_ElementAllocatedFromPool", \ - cn, \ - InstanceID = instid) -# Verifying the Creation Class name for all the records returned for each -# pool class queried - inst_list = get_inst_for_dom(assoc_info) - if (len(inst_list)) == 0: - Globals.logger.error("Association did not return any records for \ -the specified domain: %s", test_dom) - status = FAIL - break - - assoc_values(assoc_list=inst_list, field="CreationClassName", \ - list=cllist, \ - index=loop) -# verifying the DeviceID - if inst_list[0]['CreationClassName'] == 'Xen_Processor': -# The DeviceID for the processor varies from 0 to (vcpu - 1 ) - list_index = 0 - assoc_values(assoc_list=inst_list, field="DeviceID", \ - list=proc_prop, \ - index=list_index) - else: -# For LogicalDisk, Memory and NetworkPort - if inst_list[0]['CreationClassName'] == 'Xen_LogicalDisk': - list_index = 0 - elif inst_list[0]['CreationClassName'] == 'Xen_Memory': - list_index = 2 - else: - list_index = 4 # NetworkPort - assoc_values(assoc_list=inst_list, field="DeviceID", \ - list=prop_list, \ - index=list_index) - if inst_list[0]['CreationClassName'] == 'Xen_LogicalDisk': -# verifying the Name field for LogicalDisk - specific_fields = get_spec_fields_list(inst_list,field_name="Name") - list_index = 1 - elif inst_list[0]['CreationClassName'] == 'Xen_Memory': -# verifying the NumberOfBlocks allocated for Memory - specific_fields = get_spec_fields_list(inst_list,field_name="NumberOfBlocks") - list_index = 3 - else: -# verifying the NetworkAddresses for the NetworkPort - specific_fields = get_spec_fields_list(inst_list,field_name="NetworkAddresses") - list_index = 5 # NetworkPort - assoc_values(assoc_list=inst_list, field="Other", \ - list=prop_list, \ - index=list_index, \ - specific_fields_list=specific_fields) - if status != PASS: - break - else: -# The loop variable is used to index the cllist to verify the creationclassname - loop = loop + 1 - except Exception, detail: - Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, \ - 'Xen_ElementAllocatedFromPool') - Globals.logger.error("Exception: %s", detail) - clean_up_restore(server) - status = FAIL - - ret = test_domain_function(test_dom, server, \ - cmd = "destroy") - clean_up_restore(server) - return status if __name__ == "__main__": sys.exit(main()) diff -r 3703b7be5a10 -r 6d1ac5c3497b suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py --- a/suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py Tue Jul 22 06:42:27 2008 -0700 @@ -23,6 +23,7 @@ import os import os from CimTest.Globals import logger from CimTest.ReturnCodes import PASS, FAIL, SKIP +from XenKvmLib.vxml import get_typed_class # The list_values that is passed should be of the type .. # disk = { @@ -53,70 +54,58 @@ def spec_err(fieldvalue, field_list, fie logger.error("%s Mismatch", fieldname) logger.error("Returned %s instead of %s", fieldvalue, field_list[fieldname]) -def verify_proc_values(assoc_info, list_values): - proc_values = list_values['Xen_Processor'] - if assoc_info['CreationClassName'] != proc_values['CreationClassName']: - field_err(assoc_info, proc_values, fieldname = 'CreationClassName') + +def verify_device_values(assoc_info, list_values, virt='Xen'): + dev_cnames = ['LogicalDisk', 'Memory', 'NetworkPort', 'Processor'] + for i in range(len(dev_cnames)): + dev_cnames[i] = get_typed_class(virt, dev_cnames[i]) + + CCName = assoc_info['CreationClassName'] + if not CCName in dev_cnames: + logger.error("'%s' seem to be an invalid classname", CCName) + return FAIL + + dev_values = list_values[CCName] + if assoc_info['CreationClassName'] != dev_values['CreationClassName']: + field_err(assoc_info, dev_values, fieldname = 'CreationClassName') + return FAIL + + if assoc_info['DeviceID'] != dev_values['DeviceID']: + field_err(assoc_info, dev_values, fieldname = 'DeviceID') + return FAIL + + sysname = assoc_info['SystemName'] + if sysname != dev_values['SystemName']: + spec_err(sysname, list_values, fieldname = 'SystemName') return FAIL - if assoc_info['DeviceID'] != proc_values['DeviceID']: - field_err(assoc_info, proc_values, fieldname = 'DeviceID') - return FAIL - sysname = assoc_info['SystemName'] - if sysname != proc_values['SystemName']: - spec_err(sysname, proc_values, fieldname = 'SystemName') - return FAIL - return PASS -def verify_mem_values(assoc_info, list_values): - mem_values = list_values['Xen_Memory'] - if assoc_info['CreationClassName'] != mem_values['CreationClassName']: - field_err(assoc_info, mem_values, fieldname = 'CreationClassName') - return FAIL - if assoc_info['DeviceID'] != mem_values['DeviceID']: - field_err(assoc_info, mem_values, fieldname = 'DeviceID') - return FAIL - sysname = assoc_info['SystemName'] - if sysname != mem_values['SystemName']: - spec_err(sysname, mem_values, fieldname = 'SystemName') - return FAIL + # Checking Device specific values. + if CCName == dev_cnames[0]: # Verifying disk values + return verify_disk_values(assoc_info, dev_values, virt) + elif CCName == dev_cnames[1]: # Verifying mem values + return verify_mem_values(assoc_info, dev_values, virt) + elif CCName == dev_cnames[2]: # Verifying net values + return verify_net_values(assoc_info, dev_values, virt) + elif CCName == dev_cnames[3]: # Verifying processor values + return PASS + +def verify_mem_values(assoc_info, mem_values, virt='Xen'): blocks = ((int(assoc_info['NumberOfBlocks'])*4096)/1024) if blocks != mem_values['NumberOfBlocks']: spec_err(blocks, mem_values, fieldname = 'NumberOfBlocks') return FAIL return PASS -def verify_net_values(assoc_info, list_values): - net_values = list_values['Xen_NetworkPort'] - if assoc_info['CreationClassName'] != net_values['CreationClassName']: - field_err(assoc_info, net_values, fieldname = 'CreationClassName') - return FAIL - if assoc_info['DeviceID'] != net_values['DeviceID']: - field_err(assoc_info, net_values, fieldname = 'DeviceID') - return FAIL - sysname = assoc_info['SystemName'] - if sysname != net_values['SystemName']: - spec_err(sysname, net_values, fieldname = 'SystemName') - return FAIL -# We are assinging only one mac address and hence we expect only one -# address in the list +def verify_net_values(assoc_info, net_values, virt='Xen'): + # We are assinging only one mac address and hence we expect only one + # address in the list netadd = assoc_info['NetworkAddresses'][0] if netadd != net_values['NetworkAddresses']: spec_err(netadd, net_values, fieldname = 'NetworkAddresses') return FAIL return PASS -def verify_disk_values(assoc_info, list_values): - disk_values = list_values['Xen_LogicalDisk'] - if assoc_info['CreationClassName'] != disk_values['CreationClassName']: - field_err(assoc_info, disk_values, fieldname = 'CreationClassName') - return FAIL - if assoc_info['DeviceID'] != disk_values['DeviceID']: - field_err(assoc_info, disk_values, fieldname = 'DeviceID') - return FAIL - sysname = assoc_info['SystemName'] - if sysname != disk_values['SystemName']: - spec_err(sysname, disk_values, fieldname = 'SystemName') - return FAIL +def verify_disk_values(assoc_info, disk_values, virt='Xen'): devname = assoc_info['Name'] if devname != disk_values['Name']: spec_err(devname, disk_values, fieldname = 'Name') From deeptik at linux.vnet.ibm.com Tue Jul 22 13:49:18 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 22 Jul 2008 06:49:18 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Updating 04_hs_to_EAPF.py to use the verify_device_values() included in the logicaldevices.py Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1216734523 25200 # Node ID db255fa25e46430920e4e39af495f90ce05ec399 # Parent 6d1ac5c3497b95a230217f8c5f8b226c07fb1b31 [TEST] Updating 04_hs_to_EAPF.py to use the verify_device_values() included in the logicaldevices.py. 1) Elminated the need to call various verify_<>_values() calls, instead using verify_device_values() fn. NOTE: The tc should be modified to support XenFV, KVM, LXC further. Signed-off-by: Deepti B. Kalakeri diff -r 6d1ac5c3497b -r db255fa25e46 suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py --- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Tue Jul 22 06:42:27 2008 -0700 +++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Tue Jul 22 06:48:43 2008 -0700 @@ -58,8 +58,7 @@ from XenKvmLib.test_xml import testxml_b from XenKvmLib.test_xml import testxml_bridge from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all from VirtLib.live import network_by_bridge -from XenKvmLib.logicaldevices import verify_proc_values, verify_mem_values, \ -verify_net_values, verify_disk_values +from XenKvmLib.logicaldevices import verify_device_values from XenKvmLib.common_util import cleanup_restore, test_dpath, \ create_diskpool_file @@ -185,12 +184,12 @@ def check_len(an, assoc_list_info, qcn, return PASS def verify_eafp_values(server, in_pllist): -# Looping through the in_pllist to get association for various pools. + # Looping through the in_pllist to get association for various pools. status = PASS an = "Xen_ElementAllocatedFromPool" exp_len = 1 qcn = "Logical Devices" - eapf_values = eapf_list() + eafp_values = eapf_list() for cn, instid in sorted(in_pllist.items()): try: assoc_info = Associators(server, an, cn, InstanceID = instid) @@ -200,18 +199,12 @@ def verify_eafp_values(server, in_pllist break assoc_eafp_info = inst_list[0] CCName = assoc_eafp_info['CreationClassName'] - if CCName == 'Xen_Processor': - status = verify_proc_values(assoc_eafp_info, eapf_values) - elif CCName == 'Xen_NetworkPort': - status = verify_net_values(assoc_eafp_info, eapf_values) - elif CCName == 'Xen_LogicalDisk': - status = verify_disk_values(assoc_eafp_info, eapf_values) - elif CCName == 'Xen_Memory': - status = verify_mem_values(assoc_eafp_info, eapf_values) - else: - status = FAIL + status = verify_device_values(assoc_eafp_info, CCName, + eafp_values, virt='Xen') + if status != PASS: - break + return status + except Exception, detail: logger.error(CIM_ERROR_ASSOCIATORS, an) logger.error("Exception: %s", detail) From kaitlin at linux.vnet.ibm.com Tue Jul 22 15:33:21 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 22 Jul 2008 08:33:21 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #3 Fix CS 22 to use providers instead of virsh In-Reply-To: <488583FD.2000505@linux.vnet.ibm.com> References: <488583FD.2000505@linux.vnet.ibm.com> Message-ID: <4885FDC1.6050600@linux.vnet.ibm.com> >> - status = PASS >> + status = chk_state(test_dom, options.ip, DEFINE_STATE, >> options.virt) >> + if status != PASS: >> + logger.error("%s not in defined state as expected." % >> test_dom) >> > The log message is misleading. It gives me a feeling that domgst is not > in defined state and it is expected state for the domgst. > Can we chop off the "as expected" part? > or have log stmt something like "%s should have been in defined state" ?? Sure, I'll change it to "%s should have been in defined state" - this log message is more clear. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Tue Jul 22 15:42:04 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 22 Jul 2008 08:42:04 -0700 Subject: [Libvirt-cim] last problem In-Reply-To: (072021096@fudan.edu.cn's message of "Tue, 22 Jul 2008 08:38:33 +0800") References: Message-ID: <87r69mexir.fsf@caffeine.beaverton.ibm.com> SZ> sfcbmof: error while loading shared libraries: libsfcBrokerCore.so.0: cannot open shared object file: No such file or directory Run that command as root under a login shell. I usually hit this when running under sudo because some path configuration isn't set correctly. -- 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 Jul 22 15:46:46 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 22 Jul 2008 08:46:46 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #4 Fix CS 22 to use providers instead of virsh Message-ID: <0b2f67eed74e01561029.1216741606@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1216741569 25200 # Node ID 0b2f67eed74e01561029d4c46fc8d54716e9b462 # Parent 9fb3407dd5098ab438653d4854d77b44ff9888e1 [TEST] #4 Fix CS 22 to use providers instead of virsh. This test was defining a guest with virsh and then suspending it with virsh, which doesn't touch the providers in anyway. Now the test calls DefineSystem() and RequestStateChange(). Updates from 1 to 2: -Add check to verify guest is the expected state after the RequestStateChange() call. -Create a network pool because the VSMS provider requires a network pool to exist in order to create a guest. Updates from 2 to 3: -Remove destroy_netpool() if create_netpool_conf() fails. This is not needed. Updates from 3 to 4: -Changed log message from "%s not in defined state as expected." to "%s should have been in defined state" Signed-off-by: Kaitlin Rupert diff -r 9fb3407dd509 -r 0b2f67eed74e suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Mon Jul 21 09:51:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Tue Jul 22 08:46:09 2008 -0700 @@ -32,54 +32,71 @@ from XenKvmLib import computersystem from VirtLib import utils from XenKvmLib import vxml -from XenKvmLib.test_doms import destroy_and_undefine_all -from CimTest.Globals import do_main -from CimTest import Globals +from XenKvmLib.test_doms import destroy_and_undefine_domain +from CimTest.Globals import do_main, logger from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.common_util import create_using_definesystem, \ + call_request_state_change, get_cs_instance, \ + create_netpool_conf, destroy_netpool sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "domgst" +DEFINE_STATE = 3 +SUSPND_STATE = 9 +TIME = "00000000000000.000000:000" + +def chk_state(domain_name, ip, en_state, virt): + rc, cs = get_cs_instance(domain_name, ip, virt) + if rc != 0: + return rc + + if cs.EnabledState != en_state: + logger.error("EnabledState should be %d not %d", + en_state, cs.EnabledState) + return FAIL + + return PASS + @do_main(sup_types) def main(): options = main.options - status = FAIL - - cxml = vxml.get_class(options.virt)(test_dom) -#define VS + status, test_network = create_netpool_conf(options.ip, options.virt) + if status != PASS: + return FAIL + try: - ret = cxml.define(options.ip) - if not ret: - Globals.logger.error(Globals.VIRSH_ERROR_DEFINE % test_dom) - return status - - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) - if not (cs.Name == test_dom) : - Globals.logger.error("Error: VS %s not found" % test_dom) - cxml.undefine(options.ip) + # define the vs + status = create_using_definesystem(test_dom, options.ip, + virt=options.virt) + if status != PASS: + logger.error("Unable to define %s using DefineSystem()" % test_dom) + destroy_netpool(options.ip, options.virt, test_network) return status - except Exception, detail: - Globals.logger.error("Errors: %s" % detail) + # suspend the vs + status = call_request_state_change(test_dom, options.ip, SUSPND_STATE, + TIME, virt=options.virt) + if status != PASS: + logger.info("Suspending defined %s failed, as expected" % test_dom) + status = PASS -#Suspend the defined VS - - try: - ret = cxml.run_virsh_cmd(options.ip, "suspend") - if not ret : - Globals.logger.info("Suspending defined VS %s failed, as expected" \ -% test_dom) - status = PASS + status = chk_state(test_dom, options.ip, DEFINE_STATE, options.virt) + if status != PASS: + logger.error("%s should have been in defined state" % test_dom) + status = FAIL + else : - Globals.logger.info("Error: Suspending defined VS %s should not \ -have been allowed" % test_dom) + logger.error("Suspending defined %s should have failed" % test_dom) status = FAIL except Exception, detail: - Globals.logger.error("Error: %s" % detail) + logger.error("Error: %s" % detail) + status = FAIL - ret = cxml.undefine(options.ip) + destroy_netpool(options.ip, options.virt, test_network) + destroy_and_undefine_domain(test_dom, options.ip, options.virt) return status if __name__ == "__main__": From kaitlin at linux.vnet.ibm.com Tue Jul 22 15:49:55 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 22 Jul 2008 08:49:55 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix potiential false positive in AC 01 In-Reply-To: <488567F1.7030604@linux.vnet.ibm.com> References: <48847F87.7000102@linux.vnet.ibm.com> <4884A299.7050701@linux.vnet.ibm.com> <488567F1.7030604@linux.vnet.ibm.com> Message-ID: <488601A3.1060306@linux.vnet.ibm.com> >> It can be moved outside of this function to help with clarity. >> >> >> and also we should be checking len(ac) != 4 to make sure that AC >>> values == enum of MemoryPool + ProcessorPool + DiskPool + >>> NetworkPool. Any specific reason for not doing this ? >>> otherwise +1 for me. >> >> You can't guarantee 4 pools. The test creates a disk pool and a >> network pool, but it's possible for additional net and disk pools to >> exist on the system. That's why you want to check len(ac) != len(pools). >> > yes I missed this scenario. yes we shld be checking for len(ac) is > atleast 4 and not less than that since we are sure atleast 1 > processorpool + 1 memorypool + atleast 1 networkpool + atleast 1 > diskpool will exist. > Yep, that makes sense! Will send a new patch =) -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 22 15:56:29 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 22 Jul 2008 08:56:29 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #3 Fix potiential false positive in AC 01 Message-ID: <28e2e11309e79c9285a1.1216742189@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1216742122 25200 # Node ID 28e2e11309e79c9285a122ec1f387dc1f7511e7c # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] #3 Fix potiential false positive in AC 01. This test needs to verify enum of AC returns the same number of instances as the number of instances returned by enum of MemoryPool + ProcessorPool + DiskPool + NetworkPool. Also, cleaned up the logic to verify that the ResourceType and the InstanceIDs of the AC instances match the Pool instances they're describing. Updates from 1 to 2: -Create a disk pool and network pool to ensure there is an instance for each pool type. -Add comment explaining the purpose of the test. Updates from 2 to 3: -Change if len(pools) < 1 to if len(pools) < 4 -Add log message if this if statement fails. Signed-off-by: Kaitlin Rupert diff -r 3703b7be5a10 -r 28e2e11309e7 suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py --- a/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Tue Jul 22 08:55:22 2008 -0700 @@ -20,63 +20,98 @@ # 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 verifies the enum of AC returns the same number of instances as +# the number of instances returned by enum of: +# MemoryPool + ProcessorPool + DiskPool + NetworkPool. +# import sys +from VirtLib.live import virsh_version from XenKvmLib import enumclass from CimTest.Globals import do_main from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, platform_sup from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ + create_netpool_conf, destroy_netpool sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] + +def enum_pools_and_ac(ip, virt, cn): + pools = {} + ac = [] + + pt = ['MemoryPool', 'ProcessorPool', 'DiskPool', 'NetworkPool'] + + try: + key = ["InstanceID"] + ac = enumclass.enumerate(ip, cn, key, virt) + + for p in pt: + enum_list = enumclass.enumerate(ip, p, key, virt) + + if len(enum_list) < 1: + logger.error("%s did not return any instances" % p) + return pools, ac + + for pool in enum_list: + pools[pool.InstanceID] = pool + + except Exception, details: + logger.error(CIM_ERROR_ENUMERATE, cn) + logger.error(details) + return pools, ac + + if len(ac) != len(pools): + logger.error("%s returned %s instances, expected %s" % (cn, len(ac), + len(pools))) + return pools, ac + +def compare_pool_to_ac(ac, pools, cn): + try: + for inst in ac: + id = inst.InstanceID + if pools[id].ResourceType != inst.ResourceType: + logger.error("%s ResourceType %s, Pool ResourceType %s" % (cn, + inst.ResourceType, pools[id].ResourceType)) + return FAIL + + except Exception, details: + logger.error("%s returned instance with unexpected InstanceID %s" % (cn, + details)) + return FAIL + + return PASS + @do_main(sup_types) def main(): options = main.options - pools = {} - pt = ['MemoryPool', 'ProcessorPool', 'DiskPool', 'NetworkPool'] - try: - key_list = ["InstanceID"] - ac = enumclass.enumerate(options.ip, - "AllocationCapabilities", - key_list, - options.virt) - pools['MemoryPool'] = enumclass.enumerate(options.ip, - "MemoryPool", - key_list, - options.virt) - pools['ProcessorPool'] = enumclass.enumerate(options.ip, - "ProcessorPool", - key_list, - options.virt) - pools['DiskPool'] = enumclass.enumerate(options.ip, - "DiskPool", - key_list, - options.virt) - pools['NetworkPool'] = enumclass.enumerate(options.ip, - "NetworkPool", - key_list, - options.virt) - except Exception: - logger.error(CIM_ERROR_ENUMERATE, '%s_AllocationCapabilities' % options.virt) - return FAIL - - acset = set([(x.InstanceID, x.ResourceType) for x in ac]) - poolset = set() - for pl in pools.values(): - for x in pl: - poolset.add((x.InstanceID, x.ResourceType)) + cn = 'AllocationCapabilities' - if len(acset) != len(poolset): - logger.error( - 'AllocationCapabilities return %i instances, excepted %i' - % (ac_size, pool_size)) - return FAIL - zeroset = acset - poolset - if len(zeroset) != 0: - logger.error('AC is inconsistent with pools') + status, diskid = create_diskpool_conf(options.ip, options.virt) + if status != PASS: + cleanup_restore(options.ip, options.virt) + return FAIL + + status, test_network = create_netpool_conf(options.ip, options.virt) + if status != PASS: + cleanup_restore(options.ip, options.virt) + destroy_netpool(options.ip, options.virt, test_network) + return FAIL + + pools, ac = enum_pools_and_ac(options.ip, options.virt, cn) + if len(pools) < 4: + logger.error("Only %d pools returned, expected at least 4" % len(pools)) + cleanup_restore(options.ip, options.virt) + destroy_netpool(options.ip, options.virt, test_network) return FAIL - return PASS + status = compare_pool_to_ac(ac, pools, cn) + + cleanup_restore(options.ip, options.virt) + destroy_netpool(options.ip, options.virt, test_network) + + return status if __name__ == "__main__": sys.exit(main()) From kaitlin at linux.vnet.ibm.com Tue Jul 22 16:30:20 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 22 Jul 2008 09:30:20 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #3 Update VSSDC.01 for KVM/XenFV/LXC support In-Reply-To: References: Message-ID: <48860B1C.3090309@linux.vnet.ibm.com> > @@ -85,32 +84,13 @@ > rlist[2] : "%s/%s" % (test_dom, test_mac), > rlist[3] : "%s/%s" % (test_dom, "proc") > } > + if virt == 'LXC': > + rlist = [get_typed_class(virt, 'MemResourceAllocationSettingData')] > + prop_list = {rlist[0] : "%s/%s" % (test_dom, "mem")} I missed this last time, but you can use rlist[1] since you already know rlist[1] = get_typed_class(virt, 'MemResourceAllocationSettingData'). You can then remove the rlist = [get_typed_class(virt, 'MemResourceAllocationSettingData')] line. > +def assoc_values(ip, assoc_info, cn, an, vssd): > """ Can you change the comment of this function? It mentions verifying specific properties. Instead, it verifies all of the values of the instance. > - > + status = compare_all_prop(assoc_info[0], vssd) > + return status Instead of returning here, can you check the status? If status != PASS, print a log message and return the status. That way it's clear why the test fails. > except Exception, detail : > logger.error("Exception in assoc_values function: %s" % detail) > return FAIL > @@ -143,49 +116,53 @@ > status = FAIL Otherwise, looks good. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 22 16:37:24 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 22 Jul 2008 09:37:24 -0700 Subject: [Libvirt-cim] Cimtest Report for LXC on F9 (2008/07/07) In-Reply-To: References: Message-ID: <48860CC4.8090709@linux.vnet.ibm.com> > > The guest isn't starting because the console is defined in the following > > manner: > > > > /dev/ptmx > > > > It should be defined as: > > > > > > > > Daisy, can you work up a patch for this? > > Sure, good catch! Thanks Daisy! I applied your patch. ComputerSystem - 04_defineStartVS.py now passes for me on LXC. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 22 16:38:39 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 22 Jul 2008 09:38:39 -0700 Subject: [Libvirt-cim] [TEST] Cimtest Report for LXC on F9 (2008/07/21) In-Reply-To: References: Message-ID: <48860D0F.6010509@linux.vnet.ibm.com> Guo Lian Yun wrote: > > > libvirt-cim-bounces at redhat.com wrote on 2008-07-22 00:30:30: > > > KR> 03_user_netport.py should pass. It's KVM only currently. I don't see > > KR> LXC_NET_USER in the lxc_conf.h. Do you know if LXC supports the user > > KR> interface type? > > > > No, that wouldn't make much sense in an LXC environment. I can't > > really see libvirt supporting anything other than the 'network' type. > > > Also, 02_np_gi_errors.py and 03_user_netport.py don't support LXC now. > they are Xen/KVM/XenFV currently. It should be possible to convert 02_np_gi_errors.py to run on LXC. Can you look into this? Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 22 16:53:31 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 22 Jul 2008 09:53:31 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update VSMigrationS.05 for XenFV support, also convert test_xml call to vxml In-Reply-To: <5368f189cb2196ac260e.1216719543@elm3b41.beaverton.ibm.com> References: <5368f189cb2196ac260e.1216719543@elm3b41.beaverton.ibm.com> Message-ID: <4886108B.30206@linux.vnet.ibm.com> > @do_main(sup_types) > def main(): > options = main.options > - xmlfile = testxml(test_dom) > + > + virt_xml = vxml.get_class(options.virt) > + cxml = virt_xml(test_dom) > + ret = cxml.create(options.ip) > + if not ret: > + logger.error("Error create domain %s" % test_dom ) > + return FAIL > Since you're creating the guest using cxml.create, can you replace the destroy_and_undefine_domain() with cxml.destroy() and cxml.undefine() calls? If a test is updated to use the .define() / .create() calls, I'd like to phase out the destroy_and_undefine_domain() and related calls. These calls are still necessary if a guest is being defined using DefineSystem(). Don't forget to remove the "from XenKvmLib.test_doms import destroy_and_undefine_domain" line as well. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 22 17:04:50 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 22 Jul 2008 10:04:50 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update VSMigrationS.01 for XenFV support, also convert test_xml call to vxml In-Reply-To: <51375198603807e18dd3.1216720511@elm3b41.beaverton.ibm.com> References: <51375198603807e18dd3.1216720511@elm3b41.beaverton.ibm.com> Message-ID: <48861332.8070900@linux.vnet.ibm.com> > +def start_guest_get_ref(ip, guest_name, virt='Xen'): > + virt_xml = vxml.get_class(virt) > + cxml = virt_xml(guest_name) > + ret = cxml.create(ip) > + if not ret: > + logger.error("Error create domain %s" % guest_name) > + return FAIL > > - ret = start_test_domain(guest_name, ip) > - if not ret: > - return FAIL, None > - > - time.sleep(10) > - except Exception: > - logger.error("Error creating domain %s" % guest_name) > - return FAIL, None > - > + time.sleep(10) I know this was existing code, but can you change this to poll_for_state_change() to check to see if the guest is running before moving on. > classname = 'Xen_ComputerSystem' > cs_ref = CIMInstanceName(classname, keybindings = { > 'Name':guest_name, > @@ -85,9 +78,9 @@ > else: > local_migrate = 0 > > - status, cs_ref = start_guest_get_ref(options.ip, dom_name) > + status, cs_ref = start_guest_get_ref(options.ip, dom_name, options.virt) > if status != PASS: > - destroy_and_undefine_domain(guest_name, options.ip) > + destroy_and_undefine_domain(dom_name, options.ip) Can you change the destroy_and_undefine_domain() calls to .destroy() and .undefine() calls? Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 22 19:00:23 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 22 Jul 2008 12:00:23 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update VSMigrationS.02 for XenFV support, also convert test_xml call to vxml In-Reply-To: <4aecbb8cdaeef5b7c135.1216721600@elm3b41.beaverton.ibm.com> References: <4aecbb8cdaeef5b7c135.1216721600@elm3b41.beaverton.ibm.com> Message-ID: <48862E47.7040504@linux.vnet.ibm.com> > -from XenKvmLib.test_doms import define_test_domain, start_test_domain, destroy_and_undefine_domain > -from XenKvmLib.test_xml import * > +from XenKvmLib.test_doms import destroy_and_undefine_domain Can you replace the destroy_and_undefine_domain() calls with .destroy() and .undefine() calls? > > -def setup_env(ip, migration_list, local_migrate): > +def setup_env(ip, migration_list, local_migrate, virt='Xen'): Since this is an internal function, it should be: def setup_env(ip, migration_list, local_migrate, virt) The caller should supply a value for virt whenever it calls this function. > +def start_guest(ip, guest_name, type, virt='Xen'): Same here. > + > time.sleep(10) Can this be replaced by poll_for_state_change()? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 22 19:47:50 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 22 Jul 2008 12:47:50 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Updating 04_hs_to_EAPF.py to use the verify_device_values() included in the logicaldevices.py In-Reply-To: References: Message-ID: <48863966.5010906@linux.vnet.ibm.com> > - else: > - status = FAIL > + status = verify_device_values(assoc_eafp_info, CCName, > + eafp_values, virt='Xen') > + There's an extra param included here. CCName isn't needed. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From yunguol at cn.ibm.com Wed Jul 23 06:00:02 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Tue, 22 Jul 2008 23:00:02 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #4 Update VSSDC.01 for KVM/XenFV/LXC support Message-ID: # HG changeset patch # User Guolian Yun # Date 1216792796 25200 # Node ID f311f3dfa6451c7e5efeda76582e36cd119a46d4 # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] #4 Update VSSDC.01 for KVM/XenFV/LXC support The test defines non-bootloader guests for all platform types, also remove the part of thet test that verifies the bootloader Updates from 1 to 2: Pass test_disk and test_mac as parameters into init_list() function. Updates from 2 to 3: Remove build_vssd_info() and call compare_all_prop() in assoc_values() Updates from 3 to 4: 1) Remove otiose rlist define line for LXC option 2) change assoc_values comments, it verifies all of the values of instance 3) check compare_all_prop return, if it return fail, print a log message Signed-off-by: Guolian Yun diff -r 3703b7be5a10 -r f311f3dfa645 suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Tue Jul 22 22:59:56 2008 -0700 @@ -52,32 +52,31 @@ import sys from XenKvmLib import enumclass from VirtLib import utils -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all -from XenKvmLib.test_xml import testxml_bl -from XenKvmLib.test_xml import xml_get_dom_bootloader +from XenKvmLib.test_doms import destroy_and_undefine_all +from XenKvmLib.assoc import compare_all_prop from CimTest import Globals from XenKvmLib import assoc +from XenKvmLib import vxml +from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger, do_main from CimTest.ReturnCodes import FAIL, PASS -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "VSSDC_dom" test_vcpus = 2 test_mac = "00:11:22:33:44:aa" test_disk = 'xvda' -status = 0 -VSType = "Xen" -def init_list(): +def init_list(test_disk, test_mac, virt='Xen'): """ Creating the lists that will be used for comparisons. """ - rlist = ['Xen_DiskResourceAllocationSettingData', - 'Xen_MemResourceAllocationSettingData', - 'Xen_NetResourceAllocationSettingData', - 'Xen_ProcResourceAllocationSettingData' + rlist = [get_typed_class(virt, 'DiskResourceAllocationSettingData'), + get_typed_class(virt, 'MemResourceAllocationSettingData'), + get_typed_class(virt, 'NetResourceAllocationSettingData'), + get_typed_class(virt, 'ProcResourceAllocationSettingData') ] prop_list = {rlist[0] : "%s/%s" % (test_dom, test_disk), @@ -85,57 +84,33 @@ rlist[2] : "%s/%s" % (test_dom, test_mac), rlist[3] : "%s/%s" % (test_dom, "proc") } + if virt == 'LXC': + prop_list = {rlist[1] : "%s/%s" % (test_dom, "mem")} return prop_list -def build_vssd_info(ip, vssd): - """ - Creating the vssd fileds lists that will be used for comparisons. - """ - - if vssd.Bootloader == "" or vssd.Caption == "" or \ - vssd.InstanceID == "" or vssd.ElementName == "" or \ - vssd.VirtualSystemIdentifier == "" or vssd.VirtualSystemType == "": - logger.error("One of the required VSSD details seems to be empty") - test_domain_function(test_dom, ip, "undefine") - return FAIL - - vssd_vals = {'Bootloader' : vssd.Bootloader, - 'Caption' : vssd.Caption, - 'InstanceID' : vssd.InstanceID, - 'ElementName' : vssd.ElementName, - 'VirtualSystemIdentifier' : vssd.VirtualSystemIdentifier, - 'VirtualSystemType' : vssd.VirtualSystemType - } - - return vssd_vals - -def assoc_values(ip, assoc_info, cn, an, vals): +def assoc_values(ip, assoc_info, cn, an, vssd): """ The association info of Xen_VirtualSystemSettingDataComponent with every RASDclass is - verified for following fields: - Caption, InstanceID, ElementName, VirtualSystemIdentifier, - VirtualSystemType, Bootloader + verified all of the values """ try: if len(assoc_info) != 1: - Globals.logger.error("%s returned %i resource objects for '%s'" % \ - (an, len(assoc_info), cn)) + logger.error("%s returned %i resource objects for '%s'" % \ + (an, len(assoc_info), cn)) return FAIL - - for prop, val in vals.iteritems(): - if assoc_info[0][prop] != val: - Globals.logger.error("%s mismatch: returned %s instead of %s" %\ - (prop, assoc_info[0][prop], val)) - return FAIL - - return PASS - + status = compare_all_prop(assoc_info[0], vssd) + if status != PASS: + logger.error("Verification error: got %s, expect %s" % \ + (assoc_info[0], vssd)) + return FAIL except Exception, detail : logger.error("Exception in assoc_values function: %s" % detail) - return FAIL + return FAIL + + return PASS @do_main(sup_types) def main(): @@ -143,49 +118,53 @@ status = FAIL destroy_and_undefine_all(options.ip) - test_xml = testxml_bl(test_dom, vcpus = test_vcpus, \ - mac = test_mac, disk = test_disk, \ - server = options.ip,\ - gtype = 0) - ret = test_domain_function(test_xml, options.ip, cmd = "define") + prop_list = init_list(test_disk, test_mac, options.virt) + virt_xml = vxml.get_class(options.virt) + if options.virt == 'LXC': + cxml = virt_xml(test_dom) + else: + cxml = virt_xml(test_dom, vcpus = test_vcpus, \ + mac = test_mac, disk = test_disk) + ret = cxml.define(options.ip) if not ret: logger.error("Failed to define the dom: %s", test_dom) return FAIL - instIdval = "%s:%s" % (VSType, test_dom) + if options.virt == 'XenFV': + instIdval = "Xen:%s" % test_dom + else: + instIdval = "%s:%s" % (options.virt, test_dom) + keyname = "InstanceID" + key_list = { 'InstanceID' : instIdval } + vssd_cn = get_typed_class(options.virt, 'VirtualSystemSettingData') - key_list = { 'InstanceID' : instIdval } try: vssd = enumclass.getInstance(options.ip, \ - enumclass.Xen_VirtualSystemSettingData, \ - key_list) + 'VirtualSystemSettingData', \ + key_list, \ + options.virt) if vssd is None: logger.error("VSSD instance for %s not found" % test_dom) - test_domain_function(test_dom, options.ip, "undefine") + cxml.undefine(options.ip) return FAIL - - vssd_vals = build_vssd_info(options.ip, vssd) - except Exception, detail : - logger.error(Globals.CIM_ERROR_GETINSTANCE, \ - 'Xen_VirtualSystemSettingData') + logger.error(Globals.CIM_ERROR_GETINSTANCE, vssd_cn) logger.error("Exception : %s" % detail) - test_domain_function(test_dom, options.ip, "undefine") + cxml.undefine(options.ip) return FAIL - prop_list = init_list() try: # Looping through the RASD_cllist, call association # Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist - an = 'Xen_VirtualSystemSettingDataComponent' + an = get_typed_class(options.virt, 'VirtualSystemSettingDataComponent') for rasd_cname, prop in prop_list.iteritems(): assoc_info = assoc.Associators(options.ip, an, rasd_cname, - InstanceID = prop) + options.virt, InstanceID = prop) # Verify the association fields returned for particular rasd_cname. status = assoc_values(options.ip, assoc_info, rasd_cname, an, - vssd_vals) + vssd) if status != PASS: break @@ -194,7 +173,7 @@ logger.error("Exception : %s" % detail) status = FAIL - test_domain_function(test_dom, options.ip, "undefine") + cxml.undefine(options.ip) return status if __name__ == "__main__": From yunguol at cn.ibm.com Wed Jul 23 05:57:58 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 23 Jul 2008 13:57:58 +0800 Subject: [Libvirt-cim] Cimtest Report for LXC on F9 (2008/07/07) In-Reply-To: <48860CC4.8090709@linux.vnet.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-23 00:37:24: > > > The guest isn't starting because the console is defined in the following > > > manner: > > > > > > /dev/ptmx > > > > > > It should be defined as: > > > > > > > > > > > > Daisy, can you work up a patch for this? > > > > Sure, good catch! > > Thanks Daisy! I applied your patch. ComputerSystem - > 04_defineStartVS.py now passes for me on LXC. Kaitlin, Does the patch applied on your own tree? There is no changed found when I try to update cimtest repository =) > > -- > 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 Wed Jul 23 06:10:31 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Tue, 22 Jul 2008 23:10:31 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Convert NetworkPort.02_np_gi_errors.py for LXC support Message-ID: <73fa12d7cfcbc69a683d.1216793431@elm3b41.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1216793420 25200 # Node ID 73fa12d7cfcbc69a683dde7e953996d447bceaab # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] Convert NetworkPort.02_np_gi_errors.py for LXC support Signed-off-by: Guolian Yun diff -r 3703b7be5a10 -r 73fa12d7cfcb suites/libvirt-cim/cimtest/NetworkPort/02_np_gi_errors.py --- a/suites/libvirt-cim/cimtest/NetworkPort/02_np_gi_errors.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/NetworkPort/02_np_gi_errors.py Tue Jul 22 23:10:20 2008 -0700 @@ -31,11 +31,11 @@ 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 XenXML, KVMXML, LXCXML, get_class from CimTest.ReturnCodes import PASS, SKIP from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS, do_main -sup_types = ['Xen', 'KVM', 'XenFV'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] expr_values = { @@ -242,8 +242,11 @@ test_dom = "nettest_domain" test_mac = "00:11:22:33:44:55" - - vsxml = get_class(options.virt)(test_dom, mac=test_mac) + + if options.virt == 'LXC': + vsxml = get_class(options.virt)(test_dom) + else: + vsxml = get_class(options.virt)(test_dom, mac=test_mac) ret = vsxml.define(options.ip) if ret != 1: logger.error("Define domain failed!") From yunguol at cn.ibm.com Wed Jul 23 06:07:52 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 23 Jul 2008 14:07:52 +0800 Subject: [Libvirt-cim] [TEST] Cimtest Report for LXC on F9 (2008/07/21) In-Reply-To: <48860D0F.6010509@linux.vnet.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-23 00:38:39: > Guo Lian Yun wrote: > > > > > > libvirt-cim-bounces at redhat.com wrote on 2008-07-22 00:30:30: > > > > > KR> 03_user_netport.py should pass. It's KVM only currently. Idon't see > > > KR> LXC_NET_USER in the lxc_conf.h. Do you know if LXC supports the user > > > KR> interface type? > > > > > > No, that wouldn't make much sense in an LXC environment. I can't > > > really see libvirt supporting anything other than the 'network' type. > > > > > Also, 02_np_gi_errors.py and 03_user_netport.py don't support LXC now. > > they are Xen/KVM/XenFV currently. > > It should be possible to convert 02_np_gi_errors.py to run on LXC. Can > you look into this? Yup, 02_np_gi_errors.py should support LXC, I will send a patch for this. > > Thanks! > > -- > 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 deeptik at linux.vnet.ibm.com Wed Jul 23 07:16:06 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 23 Jul 2008 12:46:06 +0530 Subject: [Libvirt-cim] CimTest Report for KVM on F9 23-07-2008 Message-ID: <4886DAB6.3040606@linux.vnet.ibm.com> ======================================================================== CIM Test Report for KVM on F9 with latest libvirt-cim and libcmpiutil ======================================================================== Distro : Fedora 9 Beta Kernel : 2.6.25-0.121.rc5.git4.fc9 Libvirt : libvirt-0.4.2-1.fc9.x86_64 CIMOM : pegasus PyWBEM : pywbem-0.6 CIM Schema : cimv216Experimental LibCMPIutil : 83 LibVirtCIM : 640 CIMTEST : 249 ======================================================= PASS : 111 FAIL : 1 XFAIL : 2 SKIP : 16 ----------------- Total : 130 ======================================================= Here is one of the tc that failed ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for indication Please find the complete report attached with the mail. Thanks and Regards, Deepti. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: July23-KVM-report URL: From yunguol at cn.ibm.com Wed Jul 23 07:23:50 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Wed, 23 Jul 2008 00:23:50 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Convert VirtualSystemMigrationService.01 to support XenFV Message-ID: <8fa80a82ac8cae0885c5.1216797830@elm3b41.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1216797825 25200 # Node ID 8fa80a82ac8cae0885c5d82cafde0b4e0d07a29e # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] #2 Convert VirtualSystemMigrationService.01 to support XenFV Updates from 1 to 2: 1) Change the destroy_and_undefine_domain() calls to .destroy() and .undefine() calls 2) Remove time.sleep(10), call poll_for_state_change() to check to see if the guest is running before moving on Signed-off-by: Guolian Yun diff -r 3703b7be5a10 -r 8fa80a82ac8c suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Wed Jul 23 00:23:45 2008 -0700 @@ -27,8 +27,8 @@ import pywbem from pywbem.cim_obj import CIMInstanceName from VirtLib import utils -from XenKvmLib.test_doms import define_test_domain, start_test_domain, destroy_and_undefine_domain -from XenKvmLib.test_xml import * +from XenKvmLib import vxml +from XenKvmLib.common_util import poll_for_state_change from XenKvmLib import computersystem from XenKvmLib import vsmigrations from XenKvmLib.vsmigrations import check_possible_host_migration, migrate_guest_to_host, check_migration_job @@ -36,24 +36,24 @@ from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV'] dom_name = 'dom_migrate' -def start_guest_get_ref(ip, guest_name): - try: - xmlfile = testxml(guest_name) - ret = define_test_domain(xmlfile, ip) - if not ret: - return FAIL, None +REQUESTED_STATE = 2 - ret = start_test_domain(guest_name, ip) - if not ret: - return FAIL, None +def start_guest_get_ref(ip, guest_name, virt): + virt_xml = vxml.get_class(virt) + cxml = virt_xml(guest_name) + ret = cxml.create(ip) + if not ret: + logger.error("Error create domain %s" % guest_name) + return FAIL - time.sleep(10) - except Exception: - logger.error("Error creating domain %s" % guest_name) - return FAIL, None + status = poll_for_state_change(ip, virt, guest_name, + REQUESTED_STATE) + if status != PASS: + raise Exception("%s didn't change state as expected" % guest_name) + return FAIL classname = 'Xen_ComputerSystem' cs_ref = CIMInstanceName(classname, keybindings = { @@ -61,9 +61,9 @@ 'CreationClassName':classname}) if cs_ref is None: - return FAIL, None + return FAIL, None, cxml - return PASS, cs_ref + return PASS, cs_ref, cxml @do_main(sup_types) def main(): @@ -85,23 +85,26 @@ else: local_migrate = 0 - status, cs_ref = start_guest_get_ref(options.ip, dom_name) + status, cs_ref, cxml = start_guest_get_ref(options.ip, dom_name, options.virt) if status != PASS: - destroy_and_undefine_domain(guest_name, options.ip) + cxml.destroy(options.ip) + cxml.undefine(options.ip) return FAIL guest_name = cs_ref['Name'] status = check_possible_host_migration(service, cs_ref, target_ip) if status != PASS: - destroy_and_undefine_domain(dom_name, options.ip) + cxml.destroy(options.ip) + cxml.undefine(options.ip) return FAIL status, ret = migrate_guest_to_host(service, cs_ref, target_ip) if status == FAIL: logger.error("MigrateVirtualSystemToHost: unexpected list length %s" % len(ret)) - destroy_and_undefine_domain(dom_name, options.ip) + cxml.destroy(options.ip) + cxml.undefine(options.ip) return status elif len(ret) == 2: id = ret[1]['Job'].keybindings['InstanceID'] @@ -109,8 +112,8 @@ status = check_migration_job(options.ip, id, target_ip, guest_name, local_migrate) - - destroy_and_undefine_domain(dom_name, options.ip) + cxml.destroy(options.ip) + cxml.undefine(options.ip) return status From yunguol at cn.ibm.com Wed Jul 23 07:30:13 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Wed, 23 Jul 2008 00:30:13 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Convert VirtualSystemMigrationService.02 for XenFV support Message-ID: <5fd2b27efd0c0da47d15.1216798213@elm3b41.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1216798202 25200 # Node ID 5fd2b27efd0c0da47d15b9f365dba667293baca0 # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] #2 Convert VirtualSystemMigrationService.02 for XenFV support Updates from 1 to 2: 1) Change the destroy_and_undefine_domain() calls to .destroy() and .undefine() calls 2) Remove time.sleep(10), call poll_for_state_change() to check to see if the guest is running before moving on 3) Cancle virt default setting in internal function Signed-off-by: Guolian Yun diff -r 3703b7be5a10 -r 5fd2b27efd0c suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Wed Jul 23 00:30:02 2008 -0700 @@ -25,8 +25,8 @@ import pywbem from pywbem.cim_obj import CIMInstanceName from VirtLib import utils -from XenKvmLib.test_doms import define_test_domain, start_test_domain, destroy_and_undefine_domain -from XenKvmLib.test_xml import * +from XenKvmLib import vxml +from XenKvmLib.common_util import poll_for_state_change from XenKvmLib import computersystem from XenKvmLib import vsmigrations from XenKvmLib.vsmigrations import check_possible_host_migration, migrate_guest_to_host, check_migration_job @@ -34,17 +34,19 @@ from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV'] dom_name = 'dom_migrate' +REQUESTED_STATE = 2 -def define_guest_get_ref(ip, guest_name): +def define_guest_get_ref(ip, guest_name, virt): try: - xmlfile = testxml(guest_name) - define_test_domain(xmlfile, ip) + virt_xml = vxml.get_class(virt) + cxml = virt_xml(guest_name) + cxml.define(ip) except Exception: logger.error("Error define domain %s" % guest_name) - destroy_and_undefine_domain(guest_name, options.ip) + cxml.undefine(ip) return FAIL, None classname = 'Xen_ComputerSystem' @@ -54,18 +56,18 @@ return PASS, cs_ref -def setup_env(ip, migration_list, local_migrate): +def setup_env(ip, migration_list, local_migrate, virt): ref_list = [] if local_migrate == 1: for i in range(0, len(migration_list)): guest_name = "%s-%i" % (dom_name, i) - status, ref = define_guest_get_ref(ip, guest_name) + status, ref = define_guest_get_ref(ip, guest_name, virt) if status != PASS: return FAIL, None ref_list.append(ref) else: - status, ref = define_guest_get_ref(ip, dom_name) + status, ref = define_guest_get_ref(ip, dom_name, virt) if status != PASS: return FAIL, None ref_list.append(ref) @@ -90,16 +92,24 @@ return migration_list -def start_guest(ip, guest_name, type): +def start_guest(ip, guest_name, type, virt): if type != "Offline": try: - start_test_domain(guest_name, ip) - time.sleep(10) + virt_xml = vxml.get_class(virt) + cxml = virt_xml(guest_name) + cxml.start(ip) + + status = poll_for_state_change(ip, virt, guest_name, + REQUESTED_STATE) + if status != PASS: + raise Exception("%s didn't change state as expected" % guest_name) + return FAIL, None + except Exception: logger.error("Error start domain %s" % guest_name) - return FAIL + return FAIL, None - return PASS + return PASS, cxml @do_main(sup_types) def main(): @@ -126,7 +136,7 @@ ref_list = [] cs_ref = None - status, ref_list = setup_env(options.ip, mlist, local_migrate) + status, ref_list = setup_env(options.ip, mlist, local_migrate, options.virt) if status != PASS or len(ref_list) < 1: return FAIL @@ -135,7 +145,7 @@ for type, item in mlist.iteritems(): guest_name = cs_ref['Name'] - status = start_guest(options.ip, guest_name, type) + status, cxml = start_guest(options.ip, guest_name, type, options.virt) if status != PASS: break @@ -149,7 +159,8 @@ if status == FAIL: logger.error("MigrateVirtualSystemToHost: unexpected list length %s" % len(ret)) - destroy_and_undefine_domain(dom_name, options.ip) + cxml.destroy(options.ip) + cxml.undefine(options.ip) return status elif len(ret) == 2: id = ret[1]['Job'].keybindings['InstanceID'] @@ -161,13 +172,15 @@ #Get new ref if local_migrate == 1: - destroy_and_undefine_domain(guest_name, options.ip) + cxml.destroy(options.ip) + cxml.undefine(options.ip) ref_list.remove(cs_ref) if len(ref_list) > 0: cs_ref = ref_list[0] if local_migrate == 0: - destroy_and_undefine_domain(dom_name, options.ip) + cxml.destroy(options.ip) + cxml.undefine(options.ip) return status From yunguol at cn.ibm.com Wed Jul 23 07:32:42 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Wed, 23 Jul 2008 00:32:42 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Convert VirtualSystemMigrationService.05 to support XenFV Message-ID: <567173832c7fb213be72.1216798362@elm3b41.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1216798356 25200 # Node ID 567173832c7fb213be726e0dff29cc1b559449f8 # Parent 3703b7be5a107c67e901546978e974546b3d5562 [TEST] #2 Convert VirtualSystemMigrationService.05 to support XenFV Updates from 1 to 2: Change the destroy_and_undefine_domain() calls to .destroy() and .undefine() calls Signed-off-by: Guolian Yun diff -r 3703b7be5a10 -r 567173832c7f suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Wed Jul 16 07:23:32 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Wed Jul 23 00:32:36 2008 -0700 @@ -24,14 +24,13 @@ import pywbem from pywbem.cim_obj import CIMInstanceName from VirtLib import utils -from XenKvmLib.test_doms import define_test_domain, start_test_domain, destroy_and_undefine_domain -from XenKvmLib.test_xml import * +from XenKvmLib import vxml from XenKvmLib import computersystem from XenKvmLib import vsmigrations from CimTest.Globals import logger, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV'] test_dom = 'dom_migration' exp_rc = 1 #CIM_ERR_FAILED @@ -40,23 +39,17 @@ @do_main(sup_types) def main(): options = main.options - xmlfile = testxml(test_dom) + + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom) + ret = cxml.create(options.ip) + if not ret: + logger.error("Error create domain %s" % test_dom ) + return FAIL status = FAIL rc = -1 - try: - define_test_domain(xmlfile, options.ip) - except Exception: - logger.error("Error define domain %s" % test_dom) - return FAIL - - try: - start_test_domain(test_dom, options.ip) - except Exception: - logger.error("Error start domain %s" % test_dom) - return FAIL - try: service = vsmigrations.Xen_VirtualSystemMigrationService(options.ip) except Exception: @@ -87,7 +80,9 @@ if rc == 0: logger.error('Migrate to host method should NOT return OK with a wrong key input') - destroy_and_undefine_domain(test_dom, options.ip) + cxml.destroy(options.ip) + cxml.undefine(options.ip) + return status if __name__ == "__main__": From deeptik at linux.vnet.ibm.com Wed Jul 23 07:34:05 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 23 Jul 2008 13:04:05 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Updating 04_hs_to_EAPF.py to use the verify_device_values() included in the logicaldevices.py In-Reply-To: <48863966.5010906@linux.vnet.ibm.com> References: <48863966.5010906@linux.vnet.ibm.com> Message-ID: <4886DEED.5080601@linux.vnet.ibm.com> Kaitlin Rupert wrote: >> - else: >> - status = FAIL >> + status = verify_device_values(assoc_eafp_info, CCName, + >> eafp_values, virt='Xen') >> + > > There's an extra param included here. CCName isn't needed. > The definition of the verify_device_values() in logicaldevices.py takes the 4 arguments and hence all the 4 which includes CCName is required. The following is the definition in logicaldevices.py : def verify_device_values(assoc_info, CCName, list_values, virt='Xen'): dev_cnames = ['LogicalDisk', 'Memory', 'NetworkPort', 'Processor'] for i in range(len(dev_cnames)): dev_cnames[i] = get_typed_class(virt, dev_cnames[i]) .............. Regards, Deepti. From deeptik at linux.vnet.ibm.com Wed Jul 23 10:13:01 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 23 Jul 2008 15:43:01 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #3 Fix potiential false positive in AC 01 In-Reply-To: <28e2e11309e79c9285a1.1216742189@elm3b41.beaverton.ibm.com> References: <28e2e11309e79c9285a1.1216742189@elm3b41.beaverton.ibm.com> Message-ID: <4887042D.2000807@linux.vnet.ibm.com> +1 for me. Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1216742122 25200 > # Node ID 28e2e11309e79c9285a122ec1f387dc1f7511e7c > # Parent 3703b7be5a107c67e901546978e974546b3d5562 > [TEST] #3 Fix potiential false positive in AC 01. > > This test needs to verify enum of AC returns the same number of instances as the number of instances returned by enum of MemoryPool + ProcessorPool + DiskPool + NetworkPool. > > Also, cleaned up the logic to verify that the ResourceType and the InstanceIDs of the AC instances match the Pool instances they're describing. > > Updates from 1 to 2: > -Create a disk pool and network pool to ensure there is an instance for each pool type. > -Add comment explaining the purpose of the test. > > Updates from 2 to 3: > -Change if len(pools) < 1 to if len(pools) < 4 > -Add log message if this if statement fails. > > Signed-off-by: Kaitlin Rupert > > diff -r 3703b7be5a10 -r 28e2e11309e7 suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py > --- a/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Wed Jul 16 07:23:32 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Tue Jul 22 08:55:22 2008 -0700 > @@ -20,63 +20,98 @@ > # 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 verifies the enum of AC returns the same number of instances as > +# the number of instances returned by enum of: > +# MemoryPool + ProcessorPool + DiskPool + NetworkPool. > +# > > import sys > +from VirtLib.live import virsh_version > from XenKvmLib import enumclass > from CimTest.Globals import do_main > from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, platform_sup > from CimTest.ReturnCodes import PASS, FAIL > +from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ > + create_netpool_conf, destroy_netpool > > sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > + > +def enum_pools_and_ac(ip, virt, cn): > + pools = {} > + ac = [] > + > + pt = ['MemoryPool', 'ProcessorPool', 'DiskPool', 'NetworkPool'] > + > + try: > + key = ["InstanceID"] > + ac = enumclass.enumerate(ip, cn, key, virt) > + > + for p in pt: > + enum_list = enumclass.enumerate(ip, p, key, virt) > + > + if len(enum_list) < 1: > + logger.error("%s did not return any instances" % p) > + return pools, ac > + > + for pool in enum_list: > + pools[pool.InstanceID] = pool > + > + except Exception, details: > + logger.error(CIM_ERROR_ENUMERATE, cn) > + logger.error(details) > + return pools, ac > + > + if len(ac) != len(pools): > + logger.error("%s returned %s instances, expected %s" % (cn, len(ac), > + len(pools))) > + return pools, ac > + > +def compare_pool_to_ac(ac, pools, cn): > + try: > + for inst in ac: > + id = inst.InstanceID > + if pools[id].ResourceType != inst.ResourceType: > + logger.error("%s ResourceType %s, Pool ResourceType %s" % (cn, > + inst.ResourceType, pools[id].ResourceType)) > + return FAIL > + > + except Exception, details: > + logger.error("%s returned instance with unexpected InstanceID %s" % (cn, > + details)) > + return FAIL > + > + return PASS > + > @do_main(sup_types) > def main(): > options = main.options > > - pools = {} > - pt = ['MemoryPool', 'ProcessorPool', 'DiskPool', 'NetworkPool'] > - try: > - key_list = ["InstanceID"] > - ac = enumclass.enumerate(options.ip, > - "AllocationCapabilities", > - key_list, > - options.virt) > - pools['MemoryPool'] = enumclass.enumerate(options.ip, > - "MemoryPool", > - key_list, > - options.virt) > - pools['ProcessorPool'] = enumclass.enumerate(options.ip, > - "ProcessorPool", > - key_list, > - options.virt) > - pools['DiskPool'] = enumclass.enumerate(options.ip, > - "DiskPool", > - key_list, > - options.virt) > - pools['NetworkPool'] = enumclass.enumerate(options.ip, > - "NetworkPool", > - key_list, > - options.virt) > - except Exception: > - logger.error(CIM_ERROR_ENUMERATE, '%s_AllocationCapabilities' % options.virt) > - return FAIL > - > - acset = set([(x.InstanceID, x.ResourceType) for x in ac]) > - poolset = set() > - for pl in pools.values(): > - for x in pl: > - poolset.add((x.InstanceID, x.ResourceType)) > + cn = 'AllocationCapabilities' > > - if len(acset) != len(poolset): > - logger.error( > - 'AllocationCapabilities return %i instances, excepted %i' > - % (ac_size, pool_size)) > - return FAIL > - zeroset = acset - poolset > - if len(zeroset) != 0: > - logger.error('AC is inconsistent with pools') > + status, diskid = create_diskpool_conf(options.ip, options.virt) > + if status != PASS: > + cleanup_restore(options.ip, options.virt) > + return FAIL > + > + status, test_network = create_netpool_conf(options.ip, options.virt) > + if status != PASS: > + cleanup_restore(options.ip, options.virt) > + destroy_netpool(options.ip, options.virt, test_network) > + return FAIL > + > + pools, ac = enum_pools_and_ac(options.ip, options.virt, cn) > + if len(pools) < 4: > + logger.error("Only %d pools returned, expected at least 4" % len(pools)) > + cleanup_restore(options.ip, options.virt) > + destroy_netpool(options.ip, options.virt, test_network) > return FAIL > > - return PASS > + status = compare_pool_to_ac(ac, pools, cn) > + > + cleanup_restore(options.ip, options.virt) > + destroy_netpool(options.ip, options.virt, test_network) > + > + 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 > From deeptik at linux.vnet.ibm.com Wed Jul 23 09:53:18 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 23 Jul 2008 15:23:18 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #4 Fix CS 22 to use providers instead of virsh In-Reply-To: <0b2f67eed74e01561029.1216741606@elm3b41.beaverton.ibm.com> References: <0b2f67eed74e01561029.1216741606@elm3b41.beaverton.ibm.com> Message-ID: <4886FF8E.5020908@linux.vnet.ibm.com> +1 for me :). Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1216741569 25200 > # Node ID 0b2f67eed74e01561029d4c46fc8d54716e9b462 > # Parent 9fb3407dd5098ab438653d4854d77b44ff9888e1 > [TEST] #4 Fix CS 22 to use providers instead of virsh. > > This test was defining a guest with virsh and then suspending it with virsh, which doesn't touch the providers in anyway. Now the test calls DefineSystem() and RequestStateChange(). > > Updates from 1 to 2: > -Add check to verify guest is the expected state after the RequestStateChange() call. > -Create a network pool because the VSMS provider requires a network pool to exist in order to create a guest. > > Updates from 2 to 3: > -Remove destroy_netpool() if create_netpool_conf() fails. This is not needed. > > Updates from 3 to 4: > -Changed log message from "%s not in defined state as expected." to "%s should have been in defined state" > > Signed-off-by: Kaitlin Rupert > > diff -r 9fb3407dd509 -r 0b2f67eed74e suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py > --- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Mon Jul 21 09:51:32 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Tue Jul 22 08:46:09 2008 -0700 > @@ -32,54 +32,71 @@ > from XenKvmLib import computersystem > from VirtLib import utils > from XenKvmLib import vxml > -from XenKvmLib.test_doms import destroy_and_undefine_all > -from CimTest.Globals import do_main > -from CimTest import Globals > +from XenKvmLib.test_doms import destroy_and_undefine_domain > +from CimTest.Globals import do_main, logger > from CimTest.ReturnCodes import PASS, FAIL > +from XenKvmLib.common_util import create_using_definesystem, \ > + call_request_state_change, get_cs_instance, \ > + create_netpool_conf, destroy_netpool > > sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > test_dom = "domgst" > > +DEFINE_STATE = 3 > +SUSPND_STATE = 9 > +TIME = "00000000000000.000000:000" > + > +def chk_state(domain_name, ip, en_state, virt): > + rc, cs = get_cs_instance(domain_name, ip, virt) > + if rc != 0: > + return rc > + > + if cs.EnabledState != en_state: > + logger.error("EnabledState should be %d not %d", > + en_state, cs.EnabledState) > + return FAIL > + > + return PASS > + > @do_main(sup_types) > def main(): > options = main.options > - status = FAIL > - > - cxml = vxml.get_class(options.virt)(test_dom) > > -#define VS > + status, test_network = create_netpool_conf(options.ip, options.virt) > + if status != PASS: > + return FAIL > + > try: > - ret = cxml.define(options.ip) > - if not ret: > - Globals.logger.error(Globals.VIRSH_ERROR_DEFINE % test_dom) > - return status > - > - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) > - if not (cs.Name == test_dom) : > - Globals.logger.error("Error: VS %s not found" % test_dom) > - cxml.undefine(options.ip) > + # define the vs > + status = create_using_definesystem(test_dom, options.ip, > + virt=options.virt) > + if status != PASS: > + logger.error("Unable to define %s using DefineSystem()" % test_dom) > + destroy_netpool(options.ip, options.virt, test_network) > return status > > - except Exception, detail: > - Globals.logger.error("Errors: %s" % detail) > + # suspend the vs > + status = call_request_state_change(test_dom, options.ip, SUSPND_STATE, > + TIME, virt=options.virt) > + if status != PASS: > + logger.info("Suspending defined %s failed, as expected" % test_dom) > + status = PASS > > -#Suspend the defined VS > - > - try: > - ret = cxml.run_virsh_cmd(options.ip, "suspend") > - if not ret : > - Globals.logger.info("Suspending defined VS %s failed, as expected" \ > -% test_dom) > - status = PASS > + status = chk_state(test_dom, options.ip, DEFINE_STATE, options.virt) > + if status != PASS: > + logger.error("%s should have been in defined state" % test_dom) > + status = FAIL > + > else : > - Globals.logger.info("Error: Suspending defined VS %s should not \ > -have been allowed" % test_dom) > + logger.error("Suspending defined %s should have failed" % test_dom) > status = FAIL > > except Exception, detail: > - Globals.logger.error("Error: %s" % detail) > + logger.error("Error: %s" % detail) > + status = FAIL > > - ret = cxml.undefine(options.ip) > + destroy_netpool(options.ip, options.virt, test_network) > + destroy_and_undefine_domain(test_dom, options.ip, options.virt) > return status > > if __name__ == "__main__": > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From danms at us.ibm.com Wed Jul 23 14:37:25 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 23 Jul 2008 07:37:25 -0700 Subject: [Libvirt-cim] [PATCH] Fix DiskRASD size reporting Message-ID: # HG changeset patch # User Dan Smith # Date 1216823843 25200 # Node ID e8d39d291bb30a5337605c4ba97f20acb97ab859 # Parent 427e74d2c45881820ee33b8b6cdeb9cff57a68c0 Fix DiskRASD size reporting I *know* this was in place at one point, but I think it might have gotten lost in the changes to add libvirt storage support. We definitely need a test for this to make sure this functionality doesn't regress again. Signed-off-by: Dan Smith diff -r 427e74d2c458 -r e8d39d291bb3 src/Virt_RASD.c --- a/src/Virt_RASD.c Mon Jul 21 13:28:13 2008 -0700 +++ b/src/Virt_RASD.c Wed Jul 23 07:37:23 2008 -0700 @@ -142,6 +142,83 @@ return s; } +#if LIBVIR_VERSION_NUMBER > 4000 +static bool get_vol_size(const CMPIBroker *broker, + const CMPIObjectPath *ref, + const char *image, + uint64_t *size) +{ + virConnectPtr conn = NULL; + virStorageVolPtr vol = NULL; + virStorageVolInfo volinfo; + CMPIStatus s; + + *size = 0; + + conn = connect_by_classname(broker, CLASSNAME(ref), &s); + if (conn == NULL) + return false; + + vol = virStorageVolLookupByPath(conn, image); + if (vol != NULL) { + if (virStorageVolGetInfo(vol, &volinfo) != 0) { + CU_DEBUG("Failed to get info for volume %s", image); + } else { + *size = volinfo.capacity; + } + } + + virStorageVolFree(vol); + virConnectClose(conn); + + return true; +} +#else +static bool get_vol_size(const CMPIBroker * broker, + const CMPIObjectPath *ref, + const char *image, + uint64_t *size) +{ + struct stat st; + + if (stat(image, &st) == -1) + return false; + + *size = st.st_size; + + return true; +} +#endif + +static CMPIStatus set_disk_rasd_params(const CMPIBroker *broker, + const CMPIObjectPath *ref, + const struct virt_device *dev, + CMPIInstance *inst) +{ + uint64_t cap = 0; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + get_vol_size(broker, ref, dev->dev.disk.source, &cap); + + CMSetProperty(inst, "VirtualQuantity", + (CMPIValue *)&cap, CMPI_uint64); + + CMSetProperty(inst, "AllocationUnits", + (CMPIValue *)"Bytes", CMPI_chars); + + CMSetProperty(inst, + "VirtualDevice", + (CMPIValue *)dev->dev.disk.virtual_dev, + CMPI_chars); + + CMSetProperty(inst, + "Address", + (CMPIValue *)dev->dev.disk.source, + CMPI_chars); + + return s; +} + static CMPIInstance *rasd_from_vdev(const CMPIBroker *broker, struct virt_device *dev, const char *host, @@ -192,14 +269,7 @@ (CMPIValue *)&type, CMPI_uint16); if (dev->type == CIM_RES_TYPE_DISK) { - CMSetProperty(inst, - "VirtualDevice", - (CMPIValue *)dev->dev.disk.virtual_dev, - CMPI_chars); - CMSetProperty(inst, - "Address", - (CMPIValue *)dev->dev.disk.source, - CMPI_chars); + s = set_disk_rasd_params(broker, ref, dev, inst); } else if (dev->type == CIM_RES_TYPE_NET) { CMSetProperty(inst, "NetworkType", From danms at us.ibm.com Wed Jul 23 14:53:20 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 23 Jul 2008 07:53:20 -0700 Subject: [Libvirt-cim] [PATCH] Don't clobber KVM user-type network devices when we redefine a guest Message-ID: # HG changeset patch # User Dan Smith # Date 1216824788 25200 # Node ID caa024a3a0938bcb709df190a02fcce0d738c165 # Parent e8d39d291bb30a5337605c4ba97f20acb97ab859 Don't clobber KVM user-type network devices when we redefine a guest. This also makes KVM_NetworkPort expose an instance for user-type interfaces, and thus causes 03_user_netport to pass. Signed-off-by: Dan Smith diff -r e8d39d291bb3 -r caa024a3a093 libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Wed Jul 23 07:37:23 2008 -0700 +++ b/libxkutil/device_parsing.c Wed Jul 23 07:53:08 2008 -0700 @@ -310,6 +310,8 @@ ndev->source = strdup(DEFAULT_NETWORK); CU_DEBUG("No network, taking default of `%s'\n", ndev->source); + } else if (STREQC(ndev->type, "user")){ + CU_DEBUG("Leaving source blank for user net type"); } else { /* This likely indicates an unsupported * network configuration diff -r e8d39d291bb3 -r caa024a3a093 libxkutil/xmlgen.c --- a/libxkutil/xmlgen.c Wed Jul 23 07:37:23 2008 -0700 +++ b/libxkutil/xmlgen.c Wed Jul 23 07:53:08 2008 -0700 @@ -244,12 +244,36 @@ return true; } +static bool user_net_to_xml(char **xml, struct virt_device *dev) +{ + int ret; + char *_xml; + struct net_device *net = &dev->dev.net; + + ret = asprintf(&_xml, + "\n" + " \n" + "\n", + net->type, + net->mac); + if (ret == -1) + return false; + else + astrcat(xml, _xml); + + free(_xml); + + return true; +} + static bool net_to_xml(char **xml, struct virt_device *dev) { if (STREQ(dev->dev.net.type, "network")) return network_net_to_xml(xml, dev); else if (STREQ(dev->dev.net.type, "bridge")) return bridge_net_to_xml(xml, dev); + else if (STREQ(dev->dev.net.type, "user")) + return user_net_to_xml(xml, dev); else return false; } From bewith.tej at gmail.com Wed Jul 23 15:17:16 2008 From: bewith.tej at gmail.com (Tej) Date: Wed, 23 Jul 2008 20:47:16 +0530 Subject: [Libvirt-cim] Xen Domain Management CIM-Provider Message-ID: I am trying to understand the provider implementation for Xen VM lifecycle management. Does the xen provider (libvirt/xen-cim) uses the xenstore to access/change the configuration information regarding the domains. e.g if Xen Client has to changes the memory allocation for any of the domain (i assume discover of domain/UUID/domid is already done) then can it uses xenstore to perform the operation in following way. *xenstore-write /local/domain/domid/memory/target (balloon watch node)* Or Is there any other method to perform the same operations. thanks in advance for any information or pointers Tej From danms at us.ibm.com Wed Jul 23 15:21:27 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 23 Jul 2008 08:21:27 -0700 Subject: [Libvirt-cim] [PATCH] Add hypervisor version information to the Caption field of the VSMS Message-ID: <8d236493f5d67a952bfa.1216826487@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1216826114 25200 # Node ID 8d236493f5d67a952bfab94a3fc19a34b3fdf394 # Parent caa024a3a0938bcb709df190a02fcce0d738c165 Add hypervisor version information to the Caption field of the VSMS. I don't really see anywhere else this fits into the model, so setting the caption as such seems reasonable to me. Comments and arguments are welcome :) Signed-off-by: Dan Smith diff -r caa024a3a093 -r 8d236493f5d6 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Jul 23 07:53:08 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Wed Jul 23 08:15:14 2008 -0700 @@ -1706,6 +1706,9 @@ const char *name = NULL; const char *ccname = NULL; virConnectPtr conn = NULL; + unsigned long hv_version = 0; + const char * hv_type = NULL; + char *caption = NULL; *_inst = NULL; conn = connect_by_classname(broker, CLASSNAME(reference), &s); @@ -1742,6 +1745,30 @@ goto out; } + hv_type = virConnectGetType(conn); + if (hv_type == NULL) + hv_type = "Unkown"; + + if (virConnectGetVersion(conn, &hv_version) < 0) { + CU_DEBUG("Unable to get hypervisor version"); + hv_version = 0; + } + + if (asprintf(&caption, + "%s %lu.%lu.%lu", + hv_type, + hv_version / 1000000, + (hv_version % 1000000) / 1000, + (hv_version % 1000000) % 1000) == -1) + caption = NULL; + + if (caption != NULL) + CMSetProperty(inst, "Caption", + (CMPIValue *)caption, CMPI_chars); + else + CMSetProperty(inst, "Caption", + (CMPIValue *)"Unknown Hypervisor", CMPI_chars); + CMSetProperty(inst, "Name", (CMPIValue *)"Management Service", CMPI_chars); @@ -1767,6 +1794,7 @@ CMPI_RC_OK, ""); out: + free(caption); virConnectClose(conn); *_inst = inst; From danms at us.ibm.com Wed Jul 23 15:26:46 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 23 Jul 2008 08:26:46 -0700 Subject: [Libvirt-cim] Xen Domain Management CIM-Provider In-Reply-To: (Tej's message of "Wed, 23 Jul 2008 20:47:16 +0530") References: Message-ID: <87sku0hb9l.fsf@caffeine.beaverton.ibm.com> T> Does the xen provider (libvirt/xen-cim) uses the xenstore to T> access/change the configuration information regarding the domains. T> e.g if Xen Client has to changes the memory allocation for any of T> the domain (i assume discover of domain/UUID/domid is already done) T> then can it uses xenstore to perform the operation in following T> way. We use libvirt to perform things like this, so your question is really one of "how does libvirt change the memory for a Xen guest". I believe that libvirt goes through xend to make such changes, but I could be wrong. There are three drivers in libvirt that provide different paths to make certain changes. Some things are done directly against the hypervisor, while others go to xend directly. By default, a combination of those drivers are used. From a quick look at the libvirt code, I think the virDomainSetMemory() call is being sent to xend. Hope that helps... -- 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 Jul 23 15:47:55 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 23 Jul 2008 08:47:55 -0700 Subject: [Libvirt-cim] [PATCH] Fix units adherence in MemoryRASD processing in DefineSystem() Message-ID: # HG changeset patch # User Dan Smith # Date 1216828041 25200 # Node ID f542e90d4c672efa40a907b8c7040d6df714bd38 # Parent 8d236493f5d67a952bfab94a3fc19a34b3fdf394 Fix units adherence in MemoryRASD processing in DefineSystem() Signed-off-by: Dan Smith diff -r 8d236493f5d6 -r f542e90d4c67 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Jul 23 08:15:14 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Wed Jul 23 08:47:21 2008 -0700 @@ -469,12 +469,37 @@ static const char *mem_rasd_to_vdev(CMPIInstance *inst, struct virt_device *dev) { + const char *units; + int shift; + 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; + + if (cu_get_str_prop(inst, "AllocationUnits", &units) != CMPI_RC_OK) { + CU_DEBUG("Memory RASD has no units, assuming bytes"); + units = "Bytes"; + } + + if (STREQC(units, "Bytes")) + shift = -10; + else if (STREQC(units, "KiloBytes")) + shift = 0; + else if (STREQC(units, "MegaBytes")) + shift = 10; + else if (STREQC(units, "GigaBytes")) + shift = 20; + else + return "Unknown AllocationUnits in Memory RASD"; + + if (shift < 0) { + dev->dev.mem.size >>= -shift; + dev->dev.mem.maxsize >>= -shift; + } else { + dev->dev.mem.size <<= shift; + dev->dev.mem.maxsize <<= shift; + } return NULL; } From kaitlin at linux.vnet.ibm.com Wed Jul 23 16:38:43 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 09:38:43 -0700 Subject: [Libvirt-cim] [PATCH] Don't clobber KVM user-type network devices when we redefine a guest In-Reply-To: References: Message-ID: <48875E93.4040604@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1216824788 25200 > # Node ID caa024a3a0938bcb709df190a02fcce0d738c165 > # Parent e8d39d291bb30a5337605c4ba97f20acb97ab859 > Don't clobber KVM user-type network devices when we redefine a guest. > > This also makes KVM_NetworkPort expose an instance for user-type interfaces, > and thus causes 03_user_netport to pass. > > Signed-off-by: Dan Smith > +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From bewith.tej at gmail.com Wed Jul 23 17:15:01 2008 From: bewith.tej at gmail.com (Tej) Date: Wed, 23 Jul 2008 22:45:01 +0530 Subject: [Libvirt-cim] Xen Domain Management CIM-Provider In-Reply-To: <87sku0hb9l.fsf@caffeine.beaverton.ibm.com> References: <87sku0hb9l.fsf@caffeine.beaverton.ibm.com> Message-ID: On Wed, Jul 23, 2008 at 8:56 PM, Dan Smith wrote: > T> Does the xen provider (libvirt/xen-cim) uses the xenstore to > T> access/change the configuration information regarding the domains. > T> e.g if Xen Client has to changes the memory allocation for any of > T> the domain (i assume discover of domain/UUID/domid is already done) > T> then can it uses xenstore to perform the operation in following > T> way. > > We use libvirt to perform things like this, so your question is really > one of "how does libvirt change the memory for a Xen guest". yaa > > I believe that libvirt goes through xend to make such changes, but I > could be wrong. There are three drivers in libvirt that provide > different paths to make certain changes. Some things are done > directly against the hypervisor, while others go to xend directly. By > default, a combination of those drivers are used. From a quick look > at the libvirt code, I think the virDomainSetMemory() call is being > sent to xend. basically i want to know that is xend manipulate the xenstore to change the VM's memory or there any other mechanism which dom0 follows. If ballooning of memory happens through xend, it means two paths which i am not sure how it happens. 1. Xenstore shared memory page and event channel is mapped to dom0 memory area. Now xend enamurate all the VM's in xenstore thorough xen bus. Now change the balloon watch node for the concern domain, i.e /local/domain/domaid/memory/target 2. Instead of using the xen bus interface, xend directly uses the xenstore API (i.e. xenstore-write) to manipulate the xenstore node. my best guess is the path 1. sorry for my little understanding on xend code. > > Hope that helps... thanks for your quick reply. -tej > > -- > Dan Smith > IBM Linux Technology Center > Open Hypervisor Team > email: danms at us.ibm.com > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From danms at us.ibm.com Wed Jul 23 17:27:55 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 23 Jul 2008 10:27:55 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Convert NetworkPort.02_np_gi_errors.py for LXC support In-Reply-To: <73fa12d7cfcbc69a683d.1216793431@elm3b41.beaverton.ibm.com> (yunguol@cn.ibm.com's message of "Tue, 22 Jul 2008 23:10:31 -0700") References: <73fa12d7cfcbc69a683d.1216793431@elm3b41.beaverton.ibm.com> Message-ID: <87od4oh5no.fsf@caffeine.beaverton.ibm.com> GY> + GY> + if options.virt == 'LXC': GY> + vsxml = get_class(options.virt)(test_dom) GY> + else: GY> + vsxml = get_class(options.virt)(test_dom, mac=test_mac) Why? LXC network devices take a mac address argument as well. -- 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 Jul 23 17:30:12 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 23 Jul 2008 10:30:12 -0700 Subject: [Libvirt-cim] CimTest Report for KVM on F9 23-07-2008 In-Reply-To: <4886DAB6.3040606@linux.vnet.ibm.com> (Deepti B. Kalakeri's message of "Wed, 23 Jul 2008 12:46:06 +0530") References: <4886DAB6.3040606@linux.vnet.ibm.com> Message-ID: <87k5fch5jv.fsf@caffeine.beaverton.ibm.com> DK> ComputerSystem - 40_RSC_start.py: XFAIL Bug: 00001 DK> ERROR - Exception: (1, u'CIM_ERR_FAILED: Invalid state transition') DK> ERROR - Exception: RequestedStateChange() could not be used to start domain: 'test_domain' DK> InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Invalid state transition DK> Bug:<00001> What is this? Certainly RequestStateChange() is not broken on KVM, right? And if it is, it definitely shouldn't be an XFAIL. -- 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 Jul 23 17:45:49 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 23 Jul 2008 10:45:49 -0700 Subject: [Libvirt-cim] Xen Domain Management CIM-Provider In-Reply-To: (Tej's message of "Wed, 23 Jul 2008 22:45:01 +0530") References: <87sku0hb9l.fsf@caffeine.beaverton.ibm.com> Message-ID: <87fxq0h4tu.fsf@caffeine.beaverton.ibm.com> T> basically i want to know that is xend manipulate the xenstore to T> change the VM's memory or there any other mechanism which dom0 T> follows. That is quite offtopic for this list. I suggest you go ask on xen-devel. T> If ballooning of memory happens through xend, it means two paths which T> i am not sure how it happens. T> 1. Xenstore shared memory page and event channel is mapped to dom0 T> memory area. Now xend enamurate all the VM's in xenstore thorough xen T> bus. Now change the balloon watch node for the concern domain, i.e T> /local/domain/domaid/memory/target T> 2. Instead of using the xen bus interface, xend directly uses the T> xenstore API (i.e. xenstore-write) to manipulate the xenstore node. I don't really see how these are different, but yes, xend writes to the xenstore node to set the memory target. -- 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 bewith.tej at gmail.com Wed Jul 23 18:59:22 2008 From: bewith.tej at gmail.com (Tej) Date: Thu, 24 Jul 2008 00:29:22 +0530 Subject: [Libvirt-cim] Xen Domain Management CIM-Provider In-Reply-To: <87fxq0h4tu.fsf@caffeine.beaverton.ibm.com> References: <87sku0hb9l.fsf@caffeine.beaverton.ibm.com> <87fxq0h4tu.fsf@caffeine.beaverton.ibm.com> Message-ID: On Wed, Jul 23, 2008 at 11:15 PM, Dan Smith wrote: > T> basically i want to know that is xend manipulate the xenstore to > T> change the VM's memory or there any other mechanism which dom0 > T> follows. > > That is quite offtopic for this list. I suggest you go ask on > xen-devel. sorry for the noise in this list > > T> If ballooning of memory happens through xend, it means two paths which > T> i am not sure how it happens. > > T> 1. Xenstore shared memory page and event channel is mapped to dom0 > T> memory area. Now xend enamurate all the VM's in xenstore thorough xen > T> bus. Now change the balloon watch node for the concern domain, i.e > T> /local/domain/domaid/memory/target > > T> 2. Instead of using the xen bus interface, xend directly uses the > T> xenstore API (i.e. xenstore-write) to manipulate the xenstore node. > > I don't really see how these are different, but yes, xend writes to > the xenstore node to set the memory target. this will help me. thanks Tej > > -- > Dan Smith > IBM Linux Technology Center > Open Hypervisor Team > email: danms at us.ibm.com > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From kaitlin at linux.vnet.ibm.com Wed Jul 23 20:10:23 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 13:10:23 -0700 Subject: [Libvirt-cim] [PATCH] Fix a few bugs in the reset() call in CS Message-ID: <695e6e7fb85f14e7e768.1216843823@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1216843816 25200 # Node ID 695e6e7fb85f14e7e7685b94832b0fc73027e405 # Parent 427e74d2c45881820ee33b8b6cdeb9cff57a68c0 Fix a few bugs in the reset() call in CS. This fixes the following issues: -After the destroy call, the domain pointer is no longer valid. We need to get a new one to use for the Create call. -In the situation where the guest was created without being defined, we need to get the XML and then define the before calling the create call. Signed-off-by: Kaitlin Rupert diff -r 427e74d2c458 -r 695e6e7fb85f src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Mon Jul 21 13:28:13 2008 -0700 +++ b/src/Virt_ComputerSystem.c Wed Jul 23 13:10:16 2008 -0700 @@ -673,12 +673,45 @@ static int domain_reset(virDomainPtr dom) { int ret; + virConnectPtr conn = NULL; + virDomainInfo info; + char *xml = NULL; + + conn = virDomainGetConnect(dom); + if (conn == NULL) { + CU_DEBUG("Unable to get connection from domain"); + return 1; + } + + xml = virDomainGetXMLDesc(dom, 0); + if (xml == NULL) { + CU_DEBUG("Unable to retrieve domain XML"); + return 1; + } ret = virDomainDestroy(dom); if (ret) - return ret; + goto out; + + dom = virDomainLookupByName(virDomainGetConnect(dom), + virDomainGetName(dom)); + + if (dom == NULL) { + dom = virDomainDefineXML(conn, xml); + if (dom == NULL) { + CU_DEBUG("Failed to define domain from XML"); + ret = 1; + goto out; + } + } + + if (!domain_online(dom)) + CU_DEBUG("Guest is now offline"); ret = virDomainCreate(dom); + + out: + free(xml); return ret; } From kaitlin at linux.vnet.ibm.com Wed Jul 23 20:10:43 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 13:10:43 -0700 Subject: [Libvirt-cim] [PATCH] (#2) For pause, reboot, and enable add support for guests in the NOSTATE state Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1216757900 25200 # Node ID cc69139baaddfd14451940fc7bab9239be0edfcb # Parent 695e6e7fb85f14e7e7685b94832b0fc73027e405 (#2) For pause, reboot, and enable add support for guests in the NOSTATE state. It's possible that a XenFV guest might return no state instead of blocked or running. This can occur when the guest is active, but isn't running of the CPU or blocked waiting for it. This should be a safe approach - we return an error if the guest is in some other state or if libvirt is unable to successfully change the state of the guest. Updates: -For the reboot and reset operations, add support for paused guests (per the VSP). -If the guest returns VIR_DOMAIN_NOSTATE, the provider should return the value CIM_STATE_ENABLED, not CIM_STATE_UNKNOWN. Signed-off-by: Kaitlin Rupert diff -r 695e6e7fb85f -r cc69139baadd src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Wed Jul 23 13:10:16 2008 -0700 +++ b/src/Virt_ComputerSystem.c Tue Jul 22 13:18:20 2008 -0700 @@ -139,7 +139,7 @@ static uint16_t state_lv_to_cim(const char lv_state) { if (lv_state == VIR_DOMAIN_NOSTATE) - return CIM_STATE_UNKNOWN; + return CIM_STATE_ENABLED; else if (lv_state == VIR_DOMAIN_RUNNING) return CIM_STATE_ENABLED; else if (lv_state == VIR_DOMAIN_BLOCKED) @@ -780,6 +780,7 @@ switch (info->state) { case VIR_DOMAIN_RUNNING: case VIR_DOMAIN_BLOCKED: + case VIR_DOMAIN_NOSTATE: CU_DEBUG("Pause domain"); ret = virDomainSuspend(dom); break; @@ -805,6 +806,8 @@ switch (info->state) { case VIR_DOMAIN_RUNNING: case VIR_DOMAIN_BLOCKED: + case VIR_DOMAIN_NOSTATE: + case VIR_DOMAIN_PAUSED: CU_DEBUG("Reboot domain"); ret = virDomainReboot(dom, 0); break; @@ -830,6 +833,8 @@ switch (info->state) { case VIR_DOMAIN_RUNNING: case VIR_DOMAIN_BLOCKED: + case VIR_DOMAIN_NOSTATE: + case VIR_DOMAIN_PAUSED: CU_DEBUG("Reset domain"); ret = domain_reset(dom); break; From danms at us.ibm.com Wed Jul 23 20:26:10 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 23 Jul 2008 13:26:10 -0700 Subject: [Libvirt-cim] [PATCH] Fix (again) domain_online() Message-ID: <039b7c1f078d007f0222.1216844770@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1216844583 25200 # Node ID 039b7c1f078d007f02224652235edea0a7113926 # Parent 3327f39024303cb8a218110d039e37bf9c2b12cd Fix (again) domain_online() In the neverending quest to get domain_online() to do the Right Thing(tm), this patch attempts to count VIR_DOMAIN_NOSTATE as running for Xen, and as offline for KVM and LXC. Signed-off-by: Dan Smith diff -r 3327f3902430 -r 039b7c1f078d libxkutil/misc_util.c --- a/libxkutil/misc_util.c Wed Jul 23 12:22:04 2008 -0700 +++ b/libxkutil/misc_util.c Wed Jul 23 13:23:03 2008 -0700 @@ -383,21 +383,53 @@ { virDomainInfo info; virDomainPtr _dom; - bool rc; + bool rc = false; + virConnectPtr conn = NULL; + int flags[] = {VIR_DOMAIN_BLOCKED, + VIR_DOMAIN_RUNNING, + VIR_DOMAIN_NOSTATE, + }; + int compare_flags = 3; + int i; + + conn = virDomainGetConnect(dom); + if (conn == NULL) { + CU_DEBUG("Unknown connection type, assuming RUNNING,BLOCKED"); + compare_flags = 2; + } else if (STREQC(virConnectGetType(conn), "Xen")) { + CU_DEBUG("Type is Xen"); + compare_flags = 3; + } else if (STREQC(virConnectGetType(conn), "QEMU")) { + CU_DEBUG("Type is KVM"); + compare_flags = 2; + } else if (STREQC(virConnectGetType(conn), "LXC")) { + CU_DEBUG("Type is LXC"); + compare_flags = 2; + } else { + CU_DEBUG("Unknown type `%s', assuming RUNNING,BLOCKED", + virConnectGetType(conn)); + compare_flags = 2; + } _dom = virDomainLookupByName(virDomainGetConnect(dom), virDomainGetName(dom)); if (_dom == NULL) { CU_DEBUG("Unable to re-lookup domain"); - return false; + goto out; } - if (virDomainGetInfo(_dom, &info) != 0) + if (virDomainGetInfo(_dom, &info) != 0) { rc = false; - else - rc = (info.state == VIR_DOMAIN_BLOCKED) || - (info.state == VIR_DOMAIN_RUNNING) || - (info.state == VIR_DOMAIN_NOSTATE); + goto out; + } + + for (i = 0; i < compare_flags; i++) { + if (info.state == flags[i]) { + rc = true; + break; + } + } + out: virDomainFree(_dom); return rc; From danms at us.ibm.com Wed Jul 23 20:26:18 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 23 Jul 2008 13:26:18 -0700 Subject: [Libvirt-cim] [PATCH] Invert the bit of type-selection logic in resource_del() to match the other Message-ID: <9c40868b04724e898011.1216844778@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1216844705 25200 # Node ID 9c40868b04724e898011ecd6717162bc02c61781 # Parent 039b7c1f078d007f02224652235edea0a7113926 Invert the bit of type-selection logic in resource_del() to match the other functions. AFAICT, this still did succeeded and failed in the right places, but deeper down and with less appropriate error messages. Signed-off-by: Dan Smith diff -r 039b7c1f078d -r 9c40868b0472 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Jul 23 13:23:03 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Wed Jul 23 13:25:05 2008 -0700 @@ -1258,14 +1258,14 @@ _list = find_list(dominfo, type, &count); if ((type == CIM_RES_TYPE_MEM) || (type == CIM_RES_TYPE_PROC) || - (_list != NULL)) - list = *_list; - else { + (*_list == NULL)) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Cannot delete resources of type %" PRIu16, type); goto out; } + + list = *_list; cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, From kaitlin at linux.vnet.ibm.com Wed Jul 23 20:22:37 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 13:22:37 -0700 Subject: [Libvirt-cim] [PATCH] Add hypervisor version information to the Caption field of the VSMS In-Reply-To: <8d236493f5d67a952bfa.1216826487@guaranine.danplanet.com> References: <8d236493f5d67a952bfa.1216826487@guaranine.danplanet.com> Message-ID: <4887930D.6010404@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1216826114 25200 > # Node ID 8d236493f5d67a952bfab94a3fc19a34b3fdf394 > # Parent caa024a3a0938bcb709df190a02fcce0d738c165 > Add hypervisor version information to the Caption field of the VSMS. > > I don't really see anywhere else this fits into the model, so setting > the caption as such seems reasonable to me. > > Comments and arguments are welcome :) Is there any plan to use the caption for anything else. If so, formatting the hypervisor version in this way might make it difficult to parse the string. You'd end up with something like: "QEMU 0.9.1 myotherinfohere" -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 23 20:27:14 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 13:27:14 -0700 Subject: [Libvirt-cim] [PATCH] Fix a few bugs in the reset() call in CS In-Reply-To: <695e6e7fb85f14e7e768.1216843823@elm3b41.beaverton.ibm.com> References: <695e6e7fb85f14e7e768.1216843823@elm3b41.beaverton.ibm.com> Message-ID: <48879422.5040708@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1216843816 25200 > # Node ID 695e6e7fb85f14e7e7685b94832b0fc73027e405 > # Parent 427e74d2c45881820ee33b8b6cdeb9cff57a68c0 > Fix a few bugs in the reset() call in CS. > > This fixes the following issues: > -After the destroy call, the domain pointer is no longer valid. We need to get a new one to use for the Create call. > -In the situation where the guest was created without being defined, we need to get the XML and then define the before calling the create call. > > Signed-off-by: Kaitlin Rupert > > diff -r 427e74d2c458 -r 695e6e7fb85f src/Virt_ComputerSystem.c Please ignore this patch. Need to resend the updated version. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Wed Jul 23 20:29:17 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 23 Jul 2008 13:29:17 -0700 Subject: [Libvirt-cim] [PATCH] Add hypervisor version information to the Caption field of the VSMS In-Reply-To: <4887930D.6010404@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Wed, 23 Jul 2008 13:22:37 -0700") References: <8d236493f5d67a952bfa.1216826487@guaranine.danplanet.com> <4887930D.6010404@linux.vnet.ibm.com> Message-ID: <87bq0ogx9e.fsf@caffeine.beaverton.ibm.com> KR> Is there any plan to use the caption for anything else. I dunno. KR> If so, formatting the hypervisor version in this way might make it KR> difficult to parse the string. You'd end up with something like: KR> "QEMU 0.9.1 myotherinfohere" I hear complaints but no suggestions :) We could certainly add an attribute to the service, if you'd rather. -- 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 Jul 23 20:33:24 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 13:33:24 -0700 Subject: [Libvirt-cim] [PATCH] (#2) Fix a few bugs in the reset() call in CS Message-ID: <9669e9cfbf6f7645c503.1216845204@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1216845120 25200 # Node ID 9669e9cfbf6f7645c503a8f337cafe6a70028093 # Parent 427e74d2c45881820ee33b8b6cdeb9cff57a68c0 (#2) Fix a few bugs in the reset() call in CS. This fixes the following issues: -After the destroy call, the domain pointer is no longer valid. We need to get a new one to use for the Create call. -In the situation where the guest was created without being defined, we need to get the XML and then define the before calling the create call. Updates: -Remove unused virDomainInfo variable. Signed-off-by: Kaitlin Rupert diff -r 427e74d2c458 -r 9669e9cfbf6f src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Mon Jul 21 13:28:13 2008 -0700 +++ b/src/Virt_ComputerSystem.c Wed Jul 23 13:32:00 2008 -0700 @@ -673,12 +673,44 @@ static int domain_reset(virDomainPtr dom) { int ret; + virConnectPtr conn = NULL; + char *xml = NULL; + + conn = virDomainGetConnect(dom); + if (conn == NULL) { + CU_DEBUG("Unable to get connection from domain"); + return 1; + } + + xml = virDomainGetXMLDesc(dom, 0); + if (xml == NULL) { + CU_DEBUG("Unable to retrieve domain XML"); + return 1; + } ret = virDomainDestroy(dom); if (ret) - return ret; + goto out; + + dom = virDomainLookupByName(virDomainGetConnect(dom), + virDomainGetName(dom)); + + if (dom == NULL) { + dom = virDomainDefineXML(conn, xml); + if (dom == NULL) { + CU_DEBUG("Failed to define domain from XML"); + ret = 1; + goto out; + } + } + + if (!domain_online(dom)) + CU_DEBUG("Guest is now offline"); ret = virDomainCreate(dom); + + out: + free(xml); return ret; } From kaitlin at linux.vnet.ibm.com Wed Jul 23 20:38:18 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 13:38:18 -0700 Subject: [Libvirt-cim] [PATCH] Add hypervisor version information to the Caption field of the VSMS In-Reply-To: <87bq0ogx9e.fsf@caffeine.beaverton.ibm.com> References: <8d236493f5d67a952bfa.1216826487@guaranine.danplanet.com> <4887930D.6010404@linux.vnet.ibm.com> <87bq0ogx9e.fsf@caffeine.beaverton.ibm.com> Message-ID: <488796BA.8070204@linux.vnet.ibm.com> > KR> If so, formatting the hypervisor version in this way might make it > KR> difficult to parse the string. You'd end up with something like: > > KR> "QEMU 0.9.1 myotherinfohere" > > I hear complaints but no suggestions :) Fair enough. =) You could add some kind of demarcation between items, but you'd have to ensure that demarcation won't potentially show up as part of a string. You could also do something like: "Hypervisor: QEMU 0.9.1" Or, we can just handle that case when it happens. I have no real complaints with it how it is. > > We could certainly add an attribute to the service, if you'd rather. > > Naa.. adding yet another attribute isn't worthwhile. I agree with the choice you made here. I forgot to note - I tested this out. +1 in that regard. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 23 20:50:33 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 13:50:33 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Updating 04_hs_to_EAPF.py to use the verify_device_values() included in the logicaldevices.py In-Reply-To: <4886DEED.5080601@linux.vnet.ibm.com> References: <48863966.5010906@linux.vnet.ibm.com> <4886DEED.5080601@linux.vnet.ibm.com> Message-ID: <48879999.4040009@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > > > Kaitlin Rupert wrote: >>> - else: >>> - status = FAIL >>> + status = verify_device_values(assoc_eafp_info, CCName, + >>> eafp_values, virt='Xen') >>> + >> >> There's an extra param included here. CCName isn't needed. >> > > The definition of the verify_device_values() in logicaldevices.py takes > the 4 arguments and hence all the 4 which includes CCName is required. > The following is the definition in logicaldevices.py : > > def verify_device_values(assoc_info, CCName, list_values, virt='Xen'): > dev_cnames = ['LogicalDisk', 'Memory', 'NetworkPort', 'Processor'] > for i in range(len(dev_cnames)): > dev_cnames[i] = get_typed_class(virt, dev_cnames[i]) > Yes, my mistake here. I had applied this patch before the patch with the logicaldevices fix. This patch looks good! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Wed Jul 23 20:51:23 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 23 Jul 2008 13:51:23 -0700 Subject: [Libvirt-cim] [PATCH] (#2) For pause, reboot, and enable add support for guests in the NOSTATE state In-Reply-To: (Kaitlin Rupert's message of "Wed, 23 Jul 2008 13:10:43 -0700") References: Message-ID: <877ibcgw8k.fsf@caffeine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1216757900 25200 KR> # Node ID cc69139baaddfd14451940fc7bab9239be0edfcb KR> # Parent 695e6e7fb85f14e7e7685b94832b0fc73027e405 KR> (#2) For pause, reboot, and enable add support for guests in the KR> NOSTATE state. So, it looks to me that a KVM guest, when first defined, can have NOSTATE, but imply offline. Xen's notion of NOSTATE seems to imply being online. In my patch to domain_online() just now, I had to account for those differences. Perhaps something needs to change in this patch as well? For example, if we're in NOSTATE, we allow running virDomainReboot(), but will that function fail if it can't do a shutdown on the domain? What about for suspend? I doubt libvirt will let you pause an offline domain, so perhaps we should alter things a bit? -- 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 Jul 23 20:56:06 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 23 Jul 2008 13:56:06 -0700 Subject: [Libvirt-cim] [PATCH] (#2) Fix a few bugs in the reset() call in CS In-Reply-To: <9669e9cfbf6f7645c503.1216845204@elm3b41.beaverton.ibm.com> (Kaitlin Rupert's message of "Wed, 23 Jul 2008 13:33:24 -0700") References: <9669e9cfbf6f7645c503.1216845204@elm3b41.beaverton.ibm.com> Message-ID: <873am0gw0p.fsf@caffeine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1216845120 25200 KR> # Node ID 9669e9cfbf6f7645c503a8f337cafe6a70028093 KR> # Parent 427e74d2c45881820ee33b8b6cdeb9cff57a68c0 KR> (#2) Fix a few bugs in the reset() call in CS. This fails to apply for me. -- 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 Jul 23 20:57:57 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 13:57:57 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #4 Update VSSDC.01 for KVM/XenFV/LXC support In-Reply-To: References: Message-ID: <48879B55.3080000@linux.vnet.ibm.com> > - > - return PASS > - > + status = compare_all_prop(assoc_info[0], vssd) > + if status != PASS: > + logger.error("Verification error: got %s, expect %s" % \ > + (assoc_info[0], vssd)) > + return FAIL Hopefully last issue =) Here, you're going to print out the entire instance, which dump a lot of text to the console / log. Something like "Properties of inst returned by %s didn't match expected". Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Wed Jul 23 21:00:08 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 23 Jul 2008 14:00:08 -0700 Subject: [Libvirt-cim] [PATCH] Add hypervisor version information to the Caption field of the VSMS In-Reply-To: <488796BA.8070204@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Wed, 23 Jul 2008 13:38:18 -0700") References: <8d236493f5d67a952bfa.1216826487@guaranine.danplanet.com> <4887930D.6010404@linux.vnet.ibm.com> <87bq0ogx9e.fsf@caffeine.beaverton.ibm.com> <488796BA.8070204@linux.vnet.ibm.com> Message-ID: <87y73sfh9j.fsf@caffeine.beaverton.ibm.com> KR> Fair enough. =) You could add some kind of demarcation between KR> items, but you'd have to ensure that demarcation won't potentially KR> show up as part of a string. KR> You could also do something like: "Hypervisor: QEMU 0.9.1" My problem with that is that I believe the caption is intended to be something displayed by a client to a user. Either as a part of a larger client-generated string, or as it is. Doing something like the above, or trying to make the values separated by a delimiter means that the client is forced to parse it up to display it the way they want. For example, if they wanted to display the caption as: "Xen System: $CAPTION" It might break some visual guidelines to have that read: "Xen System: Hypervisor: QEMU 0.9.1" which is kinda awkward. So, I dunno, it's not a very formal interface and thus shouldn't really be parsed by the client as it could change. But if we try to strive for something that could reasonably be displayed to the user as it is, that seems reasonable to me. -- 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 Jul 23 21:08:20 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 14:08:20 -0700 Subject: [Libvirt-cim] [PATCH] Add hypervisor version information to the Caption field of the VSMS In-Reply-To: <87y73sfh9j.fsf@caffeine.beaverton.ibm.com> References: <8d236493f5d67a952bfa.1216826487@guaranine.danplanet.com> <4887930D.6010404@linux.vnet.ibm.com> <87bq0ogx9e.fsf@caffeine.beaverton.ibm.com> <488796BA.8070204@linux.vnet.ibm.com> <87y73sfh9j.fsf@caffeine.beaverton.ibm.com> Message-ID: <48879DC4.6080700@linux.vnet.ibm.com> Dan Smith wrote: > KR> Fair enough. =) You could add some kind of demarcation between > KR> items, but you'd have to ensure that demarcation won't potentially > KR> show up as part of a string. > > KR> You could also do something like: "Hypervisor: QEMU 0.9.1" > > My problem with that is that I believe the caption is intended to be > something displayed by a client to a user. Either as a part of a > larger client-generated string, or as it is. Doing something like the > above, or trying to make the values separated by a delimiter means > that the client is forced to parse it up to display it the way they > want. For example, if they wanted to display the caption as: > > "Xen System: $CAPTION" > > It might break some visual guidelines to have that read: > > "Xen System: Hypervisor: QEMU 0.9.1" > > which is kinda awkward. This is a really good point. I fine with this. Especially since we aren't planning to put anything else there at the moment. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 23 21:09:15 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 14:09:15 -0700 Subject: [Libvirt-cim] Cimtest Report for LXC on F9 (2008/07/07) In-Reply-To: References: Message-ID: <48879DFB.6020201@linux.vnet.ibm.com> > > > > Thanks Daisy! I applied your patch. ComputerSystem - > > 04_defineStartVS.py now passes for me on LXC. > > Kaitlin, > > Does the patch applied on your own tree? There is no changed found when I > try to update cimtest repository =) There was some delay updating to the external repository. The patch should be there now. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 23 21:35:58 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 14:35:58 -0700 Subject: [Libvirt-cim] [PATCH] (#2) Fix a few bugs in the reset() call in CS In-Reply-To: <873am0gw0p.fsf@caffeine.beaverton.ibm.com> References: <9669e9cfbf6f7645c503.1216845204@elm3b41.beaverton.ibm.com> <873am0gw0p.fsf@caffeine.beaverton.ibm.com> Message-ID: <4887A43E.3050104@linux.vnet.ibm.com> Dan Smith wrote: > KR> # HG changeset patch > KR> # User Kaitlin Rupert > KR> # Date 1216845120 25200 > KR> # Node ID 9669e9cfbf6f7645c503a8f337cafe6a70028093 > KR> # Parent 427e74d2c45881820ee33b8b6cdeb9cff57a68c0 > KR> (#2) Fix a few bugs in the reset() call in CS. > > This fails to apply for me. > It looks like the first version of this patch was applied already. So I'll need to send a follow up patch to fix the issue fixed in this version. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 23 21:48:08 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 14:48:08 -0700 Subject: [Libvirt-cim] [PATCH] Fix (again) domain_online() In-Reply-To: <039b7c1f078d007f0222.1216844770@guaranine.danplanet.com> References: <039b7c1f078d007f0222.1216844770@guaranine.danplanet.com> Message-ID: <4887A718.9000707@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1216844583 25200 > # Node ID 039b7c1f078d007f02224652235edea0a7113926 > # Parent 3327f39024303cb8a218110d039e37bf9c2b12cd > Fix (again) domain_online() > > In the neverending quest to get domain_online() to do the Right Thing(tm), > this patch attempts to count VIR_DOMAIN_NOSTATE as running for Xen, > and as offline for KVM and LXC. > > Signed-off-by: Dan Smith > > diff -r 3327f3902430 -r 039b7c1f078d libxkutil/misc_util.c +1 I don't have a really good way of testing this at the moment, other than running the test suite to check for regressions (which I've done). An explicit test case for this is needed. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 23 22:17:41 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 15:17:41 -0700 Subject: [Libvirt-cim] [PATCH] Invert the bit of type-selection logic in resource_del() to match the other In-Reply-To: <9c40868b04724e898011.1216844778@guaranine.danplanet.com> References: <9c40868b04724e898011.1216844778@guaranine.danplanet.com> Message-ID: <4887AE05.6040901@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1216844705 25200 > # Node ID 9c40868b04724e898011ecd6717162bc02c61781 > # Parent 039b7c1f078d007f02224652235edea0a7113926 > Invert the bit of type-selection logic in resource_del() to match the other > functions. > > AFAICT, this still did succeeded and failed in the right places, but > deeper down and with less appropriate error messages. > > Signed-off-by: Dan Smith > > diff -r 039b7c1f078d -r 9c40868b0472 src/Virt_VirtualSystemManagementService.c +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 23 22:20:17 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 15:20:17 -0700 Subject: [Libvirt-cim] [PATCH] Fix units adherence in MemoryRASD processing in DefineSystem() In-Reply-To: References: Message-ID: <4887AEA1.3020807@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1216828041 25200 > # Node ID f542e90d4c672efa40a907b8c7040d6df714bd38 > # Parent 8d236493f5d67a952bfab94a3fc19a34b3fdf394 > Fix units adherence in MemoryRASD processing in DefineSystem() > > Signed-off-by: Dan Smith > > diff -r 8d236493f5d6 -r f542e90d4c67 src/Virt_VirtualSystemManagementService.c +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 23 22:26:58 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 15:26:58 -0700 Subject: [Libvirt-cim] [PATCH] Remove unused variable from CS Message-ID: <39355b0cc610daa45f44.1216852018@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1216851926 25200 # Node ID 39355b0cc610daa45f44ff842ae9b1382b68c611 # Parent dbf0ce65414cfcecb01286d012387f51816cce4a Remove unused variable from CS. Signed-off-by: Kaitlin Rupert diff -r dbf0ce65414c -r 39355b0cc610 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Wed Jul 23 13:10:16 2008 -0700 +++ b/src/Virt_ComputerSystem.c Wed Jul 23 15:25:26 2008 -0700 @@ -674,7 +674,6 @@ { int ret; virConnectPtr conn = NULL; - virDomainInfo info; char *xml = NULL; conn = virDomainGetConnect(dom); From kaitlin at linux.vnet.ibm.com Wed Jul 23 22:55:19 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 15:55:19 -0700 Subject: [Libvirt-cim] CimTest Report for KVM on F9 23-07-2008 In-Reply-To: <87k5fch5jv.fsf@caffeine.beaverton.ibm.com> References: <4886DAB6.3040606@linux.vnet.ibm.com> <87k5fch5jv.fsf@caffeine.beaverton.ibm.com> Message-ID: <4887B6D7.2090800@linux.vnet.ibm.com> Dan Smith wrote: > DK> ComputerSystem - 40_RSC_start.py: XFAIL Bug: 00001 > DK> ERROR - Exception: (1, u'CIM_ERR_FAILED: Invalid state transition') > DK> ERROR - Exception: RequestedStateChange() could not be used to start domain: 'test_domain' > DK> InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Invalid state transition > DK> Bug:<00001> > > What is this? Certainly RequestStateChange() is not broken on KVM, > right? And if it is, it definitely shouldn't be an XFAIL. > The test is defining a guest and then starting it. The enable call in the provider checks to make sure the guest is either defined or pause. Deepti - you could add a return after the guest is defined and then check the state of the guest. I tried to reproduce this on my system, but I see the following error: CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available ERROR - Exception: DefineSystem() failed to create domain: test_domain InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available This is odd, because I have a network pool defined: Name State Autostart ----------------------------------------- default-net active no The provider complains with the following: Virt_VirtualSystemManagementService.c(298): Failed to get default network pool: No default pool found for type 10 Virt_VirtualSystemManagementService.c(573): rasd_to_vdev(KVM_NetResourceAllocationSettingData): No NetworkPool specified and no default available Virt_VirtualSystemManagementService.c(886): Failed to classify resources: No NetworkPool specified and no default available std_invokemethod.c(305): Method `DefineSystem' returned 1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Jul 24 00:36:39 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 17:36:39 -0700 Subject: [Libvirt-cim] CimTest Report for KVM on F9 23-07-2008 In-Reply-To: <4887B6D7.2090800@linux.vnet.ibm.com> References: <4886DAB6.3040606@linux.vnet.ibm.com> <87k5fch5jv.fsf@caffeine.beaverton.ibm.com> <4887B6D7.2090800@linux.vnet.ibm.com> Message-ID: <4887CE97.80701@linux.vnet.ibm.com> > > I tried to reproduce this on my system, but I see the following error: > > CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no > default available > ERROR - Exception: DefineSystem() failed to create domain: test_domain > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No > NetworkPool specified and no default available > > This is odd, because I have a network pool defined: > > Name State Autostart > ----------------------------------------- > default-net active no > > The provider complains with the following: > > Virt_VirtualSystemManagementService.c(298): Failed to get default > network pool: No default pool found for type 10 > Virt_VirtualSystemManagementService.c(573): > rasd_to_vdev(KVM_NetResourceAllocationSettingData): No NetworkPool > specified and no default available > Virt_VirtualSystemManagementService.c(886): Failed to classify > resources: No NetworkPool specified and no default available > std_invokemethod.c(305): Method `DefineSystem' returned 1 > > My issue appears to be caused by a different test suite - it's inadvertently deleting the network pool. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Jul 24 00:44:07 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 23 Jul 2008 17:44:07 -0700 Subject: [Libvirt-cim] [PATCH] Fix netpool issue in CS 22 Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1216860167 25200 # Node ID ab1e34deb7109d8a89d03b6b53c54f30a9c99888 # Parent 32d78f23f6e73f5443022179410128767896465d Fix netpool issue in CS 22 Don't use the existing netpool, create one for the test. Signed-off-by: Kaitlin Rupert diff -r 32d78f23f6e7 -r ab1e34deb710 suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Wed Jul 23 00:32:36 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Wed Jul 23 17:42:47 2008 -0700 @@ -62,7 +62,7 @@ def main(): options = main.options - status, test_network = create_netpool_conf(options.ip, options.virt) + status, test_network = create_netpool_conf(options.ip, options.virt, False) if status != PASS: return FAIL From yunguol at cn.ibm.com Thu Jul 24 02:07:34 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Wed, 23 Jul 2008 19:07:34 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #5 Update VSSDC.01 for KVM/XenFV/LXC support Message-ID: # HG changeset patch # User Guolian Yun # Date 1216865247 25200 # Node ID fa1868af730e8c991e4c298620e7bdfcea98ae2f # Parent 32d78f23f6e73f5443022179410128767896465d [TEST] #5 Update VSSDC.01 for KVM/XenFV/LXC support The test defines non-bootloader guests for all platform types, also remove the part of thet test that verifies the bootloader Updates from 1 to 2: Pass test_disk and test_mac as parameters into init_list() function. Updates from 2 to 3: Remove build_vssd_info() and call compare_all_prop() in assoc_values() Updates from 3 to 4: 1) Remove otiose rlist define line for LXC option 2) change assoc_values comments, it verifies all of the values of instance 3) check compare_all_prop return, if it return fail, print a log message Updates from 4 to 5: Print instance classname instend of entire instance in log info Signed-off-by: Guolian Yun diff -r 32d78f23f6e7 -r fa1868af730e suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Wed Jul 23 00:32:36 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Wed Jul 23 19:07:27 2008 -0700 @@ -52,32 +52,31 @@ import sys from XenKvmLib import enumclass from VirtLib import utils -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all -from XenKvmLib.test_xml import testxml_bl -from XenKvmLib.test_xml import xml_get_dom_bootloader +from XenKvmLib.test_doms import destroy_and_undefine_all +from XenKvmLib.assoc import compare_all_prop from CimTest import Globals from XenKvmLib import assoc +from XenKvmLib import vxml +from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger, do_main from CimTest.ReturnCodes import FAIL, PASS -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "VSSDC_dom" test_vcpus = 2 test_mac = "00:11:22:33:44:aa" test_disk = 'xvda' -status = 0 -VSType = "Xen" -def init_list(): +def init_list(test_disk, test_mac, virt='Xen'): """ Creating the lists that will be used for comparisons. """ - rlist = ['Xen_DiskResourceAllocationSettingData', - 'Xen_MemResourceAllocationSettingData', - 'Xen_NetResourceAllocationSettingData', - 'Xen_ProcResourceAllocationSettingData' + rlist = [get_typed_class(virt, 'DiskResourceAllocationSettingData'), + get_typed_class(virt, 'MemResourceAllocationSettingData'), + get_typed_class(virt, 'NetResourceAllocationSettingData'), + get_typed_class(virt, 'ProcResourceAllocationSettingData') ] prop_list = {rlist[0] : "%s/%s" % (test_dom, test_disk), @@ -85,57 +84,33 @@ rlist[2] : "%s/%s" % (test_dom, test_mac), rlist[3] : "%s/%s" % (test_dom, "proc") } + if virt == 'LXC': + prop_list = {rlist[1] : "%s/%s" % (test_dom, "mem")} return prop_list -def build_vssd_info(ip, vssd): - """ - Creating the vssd fileds lists that will be used for comparisons. - """ - - if vssd.Bootloader == "" or vssd.Caption == "" or \ - vssd.InstanceID == "" or vssd.ElementName == "" or \ - vssd.VirtualSystemIdentifier == "" or vssd.VirtualSystemType == "": - logger.error("One of the required VSSD details seems to be empty") - test_domain_function(test_dom, ip, "undefine") - return FAIL - - vssd_vals = {'Bootloader' : vssd.Bootloader, - 'Caption' : vssd.Caption, - 'InstanceID' : vssd.InstanceID, - 'ElementName' : vssd.ElementName, - 'VirtualSystemIdentifier' : vssd.VirtualSystemIdentifier, - 'VirtualSystemType' : vssd.VirtualSystemType - } - - return vssd_vals - -def assoc_values(ip, assoc_info, cn, an, vals): +def assoc_values(ip, assoc_info, cn, an, vssd): """ The association info of Xen_VirtualSystemSettingDataComponent with every RASDclass is - verified for following fields: - Caption, InstanceID, ElementName, VirtualSystemIdentifier, - VirtualSystemType, Bootloader + verified all of the values """ try: if len(assoc_info) != 1: - Globals.logger.error("%s returned %i resource objects for '%s'" % \ - (an, len(assoc_info), cn)) + logger.error("%s returned %i resource objects for '%s'" % \ + (an, len(assoc_info), cn)) return FAIL - - for prop, val in vals.iteritems(): - if assoc_info[0][prop] != val: - Globals.logger.error("%s mismatch: returned %s instead of %s" %\ - (prop, assoc_info[0][prop], val)) - return FAIL - - return PASS - + status = compare_all_prop(assoc_info[0], vssd) + if status != PASS: + logger.error("Properties of inst returned by %s didn't \ + match expected" % assoc_info[0].classname) + return FAIL except Exception, detail : logger.error("Exception in assoc_values function: %s" % detail) - return FAIL + return FAIL + + return PASS @do_main(sup_types) def main(): @@ -143,49 +118,53 @@ status = FAIL destroy_and_undefine_all(options.ip) - test_xml = testxml_bl(test_dom, vcpus = test_vcpus, \ - mac = test_mac, disk = test_disk, \ - server = options.ip,\ - gtype = 0) - ret = test_domain_function(test_xml, options.ip, cmd = "define") + prop_list = init_list(test_disk, test_mac, options.virt) + virt_xml = vxml.get_class(options.virt) + if options.virt == 'LXC': + cxml = virt_xml(test_dom) + else: + cxml = virt_xml(test_dom, vcpus = test_vcpus, \ + mac = test_mac, disk = test_disk) + ret = cxml.define(options.ip) if not ret: logger.error("Failed to define the dom: %s", test_dom) return FAIL - instIdval = "%s:%s" % (VSType, test_dom) + if options.virt == 'XenFV': + instIdval = "Xen:%s" % test_dom + else: + instIdval = "%s:%s" % (options.virt, test_dom) + keyname = "InstanceID" + key_list = { 'InstanceID' : instIdval } + vssd_cn = get_typed_class(options.virt, 'VirtualSystemSettingData') - key_list = { 'InstanceID' : instIdval } try: vssd = enumclass.getInstance(options.ip, \ - enumclass.Xen_VirtualSystemSettingData, \ - key_list) + 'VirtualSystemSettingData', \ + key_list, \ + options.virt) if vssd is None: logger.error("VSSD instance for %s not found" % test_dom) - test_domain_function(test_dom, options.ip, "undefine") + cxml.undefine(options.ip) return FAIL - - vssd_vals = build_vssd_info(options.ip, vssd) - except Exception, detail : - logger.error(Globals.CIM_ERROR_GETINSTANCE, \ - 'Xen_VirtualSystemSettingData') + logger.error(Globals.CIM_ERROR_GETINSTANCE, vssd_cn) logger.error("Exception : %s" % detail) - test_domain_function(test_dom, options.ip, "undefine") + cxml.undefine(options.ip) return FAIL - prop_list = init_list() try: # Looping through the RASD_cllist, call association # Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist - an = 'Xen_VirtualSystemSettingDataComponent' + an = get_typed_class(options.virt, 'VirtualSystemSettingDataComponent') for rasd_cname, prop in prop_list.iteritems(): assoc_info = assoc.Associators(options.ip, an, rasd_cname, - InstanceID = prop) + options.virt, InstanceID = prop) # Verify the association fields returned for particular rasd_cname. status = assoc_values(options.ip, assoc_info, rasd_cname, an, - vssd_vals) + vssd) if status != PASS: break @@ -194,7 +173,7 @@ logger.error("Exception : %s" % detail) status = FAIL - test_domain_function(test_dom, options.ip, "undefine") + cxml.undefine(options.ip) return status if __name__ == "__main__": From yunguol at cn.ibm.com Thu Jul 24 02:52:58 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Wed, 23 Jul 2008 19:52:58 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Update Network.02 and helper functions for LXC support Message-ID: <12caeec9fd69e72808b0.1216867978@elm3b41.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1216867968 25200 # Node ID 12caeec9fd69e72808b0d9a5eb989e2063cfcb6a # Parent 32d78f23f6e73f5443022179410128767896465d [TEST] #2 Update Network.02 and helper functions for LXC support Updates: Add network devices in LXC guest, also take a mac address argument in guest define Signed-off-by: Guolian Yun diff -r 32d78f23f6e7 -r 12caeec9fd69 suites/libvirt-cim/cimtest/NetworkPort/02_np_gi_errors.py --- a/suites/libvirt-cim/cimtest/NetworkPort/02_np_gi_errors.py Wed Jul 23 00:32:36 2008 -0700 +++ b/suites/libvirt-cim/cimtest/NetworkPort/02_np_gi_errors.py Wed Jul 23 19:52:48 2008 -0700 @@ -31,11 +31,11 @@ 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 XenXML, KVMXML, LXCXML, get_class from CimTest.ReturnCodes import PASS, SKIP from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS, do_main -sup_types = ['Xen', 'KVM', 'XenFV'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] expr_values = { diff -r 32d78f23f6e7 -r 12caeec9fd69 suites/libvirt-cim/lib/XenKvmLib/const.py --- a/suites/libvirt-cim/lib/XenKvmLib/const.py Wed Jul 23 00:32:36 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Wed Jul 23 19:52:48 2008 -0700 @@ -89,3 +89,4 @@ LXC_default_tty = '/dev/ptmx' LXC_default_mp = '/tmp' LXC_default_source = '/tmp/lxc_files' +LXC_default_mac = '11:22:33:aa:bb:cc' diff -r 32d78f23f6e7 -r 12caeec9fd69 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Jul 23 00:32:36 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Jul 23 19:52:48 2008 -0700 @@ -700,19 +700,21 @@ def __init__(self, test_dom=const.default_domname, mem=const.default_memory, vcpus=const.default_vcpus, + mac=const.LXC_default_mac, + ntype=const.default_net_type, tty=const.LXC_default_tty): VirtXML.__init__(self, 'lxc', test_dom, set_uuid(), mem, vcpus) self._os(const.LXC_init_path) - self._devices(const.LXC_default_tty) + self._devices(mac, ntype, const.LXC_default_tty) self.create_lxc_file(CIM_IP, const.LXC_init_path) def _os(self, os_init): os = self.get_node('/domain/os') self.add_sub_node(os, 'init', os_init) - def _devices(self, tty_set): + def _devices(self, net_mac, net_type, tty_set): devices = self.get_node('/domain/devices') - + self.set_interface_details(devices, net_mac, net_type, virt_type='LXC') interface = self.add_sub_node(devices, 'console', tty = tty_set) def create_lxc_file(self, ip, lxc_file): From yunguol at cn.ibm.com Thu Jul 24 03:19:25 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Wed, 23 Jul 2008 20:19:25 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update ElementSettingData.03 for LXC support Message-ID: # HG changeset patch # User Guolian Yun # Date 1216869559 25200 # Node ID de9cf9b8a9302a55eff582f15c133cca98547c9b # Parent 32d78f23f6e73f5443022179410128767896465d [TEST] Update ElementSettingData.03 for LXC support Signed-off-by: Guolian Yun diff -r 32d78f23f6e7 -r de9cf9b8a930 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 Wed Jul 23 00:32:36 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py Wed Jul 23 20:19:19 2008 -0700 @@ -60,7 +60,7 @@ from XenKvmLib.classes import get_typed_ from XenKvmLib.classes import get_typed_class from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen', 'KVM', 'LXC'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "hd_domain1" test_mac = "00:11:22:33:44:55" @@ -79,6 +79,8 @@ expr_values = { @do_main(sup_types) def main(): options = main.options + if options.virt == 'XenFV': + options.virt = 'Xen' status = PASS virtxml = vxml.get_class(options.virt) From yunguol at cn.ibm.com Thu Jul 24 10:10:51 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Thu, 24 Jul 2008 03:10:51 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update HostedDependency.01~04 for XenFV support Message-ID: <50c0e4d2d58d8075c010.1216894251@elm3b217.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1216894242 25200 # Node ID 50c0e4d2d58d8075c010377c2dd5d662bf80c2b7 # Parent 32d78f23f6e73f5443022179410128767896465d [TEST] Update HostedDependency.01~04 for XenFV support Signed-off-by: Guolian Yun diff -r 32d78f23f6e7 -r 50c0e4d2d58d suites/libvirt-cim/cimtest/HostedDependency/01_forward.py --- a/suites/libvirt-cim/cimtest/HostedDependency/01_forward.py Wed Jul 23 00:32:36 2008 -0700 +++ b/suites/libvirt-cim/cimtest/HostedDependency/01_forward.py Thu Jul 24 03:10:42 2008 -0700 @@ -55,7 +55,7 @@ from CimTest.Globals import do_main from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen', 'KVM', 'LXC'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "hd_domain" test_mac = "00:11:22:33:44:55" diff -r 32d78f23f6e7 -r 50c0e4d2d58d suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py --- a/suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py Wed Jul 23 00:32:36 2008 -0700 +++ b/suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py Thu Jul 24 03:10:42 2008 -0700 @@ -50,7 +50,7 @@ from CimTest.Globals import logger, do_m from CimTest.Globals import logger, do_main from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen', 'KVM', 'LXC'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "hd_domain" test_mac = "00:11:22:33:44:55" diff -r 32d78f23f6e7 -r 50c0e4d2d58d suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py --- a/suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py Wed Jul 23 00:32:36 2008 -0700 +++ b/suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py Thu Jul 24 03:10:42 2008 -0700 @@ -44,7 +44,7 @@ from XenKvmLib.devices import CIM_Instan from XenKvmLib.devices import CIM_Instance from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen', 'KVM'] +sup_types = ['Xen', 'KVM', 'XenFV'] test_dom = "hd_domain1" test_mac = "00:11:22:33:44:55" diff -r 32d78f23f6e7 -r 50c0e4d2d58d suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py --- a/suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py Wed Jul 23 00:32:36 2008 -0700 +++ b/suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py Thu Jul 24 03:10:42 2008 -0700 @@ -38,7 +38,7 @@ from XenKvmLib.common_util import get_ho from XenKvmLib.common_util import get_host_info, try_assoc from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC -sup_types = ['Xen', 'KVM', 'LXC'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "hd_domain1" test_mac = "00:11:22:33:44:55" From deeptik at linux.vnet.ibm.com Thu Jul 24 13:23:41 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 24 Jul 2008 18:53:41 +0530 Subject: [Libvirt-cim] CimTest Report on XenFV 24-07-2008 Message-ID: <4888825D.9090908@linux.vnet.ibm.com> ====================================== CIM Test Report for XenFV ====================================== Distro : RHEL 5.2 Beta Kernel : 2.6.18-88.el5xen Xen version : 3.1.2-88.el5 Libvirt : libvirt-0.3.3-7.el5 CIMOM : pegasus PyWBEM : pywbem-3.14 CIM Schema : cimv216Experimental LibCMPIutil : 83 LibVirtCIM : 642 CIMTEST : 258 ====================================== PASS : 98 TOTAL FAILED : 15 [9 test cases passed when ran manually] ACTUAL FAILED : 6 XFAIL : 2 SKIP : 15 ------------------- Total : 130 ====================================== List of tc that are failing: 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 The above test cases are failing with the following error: ERROR - Unexpected rc code 1 and description: CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available ERROR - Unable to define domain test_domain using DefineSystem() InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available This is because I believe VSMS provider requires a network pool to exist in order to create a guest. But the test cases does not ensure creation of the network pool and also the previous tc ComputerSystem - 22_define_suspend.py was deleting the existing network pool. When ComputerSystem - 22_define_suspend.py was masked and the tc for ComputerSystem was run the tc started failing because of the following reason: ERROR - EnabledState should be 2 not 0 ERROR - Attributes for dom test_domain not set as expected. Will look into the issue further and update the same. The following tc passed when run manually: ElementConforms - 01_forward.py: FAIL ElementSettingData - 01_forward.py: FAIL HostSystem - 02_hostsystem_to_rasd.py: FAIL LogicalDisk - 02_nodevs.py: FAIL LogicalDisk - 03_ld_gi_errs.py: FAIL Memory - 01_memory.py: FAIL NetworkPort - 01_netport.py: FAIL VSSD - 04_vssd_to_rasd.py: FAIL VirtualSystemManagementService - 08_modifyresource.py: FAIL Please find the complete report attached with the mail. Thanks and Regards, Deepti. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: July24-XenFV-report URL: From danms at us.ibm.com Thu Jul 24 16:33:52 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 24 Jul 2008 09:33:52 -0700 Subject: [Libvirt-cim] CimTest Report on XenFV 24-07-2008 In-Reply-To: <4888825D.9090908@linux.vnet.ibm.com> (Deepti B. Kalakeri's message of "Thu, 24 Jul 2008 18:53:41 +0530") References: <4888825D.9090908@linux.vnet.ibm.com> Message-ID: <87iquvkzrj.fsf@caffeine.beaverton.ibm.com> DK> This is because I believe VSMS provider requires a network pool to DK> exist in order to create a guest. DK> But the test cases does not ensure creation of the network pool and DK> also the previous tc ComputerSystem - 22_define_suspend.py was DK> deleting the existing network pool. That's correct. I think Kaitlin's patch to 22_define_suspend should fix this, right? Might be good for the suite to make sure a default network is defined before running the tests. DK> When ComputerSystem - 22_define_suspend.py was masked and the tc for DK> ComputerSystem was run the tc started failing because of the following DK> reason: DK> ERROR - EnabledState should be 2 not 0 DK> ERROR - Attributes for dom test_domain not set as expected. Some changes have been made to that code recently. See if the updated provider, plus Kaitlin's cimtest patch fixes the issue. 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 Jul 24 18:54:08 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 24 Jul 2008 11:54:08 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add test for hypervisor version string Message-ID: # HG changeset patch # User Dan Smith # Date 1216925647 25200 # Node ID c9acfbbfedda129e2058ed5f0049780f8a8ad8e9 # Parent 32d78f23f6e73f5443022179410128767896465d [TEST] Add test for hypervisor version string Signed-off-by: Dan Smith diff -r 32d78f23f6e7 -r c9acfbbfedda lib/VirtLib/live.py --- a/lib/VirtLib/live.py Wed Jul 23 00:32:36 2008 -0700 +++ b/lib/VirtLib/live.py Thu Jul 24 11:54:07 2008 -0700 @@ -347,3 +347,10 @@ return out return None +def get_hv_ver(server, virt="Xen"): + cmd = "virsh -c %s version | grep ^Running | cut -d ' ' -f 3,4" % utils.virt2uri(virt) + ret, out = utils.run_remote(server, cmd) + if ret == 0: + return out + else: + return None diff -r 32d78f23f6e7 -r c9acfbbfedda suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_hv_version.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_hv_version.py Thu Jul 24 11:54:07 2008 -0700 @@ -0,0 +1,60 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Dan Smith +# +# 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 pywbem +from VirtLib import live +from XenKvmLib import vsms +from CimTest.Globals import do_main +from CimTest.Globals import logger +from CimTest.ReturnCodes import FAIL, PASS + +sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] + + at do_main(sup_types) +def main(): + options = main.options + + try: + service = vsms.enumerate_instances(options.ip, options.virt)[0] + except Exception, details: + logger.error("Did not find VSMS instance") + logger.error(details) + return FAIL + + try: + cim_ver = service["Caption"] + local_ver = live.get_hv_ver(options.ip, options.virt) + + if cim_ver != local_ver: + logger.error("CIM says version is `%s', but libvirt says `%s'") + return FAIL + else: + logger.info("Verified %s == %s" % (cim_ver, local_ver)) + except Exception, details: + logger.error(details) + return FAIL + + return PASS + +if __name__ == "__main__": + sys.exit(main()) From danms at us.ibm.com Thu Jul 24 20:11:40 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 24 Jul 2008 13:11:40 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Verify functionality of MemoryRASD units specification for VSMS Message-ID: <2972728363defd7c9a76.1216930300@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1216930253 25200 # Node ID 2972728363defd7c9a7683ebfa85a4dfc8225e32 # Parent c9acfbbfedda129e2058ed5f0049780f8a8ad8e9 [TEST] Verify functionality of MemoryRASD units specification for VSMS Signed-off-by: Dan Smith diff -r c9acfbbfedda -r 2972728363de suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Thu Jul 24 13:10:53 2008 -0700 @@ -0,0 +1,138 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Dan Smith +# +# 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 pywbem +from VirtLib import live +from XenKvmLib import vsms +from XenKvmLib.test_doms import undefine_test_domain +from XenKvmLib.common_util import create_using_definesystem +from XenKvmLib import rasd +from XenKvmLib.classes import get_typed_class +from XenKvmLib import enumclass +from CimTest.Globals import do_main +from CimTest.Globals import logger +from CimTest.ReturnCodes import FAIL, PASS + +sup_types = ['Xen', 'XenFV', 'KVM'] +default_dom = "memrasd_test" + +mem_bytes = 2 << 30 + +values = [ + ("Bytes", 0), + ("KiloBytes", 10), + ("MegaBytes", 20), + ("GigaBytes", 30), + ] + +def try_define(options, service, vssd, units, value): + mrasd_class = vsms.get_masd_class(options.virt) + mrasd = mrasd_class(None, default_dom) + + mrasd.AllocationUnits = units + mrasd.VirtualQuantity = value + + params = { + "vssd" : vssd.mof(), + "rasd" : [mrasd.mof()], + } + + logger.info("Defining with %s = %i" % (units, value)) + rc = create_using_definesystem(default_dom, + options.ip, + params=params, + virt=options.virt) + + if rc != PASS: + logger.error("DefineSystem (%s) failed" % units) + return False + + return True + +def check_value(options): + mrasd_cn = get_typed_class(options.virt, rasd.masd_cn) + rasds = enumclass.enumerate_inst(options.ip, mrasd_cn, options.virt) + + the_rasd = None + mem_kb = mem_bytes >> 10 + + for _rasd in rasds: + if _rasd["InstanceID"] == "%s/mem" % default_dom: + the_rasd = _rasd + + if not the_rasd: + logger.error("Did not find test RASD on server") + return False + + if the_rasd["AllocationUnits"] != "KiloBytes": + logger.error("MRASD units are not kilobytes?") + return False + + cim_kb = int(the_rasd["VirtualQuantity"]) + + if cim_kb != mem_kb: + logger.error("CIM reports %i KB instead of %i KB" % (cim_kb, mem_kb)) + return False + + logger.info("Verified %i KB" % mem_kb) + + return True + + + at do_main(sup_types) +def main(): + options = main.options + + vssd_class = vsms.get_vssd_class(options.virt) + vssd = vssd_class(name=default_dom, virt=options.virt) + + try: + service = vsms.enumerate_instances(options.ip, options.virt)[0] + except Exception, e: + logger.error("Did not find VSMS instance: %s" % e) + return FAIL + + status = PASS + + for units, shift in values: + value = mem_bytes >> shift + + if not try_define(options, service, vssd, units, value): + status = FAIL + break + + if not check_value(options): + status = FAIL + break + + undefine_test_domain(default_dom, options.ip, virt=options.virt) + + try: + undefine_test_domain(default_dom, options.ip, virt=options.virt) + except Exception, e: + pass + + return status + +if __name__ == "__main__": + sys.exit(main()) From yunguol at cn.ibm.com Fri Jul 25 07:58:41 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Fri, 25 Jul 2008 00:58:41 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Convert HostSystem - 04_hs_to_EAPF.py for XenFV/KVM support Message-ID: # HG changeset patch # User Guolian Yun # Date 1216972699 25200 # Node ID be268ff56f1a52fb77fe8d98da8a4a7ff3602397 # Parent 32d78f23f6e73f5443022179410128767896465d [TEST] Convert HostSystem - 04_hs_to_EAPF.py for XenFV/KVM support Also fix failure for Xen, remove CCName parameter from verify_device_values() function Signed-off-by: Guolian Yun diff -r 32d78f23f6e7 -r be268ff56f1a suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py --- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Wed Jul 23 00:32:36 2008 -0700 +++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Fri Jul 25 00:58:19 2008 -0700 @@ -52,17 +52,17 @@ from CimTest.Globals import logger, CIM_ from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES, \ CIM_ERROR_ASSOCIATORS from CimTest.Globals import do_main +from XenKvmLib.vxml import XenXML, KVMXML, get_class from XenKvmLib.assoc import AssociatorNames, Associators from XenKvmLib.common_util import get_host_info +from XenKvmLib.classes import get_typed_class from CimTest.ReturnCodes import PASS, FAIL, SKIP -from XenKvmLib.test_xml import testxml_bridge -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all -from VirtLib.live import network_by_bridge +from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib.logicaldevices import verify_device_values from XenKvmLib.common_util import cleanup_restore, test_dpath, \ create_diskpool_file -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV'] test_dom = "CrossClass_GuestDom" test_mac = "00:11:22:33:44:aa" @@ -72,30 +72,6 @@ diskid = "%s/%s" % ("DiskPool", test_dpa diskid = "%s/%s" % ("DiskPool", test_dpath) memid = "%s/%s" % ("MemoryPool", 0) procid = "%s/%s" % ("ProcessorPool", 0) - -def setup_env(server): - destroy_and_undefine_all(server) - test_xml, bridge = testxml_bridge(test_dom, mem = test_mem, - vcpus = test_vcpus, mac = test_mac, - disk = test_disk, server = server) - if bridge == None: - logger.error("Unable to find virtual bridge") - return SKIP - - if test_xml == None: - logger.error("Guest xml was not created properly") - return FAIL - - virt_network = network_by_bridge(bridge, server) - if virt_network == None: - logger.error("No virtual network found for bridge %s", bridge) - return SKIP - - ret = test_domain_function(test_xml, server, cmd = "create") - if not ret: - logger.error("Failed to create the dom: %s", test_dom) - return FAIL - return PASS def print_err(err, detail, cn): logger.error(err % cn) @@ -112,34 +88,39 @@ def pool_init_list(pool_assoc): in_pllist[classname_keyvalue] = instid return in_pllist -def eapf_list(): +def eapf_list(server, virt="Xen"): + disk_inst = get_typed_class(virt, "LogicalDisk") + proc_inst = get_typed_class(virt, "Processor") + net_inst = get_typed_class(virt, "NetworkPort") + mem_inst = get_typed_class(virt, "Memory") + disk = { 'SystemName' : test_dom, - 'CreationClassName' : "Xen_LogicalDisk", - 'DeviceID' : "%s/%s" % (test_dom,test_disk), + 'CreationClassName' : disk_inst, + 'DeviceID' : "%s/%s" % (test_dom, test_disk), 'Name' : test_disk } proc = { 'SystemName' : test_dom, - 'CreationClassName' : "Xen_Processor", + 'CreationClassName' : proc_inst, 'DeviceID' : "%s/%s" % (test_dom,0) } net = { 'SystemName' : test_dom, - 'CreationClassName' : "Xen_NetworkPort", + 'CreationClassName' : net_inst, 'DeviceID' : "%s/%s" % (test_dom, test_mac), 'NetworkAddresses' : test_mac } mem = { 'SystemName' : test_dom, - 'CreationClassName' : "Xen_Memory", + 'CreationClassName' : mem_inst, 'DeviceID' : "%s/%s" % (test_dom, "mem"), 'NumberOfBlocks' : test_mem * 1024 } - eaf_values = { "Xen_Processor" : proc, - "Xen_LogicalDisk" : disk, - "Xen_NetworkPort" : net, - "Xen_Memory" : mem + eaf_values = { proc_inst : proc, + disk_inst : disk, + net_inst : net, + mem_inst : mem } return eaf_values @@ -152,13 +133,14 @@ def get_inst_for_dom(assoc_val): return dom_list -def get_assocname_info(server, cn, an, qcn, hostname): +def get_assocname_info(server, cn, an, qcn, hostname, virt="Xen"): status = PASS assoc_info = [] try: assoc_info = AssociatorNames(server, an, cn, + virt, CreationClassName=cn, Name = hostname) if len(assoc_info) < 1: @@ -172,7 +154,6 @@ def get_assocname_info(server, cn, an, q if status != PASS: cleanup_restore(server, virt='Xen') - test_domain_function(test_dom, server, "destroy") return status, assoc_info @@ -183,24 +164,24 @@ def check_len(an, assoc_list_info, qcn, return FAIL return PASS -def verify_eafp_values(server, in_pllist): +def verify_eafp_values(server, in_pllist, virt="Xen"): # Looping through the in_pllist to get association for various pools. status = PASS - an = "Xen_ElementAllocatedFromPool" + an = get_typed_class(virt, "ElementAllocatedFromPool") exp_len = 1 qcn = "Logical Devices" - eafp_values = eapf_list() + eafp_values = eapf_list(server, virt) for cn, instid in sorted(in_pllist.items()): try: - assoc_info = Associators(server, an, cn, InstanceID = instid) + assoc_info = Associators(server, an, cn, virt, InstanceID = instid) inst_list = get_inst_for_dom(assoc_info) status = check_len(an, inst_list, qcn, exp_len) if status != PASS: break assoc_eafp_info = inst_list[0] CCName = assoc_eafp_info['CreationClassName'] - status = verify_device_values(assoc_eafp_info, CCName, - eafp_values, virt='Xen') + status = verify_device_values(assoc_eafp_info, + eafp_values, virt) if status != PASS: return status @@ -216,22 +197,36 @@ def main(): def main(): options= main.options server = options.ip - virt=options.virt + if options.virt == "XenFV": + virt = "Xen" + else: + virt=options.virt # Get the host info - status, host_name, classname = get_host_info(server) + status, host_name, classname = get_host_info(server, virt) if status != PASS: return status + destroy_and_undefine_all(server) + virt_type = get_class(virt) + if virt == 'LXC': + vsxml = virt_type(test_dom) + else: + vsxml = virt_type(test_dom, vcpus = test_vcpus, mac = test_mac, + disk = test_disk) + + ret = vsxml.define(server) + if not ret: + logger.error("Failed to Create the dom: '%s'", test_dom) + return FAIL # Verify DiskPool on machine status = create_diskpool_file() if status != PASS: return status - # Get the hostedResourcePool info first cn = classname - an = "Xen_HostedResourcePool" + an = get_typed_class(virt, "HostedResourcePool") qcn = "Device Pool" - status, pool = get_assocname_info(server, cn, an, qcn, host_name) + status, pool = get_assocname_info(server, cn, an, qcn, host_name, virt) if status != PASS: return status @@ -241,15 +236,9 @@ def main(): if status != PASS: return FAIL - status = setup_env(server) - if status != PASS: - cleanup_restore(server, virt=virt) - test_domain_function(test_dom, server, cmd = "destroy") - return status - in_pllist = pool_init_list(pool) - status = verify_eafp_values(server, in_pllist) - ret = test_domain_function(test_dom, server, cmd = "destroy") + status = verify_eafp_values(server, in_pllist, virt) + vsxml.undefine(server) cleanup_restore(server, virt=virt) return status if __name__ == "__main__": From yunguol at cn.ibm.com Fri Jul 25 08:19:38 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Fri, 25 Jul 2008 01:19:38 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update ResourcePool.01 & 02 for XenFV support Message-ID: # HG changeset patch # User Guolian Yun # Date 1216973963 25200 # Node ID f45e90649f2f3f21e169537463d491e965723cdd # Parent 32d78f23f6e73f5443022179410128767896465d [TEST] Update ResourcePool.01 & 02 for XenFV support Signed-off-by: Guolian Yun diff -r 32d78f23f6e7 -r f45e90649f2f suites/libvirt-cim/cimtest/ResourcePool/01_enum.py --- a/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Wed Jul 23 00:32:36 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Fri Jul 25 01:19:23 2008 -0700 @@ -39,7 +39,7 @@ from XenKvmLib.common_util import cleanu from XenKvmLib.common_util import cleanup_restore, test_dpath, \ create_diskpool_file -sup_types = ['Xen', 'KVM', 'LXC'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] diskid = "%s/%s" % ("DiskPool", test_dpath) dp_cn = 'DiskPool' @@ -105,7 +105,10 @@ def verify_fields(pool_list, poolname, c @do_main(sup_types) def main(): ip = main.options.ip - virt = main.options.virt + if main.options.virt == "XenFV": + virt = "Xen" + else: + virt = main.options.virt status, pool_list = init_list(ip, virt) if status != PASS: logger.error("Failed to initialise the list") diff -r 32d78f23f6e7 -r f45e90649f2f suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py --- a/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py Wed Jul 23 00:32:36 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py Fri Jul 25 01:19:23 2008 -0700 @@ -40,7 +40,7 @@ from XenKvmLib.common_util import cleanu from XenKvmLib.common_util import cleanup_restore, test_dpath, \ create_diskpool_file -sup_types = ['Xen', 'KVM', 'LXC'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] expr_values = { "invalid_keyname" : { 'rc' : pywbem.CIM_ERR_FAILED, @@ -88,7 +88,10 @@ def err_invalid_instid_keyvalue(conn, cl @do_main(sup_types) def main(): ip = main.options.ip - virt = main.options.virt + if main.options.virt == "XenFV": + virt = "Xen" + else: + virt = main.options.virt conn = assoc.myWBEMConnection('http://%s' % ip, (CIM_USER, CIM_PASS), CIM_NS) From deeptik at linux.vnet.ibm.com Fri Jul 25 09:52:22 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 25 Jul 2008 15:22:22 +0530 Subject: [Libvirt-cim] [PATCH] Fix netpool issue in CS 22 In-Reply-To: References: Message-ID: <4889A256.5070900@linux.vnet.ibm.com> +1 for me. Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1216860167 25200 > # Node ID ab1e34deb7109d8a89d03b6b53c54f30a9c99888 > # Parent 32d78f23f6e73f5443022179410128767896465d > Fix netpool issue in CS 22 > > Don't use the existing netpool, create one for the test. > > Signed-off-by: Kaitlin Rupert > > diff -r 32d78f23f6e7 -r ab1e34deb710 suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py > --- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Wed Jul 23 00:32:36 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Wed Jul 23 17:42:47 2008 -0700 > @@ -62,7 +62,7 @@ > def main(): > options = main.options > > - status, test_network = create_netpool_conf(options.ip, options.virt) > + status, test_network = create_netpool_conf(options.ip, options.virt, False) > if status != PASS: > return FAIL > > > _______________________________________________ > 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 Jul 25 12:43:29 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 25 Jul 2008 18:13:29 +0530 Subject: [Libvirt-cim] CimTest Report for KVM on F9 23-07-2008 In-Reply-To: <87k5fch5jv.fsf@caffeine.beaverton.ibm.com> References: <4886DAB6.3040606@linux.vnet.ibm.com> <87k5fch5jv.fsf@caffeine.beaverton.ibm.com> Message-ID: <4889CA71.4050505@linux.vnet.ibm.com> Dan Smith wrote: > DK> ComputerSystem - 40_RSC_start.py: XFAIL Bug: 00001 > DK> ERROR - Exception: (1, u'CIM_ERR_FAILED: Invalid state transition') > DK> ERROR - Exception: RequestedStateChange() could not be used to start domain: 'test_domain' > DK> InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Invalid state transition > DK> Bug:<00001> > > What is this? Certainly RequestStateChange() is not broken on KVM, > right? And if it is, it definitely shouldn't be an XFAIL. > > The above tc *On Xen* : the test case passes *On KVM* : the test case XFAIL's with below reason. ComputerSystem - 40_RSC_start.py: XFAIL Bug: 00001 ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed') ERROR - Exception: RequestedStateChange() could not be used to start domain: '40_test_domain' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed Bug:<00001> The XML from the debug statement is as follows: a01c02b7-c8a0-4a49-9c90-0a35e19865da 40_test_domain destroy destroy hvm 0 0 1 1) The XML config file is *just enough* to *define *the guest but not start it. I manually tried to define the guest with the above XML and I was able to define it, but when I tried to start the defined guest it failed with the following error: *virsh start 40_test_domain* libvir: QEMU error : internal error QEMU quit during console startup error: Failed to start domain 40_test_domain The only problem with the above XML file is the *Memory and currentMemory *being set to* 0. *I then assigned *1024* in place of *0* for *Memory and currentMemory *and I was able to define and start the domain. I was able to start the domain only when both the values *Memory and currentMemory *were not equal to *0*. The *Memory and currentMemory *being 0 is not a problem in case of Xen and XenFV. I tried checking the difference and the limitation for this field on libvirt.org, but was not much successful. 2) I found one more peculiar problem, even though I was able to successfully define KVM domain either using tc or manually, or started the KVM guest using the virsh, I was not find any info using the virsh -c qemu:///system list --all. Can this be a problem with my machine ? I was able to use virsh for other guests though. *On XenFV* : the test case fails with following error. ComputerSystem - 40_RSC_start.py: XFAIL Bug: 00002 ERROR - EnabledState should be 2 not 0 ERROR - Exception: Attributes were not set as expected for domain: 'test_domain' Bug:<00002> I tried inserting delay in the test case between the call_request_state_change() and check_attributes(), and the test case Passed :). PS : The machine had the following network pool *virsh net-list Name State Autostart ----------------------------------------- default-net active no * Thanks and Regards, Deepti. > ------------------------------------------------------------------------ > > _______________________________________________ > 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 Jul 25 12:47:59 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 25 Jul 2008 18:17:59 +0530 Subject: [Libvirt-cim] CimTest Report for KVM on F9 23-07-2008 In-Reply-To: <4887B6D7.2090800@linux.vnet.ibm.com> References: <4886DAB6.3040606@linux.vnet.ibm.com> <87k5fch5jv.fsf@caffeine.beaverton.ibm.com> <4887B6D7.2090800@linux.vnet.ibm.com> Message-ID: <4889CB7F.60306@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Dan Smith wrote: >> DK> ComputerSystem - 40_RSC_start.py: XFAIL Bug: 00001 >> DK> ERROR - Exception: (1, u'CIM_ERR_FAILED: Invalid state >> transition') >> DK> ERROR - Exception: RequestedStateChange() could not be used to >> start domain: 'test_domain' >> DK> InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Invalid state >> transition >> DK> Bug:<00001> >> >> What is this? Certainly RequestStateChange() is not broken on KVM, >> right? And if it is, it definitely shouldn't be an XFAIL. >> > > The test is defining a guest and then starting it. The enable call in > the provider checks to make sure the guest is either defined or pause. > > Deepti - you could add a return after the guest is defined and then > check the state of the guest. > > I tried to reproduce this on my system, but I see the following error: > > CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and > no default available > ERROR - Exception: DefineSystem() failed to create domain: test_domain > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No > NetworkPool specified and no default available > > This is odd, because I have a network pool defined: > > Name State Autostart > ----------------------------------------- > default-net active no > > The provider complains with the following: > > Virt_VirtualSystemManagementService.c(298): Failed to get default > network pool: No default pool found for type 10 > Virt_VirtualSystemManagementService.c(573): > rasd_to_vdev(KVM_NetResourceAllocationSettingData): No NetworkPool > specified and no default available > Virt_VirtualSystemManagementService.c(886): Failed to classify > resources: No NetworkPool specified and no default available > std_invokemethod.c(305): Method `DefineSystem' returned 1 > I did not see the above problem on the KVM when a network pool existed. I had the following on my machine *virsh net-list Name State Autostart ----------------------------------------- default-net55 active no * and the test case on KVM failed with the following reason: ComputerSystem - 40_RSC_start.py: XFAIL Bug: 00001 ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed') ERROR - Exception: RequestedStateChange() could not be used to start domain: 'test_domain' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed Bug:<00001> I have given more information to the above error in reply to Dan's mail to the same thread. Thanks and Regards, Deepti. From danms at us.ibm.com Fri Jul 25 14:22:08 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 25 Jul 2008 07:22:08 -0700 Subject: [Libvirt-cim] [PATCH] Return a reference instead of an instance for ResultingSystem Message-ID: <6c42f34929ca88266843.1216995728@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1216995289 25200 # Node ID 6c42f34929ca88266843f931c69ccf5a09391ef1 # Parent e6f7e3922f86b9ac35c5c9e205dacf8feb88e2a8 Return a reference instead of an instance for ResultingSystem Signed-off-by: Dan Smith diff -r e6f7e3922f86 -r 6c42f34929ca src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Thu Jul 24 11:05:22 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Fri Jul 25 07:14:49 2008 -0700 @@ -953,6 +953,7 @@ CMPIArgs *argsout) { CMPIObjectPath *refconf; + CMPIObjectPath *result; CMPIInstance *vssd; CMPIInstance *sys; CMPIArray *res; @@ -972,7 +973,9 @@ if (sys == NULL) goto out; - CMAddArg(argsout, "ResultingSystem", &sys, CMPI_instance); + result = CMGetObjectPath(sys, &s); + if ((result != NULL) && (s.rc == CMPI_RC_OK)) + CMAddArg(argsout, "ResultingSystem", &result, CMPI_ref); trigger_indication(context, "ComputerSystemCreatedIndication", From danms at us.ibm.com Fri Jul 25 17:04:34 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 25 Jul 2008 10:04:34 -0700 Subject: [Libvirt-cim] [PATCH] (#2) Fix DiskRASD size reporting Message-ID: <9cd2071b34e6251a64db.1217005474@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1217005472 25200 # Node ID 9cd2071b34e6251a64db54b5008d4d9f0a64a0bd # Parent baebb5941892dbdac23a5a902f4dfd5d7101587b (#2) Fix DiskRASD size reporting I *know* this was in place at one point, but I think it might have gotten lost in the changes to add libvirt storage support. Changes: - If libvirt storage pool lookup fails, attempt to stat the image as a backup Signed-off-by: Dan Smith diff -r baebb5941892 -r 9cd2071b34e6 src/Virt_RASD.c --- a/src/Virt_RASD.c Wed Jul 23 15:25:26 2008 -0700 +++ b/src/Virt_RASD.c Fri Jul 25 10:04:32 2008 -0700 @@ -142,6 +142,98 @@ return s; } +static bool get_file_size(const CMPIBroker *broker, + const CMPIObjectPath *ref, + const char *image, + uint64_t *size) +{ + struct stat st; + + if (stat(image, &st) == -1) + return false; + + *size = st.st_size; + + return true; +} + +#if LIBVIR_VERSION_NUMBER > 4000 +static bool get_vol_size(const CMPIBroker *broker, + const CMPIObjectPath *ref, + const char *image, + uint64_t *size) +{ + virConnectPtr conn = NULL; + virStorageVolPtr vol = NULL; + virStorageVolInfo volinfo; + CMPIStatus s; + bool ret = false; + + *size = 0; + + conn = connect_by_classname(broker, CLASSNAME(ref), &s); + if (conn == NULL) + return false; + + vol = virStorageVolLookupByPath(conn, image); + if (vol != NULL) { + if (virStorageVolGetInfo(vol, &volinfo) != 0) { + CU_DEBUG("Failed to get info for volume %s", image); + } else { + *size = volinfo.capacity; + ret = true; + } + } else { + CU_DEBUG("Failed to lookup pool for volume %s", image); + } + + virStorageVolFree(vol); + virConnectClose(conn); + + if (!ret) + return get_file_size(broker, ref, image, size); + else + return true; +} +#else +static bool get_vol_size(const CMPIBroker *broker, + const CMPIObjectPath *ref, + const char *image, + uint64_t *size) +{ + return get_file_size(broker, ref, image, size); +} +#endif + +static CMPIStatus set_disk_rasd_params(const CMPIBroker *broker, + const CMPIObjectPath *ref, + const struct virt_device *dev, + CMPIInstance *inst) +{ + uint64_t cap = 0; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + get_vol_size(broker, ref, dev->dev.disk.source, &cap); + + CMSetProperty(inst, "VirtualQuantity", + (CMPIValue *)&cap, CMPI_uint64); + + CMSetProperty(inst, "AllocationUnits", + (CMPIValue *)"Bytes", CMPI_chars); + + CMSetProperty(inst, + "VirtualDevice", + (CMPIValue *)dev->dev.disk.virtual_dev, + CMPI_chars); + + CMSetProperty(inst, + "Address", + (CMPIValue *)dev->dev.disk.source, + CMPI_chars); + + return s; +} + static CMPIInstance *rasd_from_vdev(const CMPIBroker *broker, struct virt_device *dev, const char *host, @@ -192,14 +284,7 @@ (CMPIValue *)&type, CMPI_uint16); if (dev->type == CIM_RES_TYPE_DISK) { - CMSetProperty(inst, - "VirtualDevice", - (CMPIValue *)dev->dev.disk.virtual_dev, - CMPI_chars); - CMSetProperty(inst, - "Address", - (CMPIValue *)dev->dev.disk.source, - CMPI_chars); + s = set_disk_rasd_params(broker, ref, dev, inst); } else if (dev->type == CIM_RES_TYPE_NET) { CMSetProperty(inst, "NetworkType", From danms at us.ibm.com Fri Jul 25 17:04:51 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 25 Jul 2008 10:04:51 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add test for DiskRASD size parameter Message-ID: <3c80ea156a3c45bc321f.1217005491@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1217005489 25200 # Node ID 3c80ea156a3c45bc321f9c465ba7692c011ab2e0 # Parent 2972728363defd7c9a7683ebfa85a4dfc8225e32 [TEST] Add test for DiskRASD size parameter Signed-off-by: Dan Smith diff -r 2972728363de -r 3c80ea156a3c suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py Fri Jul 25 10:04:49 2008 -0700 @@ -0,0 +1,127 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Dan Smith +# +# 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 +# + +sup_types = ['Xen', 'XenFV', 'KVM'] +default_dom = "diskrasd_test" + +import sys + +from CimTest.ReturnCodes import FAIL, PASS +from CimTest.Globals import do_main +from CimTest.Globals import logger +from VirtLib import utils +from XenKvmLib.test_doms import undefine_test_domain +from XenKvmLib.common_util import create_using_definesystem +from XenKvmLib import vsms +from XenKvmLib import enumclass + +def make_image(ip, size): + s, fn = utils.run_remote(ip, "mktemp") + if s != 0: + return None + + s, _ = utils.run_remote(ip, + "dd if=/dev/zero of=%s bs=1 count=%i" % (fn, size)) + if s != 0: + return None + + return fn + +def kill_image(ip, name): + s, _ = utils.run_remote(ip, "rm -f %s" % name) + + return s == 0 + +def check_rasd_size(rasd, size): + if rasd["AllocationUnits"] != "Bytes": + logger.error("AllocationUnits != Bytes?") + return FAIL + + try: + cim_size = int(rasd["VirtualQuantity"]) + except Exception, e: + logger.error("Failed to get DiskRASD size: %s" % e) + return FAIL + + if cim_size != size: + logger.error("CIM reports %i bytes, but should be %i bytes" % (cim_size, + size)) + return FAIL + else: + logger.info("Verified %i bytes" % cim_size) + return PASS + +def test_rasd(options, temp, test_size): + vssd_class = vsms.get_vssd_class(options.virt) + vssd = vssd_class(name=default_dom, virt=options.virt) + + drasd_class = vsms.get_dasd_class(options.virt) + drasd = drasd_class("hda", temp, default_dom) + + mrasd_class = vsms.get_masd_class(options.virt) + mrasd = mrasd_class(32, default_dom) + + params = { + "vssd" : vssd.mof(), + "rasd" : [drasd.mof(), mrasd.mof()] + } + + create_using_definesystem(default_dom, + options.ip, + params=params, + virt=options.virt) + + rasds = enumclass.enumerate_inst(options.ip, drasd_class, options.virt) + + status = FAIL + for rasd in rasds: + if rasd["Address"] == temp: + status = check_rasd_size(rasd, test_size) + break + + return status + + at do_main(sup_types) +def main(): + options = main.options + + test_size = 123 << 10 + + temp = make_image(options.ip, test_size) + if not temp: + logger.error("Unable to create a temporary disk image") + return FAIL + + logger.info("Created temp disk %s of size %i bytes" % (temp, test_size)) + + try: + status = test_rasd(options, temp, test_size) + except Exception, e: + logger.error("Failed to test RASD: %s" % e) + + undefine_test_domain(default_dom, options.ip, options.virt) + kill_image(options.ip, temp) + + return status + +if __name__ == "__main__": + sys.exit(main()) From danms at us.ibm.com Fri Jul 25 19:03:43 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 25 Jul 2008 12:03:43 -0700 Subject: [Libvirt-cim] [PATCH] Fix ReferenceConfiguration parameter parsing to properly expect a VSSD Message-ID: <466808eaaefaf26e1200.1217012623@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1217012608 25200 # Node ID 466808eaaefaf26e1200ab6ce57dc7b96b9ee7c7 # Parent a3aa7dff01cc4128a55553c6cfbbf1123441c272 Fix ReferenceConfiguration parameter parsing to properly expect a VSSD Which means grabbing InstaceID instead and parsing out the name. I think a test was recently added for ReferenceConfiguration, so that will need to change, as it was based on the code and not the schema. Signed-off-by: Dan Smith diff -r a3aa7dff01cc -r 466808eaaefa src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Fri Jul 25 11:56:55 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Fri Jul 25 12:03:28 2008 -0700 @@ -813,7 +813,8 @@ { virConnectPtr conn = NULL; virDomainPtr dom = NULL; - const char *name; + char *name = NULL; + const char *iid; CMPIStatus s; int ret; @@ -833,11 +834,19 @@ } } - if (cu_get_str_path(refconf, "Name", &name) != CMPI_RC_OK) { - CU_DEBUG("Missing Name parameter"); + if (cu_get_str_path(refconf, "InstanceID", &iid) != CMPI_RC_OK) { + CU_DEBUG("Missing InstanceID parameter"); cu_statusf(_BROKER, &s, CMPI_RC_ERR_INVALID_PARAMETER, - "Missing `Name' from ReferenceConfiguration"); + "Missing `InstanceID' from ReferenceConfiguration"); + goto out; + } + + if (!parse_id(iid, NULL, &name)) { + CU_DEBUG("Failed to parse InstanceID: %s", iid); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_INVALID_PARAMETER, + "Invalid `InstanceID' from ReferenceConfiguration"); goto out; } @@ -868,6 +877,7 @@ out: virDomainFree(dom); virConnectClose(conn); + free(name); return s; } From danms at us.ibm.com Fri Jul 25 19:41:23 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 25 Jul 2008 12:41:23 -0700 Subject: [Libvirt-cim] [PATCH] Force the namespace into the ResultingSystem reference from DefineSystem Message-ID: <949e4c0f1e7c1c04d487.1217014883@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1217014881 25200 # Node ID 949e4c0f1e7c1c04d4875d7a6566240385af1656 # Parent 466808eaaefaf26e1200ab6ce57dc7b96b9ee7c7 Force the namespace into the ResultingSystem reference from DefineSystem ...since Pegasus drops it by default. Signed-off-by: Dan Smith diff -r 466808eaaefa -r 949e4c0f1e7c src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Fri Jul 25 12:03:28 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Fri Jul 25 12:41:21 2008 -0700 @@ -984,8 +984,10 @@ goto out; result = CMGetObjectPath(sys, &s); - if ((result != NULL) && (s.rc == CMPI_RC_OK)) + if ((result != NULL) && (s.rc == CMPI_RC_OK)) { + CMSetNameSpace(result, NAMESPACE(reference)); CMAddArg(argsout, "ResultingSystem", &result, CMPI_ref); + } trigger_indication(context, "ComputerSystemCreatedIndication", From skanan at us.ibm.com Fri Jul 25 20:14:11 2008 From: skanan at us.ibm.com (Saravanan Kannan) Date: Fri, 25 Jul 2008 16:14:11 -0400 Subject: [Libvirt-cim] [PATCH] Return a reference instead of an instance for ResultingSystem In-Reply-To: <6c42f34929ca88266843.1216995728@guaranine.danplanet.com> References: <6c42f34929ca88266843.1216995728@guaranine.danplanet.com> Message-ID: ># HG changeset patch ># User Dan Smith ># Date 1216995289 25200 ># Node ID 6c42f34929ca88266843f931c69ccf5a09391ef1 ># Parent e6f7e3922f86b9ac35c5c9e205dacf8feb88e2a8 >Return a reference instead of an instance for ResultingSystem > >Signed-off-by: Dan Smith >diff -r e6f7e3922f86 -r 6c42f34929ca src/Virt_VirtualSystemManagementService.c >--- a/src/Virt_VirtualSystemManagementService.c Thu Jul 24 11:05:22 2008 -0700 >+++ b/src/Virt_VirtualSystemManagementService.c Fri Jul 25 07:14:49 2008 -0700 >@@ -953,6 +953,7 @@ > CMPIArgs *argsout) > { > CMPIObjectPath *refconf; >+ CMPIObjectPath *result; > CMPIInstance *vssd; > CMPIInstance *sys; > CMPIArray *res; >@@ -972,7 +973,9 @@ > if (sys == NULL) > goto out; > >- CMAddArg(argsout, "ResultingSystem", &sys, CMPI_instance); >+ result = CMGetObjectPath(sys, &s); >+ if ((result != NULL) && (s.rc == CMPI_RC_OK)) >+ CMAddArg(argsout, "ResultingSystem", &result, CMPI_ref); > > trigger_indication(context, > "ComputerSystemCreatedIndication", > +1 Regards, Sam Kannan Linux Systems Management - WBEMSMT Systems & Technology Group IBM skanan at us.ibm.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From danms at us.ibm.com Fri Jul 25 20:15:11 2008 From: danms at us.ibm.com (Dan Smith) Date: Fri, 25 Jul 2008 13:15:11 -0700 Subject: [Libvirt-cim] CimTest Report for KVM on F9 23-07-2008 References: <4886DAB6.3040606@linux.vnet.ibm.com> <87k5fch5jv.fsf@caffeine.beaverton.ibm.com> <4889CA71.4050505@linux.vnet.ibm.com> Message-ID: <87d4l1lnzk.fsf@caffeine.beaverton.ibm.com> DK> 1) DK> The XML config file is *just enough* to *define *the guest but not DK> start it. DK> I manually tried to define the guest with the above XML and I was able DK> to define it, but when I tried to start the defined guest it failed DK> with the following error: DK> *virsh start 40_test_domain* DK> libvir: QEMU error : internal error QEMU quit during console startup DK> error: Failed to start domain 40_test_domain DK> The only problem with the above XML file is the *Memory and DK> currentMemory *being set to* 0. That's a pretty big problem. Why is this marked as XFAIL? This should be failing, and needs to be fixed ASAP. When I define a KVM guest through the providers manually, I get a correctly-set memory value. Is this an error in the test? DK> *I then assigned *1024* in place of *0* for *Memory and DK> currentMemory *and I was able to define and start the domain. I DK> was able to start the domain only when both the values *Memory and DK> currentMemory *were not equal to *0*. DK> The *Memory and currentMemory *being 0 is not a problem in case of Xen DK> and XenFV. DK> I tried checking the difference and the limitation for this field on DK> libvirt.org, but was not much successful. Yeah, it's not expected to do anything at all if given 0 memory. DK> 2) I found one more peculiar problem, even though I was able to DK> successfully define KVM domain either using tc or manually, or DK> started the KVM guest using the virsh, I was not find any info DK> using the virsh -c qemu:///system list --all. Can this be a DK> problem with my machine ? I was able to use virsh for other DK> guests though. I don't see that, and obviously if you're seeing it with a manual virsh define, then something else is broken. -- 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 cshan at hitachi.cn Mon Jul 28 02:14:10 2008 From: cshan at hitachi.cn (SHAN, CHUN -HCHBJ) Date: Mon, 28 Jul 2008 10:14:10 +0800 Subject: [Libvirt-cim] Problems when using libvirt-cim provider Message-ID: Hello,everyone: I am trying to use libvirt API and libvirt-cim now. After installed them successfully, I can see the "Virt_*****" providers using "cimprovider -l -s"commond. My cimom is pegasus. Then I used wbemcli as cim client. But when I used "wbemcli ei" to enumerate instances of a specified class,for example,Xen_DiskPool, error code was: wbemcli:Cim(1) CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code:"For provider Virt_DevicePool the library name was empty. Check provider registered location". Could you please help me to solve this problem? Did it mean that the providers were not registered correctly? But I "make postinstall" the provider and no errors occourred. Thank you! Regards, Chun Shan Disclaimer: The contents of this e-mail, and its attachments, if any, are confidential and may be protected by law against any unauthorized use. If you have received this e-mail by mistake or have reason to believe that you are not the intended recipient, please notify the sender by reply e-mail as soon as possible and delete it from your computer system immediately thereafter. If you are not the intended recipient, you must not copy this e-mail or attachment or disclose the contents to any other person. While we have made every effort to keep our network virus free, we take no responsibility for any computer virus which might be transferred by way of this e-mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: From yunguol at cn.ibm.com Mon Jul 28 08:44:12 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Mon, 28 Jul 2008 16:44:12 +0800 Subject: [Libvirt-cim] Cimtest Report for Xen on RHEL5.2 (2008/07/28) Message-ID: Distro : RHEL 5.2 Beta Kernel : kernel-2.6.18-92.el5 Xen version : xen-3.0.3-64.el5 Libvirt : libvirt-0.3.3-7.el5 CIMOM : pegasus PyWBEM : pywbem-3.14 CIM Schema : cimv216Experimental LibCMPIutil : 83 LibVirtCIM : 647 CIMTEST : 258 ========================================================= PASS : 113 FAILED : 15 SKIP : 2 Total : 130 =======================FAILED============================== ComputerSystem - 23_suspend_suspend.py: FAIL InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available ComputerSystem - 27_define_suspend_errs.py: FAIL InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available ComputerSystem - 32_start_reboot.py: FAIL InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available ComputerSystem - 33_suspend_reboot.py: FAIL InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available ComputerSystem - 35_start_reset.py: FAIL InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available ComputerSystem - 40_RSC_start.py: FAIL InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available HostSystem - 04_hs_to_EAPF.py: FAIL LogicalDisk - 02_nodevs.py: FAIL LogicalDisk - 03_ld_gi_errs.py: FAIL Memory - 01_memory.py: FAIL NetworkPort - 01_netport.py: FAIL VSSD - 02_bootldr.py: FAIL CIM_ERR_NOT_FOUND: No such instance (dom) VirtualSystemManagementService - 06_addresource.py: FAIL InvokeMethod(AddResourceSettings): CIM_ERR_FAILED: Unknown system `rstest_domain' VirtualSystemManagementService - 08_modifyresource.py: FAIL VirtualSystemManagementService - 09_procrasd_persist.py: FAIL =======================CIMTEST REPORT======================= AllocationCapabilities - 01_enum.py: PASS AllocationCapabilities - 02_alloccap_gi_errs.py: PASS ComputerSystem - 01_enum.py: PASS ComputerSystem - 02_nosystems.py: SKIP ComputerSystem - 03_defineVS.py: PASS ComputerSystem - 04_defineStartVS.py: PASS ComputerSystem - 05_activate_defined_start.py: PASS ComputerSystem - 06_paused_active_suspend.py: PASS ComputerSystem - 22_define_suspend.py: PASS ComputerSystem - 23_suspend_suspend.py: FAIL InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available ComputerSystem - 27_define_suspend_errs.py: FAIL InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available ComputerSystem - 32_start_reboot.py: FAIL InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available ComputerSystem - 33_suspend_reboot.py: FAIL InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available ComputerSystem - 35_start_reset.py: FAIL InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available ComputerSystem - 40_RSC_start.py: FAIL InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No NetworkPool specified and no default available ComputerSystem - 41_cs_to_settingdefinestate.py: PASS ComputerSystem - 42_cs_gi_errs.py: PASS ComputerSystemIndication - 01_created_indication.py: PASS ElementAllocatedFromPool - 01_forward.py: PASS ElementAllocatedFromPool - 02_reverse.py: PASS ElementAllocatedFromPool - 03_reverse_errs.py: PASS ElementAllocatedFromPool - 04_forward_errs.py: PASS ElementCapabilities - 01_forward.py: PASS ElementCapabilities - 02_reverse.py: PASS ElementCapabilities - 03_forward_errs.py: PASS ElementCapabilities - 04_reverse_errs.py: PASS ElementCapabilities - 05_hostsystem_cap.py: PASS ElementConforms - 01_forward.py: PASS ElementConforms - 02_reverse.py: PASS ElementConforms - 03_ectp_fwd_errs.py: PASS ElementConforms - 04_ectp_rev_errs.py: PASS ElementSettingData - 01_forward.py: PASS ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS EnabledLogicalElementCapabilities - 01_enum.py: PASS EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS HostSystem - 01_enum.py: PASS HostSystem - 02_hostsystem_to_rasd.py: PASS HostSystem - 03_hs_to_settdefcap.py: PASS HostSystem - 04_hs_to_EAPF.py: 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: FAIL LogicalDisk - 03_ld_gi_errs.py: FAIL Memory - 01_memory.py: FAIL Memory - 02_defgetmem.py: PASS 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: PASS Processor - 03_proc_gi_errs.py: PASS Profile - 01_enum.py: PASS Profile - 02_profile_to_elec.py: PASS Profile - 03_rprofile_gi_errs.py: PASS RASD - 01_verify_rasd_fields.py: PASS RASD - 02_enum.py: PASS RASD - 03_rasd_errs.py: PASS ReferencedProfile - 01_verify_refprof.py: PASS ReferencedProfile - 02_refprofile_errs.py: PASS ResourceAllocationFromPool - 01_forward.py: PASS ResourceAllocationFromPool - 02_reverse.py: PASS ResourceAllocationFromPool - 03_forward_errs.py: PASS ResourceAllocationFromPool - 04_reverse_errs.py: PASS ResourceAllocationFromPool - 05_RAPF_err.py: PASS ResourcePool - 01_enum.py: PASS ResourcePool - 02_rp_gi_errors.py: PASS ResourcePoolConfigurationCapabilities - 01_enum.py: PASS ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS ResourcePoolConfigurationService - 01_enum.py: PASS ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS SettingsDefine - 01_forward.py: PASS SettingsDefine - 02_reverse.py: PASS SettingsDefine - 03_sds_fwd_errs.py: PASS SettingsDefine - 04_sds_rev_errs.py: PASS SettingsDefineCapabilities - 01_forward.py: PASS SettingsDefineCapabilities - 03_forward_errs.py: PASS SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS SystemDevice - 01_forward.py: PASS SystemDevice - 02_reverse.py: PASS SystemDevice - 03_fwderrs.py: PASS VSSD - 01_enum.py: PASS VSSD - 02_bootldr.py: FAIL CIM_ERR_NOT_FOUND: No such instance (dom) VSSD - 03_vssd_gi_errs.py: PASS VSSD - 04_vssd_to_rasd.py: PASS VirtualSystemManagementCapabilities - 01_enum.py: PASS VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS VirtualSystemManagementService - 01_definesystem_name.py: PASS VirtualSystemManagementService - 02_destroysystem.py: PASS VirtualSystemManagementService - 03_definesystem_ess.py: PASS VirtualSystemManagementService - 04_definesystem_ers.py: PASS VirtualSystemManagementService - 05_destroysystem_neg.py: PASS VirtualSystemManagementService - 06_addresource.py: FAIL InvokeMethod(AddResourceSettings): CIM_ERR_FAILED: Unknown system `rstest_domain' VirtualSystemManagementService - 07_addresource_neg.py: PASS VirtualSystemManagementService - 08_modifyresource.py: FAIL VirtualSystemManagementService - 09_procrasd_persist.py: FAIL VirtualSystemMigrationCapabilities - 01_enum.py: PASS VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS VirtualSystemMigrationService - 01_migratable_host.py: PASS VirtualSystemMigrationService - 02_host_migrate_type.py: PASS VirtualSystemMigrationService - 05_migratable_host_errs.py: PASS VirtualSystemMigrationSettingData - 01_enum.py: PASS VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS VirtualSystemSettingDataComponent - 01_forward.py: PASS VirtualSystemSettingDataComponent - 02_reverse.py: PASS VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS VirtualSystemSnapshotService - 01_enum.py: PASS VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922403 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 -------------- next part -------------- An HTML attachment was scrubbed... URL: From danms at us.ibm.com Mon Jul 28 15:24:29 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 28 Jul 2008 08:24:29 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Check that the DefineSystem() result can be passed to GetInstance() Message-ID: # HG changeset patch # User Dan Smith # Date 1217258665 25200 # Node ID d1fb0dfbebaa98fd1e7fbcca1ce29dfb1bf44568 # Parent 3c80ea156a3c45bc321f9c465ba7692c011ab2e0 [TEST] Check that the DefineSystem() result can be passed to GetInstance() Signed-off-by: Dan Smith diff -r 3c80ea156a3c -r d1fb0dfbebaa suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_define_result.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_define_result.py Mon Jul 28 08:24:25 2008 -0700 @@ -0,0 +1,93 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Dan Smith +# +# 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 +# + +sup_types = ['Xen', 'XenFV', 'KVM'] +default_dom = "define_test" + +import sys +import pywbem +from CimTest.ReturnCodes import FAIL, PASS +from CimTest.Globals import do_main +from CimTest.Globals import logger +from CimTest import Globals +from XenKvmLib import vsms +from XenKvmLib.classes import get_typed_class + +def define_system(host, virt, name, vssd, rasds): + vsms_class = eval("vsms." + \ + get_typed_class(virt, + "VirtualSystemManagementService")) + + service = vsms_class(host) + + rc, results = service.DefineSystem(SystemSettings=vssd, + ResourceSettings=rasds, + ReferenceConfiguration=' ') + + system = results["ResultingSystem"] + + return rc, system + +def get_instance_by_ref(host, ref): + conn = pywbem.WBEMConnection('http://%s' % host, + (Globals.CIM_USER, Globals.CIM_PASS), + ref.namespace) + return conn.GetInstance(ref) + +def define_test_system(options): + vssd_class = vsms.get_vssd_class(options.virt) + vssd = vssd_class(name=default_dom, virt=options.virt) + + mrasd_class = vsms.get_masd_class(options.virt) + mrasd = mrasd_class(32, default_dom) + + rc, system = define_system(options.ip, + options.virt, + default_dom, + vssd.mof(), + [mrasd.mof()]) + + return system + + at do_main(sup_types) +def main(): + options = main.options + + systemref = define_test_system(options) + logger.info("GetInstance(%s)" % systemref) + + if systemref.namespace is None: + logger.error("Returned reference had no namespace!") + return FAIL + + system = get_instance_by_ref(options.ip, systemref) + + if system["Name"] == default_dom: + logger.info("Validated resulting system instance") + return PASS + else: + logger.error("Result system was: %s instead of %s" % (system["Name"], + default_dom)) + return FAIL + +if __name__ == "__main__": + sys.exit(main()) From danms at us.ibm.com Mon Jul 28 15:24:49 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 28 Jul 2008 08:24:49 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add stack trace on error to make test case development easier Message-ID: # HG changeset patch # User Dan Smith # Date 1217258680 25200 # Node ID cf3ab249243b02c259aa63f7cc69d0b3983c176d # Parent d1fb0dfbebaa98fd1e7fbcca1ce29dfb1bf44568 [TEST] Add stack trace on error to make test case development easier Signed-off-by: Dan Smith diff -r d1fb0dfbebaa -r cf3ab249243b lib/CimTest/Globals.py --- a/lib/CimTest/Globals.py Mon Jul 28 08:24:25 2008 -0700 +++ b/lib/CimTest/Globals.py Mon Jul 28 08:24:40 2008 -0700 @@ -25,6 +25,7 @@ import os import logging from optparse import OptionParser +import traceback global CIM_USER global CIM_PASS @@ -143,6 +144,7 @@ rc = f() except Exception, e: logger.error('%s : %s' % (e.__class__.__name__, e)) + logger.error("%s" % traceback.print_exc()) rc = FAIL return rc setattr(do_try, 'options', options) From danms at us.ibm.com Mon Jul 28 16:04:39 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 28 Jul 2008 09:04:39 -0700 Subject: [Libvirt-cim] Problems when using libvirt-cim provider In-Reply-To: (CHUN SHAN's message of "Mon, 28 Jul 2008 10:14:10 +0800") References: Message-ID: <87zlo2j8q0.fsf@caffeine.beaverton.ibm.com> SC> wbemcli:Cim(1) CIM_ERR_FAILED: A general error occurred that SC> is not covered by a more specific error code:"For provider SC> Virt_DevicePool the library name was empty. Check provider SC> registered location". This usually happens because the CIMOM is unable to load some dependent libraries for the providers. Where did the .so files get installed? I think the default is /usr/local/lib/cmpi for Pegasus if you don't specify a location. Figure out where your Pegasus providers directory is and set that with PROVIDERDIR like this: ./configure PROVIDERDIR=/usr/lib64/cmpi Then clean and rebuild/reinstall your tree. Also, make sure that the above path is set in your linker config (i.e. /etc/ld.so.conf). -- 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 Jul 28 16:20:57 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 28 Jul 2008 09:20:57 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Check that the DefineSystem() result can be passed to GetInstance() Message-ID: # HG changeset patch # User Dan Smith # Date 1217262054 25200 # Node ID a39dc855b73eb6f5a960bc377a093d3fa953f926 # Parent 3c80ea156a3c45bc321f9c465ba7692c011ab2e0 [TEST] #2 Check that the DefineSystem() result can be passed to GetInstance() Changes: - Check that ResultingSystem is a REF instead of an instance too Signed-off-by: Dan Smith diff -r 3c80ea156a3c -r a39dc855b73e suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_define_result.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_define_result.py Mon Jul 28 09:20:54 2008 -0700 @@ -0,0 +1,97 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Dan Smith +# +# 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 +# + +sup_types = ['Xen', 'XenFV', 'KVM'] +default_dom = "define_test" + +import sys +import pywbem +from CimTest.ReturnCodes import FAIL, PASS +from CimTest.Globals import do_main +from CimTest.Globals import logger +from CimTest import Globals +from XenKvmLib import vsms +from XenKvmLib.classes import get_typed_class + +def define_system(host, virt, name, vssd, rasds): + vsms_class = eval("vsms." + \ + get_typed_class(virt, + "VirtualSystemManagementService")) + + service = vsms_class(host) + + rc, results = service.DefineSystem(SystemSettings=vssd, + ResourceSettings=rasds, + ReferenceConfiguration=' ') + + system = results["ResultingSystem"] + + return rc, system + +def get_instance_by_ref(host, ref): + conn = pywbem.WBEMConnection('http://%s' % host, + (Globals.CIM_USER, Globals.CIM_PASS), + ref.namespace) + return conn.GetInstance(ref) + +def define_test_system(options): + vssd_class = vsms.get_vssd_class(options.virt) + vssd = vssd_class(name=default_dom, virt=options.virt) + + mrasd_class = vsms.get_masd_class(options.virt) + mrasd = mrasd_class(32, default_dom) + + rc, system = define_system(options.ip, + options.virt, + default_dom, + vssd.mof(), + [mrasd.mof()]) + + return system + + at do_main(sup_types) +def main(): + options = main.options + + systemref = define_test_system(options) + + if not isinstance(systemref, pywbem.CIMInstanceName): + logger.error("ResultingSystem is not a Reference!") + return FAIL + + if systemref.namespace is None: + logger.error("Returned reference had no namespace!") + return FAIL + + logger.info("GetInstance(%s)" % systemref) + system = get_instance_by_ref(options.ip, systemref) + + if system["Name"] == default_dom: + logger.info("Validated resulting system instance") + return PASS + else: + logger.error("Result system was: %s instead of %s" % (system["Name"], + default_dom)) + return FAIL + +if __name__ == "__main__": + sys.exit(main()) From danms at us.ibm.com Mon Jul 28 16:27:54 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 28 Jul 2008 09:27:54 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Add stack trace on error to make test case development easier Message-ID: <9e1d09bf6636d3a0244e.1217262474@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1217262465 25200 # Node ID 9e1d09bf6636d3a0244ee3224b22dcba267425d5 # Parent a39dc855b73eb6f5a960bc377a093d3fa953f926 [TEST] #2 Add stack trace on error to make test case development easier Changes: - Fix whitespace issue Signed-off-by: Dan Smith diff -r a39dc855b73e -r 9e1d09bf6636 lib/CimTest/Globals.py --- a/lib/CimTest/Globals.py Mon Jul 28 09:20:54 2008 -0700 +++ b/lib/CimTest/Globals.py Mon Jul 28 09:27:45 2008 -0700 @@ -25,6 +25,7 @@ import os import logging from optparse import OptionParser +import traceback global CIM_USER global CIM_PASS @@ -143,6 +144,7 @@ rc = f() except Exception, e: logger.error('%s : %s' % (e.__class__.__name__, e)) + logger.error("%s" % traceback.print_exc()) rc = FAIL return rc setattr(do_try, 'options', options) From danms at us.ibm.com Mon Jul 28 16:57:12 2008 From: danms at us.ibm.com (Dan Smith) Date: Mon, 28 Jul 2008 09:57:12 -0700 Subject: [Libvirt-cim] Cimtest Report for Xen on RHEL5.2 (2008/07/28) References: Message-ID: <87od4ij6af.fsf@caffeine.beaverton.ibm.com> GY> ComputerSystem - 23_suspend_suspend.py: FAIL GY> InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No GY> NetworkPool specified and no default available GY> ComputerSystem - 27_define_suspend_errs.py: FAIL GY> InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No GY> NetworkPool specified and no default available GY> ComputerSystem - 32_start_reboot.py: FAIL GY> InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No GY> NetworkPool specified and no default available GY> ComputerSystem - 33_suspend_reboot.py: FAIL GY> InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No GY> NetworkPool specified and no default available GY> ComputerSystem - 35_start_reset.py: FAIL GY> InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No GY> NetworkPool specified and no default available GY> ComputerSystem - 40_RSC_start.py: FAIL GY> InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No GY> NetworkPool specified and no default available Looks like your default network is down. Can you verify? Seems like the test suite might need to do some sanity checks (for things like this) before starting the test run. GY> HostSystem - 04_hs_to_EAPF.py: FAIL GY> LogicalDisk - 02_nodevs.py: FAIL GY> LogicalDisk - 03_ld_gi_errs.py: FAIL GY> Memory - 01_memory.py: FAIL GY> NetworkPort - 01_netport.py: FAIL GY> VSSD - 02_bootldr.py: FAIL GY> CIM_ERR_NOT_FOUND: No such instance (dom) GY> VirtualSystemManagementService - 06_addresource.py: FAIL GY> InvokeMethod(AddResourceSettings): CIM_ERR_FAILED: Unknown system GY> `rstest_domain' GY> VirtualSystemManagementService - 08_modifyresource.py: FAIL GY> VirtualSystemManagementService - 09_procrasd_persist.py: FAIL Can you look into these please? It's not very helpful to post a list of failures without a diagnosis or at least a log snippet :) -- 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 skanan at us.ibm.com Mon Jul 28 20:17:18 2008 From: skanan at us.ibm.com (Saravanan Kannan) Date: Mon, 28 Jul 2008 16:17:18 -0400 Subject: [Libvirt-cim] Re: [PATCH] Force the namespace into the ResultingSystem reference from DefineSystem In-Reply-To: <949e4c0f1e7c1c04d487.1217014883@guaranine.danplanet.com> References: <949e4c0f1e7c1c04d487.1217014883@guaranine.danplanet.com> Message-ID: From: danms at linux.vnet.ibm.com To: libvirt-cim at redhat.com Cc: Saravanan Kannan/Boca Raton/IBM at IBMUS Date: 07/25/2008 03:38 PM Subject: [PATCH] Force the namespace into the ResultingSystem reference from DefineSystem # HG changeset patch # User Dan Smith # Date 1217014881 25200 # Node ID 949e4c0f1e7c1c04d4875d7a6566240385af1656 # Parent 466808eaaefaf26e1200ab6ce57dc7b96b9ee7c7 Force the namespace into the ResultingSystem reference from DefineSystem ...since Pegasus drops it by default. Signed-off-by: Dan Smith diff -r 466808eaaefa -r 949e4c0f1e7c src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Fri Jul 25 12:03:28 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Fri Jul 25 12:41:21 2008 -0700 @@ -984,8 +984,10 @@ goto out; result = CMGetObjectPath(sys, &s); - if ((result != NULL) && (s.rc == CMPI_RC_OK)) + if ((result != NULL) && (s.rc == CMPI_RC_OK)) { + CMSetNameSpace(result, NAMESPACE(reference)); CMAddArg(argsout, "ResultingSystem", &result, CMPI_ref); + } trigger_indication(context, "ComputerSystemCreatedIndication", +1 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cshan at hitachi.cn Tue Jul 29 03:36:05 2008 From: cshan at hitachi.cn (cshan) Date: Tue, 29 Jul 2008 11:36:05 +0800 Subject: =?gb2312?B?tPC4tDogW0xpYnZpcnQtY2ltXSBQcm9ibGVtcyB3aGVuIHVzaW5nIA==?= =?gb2312?B?bGlidmlydC1jaW0gcHJvdmlkZXI=?= In-Reply-To: <87zlo2j8q0.fsf@caffeine.beaverton.ibm.com> Message-ID: Hi? Mr. Smith: Now the problem is solved. Thank you very much! Best Regards Chun Shan Open System Software Laboratory ---------------------------------------------------------------------------- -- Hitachi (China) Research & Development Corporation 301, Tower C Raycom infotech Park, 2 kexueyuan Nanlu, Hai Dian District, Beijing 100080, China Tel:(86)-10-8286-2918 (Ext.) 371 Fax:(86)-10-8286-2919 E-mail: cshan at hitachi.cn ---------------------------------------------------------------------------- -- -----????----- ???: libvirt-cim-bounces at redhat.com [mailto:libvirt-cim-bounces at redhat.com] ?? Dan Smith ????: 2008?7?29? 0:05 ???: List for discussion and development of libvirt CIM ??: Re: [Libvirt-cim] Problems when using libvirt-cim provider SC> wbemcli:Cim(1) CIM_ERR_FAILED: A general error occurred that SC> is not covered by a more specific error code:"For provider SC> Virt_DevicePool the library name was empty. Check provider SC> registered location". This usually happens because the CIMOM is unable to load some dependent libraries for the providers. Where did the .so files get installed? I think the default is /usr/local/lib/cmpi for Pegasus if you don't specify a location. Figure out where your Pegasus providers directory is and set that with PROVIDERDIR like this: ./configure PROVIDERDIR=/usr/lib64/cmpi Then clean and rebuild/reinstall your tree. Also, make sure that the above path is set in your linker config (i.e. /etc/ld.so.conf). -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com From deeptik at linux.vnet.ibm.com Tue Jul 29 05:43:17 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 29 Jul 2008 11:13:17 +0530 Subject: [Libvirt-cim] CimTest Report for KVM on F9 23-07-2008 In-Reply-To: <87d4l1lnzk.fsf@caffeine.beaverton.ibm.com> References: <4886DAB6.3040606@linux.vnet.ibm.com> <87k5fch5jv.fsf@caffeine.beaverton.ibm.com> <4889CA71.4050505@linux.vnet.ibm.com> <87d4l1lnzk.fsf@caffeine.beaverton.ibm.com> Message-ID: <488EADF5.4050207@linux.vnet.ibm.com> Dan Smith wrote: > DK> 1) > DK> The XML config file is *just enough* to *define *the guest but not > DK> start it. > DK> I manually tried to define the guest with the above XML and I was able > DK> to define it, but when I tried to start the defined guest it failed > DK> with the following error: > > DK> *virsh start 40_test_domain* > DK> libvir: QEMU error : internal error QEMU quit during console startup > DK> error: Failed to start domain 40_test_domain > > DK> The only problem with the above XML file is the *Memory and > DK> currentMemory *being set to* 0. > > That's a pretty big problem. Why is this marked as XFAIL? This > should be failing, and needs to be fixed ASAP. > > When I define a KVM guest through the providers manually, I get a > correctly-set memory value. Is this an error in the test? > > Yes, the test case is passing the RASD values which is inturn used for generating the XML configuration of the domain. According to my analysis, to create a KVM guest we need atleast 1024 memory units. Currently the test library vsms.py which is responsible for creating MemRASD values is passing only VirtualQuantity=512. This value is *not sufficient* for creating a *KVM* guest, but is *just enough* for *Xen, XenFV* guests. Also, AllocationUnits is one of the important field of MemRASD that determines the Memory and CurrentMemory fields in the XML configuration. The provider code that generates the Memory and CurrentMemory part of the XML configuration is given below. static const char *mem_rasd_to_vdev(CMPIInstance *inst, struct virt_device *dev) { const char *units; int shift; 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); if (cu_get_str_prop(inst, "AllocationUnits", &units) != CMPI_RC_OK) { CU_DEBUG("Memory RASD has no units, assuming bytes"); units = "Bytes"; } if (STREQC(units, "Bytes")) shift = -10; else if (STREQC(units, "KiloBytes")) shift = 0; else if (STREQC(units, "MegaBytes")) shift = 10; else if (STREQC(units, "GigaBytes")) shift = 20; else return "Unknown AllocationUnits in Memory RASD"; if (shift < 0) { dev->dev.mem.size >>= -shift; dev->dev.mem.maxsize >>= -shift; } else { dev->dev.mem.size <<= shift; dev->dev.mem.maxsize <<= shift; } return NULL; } Currently, the default value for the AllocationUnits is not being set by the vsms.py test library. Hence according to the above code the units that will be considered will be Bytes, when this happens the final value that is currently being assigned will be (dev->dev.mem.size >>= -shift, 512>>10) 0. As mentioned above this value is not at all sufficient for the successful KVM creation. This problem for KVM can be solved by setting the VirtualQuantity as 1024 and the AllocationUnits as "KiloBytes". After making these changes to the vsms.py , the tc 40_RSC_start.py passed on KVM and Xen. And for XenFV the test case passed with additional modification in the 40_RSC_start.py tc, which required polling for enabled state to be set properly after RequestedStateChange(). 1) As an extention to the 40_RSC_start.py tc we can actually pass different combination of VirtualQuantity and AllocationUnits to test the mem_rasd_to_vdev code path. 2) Also, can I update our libvirt wiki where we post our test results with tips like the necessary value for Memory and CurrentMemory value, if you think its valuable and if my analysis is accurate. Any suggestions ?? Thanks and Regards, Deepti. From yunguol at cn.ibm.com Tue Jul 29 07:02:56 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Tue, 29 Jul 2008 15:02:56 +0800 Subject: [Libvirt-cim] Cimtest Report for Xen on RHEL5.2 (2008/07/28) In-Reply-To: <87od4ij6af.fsf@caffeine.beaverton.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-29 00:57:12: > GY> ComputerSystem - 23_suspend_suspend.py: FAIL > GY> InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No > GY> NetworkPool specified and no default available > GY> ComputerSystem - 27_define_suspend_errs.py: FAIL > GY> InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No > GY> NetworkPool specified and no default available > GY> ComputerSystem - 32_start_reboot.py: FAIL > GY> InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No > GY> NetworkPool specified and no default available > GY> ComputerSystem - 33_suspend_reboot.py: FAIL > GY> InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No > GY> NetworkPool specified and no default available > GY> ComputerSystem - 35_start_reset.py: FAIL > GY> InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No > GY> NetworkPool specified and no default available > GY> ComputerSystem - 40_RSC_start.py: FAIL > GY> InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No > GY> NetworkPool specified and no default available > > Looks like your default network is down. Can you verify? Seems like > the test suite might need to do some sanity checks (for things like > this) before starting the test run. > > GY> HostSystem - 04_hs_to_EAPF.py: FAIL This fails because of CCName parameter in verify_device_values() function. I'v fixed it in a patch still waited for review. > GY> LogicalDisk - 02_nodevs.py: FAIL It pass when run manually. > GY> LogicalDisk - 03_ld_gi_errs.py: FAIL Same as above. > GY> Memory - 01_memory.py: FAIL Same as above. > GY> NetworkPort - 01_netport.py: FAIL Same as above. > GY> VSSD - 02_bootldr.py: FAIL > GY> CIM_ERR_NOT_FOUND: No such instance (dom) It fails because of the test dom isn't started. We have to start it when we try to get concrete instance. However, it can't be started successfully with its xml. I will look into this. > GY> VirtualSystemManagementService - 06_addresource.py: FAIL > GY> InvokeMethod(AddResourceSettings): CIM_ERR_FAILED: Unknown system > GY> `rstest_domain' It pass when run manually. > GY> VirtualSystemManagementService - 08_modifyresource.py: FAIL > GY> VirtualSystemManagementService - 09_procrasd_persist.py: FAIL > > Can you look into these please? It's not very helpful to post a list > of failures without a diagnosis or at least a log snippet :) > > -- > Dan Smith > IBM Linux Technology Center > Open Hypervisor Team > email: danms at us.ibm.com > [attachment "attz609o.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 Tue Jul 29 11:57:01 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 29 Jul 2008 04:57:01 -0700 Subject: [Libvirt-cim] [PATCH 5 of 6] 1) Added support for KVM In-Reply-To: Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1217332224 25200 # Node ID af243cf40f479c533eb54547f2260d99f63e316b # Parent 00e3d0fff2b8379a1882c78ceffeecb68c61c5e7 1) Added support for KVM 2) Removed the invalid bug nos. 3) Removed check_attributes() and used check_reqstate_value() library function instead. 4) Adding create_netpool_conf(), destroy_netpool() since the VSMS now requires networkpool. 5) Used destroy_and_undefine_domain() to undefine and destroy the VS. 6) Used try_request_state_change() library function to verify the exception. 7) Used poll_for_state_change() to verify the poll and verify the EnabledState value. The changes are verified with KVM, Xen, XenFV with current sources. Signed-off-by: Deepti B. Kalakeri diff -r 00e3d0fff2b8 -r af243cf40f47 suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py Tue Jul 29 04:47:38 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py Tue Jul 29 04:50:24 2008 -0700 @@ -4,6 +4,7 @@ # # Authors: # Anoop V Chakkalakkal +# Deepti B. Kalakeri # # # This library is free software; you can redistribute it and/or @@ -26,7 +27,8 @@ # information is captured in the RequestedState Property of the VS. # The test is considered to be successful if RequestedState Property # has a value of 9 when the VS is moved from active to suspend state -# and has a value of 10 when rebooted +# and when rebooted we should get an exception as this is not a valid +# state transition. # # List of Valid state values (Refer to VSP spec doc Table 2 for more) # --------------------------------- @@ -40,77 +42,72 @@ # Date: 06-03-2008 import sys +import pywbem from VirtLib import utils from CimTest.Globals import do_main, logger from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC -from XenKvmLib.test_doms import undefine_test_domain -from XenKvmLib.common_util import get_cs_instance +from XenKvmLib.test_doms import destroy_and_undefine_domain from XenKvmLib.common_util import create_using_definesystem from XenKvmLib.common_util import call_request_state_change +from XenKvmLib.common_util import poll_for_state_change +from XenKvmLib.common_util import check_reqstate_value +from XenKvmLib.common_util import try_request_state_change +from XenKvmLib.common_util import create_netpool_conf, destroy_netpool -sup_types = ['Xen', 'XenFV'] +sup_types = ['Xen', 'XenFV', 'KVM'] ACTIVE_STATE = 2 SUSPND_STATE = 9 REBOOT_STATE = 10 -bug_req_state = "00002" default_dom = 'test_domain' TIME = "00000000000000.000000:000" - -def check_attributes(domain_name, ip, en_state, rq_state, virt): - rc, cs = get_cs_instance(domain_name, ip, virt) - if rc != 0: - return rc - if cs.RequestedState != rq_state: - logger.error("RequestedState should be %d not %d", - rq_state, cs.RequestedState) - return XFAIL_RC(bug_req_state) - - if cs.EnabledState != en_state: - logger.error("EnabledState should be %d not %d", - en_state, cs.EnabledState) - return FAIL - - return PASS +err_no = pywbem.CIM_ERR_FAILED +err_desc = "Domain not running" @do_main(sup_types) def main(): options = main.options status = FAIL + server = options.ip + virt = options.virt + + status, test_network = create_netpool_conf(server, virt, False) + if status != PASS: + return FAIL tc_scen = [('Start', [ACTIVE_STATE, ACTIVE_STATE]), \ - ('Suspend', [SUSPND_STATE, SUSPND_STATE]), \ - ('Reboot', [SUSPND_STATE, REBOOT_STATE])] + ('Suspend', [SUSPND_STATE, SUSPND_STATE])] try: # define the vs - status = create_using_definesystem(default_dom, options.ip, - virt=options.virt) + status = create_using_definesystem(default_dom, server, + virt=virt) if status != PASS: - logger.error("Unable to define domain %s using DefineSystem()", \ - default_dom) + logger.error("Unable to define domain '%s' using DefineSystem()", + default_dom) return status # start, suspend and reboot for action, state in tc_scen: en_state = state[0] rq_state = state[1] - status = call_request_state_change(default_dom, options.ip, + status = call_request_state_change(default_dom, server, rq_state, TIME, - virt=options.virt) + virt=virt) if status != PASS: - logger.error("Unable to %s dom %s using \ -RequestedStateChange()", action, default_dom) + logger.error("Unable to '%s' dom '%s' using RequestedStateChange()", + action, default_dom) break - # FIX ME - # sleep() + status = poll_for_state_change(server, virt, default_dom, en_state, + timeout=10) + if status != PASS: + break - status = check_attributes(default_dom, options.ip, - en_state, rq_state, options.virt) + status = check_reqstate_value(default_dom, server, rq_state, virt) if status != PASS: - logger.error("Attributes for dom %s not set as expected.", + logger.error("RequestedState for dom '%s' is not set as expected.", default_dom) break @@ -118,9 +115,19 @@ logger.error("Exception: %s", detail) status = FAIL - # undefine the vs - undefine_test_domain(default_dom, options.ip, options.virt) + if status != PASS: + destroy_netpool(server, virt, test_network) + destroy_and_undefine_domain(default_dom, server, virt) + return status + # Try to reboot the VS which is suspened + rq_state = REBOOT_STATE + status = try_request_state_change(default_dom, server, + rq_state, TIME, err_no, + err_desc, virt) + + destroy_netpool(server, virt, test_network) + destroy_and_undefine_domain(default_dom, server, virt) return status if __name__ == "__main__": From deeptik at linux.vnet.ibm.com Tue Jul 29 11:57:02 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 29 Jul 2008 04:57:02 -0700 Subject: [Libvirt-cim] [PATCH 6 of 6] 1) Added support for KVM In-Reply-To: Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1217332491 25200 # Node ID f1ca2afeec3e973028686fab4fddde3ddbd375de # Parent af243cf40f479c533eb54547f2260d99f63e316b 1) Added support for KVM 2) Removed the invalid bug nos. 3) Removed check_attributes() and used check_reqstate_value() library function instead. 4) Adding create_netpool_conf(), destroy_netpool() since the VSMS now requires networkpool. 5) Used destroy_and_undefine_domain() to undefine and destroy the VS. 6) Used poll_for_state_change() to verify the poll and verify the EnabledState value. The changes are verified with KVM, Xen, XenFV with current sources. Signed-off-by: Deepti B. Kalakeri diff -r af243cf40f47 -r f1ca2afeec3e suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py Tue Jul 29 04:50:24 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py Tue Jul 29 04:54:51 2008 -0700 @@ -4,6 +4,7 @@ # # Authors: # Anoop V Chakkalakkal +# Deepti B. Kalakeri # # # This library is free software; you can redistribute it and/or @@ -41,83 +42,76 @@ import sys from VirtLib import utils from CimTest.Globals import do_main, logger -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC -from XenKvmLib.test_doms import undefine_test_domain +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.test_doms import destroy_and_undefine_domain from XenKvmLib.common_util import get_cs_instance from XenKvmLib.common_util import create_using_definesystem from XenKvmLib.common_util import call_request_state_change +from XenKvmLib.common_util import poll_for_state_change +from XenKvmLib.common_util import check_reqstate_value +from XenKvmLib.common_util import create_netpool_conf, destroy_netpool -sup_types = ['Xen', 'XenFV'] +sup_types = ['Xen', 'XenFV', 'KVM'] ACTIVE_STATE = 2 RESET_STATE = 11 -bug_req_state = "00002" -default_dom = 'test_domain' +default_dom = 'cs_test_domain' TIME = "00000000000000.000000:000" - -def check_attributes(domain_name, ip, en_state, rq_state, virt): - rc, cs = get_cs_instance(domain_name, ip, virt) - if rc != 0: - return rc - if cs.RequestedState != rq_state: - logger.error("RequestedState should be %d not %d", - rq_state, cs.RequestedState) - return XFAIL_RC(bug_req_state) - - if cs.EnabledState != en_state: - logger.error("EnabledState should be %d not %d", - en_state, cs.EnabledState) - return FAIL - - return PASS @do_main(sup_types) def main(): options = main.options status = FAIL + server = options.ip + virt = options.virt + + status, test_network = create_netpool_conf(server, virt, False) + if status != PASS: + return FAIL tc_scen = [('Start', [ACTIVE_STATE, ACTIVE_STATE]), \ ('Reset', [ACTIVE_STATE, RESET_STATE])] try: # define the vs - status = create_using_definesystem(default_dom, options.ip, - virt=options.virt) + status = create_using_definesystem(default_dom, server, + virt=virt) if status != PASS: - logger.error("Unable to define domain %s using DefineSystem()", \ - default_dom) + logger.error("Unable to define domain '%s' using DefineSystem()", + default_dom) return status # start and reset for action, state in tc_scen: en_state = state[0] rq_state = state[1] - status = call_request_state_change(default_dom, options.ip, + status = call_request_state_change(default_dom, server, rq_state, TIME, - virt=options.virt) + virt=virt) if status != PASS: - logger.error("Unable to %s dom %s using \ -RequestedStateChange()", action, default_dom) + logger.error("Unable to '%s' dom '%s' using RequestedStateChange()", + action, default_dom) break - # FIX ME - # sleep() + status = poll_for_state_change(server, virt, default_dom, en_state, + timeout=10) + if status != PASS: + break - status = check_attributes(default_dom, options.ip, - en_state, rq_state, options.virt) + status = check_reqstate_value(default_dom, server, rq_state, virt) if status != PASS: - logger.error("Attributes for dom %s not set as expected.", + logger.error("RequestedState for dom '%s' is not set as expected.", default_dom) break + except Exception, detail: logger.error("Exception: %s", detail) status = FAIL - # undefine the vs - undefine_test_domain(default_dom, options.ip, options.virt) - + destroy_netpool(server, virt, test_network) + destroy_and_undefine_domain(default_dom, server, virt) return status if __name__ == "__main__": From deeptik at linux.vnet.ibm.com Tue Jul 29 11:56:58 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 29 Jul 2008 04:56:58 -0700 Subject: [Libvirt-cim] [PATCH 2 of 6] changes in vsms.py In-Reply-To: Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1217331585 25200 # Node ID ec303feee0e302ddf29b8dad81d0d4416e0fb48a # Parent f2f1c1899247df3a68d885a73bbfbb989a6e7941 changes in vsms.py ------------------ 1) Added mvirtquantity to be passed for MemRASD. 2) Set the default mvirtquantity to 1024 units since this is the mininmum value that is req for KVM. 3) Added mem_allocunit param to default_vssd_rasd_str() to pass the AllocationUnits. The above changes are required to be able to start KVM guest using DefineSystem(). changes in 40_RSC_start.py -------------------------- 1) Used poll_for_state_change() to verify the poll and verify the EnabledState value. 2) Removed the invalid bug nos. 3) Removed check_attributes() and used check_reqstate_value() library function instead. 4) Adding create_netpool_conf(), destroy_netpool() since the VSMS now requires networkpool. 5) Used destroy_and_undefine_domain() to undefine and destroy the VS. The changes are verified with KVM Xen, XenFV with current sources. Signed-off-by: Deepti B. Kalakeri diff -r f2f1c1899247 -r ec303feee0e3 suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Tue Jul 29 04:23:52 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Tue Jul 29 04:39:45 2008 -0700 @@ -36,60 +36,49 @@ import sys import pywbem from VirtLib import utils -from XenKvmLib.test_doms import undefine_test_domain +from XenKvmLib.test_doms import destroy_and_undefine_domain from XenKvmLib.common_util import * from CimTest.Globals import logger from CimTest.Globals import do_main -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL sup_types = ['Xen', 'KVM', 'XenFV'] -bug = "00001" -bug_req_state = "00002" -default_dom = 'test_domain' +default_dom = 'cs_test_domain' REQUESTED_STATE = 2 TIME = "00000000000000.000000:000" - -def check_attributes(domain_name, ip, virt): - rc, cs = get_cs_instance(domain_name, ip, virt) - if rc != 0: - return rc - - if cs.RequestedState != REQUESTED_STATE: - logger.error("RequestedState should be %d not %d", - REQUESTED_STATE, cs.RequestedState) - return FAIL - - if cs.EnabledState != REQUESTED_STATE: - logger.error("EnabledState should be %d not %d", - REQUESTED_STATE, cs.EnabledState) - return FAIL - - return PASS @do_main(sup_types) def main(): options = main.options + server = options.ip + virt = options.virt status = FAIL + status, test_network = create_netpool_conf(server, virt, False) + if status != PASS: + return FAIL + try: - rc = create_using_definesystem(default_dom, options.ip, - virt=options.virt) + rc = create_using_definesystem(default_dom, server, + virt=virt) if rc != 0: - raise Exception("DefineSystem() failed to create domain: %s" % + raise Exception("DefineSystem() failed to create domain: '%s'" % default_dom) - rc = call_request_state_change(default_dom, options.ip, - REQUESTED_STATE, TIME, options.virt) + rc = call_request_state_change(default_dom, server, + REQUESTED_STATE, TIME, virt) if rc != 0: - status = XFAIL_RC(bug) + status = FAIL raise Exception("RequestedStateChange() could not be used to start" " domain: '%s'" % default_dom) + status = poll_for_state_change(server, virt, default_dom, + REQUESTED_STATE, timeout=10) - rc = check_attributes(default_dom, options.ip, options.virt) - if rc != 0: - status = XFAIL_RC(bug_req_state) + rc = check_reqstate_value(default_dom, server, REQUESTED_STATE, virt) + if rc != PASS or status != PASS: + status = FAIL raise Exception("Attributes were not set as expected for " "domain: '%s'" % default_dom) else: @@ -98,8 +87,8 @@ except Exception, detail: logger.error("Exception: %s", detail) - undefine_test_domain(default_dom, options.ip, options.virt) - + destroy_netpool(server, virt, test_network) + destroy_and_undefine_domain(default_dom, server, virt) return status if __name__ == "__main__": diff -r f2f1c1899247 -r ec303feee0e3 suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Tue Jul 29 04:23:52 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Tue Jul 29 04:39:45 2008 -0700 @@ -203,11 +203,14 @@ pass class CIM_MemResourceAllocationSettingData(CIMClassMOF): - def __init__(self, megabytes, name): + def __init__(self, mvirtquantity, mallocunits, name): self.ResourceType = RASD_TYPE_MEM - if megabytes != None: - self.VirtualQuantity = megabytes + if mvirtquantity != None: + self.VirtualQuantity = mvirtquantity + + if mallocunits != None: + self.AllocationUnits = mallocunits if name != None: self.InstanceID = '%s/mem' % name @@ -231,7 +234,8 @@ net_type='ethernet', net_mac=const.Xen_default_mac, proc_vcpu=1, - mem_mb=512, + mem_val=1024, + mem_allocunit="KiloBytes", virt='Xen'): class_vssd = get_vssd_class(virt) vssd = class_vssd(name=dom_name, virt=virt) @@ -257,7 +261,8 @@ class_masd = get_masd_class(virt) m = class_masd( - megabytes=mem_mb, + mvirtquantity=mem_val, + mallocunits=mem_allocunit, name=dom_name) if virt == 'LXC': return vssd.mof(), [d.mof(), m.mof()] From deeptik at linux.vnet.ibm.com Tue Jul 29 11:56:59 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 29 Jul 2008 04:56:59 -0700 Subject: [Libvirt-cim] [PATCH 3 of 6] 1) Added support for KVM In-Reply-To: Message-ID: <8c8ec47bc8492eacc1f5.1217332619@elm3b193.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1217331858 25200 # Node ID 8c8ec47bc8492eacc1f5feff6ed6fd871451a9d0 # Parent ec303feee0e302ddf29b8dad81d0d4416e0fb48a 1) Added support for KVM 2) Removed the invalid bug nos. 3) Removed check_attributes() and used check_reqstate_value() library function instead. 4) Adding create_netpool_conf(), destroy_netpool() since the VSMS now requires networkpool. 5) used destroy_and_undefine_domain() to undefine and destroy the VS. 6) Used try_request_state_change() library function to verify the exception. 7) Used poll_for_state_change() to verify the poll and verify the EnabledState value. The changes are verified with KVM Xen, XenFV with current sources. Signed-off-by: Deepti B. Kalakeri diff -r ec303feee0e3 -r 8c8ec47bc849 suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py Tue Jul 29 04:39:45 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py Tue Jul 29 04:44:18 2008 -0700 @@ -4,7 +4,7 @@ # # Authors: # Anoop V Chakkalakkal -# +# Deepti B. Kalakeri # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public @@ -26,7 +26,7 @@ # information is captured in the RequestedState Property of the VS. # The test is considered to be successful if RequestedState Property # has a value of 9 when the VS is moved from active to suspend state -# and has a value of 9 when supended again +# and returns an excpetion when supended again. # # List of Valid state values (Refer to VSP spec doc Table 2 for more) # --------------------------------- @@ -39,84 +39,89 @@ # Date: 29-02-2008 import sys +import pywbem from VirtLib import utils from CimTest.Globals import do_main, logger -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC -from XenKvmLib.test_doms import undefine_test_domain -from XenKvmLib.common_util import get_cs_instance +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.test_doms import destroy_and_undefine_domain from XenKvmLib.common_util import create_using_definesystem from XenKvmLib.common_util import call_request_state_change +from XenKvmLib.common_util import try_request_state_change +from XenKvmLib.common_util import poll_for_state_change +from XenKvmLib.common_util import check_reqstate_value +from XenKvmLib.common_util import create_netpool_conf, destroy_netpool -sup_types = ['Xen', 'XenFV'] +sup_types = ['Xen', 'XenFV', 'KVM'] ACTIVE_STATE = 2 SUSPND_STATE = 9 -bug_req_state = "00002" -default_dom = 'test_domain' +default_dom = 'cs_test_domain' TIME = "00000000000000.000000:000" - -def check_attributes(domain_name, ip, en_state, rq_state, virt): - rc, cs = get_cs_instance(domain_name, ip, virt) - if rc != 0: - return rc - if cs.RequestedState != rq_state: - logger.error("RequestedState should be %d not %d", - rq_state, cs.RequestedState) - return XFAIL_RC(bug_req_state) - - if cs.EnabledState != en_state: - logger.error("EnabledState should be %d not %d", - en_state, cs.EnabledState) - return FAIL - - return PASS +err_no = pywbem.CIM_ERR_FAILED +err_desc = "Domain not running" @do_main(sup_types) def main(): options = main.options - status = FAIL + server = options.ip + virt = options.virt + + status, test_network = create_netpool_conf(server, virt, False) + if status != PASS: + return FAIL tc_scen = [('Start', [ACTIVE_STATE, ACTIVE_STATE]), \ - ('Suspend', [SUSPND_STATE, SUSPND_STATE]), \ - ('Suspend', [SUSPND_STATE, SUSPND_STATE])] + ('Suspend', [SUSPND_STATE, SUSPND_STATE])] try: # define the vs status = create_using_definesystem(default_dom, - options.ip, - virt=options.virt) + server, + virt=virt) if status != PASS: - logger.error("Unable to define domain %s using DefineSystem()", \ - default_dom) + logger.error("Unable to define domain '%s' using DefineSystem()", + default_dom) return status - # start, suspend and suspend again + # start, suspend for action, state in tc_scen: en_state = state[0] rq_state = state[1] - status = call_request_state_change(default_dom, options.ip, - rq_state, TIME, options.virt) + status = call_request_state_change(default_dom, server, + rq_state, TIME, virt) if status != PASS: - logger.error("Unable to %s dom %s using \ -RequestedStateChange()", action, default_dom) + logger.error("Unable to '%s' dom '%s' using RequestedStateChange()", + action, default_dom) break - # FIX ME - # sleep() + status = poll_for_state_change(server, virt, default_dom, en_state, + timeout=10) + if status != PASS: + break - status = check_attributes(default_dom, options.ip, - en_state, rq_state, options.virt) + status = check_reqstate_value(default_dom, server, rq_state, virt) if status != PASS: - logger.error("Attributes for dom %s not set as expected.", + logger.error("RequestedState for dom '%s' is not set as expected.", default_dom) break except Exception, detail: - logger.error("Exception: %s", detail) + logger.error("Exception: '%s'", detail) status = FAIL - # undefine the vs - undefine_test_domain(default_dom, options.ip, options.virt) + if status != PASS: + destroy_netpool(server, virt, test_network) + destroy_and_undefine_domain(default_dom, server, virt) + return status + + # try to suspend already suspended VS + rq_state = SUSPND_STATE + status = try_request_state_change(default_dom, server, + rq_state, TIME, err_no, + err_desc, virt) + + destroy_netpool(server, virt, test_network) + destroy_and_undefine_domain(default_dom, server, virt) return status From deeptik at linux.vnet.ibm.com Tue Jul 29 11:57:00 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 29 Jul 2008 04:57:00 -0700 Subject: [Libvirt-cim] [PATCH 4 of 6] 1) Removed the invalid bug nos In-Reply-To: Message-ID: <00e3d0fff2b8379a1882.1217332620@elm3b193.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1217332058 25200 # Node ID 00e3d0fff2b8379a1882c78ceffeecb68c61c5e7 # Parent 8c8ec47bc8492eacc1f5feff6ed6fd871451a9d0 1) Removed the invalid bug nos. 2) Removed check_attributes() and used check_reqstate_value() library function instead. 3) Adding create_netpool_conf(), destroy_netpool() since the VSMS now requires networkpool. 4) Used destroy_and_undefine_domain() to undefine and destroy the VS. 5) Used poll_for_state_change() to verify the poll and verify the EnabledState value. The changes are verified with KVM, Xen, XenFV with current sources. Signed-off-by: Deepti B. Kalakeri diff -r 8c8ec47bc849 -r 00e3d0fff2b8 suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py Tue Jul 29 04:44:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py Tue Jul 29 04:47:38 2008 -0700 @@ -4,6 +4,7 @@ # # Authors: # Anoop V Chakkalakkal +# Deepti B. Kalakeri # # # This library is free software; you can redistribute it and/or @@ -25,7 +26,7 @@ # This test case is used to verify the Virtual System State Transition # information is captured in the RequestedState Property of the VS. # The test is considered to be successful if RequestedState Property -# has a value of 10 when the VS is moved from active to reboot state +# has a value of 10 when the VS is moved from active to reboot state. # # List of Valid state values (Refer to VSP spec doc Table 2 for more) # --------------------------------- @@ -41,72 +42,64 @@ from VirtLib import utils from CimTest.Globals import do_main, logger from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC -from XenKvmLib.test_doms import undefine_test_domain -from XenKvmLib.common_util import get_cs_instance +from XenKvmLib.test_doms import destroy_and_undefine_domain from XenKvmLib.common_util import create_using_definesystem from XenKvmLib.common_util import call_request_state_change +from XenKvmLib.common_util import poll_for_state_change +from XenKvmLib.common_util import check_reqstate_value +from XenKvmLib.common_util import create_netpool_conf, destroy_netpool sup_types = ['Xen', 'XenFV'] ACTIVE_STATE = 2 REBOOT_STATE = 10 -bug_req_state = "00002" -default_dom = 'test_domain' +default_dom = 'cs_test_domain' TIME = "00000000000000.000000:000" - -def check_attributes(domain_name, ip, en_state, rq_state, virt): - rc, cs = get_cs_instance(domain_name, ip, virt) - if rc != 0: - return rc - if cs.RequestedState != rq_state: - logger.error("RequestedState should be %d not %d", - rq_state, cs.RequestedState) - return XFAIL_RC(bug_req_state) - - if cs.EnabledState != en_state: - logger.error("EnabledState should be %d not %d", - en_state, cs.EnabledState) - return FAIL - - return PASS @do_main(sup_types) def main(): options = main.options status = FAIL + server = options.ip + virt = options.virt + + status, test_network = create_netpool_conf(server, virt, False) + if status != PASS: + return FAIL tc_scen = [('Start', [ACTIVE_STATE, ACTIVE_STATE]), \ ('Reboot', [ACTIVE_STATE, REBOOT_STATE])] try: # define the vs - status = create_using_definesystem(default_dom, options.ip, - virt=options.virt) + status = create_using_definesystem(default_dom, server, + virt=virt) if status != PASS: - logger.error("Unable to define domain %s using DefineSystem()", \ - default_dom) + logger.error("Unable to define domain '%s' using DefineSystem()", + default_dom) return status # start, then reboot for action, state in tc_scen: en_state = state[0] rq_state = state[1] - status = call_request_state_change(default_dom, options.ip, + status = call_request_state_change(default_dom, server, rq_state, TIME, - virt=options.virt) + virt=virt) if status != PASS: - logger.error("Unable to %s dom %s using \ -RequestedStateChange()", action, default_dom) + logger.error("Unable to '%s' dom '%s' using RequestedStateChange()", + action, default_dom) break - # FIX ME - # sleep() + status = poll_for_state_change(server, virt, default_dom, en_state, + timeout=10) + if status != PASS: + break - status = check_attributes(default_dom, options.ip, - en_state, rq_state, options.virt) + status = check_reqstate_value(default_dom, server, rq_state, virt) if status != PASS: - logger.error("Attributes for dom %s not set as expected.", + logger.error("RequestedState for dom '%s' is not set as expected.", default_dom) break @@ -114,9 +107,8 @@ logger.error("Exception: %s", detail) status = FAIL - # undefine the vs - undefine_test_domain(default_dom, options.ip, options.virt) - + destroy_netpool(server, virt, test_network) + destroy_and_undefine_domain(default_dom, server, virt) return status if __name__ == "__main__": From deeptik at linux.vnet.ibm.com Tue Jul 29 11:56:57 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 29 Jul 2008 04:56:57 -0700 Subject: [Libvirt-cim] [PATCH 1 of 6] 1) Fixed get_cs_instance() debug statement In-Reply-To: Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1217330632 25200 # Node ID f2f1c1899247df3a68d885a73bbfbb989a6e7941 # Parent 32d78f23f6e73f5443022179410128767896465d 1) Fixed get_cs_instance() debug statement. 2) Moved the common code which tried to match the error to a new fn verify_err_desc(). 3) Added try_request_state_change() to verify the error conditions of RequestStateChange(). 4) Added check_reqstate_value() that verifies the RequestState value. The changes are verified with KVM Xen, XenFV with current sources. Signed-off-by: Deepti B. Kalakeri diff -r 32d78f23f6e7 -r f2f1c1899247 suites/libvirt-cim/lib/XenKvmLib/common_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Wed Jul 23 00:32:36 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Tue Jul 29 04:23:52 2008 -0700 @@ -33,7 +33,8 @@ from pywbem.cim_obj import CIMInstanceName from XenKvmLib.devices import CIM_Instance from XenKvmLib.classes import get_typed_class -from CimTest.Globals import logger, log_param, CIM_ERROR_ENUMERATE +from CimTest.Globals import logger, log_param, CIM_ERROR_ENUMERATE, \ +CIM_ERROR_GETINSTANCE from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC from VirtLib.live import diskpool_list, virsh_version, net_list from XenKvmLib.vxml import PoolXML, NetXML @@ -57,7 +58,7 @@ return (1, cs) except Exception, detail: - logger.error(Globals.CIM_ERROR_GETINSTANCE, + logger.error(CIM_ERROR_GETINSTANCE, get_typed_class(virt, 'ComputerSystem')) logger.error("Exception: %s", detail) return (1, cs) @@ -122,10 +123,21 @@ return PASS +def verify_err_desc(exp_rc, exp_desc, err_no, err_desc): + if err_no == exp_rc and err_desc.find(exp_desc) >= 0: + logger.info("Got expected exception where ") + logger.info("Errno is '%s' ", exp_rc) + logger.info("Error string is '%s'", exp_desc) + return PASS + else: + logger.error("Unexpected rc code %s and description %s\n", + (err_no, err_desc)) + return FAIL + def call_request_state_change(domain_name, ip, rs, time, virt='Xen'): rc, cs = get_cs_instance(domain_name, ip, virt) if rc != 0: - return 1 + return FAIL try: cs.RequestStateChange(RequestedState=pywbem.cim_types.Uint16(rs), @@ -133,9 +145,24 @@ except Exception, detail: logger.error("Exception: %s" % detail) - return 1 + return FAIL - return 0 + return PASS + +def try_request_state_change(domain_name, ip, rs, time, exp_rc, + exp_desc, virt='Xen'): + rc, cs = get_cs_instance(domain_name, ip, virt) + if rc != 0: + return FAIL + + try: + cs.RequestStateChange(RequestedState=pywbem.cim_types.Uint16(rs), + TimeoutPeriod=pywbem.cim_types.CIMDateTime(time)) + + except Exception, (err_no, err_desc) : + return verify_err_desc(exp_rc, exp_desc, err_no, err_desc) + logger.error("RequestStateChange failed to generate an exception") + return FAIL def poll_for_state_change(server, virt, dom, exp_state, timeout=30): cs = computersystem.get_cs_class(virt) @@ -162,6 +189,20 @@ return FAIL return PASS + + +def check_reqstate_value(domain_name, server, rq_state, virt): + rc, cs = get_cs_instance(domain_name, server, virt) + if rc != 0: + return FAIL + + if cs.RequestedState != rq_state: + logger.error("RequestedState should be %d not %d", + rq_state, cs.RequestedState) + return FAIL + + return PASS + def get_host_info(server, virt="Xen"): status = PASS @@ -191,20 +232,12 @@ try: assoc_info = conn.AssociatorNames(instanceref, \ AssocClass=assoc_classname) - except pywbem.CIMError, (err_no, desc): + except pywbem.CIMError, (err_no, err_desc): exp_rc = expr_values['rc'] exp_desc = expr_values['desc'] - if err_no == exp_rc and desc.find(exp_desc) >= 0: - logger.info("Got expected exception where ") - logger.info("Errno is '%s' ", exp_rc) - logger.info("Error string is '%s'", exp_desc) - return PASS - else: - logger.error("Unexpected rc code %s and description %s\n" \ - %(err_no, desc)) - return FAIL - logger.error("'%s' association failed to generate an exception and \ -'%s' passed.", assoc_classname, field_name) + return verify_err_desc(exp_rc, exp_desc, err_no, err_desc) + logger.error("'%s' association failed to generate an exception and" + " '%s' passed.", assoc_classname, field_name) return XFAIL_RC(bug_no) def try_getinstance(conn, classname, keys, field_name, expr_values, bug_no): @@ -213,20 +246,12 @@ instanceref = CIMInstanceName(classname, keybindings=keys) logger.info ("Instanceref is '%s'", instanceref) inst = conn.GetInstance(instanceref) - except pywbem.CIMError, (err_no, desc): + except pywbem.CIMError, (err_no, err_desc): exp_rc = expr_values['rc'] exp_desc = expr_values['desc'] - if err_no == exp_rc and desc.find(exp_desc) >= 0: - logger.info("Got expected exception where ") - logger.info("Errno is '%s' ", exp_rc) - logger.info("Error string is '%s'", exp_desc) - return PASS - else: - logger.error("Unexpected rc code %s and description %s\n" \ - %(err_no, desc)) - return FAIL - logger.error("'%s' GetInstance failed to generate an exception and \ -'%s' passed.", classname, field_name) + return verify_err_desc(exp_rc, exp_desc, err_no, err_desc) + logger.error("'%s' GetInstance failed to generate an exception and" + " '%s' passed.", classname, field_name) return XFAIL_RC(bug_no) def profile_init_list(): From deeptik at linux.vnet.ibm.com Tue Jul 29 11:56:56 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 29 Jul 2008 04:56:56 -0700 Subject: [Libvirt-cim] [PATCH 0 of 6] CS related tc changes. Message-ID: 1) Fixed 40_RSC_start.py 2) Supported KVM in 23_suspend_suspend.py, 33_suspend_reboot.py, 35_start_reset.py. 3) Updated 32_start_reboot.py. From deeptik at linux.vnet.ibm.com Tue Jul 29 12:17:12 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 29 Jul 2008 17:47:12 +0530 Subject: [Libvirt-cim] CimTest Report on XenFV 24-07-2008 In-Reply-To: <87iquvkzrj.fsf@caffeine.beaverton.ibm.com> References: <4888825D.9090908@linux.vnet.ibm.com> <87iquvkzrj.fsf@caffeine.beaverton.ibm.com> Message-ID: <488F0A48.20908@linux.vnet.ibm.com> Dan Smith wrote: > DK> This is because I believe VSMS provider requires a network pool to > DK> exist in order to create a guest. > > DK> But the test cases does not ensure creation of the network pool and > DK> also the previous tc ComputerSystem - 22_define_suspend.py was > DK> deleting the existing network pool. > > That's correct. I think Kaitlin's patch to 22_define_suspend should > fix this, right? Might be good for the suite to make sure a default > network is defined before running the tests. > > DK> When ComputerSystem - 22_define_suspend.py was masked and the tc for > DK> ComputerSystem was run the tc started failing because of the following > DK> reason: > DK> ERROR - EnabledState should be 2 not 0 > DK> ERROR - Attributes for dom test_domain not set as expected. > > Some changes have been made to that code recently. See if the updated > provider, plus Kaitlin's cimtest patch fixes the issue. > I have send fix for the following test cases which were failing because of the EnabledState problem. ComputerSystem - 23_suspend_suspend.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 > Thanks! > > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim From danms at us.ibm.com Tue Jul 29 13:53:10 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 29 Jul 2008 06:53:10 -0700 Subject: [Libvirt-cim] CimTest Report for KVM on F9 23-07-2008 In-Reply-To: <488EADF5.4050207@linux.vnet.ibm.com> (Deepti B. Kalakeri's message of "Tue, 29 Jul 2008 11:13:17 +0530") References: <4886DAB6.3040606@linux.vnet.ibm.com> <87k5fch5jv.fsf@caffeine.beaverton.ibm.com> <4889CA71.4050505@linux.vnet.ibm.com> <87d4l1lnzk.fsf@caffeine.beaverton.ibm.com> <488EADF5.4050207@linux.vnet.ibm.com> Message-ID: <87ljzku795.fsf@caffeine.beaverton.ibm.com> DK> Yes, the test case is passing the RASD values which is inturn used DK> for generating the XML configuration of the domain. According to DK> my analysis, to create a KVM guest we need atleast 1024 memory DK> units. Currently the test library vsms.py which is responsible DK> for creating MemRASD values is passing only VirtualQuantity=512. Aiee. The libvirt XML specifies memory in kilobytes, which means 512 rounds to zero. The fact that you can create a Xen guest is probably just because of a lack of verification. The QEMU command line takes memory in megabytes, so anything less than that isn't really valid. This was changed (fixed) in my recent patch to make the providers honor AllocationUnits in the MemRASD on DefineSystem(). DK> This value is *not sufficient* for creating a *KVM* guest, but is DK> *just enough* for *Xen, XenFV* guests. Perhaps just enough to create the guest, but not start it. Not even MS-DOS can run in 512 bytes of memory... DK> Also, AllocationUnits is one of the important field of MemRASD DK> that determines the Memory and CurrentMemory fields in the XML DK> configuration. Indeed, which is why I wrote the (still unreviewed) test for AllocationUnits last week. DK> 1) As an extention to the 40_RSC_start.py tc we can actually pass DK> different combination of VirtualQuantity and AllocationUnits to test DK> the mem_rasd_to_vdev code path. My test exercises all of the AllocationUnits paths. 40_RSC_start isn't the proper place for that, IMHO. I think you should change the default VirtualQuantity to 32, and the AllocationUnits to "MegaBytes" for this case. 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 deeptik at linux.vnet.ibm.com Tue Jul 29 14:51:21 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 29 Jul 2008 20:21:21 +0530 Subject: [Libvirt-cim] CimTest Report for KVM on F9 23-07-2008 In-Reply-To: <87ljzku795.fsf@caffeine.beaverton.ibm.com> References: <4886DAB6.3040606@linux.vnet.ibm.com> <87k5fch5jv.fsf@caffeine.beaverton.ibm.com> <4889CA71.4050505@linux.vnet.ibm.com> <87d4l1lnzk.fsf@caffeine.beaverton.ibm.com> <488EADF5.4050207@linux.vnet.ibm.com> <87ljzku795.fsf@caffeine.beaverton.ibm.com> Message-ID: <488F2E69.3080706@linux.vnet.ibm.com> Dan Smith wrote: > DK> Yes, the test case is passing the RASD values which is inturn used > DK> for generating the XML configuration of the domain. According to > DK> my analysis, to create a KVM guest we need atleast 1024 memory > DK> units. Currently the test library vsms.py which is responsible > DK> for creating MemRASD values is passing only VirtualQuantity=512. > > Aiee. The libvirt XML specifies memory in kilobytes, which means 512 > rounds to zero. The fact that you can create a Xen guest is probably > just because of a lack of verification. The QEMU command line takes > memory in megabytes, so anything less than that isn't really valid. > > This was changed (fixed) in my recent patch to make the providers > honor AllocationUnits in the MemRASD on DefineSystem(). > > DK> This value is *not sufficient* for creating a *KVM* guest, but is > DK> *just enough* for *Xen, XenFV* guests. > > Perhaps just enough to create the guest, but not start it. Not even > MS-DOS can run in 512 bytes of memory... > > DK> Also, AllocationUnits is one of the important field of MemRASD > DK> that determines the Memory and CurrentMemory fields in the XML > DK> configuration. > > Indeed, which is why I wrote the (still unreviewed) test for > AllocationUnits last week. > > DK> 1) As an extention to the 40_RSC_start.py tc we can actually pass > DK> different combination of VirtualQuantity and AllocationUnits to test > DK> the mem_rasd_to_vdev code path. > > My test exercises all of the AllocationUnits paths. 40_RSC_start > isn't the proper place for that, IMHO. > Cool, I have not yet got a chance to review the patches. > I think you should change the default VirtualQuantity to 32, and the > AllocationUnits to "MegaBytes" for this case. > > I will try using this. Thanks. Regards, Deepti. > Thanks! > > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim From danms at us.ibm.com Tue Jul 29 15:22:39 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 29 Jul 2008 08:22:39 -0700 Subject: [Libvirt-cim] [PATCH] Add cmdline support for PV kernels Message-ID: <56271bbbbdf55ea21432.1217344959@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1217343996 25200 # Node ID 56271bbbbdf55ea21432dadaeccc1825e5f28cea # Parent 693739f8075501382f92bd4fa729e336905e9e9f Add cmdline support for PV kernels Signed-off-by: Dan Smith diff -r 693739f80755 -r 56271bbbbdf5 schema/VSSD.mof --- a/schema/VSSD.mof Mon Jul 28 09:17:31 2008 -0700 +++ b/schema/VSSD.mof Tue Jul 29 08:06:36 2008 -0700 @@ -21,6 +21,9 @@ [Description ("The direct-boot ramdisk for PV guests not using a bootloader")] string Ramdisk; + + [Description ("The command-line arguments to be passed to a PV kernel")] + string CommandLine; [Description ("The device to boot from when in fully-virtualized mode." "One of hd,fd,cdrom.")] diff -r 693739f80755 -r 56271bbbbdf5 src/Virt_VSSD.c --- a/src/Virt_VSSD.c Mon Jul 28 09:17:31 2008 -0700 +++ b/src/Virt_VSSD.c Tue Jul 29 08:06:36 2008 -0700 @@ -80,6 +80,11 @@ if (dominfo->os_info.pv.initrd != NULL) CMSetProperty(inst, "Ramdisk", (CMPIValue *)dominfo->os_info.pv.initrd, + CMPI_chars); + + if (dominfo->os_info.pv.cmdline != NULL) + CMSetProperty(inst, "CommandLine", + (CMPIValue *)dominfo->os_info.pv.cmdline, CMPI_chars); } diff -r 693739f80755 -r 56271bbbbdf5 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Jul 28 09:17:31 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Tue Jul 29 08:06:36 2008 -0700 @@ -135,6 +135,13 @@ domain->os_info.pv.initrd = strdup(val); else domain->os_info.pv.initrd = NULL; + + free(domain->os_info.pv.cmdline); + ret = cu_get_str_prop(inst, "CommandLine", &val); + if (ret == CMPI_RC_OK) + domain->os_info.pv.cmdline = strdup(val); + else + domain->os_info.pv.cmdline = NULL; return 1; } From kaitlin at linux.vnet.ibm.com Tue Jul 29 15:57:34 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 29 Jul 2008 08:57:34 -0700 Subject: [Libvirt-cim] [PATCH] Fix DiskRASD size reporting In-Reply-To: References: Message-ID: <488F3DEE.10603@linux.vnet.ibm.com> > > +#if LIBVIR_VERSION_NUMBER > 4000 > +static bool get_vol_size(const CMPIBroker *broker, > + const CMPIObjectPath *ref, > + const char *image, > + uint64_t *size) > +{ > + virConnectPtr conn = NULL; > + virStorageVolPtr vol = NULL; > + virStorageVolInfo volinfo; > + CMPIStatus s; > + > + *size = 0; > + > + conn = connect_by_classname(broker, CLASSNAME(ref), &s); > + if (conn == NULL) > + return false; > + > + vol = virStorageVolLookupByPath(conn, image); > + if (vol != NULL) { > + if (virStorageVolGetInfo(vol, &volinfo) != 0) { > + CU_DEBUG("Failed to get info for volume %s", image); You don't set a return code here, so you'll return true in this case. You're not using the return code of this function in the calling function, but that may change in the future. > + } else { > + *size = volinfo.capacity; > + } > + } > + > + virStorageVolFree(vol); > + virConnectClose(conn); > + > + return true; -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 29 16:06:11 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 29 Jul 2008 09:06:11 -0700 Subject: [Libvirt-cim] [PATCH] Force the namespace into the ResultingSystem reference from DefineSystem In-Reply-To: <949e4c0f1e7c1c04d487.1217014883@guaranine.danplanet.com> References: <949e4c0f1e7c1c04d487.1217014883@guaranine.danplanet.com> Message-ID: <488F3FF3.1010304@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1217014881 25200 > # Node ID 949e4c0f1e7c1c04d4875d7a6566240385af1656 > # Parent 466808eaaefaf26e1200ab6ce57dc7b96b9ee7c7 > Force the namespace into the ResultingSystem reference from DefineSystem > > ...since Pegasus drops it by default. > > Signed-off-by: Dan Smith > > diff -r 466808eaaefa -r 949e4c0f1e7c src/Virt_VirtualSystemManagementService.c +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 29 16:08:48 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 29 Jul 2008 09:08:48 -0700 Subject: [Libvirt-cim] [PATCH] (#2) Fix DiskRASD size reporting In-Reply-To: <9cd2071b34e6251a64db.1217005474@guaranine.danplanet.com> References: <9cd2071b34e6251a64db.1217005474@guaranine.danplanet.com> Message-ID: <488F4090.9010505@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1217005472 25200 > # Node ID 9cd2071b34e6251a64db54b5008d4d9f0a64a0bd > # Parent baebb5941892dbdac23a5a902f4dfd5d7101587b > (#2) Fix DiskRASD size reporting > > I *know* this was in place at one point, but I think it might have gotten > lost in the changes to add libvirt storage support. > > Changes: > - If libvirt storage pool lookup fails, attempt to stat the image as > a backup > > Signed-off-by: Dan Smith > > diff -r baebb5941892 -r 9cd2071b34e6 src/Virt_RASD.c I'd reviewed an older version of the patch. This one looks good. +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 29 16:24:34 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 29 Jul 2008 09:24:34 -0700 Subject: [Libvirt-cim] [PATCH] Return a reference instead of an instance for ResultingSystem In-Reply-To: <6c42f34929ca88266843.1216995728@guaranine.danplanet.com> References: <6c42f34929ca88266843.1216995728@guaranine.danplanet.com> Message-ID: <488F4442.9040608@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1216995289 25200 > # Node ID 6c42f34929ca88266843f931c69ccf5a09391ef1 > # Parent e6f7e3922f86b9ac35c5c9e205dacf8feb88e2a8 > Return a reference instead of an instance for ResultingSystem > > Signed-off-by: Dan Smith > > diff -r e6f7e3922f86 -r 6c42f34929ca src/Virt_VirtualSystemManagementService.c > --- a/src/Virt_VirtualSystemManagementService.c Thu Jul 24 11:05:22 2008 -0700 > +++ b/src/Virt_VirtualSystemManagementService.c Fri Jul 25 07:14:49 2008 -0700 > @@ -953,6 +953,7 @@ +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 29 16:34:21 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 29 Jul 2008 09:34:21 -0700 Subject: [Libvirt-cim] [PATCH] Fix ReferenceConfiguration parameter parsing to properly expect a VSSD In-Reply-To: <466808eaaefaf26e1200.1217012623@guaranine.danplanet.com> References: <466808eaaefaf26e1200.1217012623@guaranine.danplanet.com> Message-ID: <488F468D.5090608@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1217012608 25200 > # Node ID 466808eaaefaf26e1200ab6ce57dc7b96b9ee7c7 > # Parent a3aa7dff01cc4128a55553c6cfbbf1123441c272 > Fix ReferenceConfiguration parameter parsing to properly expect a VSSD > > Which means grabbing InstaceID instead and parsing out the name. I think > a test was recently added for ReferenceConfiguration, so that will need > to change, as it was based on the code and not the schema. > > Signed-off-by: Dan Smith > > diff -r a3aa7dff01cc -r 466808eaaefa src/Virt_VirtualSystemManagementService.c +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 29 17:29:09 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 29 Jul 2008 10:29:09 -0700 Subject: [Libvirt-cim] [PATCH] Add cmdline support for PV kernels In-Reply-To: <56271bbbbdf55ea21432.1217344959@guaranine.danplanet.com> References: <56271bbbbdf55ea21432.1217344959@guaranine.danplanet.com> Message-ID: <488F5365.3070807@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1217343996 25200 > # Node ID 56271bbbbdf55ea21432dadaeccc1825e5f28cea > # Parent 693739f8075501382f92bd4fa729e336905e9e9f > Add cmdline support for PV kernels > > Signed-off-by: Dan Smith > > diff -r 693739f80755 -r 56271bbbbdf5 schema/VSSD.mof +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From jfehlig at novell.com Tue Jul 29 17:55:14 2008 From: jfehlig at novell.com (Jim Fehlig) Date: Tue, 29 Jul 2008 11:55:14 -0600 Subject: [Libvirt-cim] [PATCH] Add cmdline support for PV kernels In-Reply-To: <56271bbbbdf55ea21432.1217344959@guaranine.danplanet.com> References: <56271bbbbdf55ea21432.1217344959@guaranine.danplanet.com> Message-ID: <488F5982.5040602@novell.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1217343996 25200 > # Node ID 56271bbbbdf55ea21432dadaeccc1825e5f28cea > # Parent 693739f8075501382f92bd4fa729e336905e9e9f > Add cmdline support for PV kernels > +1, thanks Dan :-) From danms at us.ibm.com Tue Jul 29 19:38:24 2008 From: danms at us.ibm.com (Dan Smith) Date: Tue, 29 Jul 2008 12:38:24 -0700 Subject: [Libvirt-cim] [PATCH] Fix VirtualSystemSettingDataComponent inheritance Message-ID: # HG changeset patch # User Dan Smith # Date 1217360078 25200 # Node ID d7406e2f4670208cfe61ef9c0065164292ab3942 # Parent f7fd7b14cee99f366227a35b406aa4da737b1dbc Fix VirtualSystemSettingDataComponent inheritance This should inherit from CIM_VSSDComponent, not CIM_Component Signed-off-by: Dan Smith diff -r f7fd7b14cee9 -r d7406e2f4670 schema/VSSDComponent.mof --- a/schema/VSSDComponent.mof Tue Jul 29 10:51:00 2008 -0700 +++ b/schema/VSSDComponent.mof Tue Jul 29 12:34:38 2008 -0700 @@ -3,20 +3,20 @@ [Association, Provider("cmpi::Virt_VSSDComponent") ] -class Xen_VirtualSystemSettingDataComponent : CIM_Component +class Xen_VirtualSystemSettingDataComponent : CIM_VirtualSystemSettingDataComponent { }; [Association, Provider("cmpi::Virt_VSSDComponent") ] -class KVM_VirtualSystemSettingDataComponent : CIM_Component +class KVM_VirtualSystemSettingDataComponent : CIM_VirtualSystemSettingDataComponent { }; [Association, Provider("cmpi::Virt_VSSDComponent") ] -class LXC_VirtualSystemSettingDataComponent : CIM_Component +class LXC_VirtualSystemSettingDataComponent : CIM_VirtualSystemSettingDataComponent { }; From kaitlin at linux.vnet.ibm.com Tue Jul 29 20:08:08 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 29 Jul 2008 13:08:08 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update ElementSettingData.03 for LXC support In-Reply-To: References: Message-ID: <488F78A8.3060802@linux.vnet.ibm.com> yunguol at cn.ibm.com wrote: > # HG changeset patch > # User Guolian Yun > # Date 1216869559 25200 > # Node ID de9cf9b8a9302a55eff582f15c133cca98547c9b > # Parent 32d78f23f6e73f5443022179410128767896465d > [TEST] Update ElementSettingData.03 for LXC support > > Signed-off-by: Guolian Yun > > diff -r 32d78f23f6e7 -r de9cf9b8a930 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 Wed Jul 23 00:32:36 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py Wed Jul 23 20:19:19 2008 -0700 > @@ -60,7 +60,7 @@ from XenKvmLib.classes import get_typed_ > from XenKvmLib.classes import get_typed_class > from CimTest.ReturnCodes import PASS, FAIL > > -sup_types = ['Xen', 'KVM', 'LXC'] > +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > > test_dom = "hd_domain1" > test_mac = "00:11:22:33:44:55" > @@ -79,6 +79,8 @@ expr_values = { > @do_main(sup_types) > def main(): > options = main.options > + if options.virt == 'XenFV': > + options.virt = 'Xen' > The guest you'll create will be a Xen guest, not a XenFV guest. Are these 2 lines of code needed? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 29 20:18:58 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 29 Jul 2008 13:18:58 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add test for hypervisor version string In-Reply-To: References: Message-ID: <488F7B32.6080302@linux.vnet.ibm.com> > + > + try: > + service = vsms.enumerate_instances(options.ip, options.virt)[0] > + except Exception, details: > + logger.error("Did not find VSMS instance") > + logger.error(details) > + return FAIL You'll want to check to make sure None was not returned from the enumerate call. It's possible the call returned CMPI_RC_OK and no instances. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From skanan at linux.vnet.ibm.com Tue Jul 29 22:07:01 2008 From: skanan at linux.vnet.ibm.com (skannan) Date: Tue, 29 Jul 2008 18:07:01 -0400 Subject: [Libvirt-cim] [PATCH] Fix VirtualSystemSettingDataComponent inheritance Message-ID: <488F9485.8060100@linux.vnet.ibm.com> danms at linux.vnet.ibm.com wrote: # HG changeset patch # User Dan Smith # Date 1217360078 25200 # Node ID d7406e2f4670208cfe61ef9c0065164292ab3942 # Parent f7fd7b14cee99f366227a35b406aa4da737b1dbc Fix VirtualSystemSettingDataComponent inheritance This should inherit from CIM_VSSDComponent, not CIM_Component Signed-off-by: Dan Smith diff -r f7fd7b14cee9 -r d7406e2f4670 schema/VSSDComponent.mof --- a/schema/VSSDComponent.mof Tue Jul 29 10:51:00 2008 -0700 +++ b/schema/VSSDComponent.mof Tue Jul 29 12:34:38 2008 -0700 @@ -3,20 +3,20 @@ [Association, Provider("cmpi::Virt_VSSDComponent") ] -class Xen_VirtualSystemSettingDataComponent : CIM_Component +class Xen_VirtualSystemSettingDataComponent : CIM_VirtualSystemSettingDataComponent { }; [Association, Provider("cmpi::Virt_VSSDComponent") ] -class KVM_VirtualSystemSettingDataComponent : CIM_Component +class KVM_VirtualSystemSettingDataComponent : CIM_VirtualSystemSettingDataComponent { }; [Association, Provider("cmpi::Virt_VSSDComponent") ] -class LXC_VirtualSystemSettingDataComponent : CIM_Component +class LXC_VirtualSystemSettingDataComponent : CIM_VirtualSystemSettingDataComponent { }; +1 From kaitlin at linux.vnet.ibm.com Tue Jul 29 22:24:15 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 29 Jul 2008 15:24:15 -0700 Subject: [Libvirt-cim] [PATCH] Fix VirtualSystemSettingDataComponent inheritance In-Reply-To: References: Message-ID: <488F988F.9060000@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1217360078 25200 > # Node ID d7406e2f4670208cfe61ef9c0065164292ab3942 > # Parent f7fd7b14cee99f366227a35b406aa4da737b1dbc > Fix VirtualSystemSettingDataComponent inheritance > > This should inherit from CIM_VSSDComponent, not CIM_Component > > Signed-off-by: Dan Smith +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 29 22:36:09 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 29 Jul 2008 15:36:09 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Verify functionality of MemoryRASD units specification for VSMS In-Reply-To: <2972728363defd7c9a76.1216930300@guaranine.danplanet.com> References: <2972728363defd7c9a76.1216930300@guaranine.danplanet.com> Message-ID: <488F9B59.4000008@linux.vnet.ibm.com> > +def try_define(options, service, vssd, units, value): The service param isn't used in this function. > + at do_main(sup_types) > +def main(): > + options = main.options > + > + vssd_class = vsms.get_vssd_class(options.virt) > + vssd = vssd_class(name=default_dom, virt=options.virt) > + > + try: > + service = vsms.enumerate_instances(options.ip, options.virt)[0] > + except Exception, e: > + logger.error("Did not find VSMS instance: %s" % e) > + return FAIL This block can be removed since it's not being used. > + > + status = PASS > + > + for units, shift in values: > + value = mem_bytes >> shift > + > + if not try_define(options, service, vssd, units, value): > + status = FAIL > + break > + > + if not check_value(options): > + status = FAIL > + break > + > + undefine_test_domain(default_dom, options.ip, virt=options.virt) > + > + try: > + undefine_test_domain(default_dom, options.ip, virt=options.virt) > + except Exception, e: > + pass Why put the second call to undefine_test_domain() in a try / catch block? The first call isn't in a try/catch block. Even if the guest has already been undefined, this shouldn't thrown an exception. The virsh undefine call should fail. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 29 22:48:30 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 29 Jul 2008 15:48:30 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update ResourcePool.01 & 02 for XenFV support In-Reply-To: References: Message-ID: <488F9E3E.7080904@linux.vnet.ibm.com> yunguol at cn.ibm.com wrote: > # HG changeset patch > # User Guolian Yun > # Date 1216973963 25200 > # Node ID f45e90649f2f3f21e169537463d491e965723cdd > # Parent 32d78f23f6e73f5443022179410128767896465d > [TEST] Update ResourcePool.01 & 02 for XenFV support > > Signed-off-by: Guolian Yun > > diff -r 32d78f23f6e7 -r f45e90649f2f suites/libvirt-cim/cimtest/ResourcePool/01_enum.py This fails on Xen and XenFV for me, which means its an existing bug. I can you look into fixing this up in this patch. Here's the error I get: ResourcePool - 01_enum.py: FAIL ERROR - InstanceID Mismatch ERROR - Returned NetworkPool/default-net44 instead of NetworkPool/default-net -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 30 00:43:09 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 29 Jul 2008 17:43:09 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Convert HostSystem - 04_hs_to_EAPF.py for XenFV/KVM support In-Reply-To: References: Message-ID: <488FB91D.4020201@linux.vnet.ibm.com> > create_diskpool_file > > -sup_types = ['Xen'] > +sup_types = ['Xen', 'KVM', 'XenFV'] Need to add LXC to the list. > +def eapf_list(server, virt="Xen"): > + disk_inst = get_typed_class(virt, "LogicalDisk") > + proc_inst = get_typed_class(virt, "Processor") > + net_inst = get_typed_class(virt, "NetworkPort") > + mem_inst = get_typed_class(virt, "Memory") > + > disk = { > 'SystemName' : test_dom, > - 'CreationClassName' : "Xen_LogicalDisk", > - 'DeviceID' : "%s/%s" % (test_dom,test_disk), > + 'CreationClassName' : disk_inst, > + 'DeviceID' : "%s/%s" % (test_dom, test_disk), > 'Name' : test_disk > } > proc = { > 'SystemName' : test_dom, > - 'CreationClassName' : "Xen_Processor", > + 'CreationClassName' : proc_inst, > 'DeviceID' : "%s/%s" % (test_dom,0) > } > net = { > 'SystemName' : test_dom, > - 'CreationClassName' : "Xen_NetworkPort", > + 'CreationClassName' : net_inst, > 'DeviceID' : "%s/%s" % (test_dom, test_mac), > 'NetworkAddresses' : test_mac > } > mem = { > 'SystemName' : test_dom, > - 'CreationClassName' : "Xen_Memory", > + 'CreationClassName' : mem_inst, > 'DeviceID' : "%s/%s" % (test_dom, "mem"), > 'NumberOfBlocks' : test_mem * 1024 > } > - eaf_values = { "Xen_Processor" : proc, > - "Xen_LogicalDisk" : disk, > - "Xen_NetworkPort" : net, > - "Xen_Memory" : mem > + eaf_values = { proc_inst : proc, > + disk_inst : disk, > + net_inst : net, > + mem_inst : mem > } You'll need to make this part LXC specific. You'll need to change the "exp_len = 4" value accordingly (in the main function, before check_len() is called. > return eaf_values > > @@ -152,13 +133,14 @@ def get_inst_for_dom(assoc_val): > + destroy_and_undefine_all(server) > + virt_type = get_class(virt) > + if virt == 'LXC': > + vsxml = virt_type(test_dom) > + else: > + vsxml = virt_type(test_dom, vcpus = test_vcpus, mac = test_mac, > + disk = test_disk) > + > + ret = vsxml.define(server) > + if not ret: > + logger.error("Failed to Create the dom: '%s'", test_dom) > + return FAIL > > # Verify DiskPool on machine > status = create_diskpool_file() > if status != PASS: > return status > - > You'll need to define a network pool as well. Otherwise, the test will fail if a network pool isn't present on the host: HostSystem - 04_hs_to_EAPF.py: FAIL ERROR - KVM_HostedResourcePool returned 3 Device Pool objects -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 30 01:46:46 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 29 Jul 2008 18:46:46 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add test for DiskRASD size parameter In-Reply-To: <3c80ea156a3c45bc321f.1217005491@guaranine.danplanet.com> References: <3c80ea156a3c45bc321f.1217005491@guaranine.danplanet.com> Message-ID: <488FC806.4020304@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1217005489 25200 > # Node ID 3c80ea156a3c45bc321f9c465ba7692c011ab2e0 > # Parent 2972728363defd7c9a7683ebfa85a4dfc8225e32 > [TEST] Add test for DiskRASD size parameter > > Signed-off-by: Dan Smith > > diff -r 2972728363de -r 3c80ea156a3c suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py You'll need to create a diskpool using the diskpool functions in common_util. Otherwise, the test fails if a corresponding storage pool isn't present. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 30 01:51:58 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 29 Jul 2008 18:51:58 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Check that the DefineSystem() result can be passed to GetInstance() In-Reply-To: References: Message-ID: <488FC93E.6050807@linux.vnet.ibm.com> > + > +def define_system(host, virt, name, vssd, rasds): > + vsms_class = eval("vsms." + \ > + get_typed_class(virt, > + "VirtualSystemManagementService")) > + > + service = vsms_class(host) > + > + rc, results = service.DefineSystem(SystemSettings=vssd, > + ResourceSettings=rasds, > + ReferenceConfiguration=' ') > + > + system = results["ResultingSystem"] What if the DefineSystem call throws an exception or if results is None? > + > + return rc, system > + > +def get_instance_by_ref(host, ref): > + conn = pywbem.WBEMConnection('http://%s' % host, > + (Globals.CIM_USER, Globals.CIM_PASS), > + ref.namespace) > + return conn.GetInstance(ref) > + > + > + at do_main(sup_types) > +def main(): > + options = main.options > + > + systemref = define_test_system(options) > + > + if not isinstance(systemref, pywbem.CIMInstanceName): > + logger.error("ResultingSystem is not a Reference!") > + return FAIL > + > + if systemref.namespace is None: > + logger.error("Returned reference had no namespace!") > + return FAIL > + > + logger.info("GetInstance(%s)" % systemref) > + system = get_instance_by_ref(options.ip, systemref) > + > + if system["Name"] == default_dom: > + logger.info("Validated resulting system instance") > + return PASS > + else: > + logger.error("Result system was: %s instead of %s" % (system["Name"], > + default_dom)) > + return FAIL You'll need to undefine the guest before the test returns in each if condition. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From yunguol at cn.ibm.com Wed Jul 30 03:16:36 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Tue, 29 Jul 2008 20:16:36 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix ResourcePool.01 failure for Xen, verify exp_value in a list not the first item Message-ID: # HG changeset patch # User Guolian Yun # Date 1217387789 25200 # Node ID e803555f6857e4e230749f0a8b72c0ddb3c7e8fe # Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb [TEST] Fix ResourcePool.01 failure for Xen, verify exp_value in a list not the first item Signed-off-by: Guolian Yun diff -r 2efc46fd30f3 -r e803555f6857 suites/libvirt-cim/cimtest/ResourcePool/01_enum.py --- a/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Wed Jul 23 17:42:47 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Tue Jul 29 20:16:29 2008 -0700 @@ -89,11 +89,14 @@ def verify_fields(pool_list, poolname, c logger.error("%s return %i instances, expected atleast 1 instance" \ % (cn, len(poolname))) return FAIL - ret_value = poolname[0].InstanceID exp_value = pool_list[cn][0] - if ret_value != exp_value: - print_error('InstanceID', ret_value, exp_value) - status = FAIL + for i in range(0, len(poolname)): + ret_value = poolname[i].InstanceID + if ret_value == exp_value: + break + elif ret_value != exp_value and i == len(poolname)-1: + print_error('InstanceID', ret_value, exp_value) + status = FAIL ret_value = poolname[0].ResourceType exp_value = pool_list[cn][1] if ret_value != exp_value: From yunguol at cn.ibm.com Wed Jul 30 04:03:58 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Tue, 29 Jul 2008 21:03:58 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Update ResourcePool.01 & 02 for XenFV support Message-ID: # HG changeset patch # User Guolian Yun # Date 1217390631 25200 # Node ID f4ee15598db4fe3042b8cd0485ae17803c778795 # Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb [TEST] #2 Update ResourcePool.01 & 02 for XenFV support I cooked up a patche for fix ResourcePool.01 on the way, so I rebased this patch. Signed-off-by: Guolian Yun diff -r 2efc46fd30f3 -r f4ee15598db4 suites/libvirt-cim/cimtest/ResourcePool/01_enum.py --- a/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Wed Jul 23 17:42:47 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Tue Jul 29 21:03:51 2008 -0700 @@ -39,7 +39,7 @@ from XenKvmLib.common_util import cleanu from XenKvmLib.common_util import cleanup_restore, test_dpath, \ create_diskpool_file -sup_types = ['Xen', 'KVM', 'LXC'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] diskid = "%s/%s" % ("DiskPool", test_dpath) dp_cn = 'DiskPool' @@ -105,7 +105,10 @@ def verify_fields(pool_list, poolname, c @do_main(sup_types) def main(): ip = main.options.ip - virt = main.options.virt + if main.options.virt == "XenFV": + virt = "Xen" + else: + virt = main.options.virt status, pool_list = init_list(ip, virt) if status != PASS: logger.error("Failed to initialise the list") diff -r 2efc46fd30f3 -r f4ee15598db4 suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py --- a/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py Wed Jul 23 17:42:47 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py Tue Jul 29 21:03:51 2008 -0700 @@ -40,7 +40,7 @@ from XenKvmLib.common_util import cleanu from XenKvmLib.common_util import cleanup_restore, test_dpath, \ create_diskpool_file -sup_types = ['Xen', 'KVM', 'LXC'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] expr_values = { "invalid_keyname" : { 'rc' : pywbem.CIM_ERR_FAILED, @@ -88,7 +88,10 @@ def err_invalid_instid_keyvalue(conn, cl @do_main(sup_types) def main(): ip = main.options.ip - virt = main.options.virt + if main.options.virt == "XenFV": + virt = "Xen" + else: + virt = main.options.virt conn = assoc.myWBEMConnection('http://%s' % ip, (CIM_USER, CIM_PASS), CIM_NS) From yunguol at cn.ibm.com Wed Jul 30 05:34:04 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Tue, 29 Jul 2008 22:34:04 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Update ElementSettingData.03 for XenFV support Message-ID: # HG changeset patch # User Guolian Yun # Date 1217396027 25200 # Node ID f5e68364070e684580fadf659592aac5565f8b69 # Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb [TEST] #2 Update ElementSettingData.03 for XenFV support Updates from 1 to 2: When Xen guest creation finish, set options.virt to 'Xen' Signed-off-by: Guolian Yun diff -r 2efc46fd30f3 -r f5e68364070e 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 Wed Jul 23 17:42:47 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py Tue Jul 29 22:33:47 2008 -0700 @@ -60,7 +60,7 @@ from XenKvmLib.classes import get_typed_ from XenKvmLib.classes import get_typed_class from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen', 'KVM', 'LXC'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "hd_domain1" test_mac = "00:11:22:33:44:55" @@ -91,6 +91,8 @@ def main(): logger.error("Failed to Create the dom: %s" % test_dom) status = FAIL return status + if options.virt == "XenFV": + options.virt = "Xen" try: instid = '%s:%s' % (options.virt, test_dom) rasd_list = assoc.Associators(options.ip, vssdc_cn, vssd_cn, From yunguol at cn.ibm.com Wed Jul 30 05:20:50 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 30 Jul 2008 13:20:50 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] Update ElementSettingData.03 for LXC support In-Reply-To: <488F78A8.3060802@linux.vnet.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-30 04:08:08: > yunguol at cn.ibm.com wrote: > > # HG changeset patch > > # User Guolian Yun > > # Date 1216869559 25200 > > # Node ID de9cf9b8a9302a55eff582f15c133cca98547c9b > > # Parent 32d78f23f6e73f5443022179410128767896465d > > [TEST] Update ElementSettingData.03 for LXC support > > > > Signed-off-by: Guolian Yun > > > > diff -r 32d78f23f6e7 -r de9cf9b8a930 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 Wed > Jul 23 00:32:36 2008 -0700 > > +++ b/suites/libvirt- > cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py Wed > Jul 23 20:19:19 2008 -0700 > > @@ -60,7 +60,7 @@ from XenKvmLib.classes import get_typed_ > > from XenKvmLib.classes import get_typed_class > > from CimTest.ReturnCodes import PASS, FAIL > > > > -sup_types = ['Xen', 'KVM', 'LXC'] > > +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > > > > test_dom = "hd_domain1" > > test_mac = "00:11:22:33:44:55" > > @@ -79,6 +79,8 @@ expr_values = { > > @do_main(sup_types) > > def main(): > > options = main.options > > + if options.virt == 'XenFV': > > + options.virt = 'Xen' > > > > The guest you'll create will be a Xen guest, not a XenFV guest. Are > these 2 lines of code needed? These 2 lines are needed, but not here, they should be set after XenFV guest creation. #2 patch on the way. Thanks! > -- > 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 Wed Jul 30 07:12:53 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Wed, 30 Jul 2008 00:12:53 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Call destroy_netpool() to remove the created netpool in tc Message-ID: <484734992819e5836997.1217401973@elm3b41.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1217401967 25200 # Node ID 484734992819e58369974ac579a6c39c1bcd0cfa # Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb [TEST] Call destroy_netpool() to remove the created netpool in tc Signed-off-by: Guolian Yun diff -r 2efc46fd30f3 -r 484734992819 suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Wed Jul 23 17:42:47 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Wed Jul 30 00:12:47 2008 -0700 @@ -33,7 +33,7 @@ from CimTest.Globals import logger, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ -create_netpool_conf +create_netpool_conf, destroy_netpool sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] @@ -152,6 +152,7 @@ break cleanup_restore(options.ip, options.virt) + destroy_netpool(options.ip, options.virt, test_network) vsxml.undefine(options.ip) return status diff -r 2efc46fd30f3 -r 484734992819 suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Wed Jul 23 17:42:47 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Wed Jul 30 00:12:47 2008 -0700 @@ -34,7 +34,7 @@ from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib import enumclass from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ -create_netpool_conf +create_netpool_conf, destroy_netpool sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] @@ -184,6 +184,7 @@ return status cleanup_restore(server, virt) + destroy_netpool(server, virt, test_network) vsxml.undefine(server) return status diff -r 2efc46fd30f3 -r 484734992819 suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py --- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Jul 23 17:42:47 2008 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Jul 30 00:12:47 2008 -0700 @@ -63,7 +63,7 @@ CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIATORS from XenKvmLib.classes import get_typed_class from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ -create_netpool_conf +create_netpool_conf, destroy_netpool from XenKvmLib.common_util import print_field_error platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC'] @@ -148,9 +148,9 @@ except Exception, detail: logger.error("Exception: %s", detail) - return FAIL, dpool, npool, mpool, ppool + return FAIL, dpool, npool, mpool, ppool, test_network - return PASS, dpool, npool, mpool, ppool + return PASS, dpool, npool, mpool, ppool, test_network def verify_rasd_fields(loop, assoc_info, cllist, rtype, rangelist): for inst in assoc_info: @@ -200,7 +200,7 @@ server = options.ip virt = options.virt - status, dpool, npool, mpool, ppool = get_pool_details(virt, server) + status, dpool, npool, mpool, ppool, test_network = get_pool_details(virt, server) if status != PASS or dpool.InstanceID == None or mpool.InstanceID == None \ or npool.InstanceID == None or ppool.InstanceID == None: cleanup_restore(server, virt) @@ -208,6 +208,7 @@ status = verify_sdc_with_ac(virt, server, dpool, npool, mpool, ppool) cleanup_restore(server, virt) + destroy_netpool(server, virt, test_network) return status if __name__ == "__main__": From yunguol at cn.ibm.com Wed Jul 30 07:42:04 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Wed, 30 Jul 2008 00:42:04 -0700 Subject: [Libvirt-cim] [PATCH] [TEST]#2 Update HostSystem.04 for XenFV/KVM/LXC support Message-ID: # HG changeset patch # User Guolian Yun # Date 1217403718 25200 # Node ID b0af611e1fde61297aa300a0d5f51ebc0a5de1c3 # Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb [TEST]#2 Update HostSystem.04 for XenFV/KVM/LXC support Updates from 1 to 2: define a network pool for test Signed-off-by: Guolian Yun diff -r 2efc46fd30f3 -r b0af611e1fde suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py --- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Wed Jul 23 17:42:47 2008 -0700 +++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Wed Jul 30 00:41:58 2008 -0700 @@ -52,17 +52,17 @@ from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES, \ CIM_ERROR_ASSOCIATORS from CimTest.Globals import do_main +from XenKvmLib.vxml import XenXML, KVMXML, get_class from XenKvmLib.assoc import AssociatorNames, Associators from XenKvmLib.common_util import get_host_info +from XenKvmLib.classes import get_typed_class from CimTest.ReturnCodes import PASS, FAIL, SKIP -from XenKvmLib.test_xml import testxml_bridge -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all -from VirtLib.live import network_by_bridge +from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib.logicaldevices import verify_device_values from XenKvmLib.common_util import cleanup_restore, test_dpath, \ -create_diskpool_file +create_diskpool_file, create_netpool_conf, destroy_netpool -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "CrossClass_GuestDom" test_mac = "00:11:22:33:44:aa" @@ -72,30 +72,6 @@ diskid = "%s/%s" % ("DiskPool", test_dpath) memid = "%s/%s" % ("MemoryPool", 0) procid = "%s/%s" % ("ProcessorPool", 0) - -def setup_env(server): - destroy_and_undefine_all(server) - test_xml, bridge = testxml_bridge(test_dom, mem = test_mem, - vcpus = test_vcpus, mac = test_mac, - disk = test_disk, server = server) - if bridge == None: - logger.error("Unable to find virtual bridge") - return SKIP - - if test_xml == None: - logger.error("Guest xml was not created properly") - return FAIL - - virt_network = network_by_bridge(bridge, server) - if virt_network == None: - logger.error("No virtual network found for bridge %s", bridge) - return SKIP - - ret = test_domain_function(test_xml, server, cmd = "create") - if not ret: - logger.error("Failed to create the dom: %s", test_dom) - return FAIL - return PASS def print_err(err, detail, cn): logger.error(err % cn) @@ -112,35 +88,43 @@ in_pllist[classname_keyvalue] = instid return in_pllist -def eapf_list(): +def eapf_list(server, virt="Xen"): + disk_inst = get_typed_class(virt, "LogicalDisk") + proc_inst = get_typed_class(virt, "Processor") + net_inst = get_typed_class(virt, "NetworkPort") + mem_inst = get_typed_class(virt, "Memory") + disk = { 'SystemName' : test_dom, - 'CreationClassName' : "Xen_LogicalDisk", - 'DeviceID' : "%s/%s" % (test_dom,test_disk), + 'CreationClassName' : disk_inst, + 'DeviceID' : "%s/%s" % (test_dom, test_disk), 'Name' : test_disk } proc = { 'SystemName' : test_dom, - 'CreationClassName' : "Xen_Processor", + 'CreationClassName' : proc_inst, 'DeviceID' : "%s/%s" % (test_dom,0) } net = { 'SystemName' : test_dom, - 'CreationClassName' : "Xen_NetworkPort", + 'CreationClassName' : net_inst, 'DeviceID' : "%s/%s" % (test_dom, test_mac), 'NetworkAddresses' : test_mac } mem = { 'SystemName' : test_dom, - 'CreationClassName' : "Xen_Memory", + 'CreationClassName' : mem_inst, 'DeviceID' : "%s/%s" % (test_dom, "mem"), 'NumberOfBlocks' : test_mem * 1024 } - eaf_values = { "Xen_Processor" : proc, - "Xen_LogicalDisk" : disk, - "Xen_NetworkPort" : net, - "Xen_Memory" : mem - } + if virt == "LXC": + eaf_values = { mem_inst : mem} + else: + eaf_values = { proc_inst : proc, + disk_inst : disk, + net_inst : net, + mem_inst : mem + } return eaf_values def get_inst_for_dom(assoc_val): @@ -152,13 +136,14 @@ return dom_list -def get_assocname_info(server, cn, an, qcn, hostname): +def get_assocname_info(server, cn, an, qcn, hostname, virt="Xen"): status = PASS assoc_info = [] try: assoc_info = AssociatorNames(server, an, cn, + virt, CreationClassName=cn, Name = hostname) if len(assoc_info) < 1: @@ -172,7 +157,6 @@ if status != PASS: cleanup_restore(server, virt='Xen') - test_domain_function(test_dom, server, "destroy") return status, assoc_info @@ -183,24 +167,24 @@ return FAIL return PASS -def verify_eafp_values(server, in_pllist): +def verify_eafp_values(server, in_pllist, virt="Xen"): # Looping through the in_pllist to get association for various pools. status = PASS - an = "Xen_ElementAllocatedFromPool" + an = get_typed_class(virt, "ElementAllocatedFromPool") exp_len = 1 qcn = "Logical Devices" - eafp_values = eapf_list() + eafp_values = eapf_list(server, virt) for cn, instid in sorted(in_pllist.items()): try: - assoc_info = Associators(server, an, cn, InstanceID = instid) + assoc_info = Associators(server, an, cn, virt, InstanceID = instid) inst_list = get_inst_for_dom(assoc_info) status = check_len(an, inst_list, qcn, exp_len) if status != PASS: break assoc_eafp_info = inst_list[0] CCName = assoc_eafp_info['CreationClassName'] - status = verify_device_values(assoc_eafp_info, CCName, - eafp_values, virt='Xen') + status = verify_device_values(assoc_eafp_info, + eafp_values, virt) if status != PASS: return status @@ -216,41 +200,60 @@ def main(): options= main.options server = options.ip - virt=options.virt + if options.virt == "XenFV": + virt = "Xen" + else: + virt=options.virt # Get the host info - status, host_name, classname = get_host_info(server) + status, host_name, classname = get_host_info(server, virt) if status != PASS: return status + destroy_and_undefine_all(server) + virt_type = get_class(virt) + if virt == 'LXC': + vsxml = virt_type(test_dom) + else: + vsxml = virt_type(test_dom, vcpus = test_vcpus, mac = test_mac, + disk = test_disk) + ret = vsxml.define(server) + if not ret: + logger.error("Failed to define the dom: '%s'", test_dom) + return FAIL + cleanup_restore(server, virt=virt) # Verify DiskPool on machine status = create_diskpool_file() if status != PASS: return status + # Create NetPool on machine + status, net_name = create_netpool_conf(server, virt) + if status != PASS: + logger.error('Unable to create network pool') + return FAIL # Get the hostedResourcePool info first cn = classname - an = "Xen_HostedResourcePool" + an = get_typed_class(virt, "HostedResourcePool") qcn = "Device Pool" - status, pool = get_assocname_info(server, cn, an, qcn, host_name) + status, pool = get_assocname_info(server, cn, an, qcn, host_name, virt) if status != PASS: return status - - # One pool for each Device type, hence len should be 4 + # One pool for each Device type, hence len should be 4 exp_len = 4 status = status = check_len(an, pool, qcn, exp_len) if status != PASS: return FAIL - status = setup_env(server) - if status != PASS: - cleanup_restore(server, virt=virt) - test_domain_function(test_dom, server, cmd = "destroy") - return status - in_pllist = pool_init_list(pool) - status = verify_eafp_values(server, in_pllist) - ret = test_domain_function(test_dom, server, cmd = "destroy") + if virt == 'LXC': + for cn, instid in in_pllist.items(): + if cn == 'LXC_MemoryPool': + in_pllist = {cn: instid} + break + status = verify_eafp_values(server, in_pllist, virt) + vsxml.undefine(server) cleanup_restore(server, virt=virt) + destroy_netpool(server, virt, net_name) return status if __name__ == "__main__": sys.exit(main()) From yunguol at cn.ibm.com Wed Jul 30 08:47:37 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 30 Jul 2008 16:47:37 +0800 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Fixes to support the ReferencedConfiguration VSMS param In-Reply-To: Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-22 08:34:00: > # HG changeset patch > # User Kaitlin Rupert > # Date 1216686405 25200 > # Node ID e14f791f1cb4f84ed3cad03c9099d336e232fb48 > # Parent abcd4c8a873656b6f12c4416832d185f8c9eb151 > [TEST] Fixes to support the ReferencedConfiguration VSMS param. > > These changes are needed to create a test case that tests the > ReferencedConfiguration VSMS parameter. > > Fixes: > -Add ref_config param to create_using_definesystem() - allows the > caller to specify a reference for the ReferenceConfiguration param > -Add enumerate_names() - Calls EnumerateInstanceNames() so the > caller can get a list of CS references > -Fix default_vssd_rasd_str() so that is a mac address is supplied > to the function, it is used instead of one of the const.<> values. > > Signed-off-by: Kaitlin Rupert > > diff -r abcd4c8a8736 -r e14f791f1cb4 suites/libvirt- > cim/lib/XenKvmLib/common_util.py > --- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Mon Jul 21 > 10:33:31 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Mon Jul 21 > 17:26:45 2008 -0700 > @@ -64,8 +64,8 @@ > > return (0, cs) > > -def create_using_definesystem(domain_name, ip, > - params=None, exp_err=None, virt='Xen'): > +def create_using_definesystem(domain_name, ip, params=None, ref_config=' ', > + exp_err=None, virt='Xen'): > bug = "85673" > try: > class_vsms = eval('vsms.' + \ > @@ -89,7 +89,7 @@ > > service.DefineSystem(SystemSettings=vssd, > ResourceSettings=rasd, > - ReferenceConfiguration=' ') > + ReferenceConfiguration=ref_config) > except pywbem.CIMError, (rc, desc): > if rc == exp_rc and desc.find(exp_desc) >= 0: > logger.info('Got expected rc code and error string.') > diff -r abcd4c8a8736 -r e14f791f1cb4 suites/libvirt- > cim/lib/XenKvmLib/computersystem.py > --- a/suites/libvirt-cim/lib/XenKvmLib/computersystem.py Mon Jul > 21 10:33:31 2008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/computersystem.py Mon Jul > 21 17:26:45 2008 -0700 > @@ -95,6 +95,20 @@ > > return list > > +def enumerate_names(server, virt='Xen'): > + conn = pywbem.WBEMConnection('http://%s' % server, > + (Globals.CIM_USER, Globals.CIM_PASS), > + Globals.CIM_NS) > + classname = get_typed_class(virt, 'ComputerSystem') > + > + try: > + refs = conn.EnumerateInstanceNames(classname) > + except pywbem.CIMError, arg: > + raise Exception(arg[1]) > + return [] > + > + return refs > + > def system_of(server, iname): > t = eval(iname["CreationClassName"]) > > diff -r abcd4c8a8736 -r e14f791f1cb4 suites/libvirt-cim/lib/XenKvmLib/vsms.py > --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Mon Jul 21 10:33:312008 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Mon Jul 21 17:26:452008 -0700 > @@ -263,7 +263,9 @@ > return vssd.mof(), [d.mof(), m.mof()] > > class_nasd = get_nasd_class(virt) > - if virt == 'KVM': > + if net_mac != const.Xen_default_mac: > + pass > + elif virt == 'KVM': > net_mac= const.KVM_default_mac > elif virt == 'XenFV': > net_mac = const.XenFV_default_mac > LXC network devices take a mac address argument as well? > _______________________________________________ > 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 Jul 30 08:47:59 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Wed, 30 Jul 2008 16:47:59 +0800 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Add VSMS 10_referenced_config.py In-Reply-To: Message-ID: +1 from me =) Best, Regards Daisy (???) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol at cn.ibm.com TEL: (86)-21-60922403 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 Kaitlin Rupert Sent by: libvirt-cim-bounces at redhat.com 2008-07-22 08:34 Please respond to List for discussion and development of libvirt CIM To libvirt-cim at redhat.com cc Subject [Libvirt-cim] [PATCH 2 of 2] [TEST] Add VSMS 10_referenced_config.py # HG changeset patch # User Kaitlin Rupert # Date 1216686405 25200 # Node ID c2c0ac1f88c47405a0326dc7d019bbf931870dec # Parent e14f791f1cb4f84ed3cad03c9099d336e232fb48 [TEST] Add VSMS 10_referenced_config.py. This test creates a guest using default RASDS. Then another guest is defined using a reference of the first guest an the value for the ReferencedConfiguration parameter. This second guest is created with an additional network interface. The test verifies that the second guest is defined properly. It also verifies that the second guest has 2 network interfaces: one with a mac address that matches that of the first guest and one with a different mac address. This test current fails on LXC because the test suite doesn't pass a console device to the DefineSystem(). Will fix this in a follow up patch. Signed-off-by: Kaitlin Rupert diff -r e14f791f1cb4 -r c2c0ac1f88c4 suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_referenced_config.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_referenced_config.py Mon Jul 21 17:26:45 2008 -0700 @@ -0,0 +1,169 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Kaitlin Rupert +# +# 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 pywbem +from XenKvmLib.common_util import create_using_definesystem, \ + call_request_state_change, \ + poll_for_state_change +from XenKvmLib import vsms +from VirtLib import utils +from CimTest.Globals import logger, do_main +from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib.test_doms import destroy_and_undefine_domain +from XenKvmLib.classes import get_typed_class +from XenKvmLib import computersystem + +sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] +test_dom = 'rstest_domain' +test_dom2 = 'rstest_domain2' + +mac = "aa:aa:aa:00:00:00" + +REQUESTED_STATE = 2 +TIME = "00000000000000.000000:000" + +def setup_first_guest(ip, virt): + status = create_using_definesystem(test_dom, ip, virt=virt) + if status != PASS: + logger.error("Unable to define %s using DefineSystem()" % test_dom) + return FAIL + + rc = call_request_state_change(test_dom, ip, REQUESTED_STATE, TIME, virt) + if rc != 0: + logger.error("Unable to start %s" % test_dom) + return FAIL + + status = poll_for_state_change(ip, virt, test_dom, REQUESTED_STATE) + if status != PASS: + logger.error("%s didn't change state as expected" % test_dom) + return FAIL + + return PASS + +def get_ref(ip, virt): + cs_ref = None + + cs = computersystem.enumerate_names(ip, virt) + if len(cs) < 1: + logger.error("ComputerSystem EnumerateNames() returned no instances") + return cs_ref + + for ref in cs: + for item in ref.items(): + prop, val = item + if prop == "Name" and val == test_dom: + cs_ref = ref + + return cs_ref + +def get_vssd_rasd(virt): + vssd, def_rasd = vsms.default_vssd_rasd_str(dom_name=test_dom2, + net_type='network', + net_mac=mac, virt=virt) + + rasd = [] + for inst in def_rasd: + cn = get_typed_class(virt, "NetResourceAllocationSettingData") + if cn in inst: + rasd.append(inst) + + params = {} + + if len(rasd) != 1: + return params + + params['vssd'] = vssd + params['rasd'] = rasd + + return params + +def get_dom_macs(server, dom, virt): + mac_list = [] + + cmd = "virsh -c %s dumpxml %s | grep mac" % (utils.virt2uri(virt), dom) + ret, out = utils.run_remote(server, cmd) + if ret != 0: + return mac_list + + lines = out.splitlines() + for l in lines: + mac = l.split('=')[1] + mac = mac.lstrip('\'') + mac = mac.rstrip('\'/>') + mac_list.append(mac) + + return mac_list + + at do_main(sup_types) +def main(): + options = main.options + + try: + status = setup_first_guest(options.ip, options.virt) + if status != PASS: + raise Exception("Unable to start %s" % test_dom) + + ref = get_ref(options.ip, options.virt) + if ref is None: + raise Exception("Unable to get %s reference" % test_dom) + + define_params = get_vssd_rasd(options.virt) + if len(define_params) != 2: + raise Exception("Unable to build VSSD and RASD instances for %s" % \ + test_dom2) + + status = create_using_definesystem(test_dom2, options.ip, + params=define_params, ref_config=ref, + virt=options.virt) + if status != PASS: + raise Exception("Unable to define %s" % test_dom2) + + dom1_mac_list = get_dom_macs(options.ip, test_dom, options.virt) + if len(dom1_mac_list) != 1: + raise Exception("%s has %d macs, expected 1" % (test_dom, + len(dom1_mac_list))) + + dom2_mac_list = get_dom_macs(options.ip, test_dom2, options.virt) + if len(dom2_mac_list) != 2: + raise Exception("%s has %d macs, expected 1" % (test_dom2, + len(dom2_mac_list))) + + for item in dom2_mac_list: + if item != mac and item != dom1_mac_list[0]: + raise Exception("%s has unexpected mac value, exp: %s %s" % \ + (item, mac, dom1_mac_list[0])) + + status = PASS + + except Exception, details: + logger.error(details) + status = FAIL + + destroy_and_undefine_domain(test_dom, options.ip, options.virt) + destroy_and_undefine_domain(test_dom2, options.ip, options.virt) + + 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From deeptik at linux.vnet.ibm.com Wed Jul 30 09:54:48 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 30 Jul 2008 15:24:48 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Add stack trace on error to make test case development easier In-Reply-To: <9e1d09bf6636d3a0244e.1217262474@guaranine.danplanet.com> References: <9e1d09bf6636d3a0244e.1217262474@guaranine.danplanet.com> Message-ID: <48903A68.6080409@linux.vnet.ibm.com> How or when can we make use of this ? Thanks and Regards, Deepti. Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1217262465 25200 > # Node ID 9e1d09bf6636d3a0244ee3224b22dcba267425d5 > # Parent a39dc855b73eb6f5a960bc377a093d3fa953f926 > [TEST] #2 Add stack trace on error to make test case development easier > > Changes: > - Fix whitespace issue > > Signed-off-by: Dan Smith > > diff -r a39dc855b73e -r 9e1d09bf6636 lib/CimTest/Globals.py > --- a/lib/CimTest/Globals.py Mon Jul 28 09:20:54 2008 -0700 > +++ b/lib/CimTest/Globals.py Mon Jul 28 09:27:45 2008 -0700 > @@ -25,6 +25,7 @@ > import os > import logging > from optparse import OptionParser > +import traceback > > global CIM_USER > global CIM_PASS > @@ -143,6 +144,7 @@ > rc = f() > except Exception, e: > logger.error('%s : %s' % (e.__class__.__name__, e)) > + logger.error("%s" % traceback.print_exc()) > rc = FAIL > return rc > setattr(do_try, 'options', options) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From deeptik at linux.vnet.ibm.com Wed Jul 30 11:21:58 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 30 Jul 2008 04:21:58 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing VSSDC 01_forward.py Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1217416905 25200 # Node ID ee9f77162c6d8979230dd17e8526db2cdbae45d8 # Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb [TEST] Fixing VSSDC 01_forward.py This tc was failing on KVM with current sources. Fix tested for Xen, XenFV and KVM with current sources. Signed-off-by: Deepti B. Kalakeri diff -r 2efc46fd30f3 -r ee9f77162c6d suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Wed Jul 23 17:42:47 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Wed Jul 30 04:21:45 2008 -0700 @@ -66,7 +66,6 @@ test_dom = "VSSDC_dom" test_dom = "VSSDC_dom" test_vcpus = 2 test_mac = "00:11:22:33:44:aa" -test_disk = 'xvda' def init_list(test_disk, test_mac, virt='Xen'): """ @@ -118,6 +117,12 @@ def main(): status = FAIL destroy_and_undefine_all(options.ip) + + if options.virt == "Xen": + test_disk = "xvdb" + else: + test_disk = "hdb" + prop_list = init_list(test_disk, test_mac, options.virt) virt_xml = vxml.get_class(options.virt) if options.virt == 'LXC': From danms at us.ibm.com Wed Jul 30 12:53:16 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 30 Jul 2008 05:53:16 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add test for DiskRASD size parameter In-Reply-To: <488FC806.4020304@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Tue, 29 Jul 2008 18:46:46 -0700") References: <3c80ea156a3c45bc321f.1217005491@guaranine.danplanet.com> <488FC806.4020304@linux.vnet.ibm.com> Message-ID: <871w1bttxf.fsf@caffeine.beaverton.ibm.com> KR> You'll need to create a diskpool using the diskpool functions in KR> common_util. Otherwise, the test fails if a corresponding storage KR> pool isn't present. Why? I just ran it on my system with all the storage pools destroyed and it worked. The info log shows it retrieved the proper size for the image as well. -- 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 Jul 30 12:55:28 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 30 Jul 2008 05:55:28 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Add stack trace on error to make test case development easier In-Reply-To: <48903A68.6080409@linux.vnet.ibm.com> (Deepti B. Kalakeri's message of "Wed, 30 Jul 2008 15:24:48 +0530") References: <9e1d09bf6636d3a0244e.1217262474@guaranine.danplanet.com> <48903A68.6080409@linux.vnet.ibm.com> Message-ID: <87wsj3sf9b.fsf@caffeine.beaverton.ibm.com> DK> How or when can we make use of this ? Since the entire test is run in a try..except block, errors and typos while writing tests get squashed down to nothing more than an error message like "IndexError: list index out of range", with no indication of where that is happening. Putting a stack trace in the error output gives you that information. -- 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 Wed Jul 30 12:57:02 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 30 Jul 2008 18:27:02 +0530 Subject: [Libvirt-cim] CimTest Report for KVM on F9 30-07-2008 Message-ID: <4890651E.7020303@linux.vnet.ibm.com> ======================================================================== CIM Test Report for KVM on F9 with latest libvirt-cim and libcmpiutil ======================================================================== Distro : Fedora 9 Beta Kernel : 2.6.25-0.121.rc5.git4.fc9 Libvirt : libvirt-0.4.2-1.fc9.x86_64 CIMOM : pegasus PyWBEM : pywbem-0.6 CIM Schema : cimv216Experimental LibCMPIutil : 83 LibVirtCIM : 651 CIMTEST : 262 ======================================================= PASS : 113 FAIL : 4 XFAIL : 1 SKIP : 12 ----------------- Total : 130 ======================================================= Here is one of the tc that failed ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for indication Need to investigate into this. VirtualSystemManagementService - 08_modifyresource.py: FAIL ERROR - Got 0, exp 262144. ERROR - Error invoking ModifyRS: mod_mem_res ERROR - Error changing rs for mem VirtualSystemManagementService - 09_procrasd_persist.py: FAIL ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed') ERROR - Unable to start rstest_domain using RequestedStateChange() InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed These above two test cases are failing since the tc is not able to create a guest using the VSMS DefineSystem(). This can be fixed if by passing appropriate values to the AllocationUnits of MemRASD. Will be sending a fix for the same shortly. VirtualSystemSettingDataComponent - 01_forward.py: FAIL ERROR - Failed to define the dom: VSSDC_dom Submitted fix for the above tc. Please find the complete report attached with the mail. Thanks and Regards, Deepti. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: July30-KVM-report URL: From danms at us.ibm.com Wed Jul 30 13:55:35 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 30 Jul 2008 06:55:35 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Add test for hypervisor version string Message-ID: # HG changeset patch # User Dan Smith # Date 1217426131 25200 # Node ID e3d4987d295d2905b921a1a3980430cd7bb03735 # Parent 32d78f23f6e73f5443022179410128767896465d [TEST] #2 Add test for hypervisor version string Changes: - Check for None result of service Signed-off-by: Dan Smith diff -r 32d78f23f6e7 -r e3d4987d295d lib/VirtLib/live.py --- a/lib/VirtLib/live.py Wed Jul 23 00:32:36 2008 -0700 +++ b/lib/VirtLib/live.py Wed Jul 30 06:55:31 2008 -0700 @@ -347,3 +347,10 @@ return out return None +def get_hv_ver(server, virt="Xen"): + cmd = "virsh -c %s version | grep ^Running | cut -d ' ' -f 3,4" % utils.virt2uri(virt) + ret, out = utils.run_remote(server, cmd) + if ret == 0: + return out + else: + return None diff -r 32d78f23f6e7 -r e3d4987d295d suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_hv_version.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_hv_version.py Wed Jul 30 06:55:31 2008 -0700 @@ -0,0 +1,63 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Dan Smith +# +# 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 pywbem +from VirtLib import live +from XenKvmLib import vsms +from CimTest.Globals import do_main +from CimTest.Globals import logger +from CimTest.ReturnCodes import FAIL, PASS + +sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] + + at do_main(sup_types) +def main(): + options = main.options + + try: + service = vsms.enumerate_instances(options.ip, options.virt)[0] + except Exception, details: + service = None + + if not service: + logger.error("Did not find VSMS instance") + logger.error(details) + return FAIL + + try: + cim_ver = service["Caption"] + local_ver = live.get_hv_ver(options.ip, options.virt) + + if cim_ver != local_ver: + logger.error("CIM says version is `%s', but libvirt says `%s'") + return FAIL + else: + logger.info("Verified %s == %s" % (cim_ver, local_ver)) + except Exception, details: + logger.error(details) + return FAIL + + return PASS + +if __name__ == "__main__": + sys.exit(main()) From danms at us.ibm.com Wed Jul 30 14:02:18 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 30 Jul 2008 07:02:18 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Verify functionality of MemoryRASD units specification for VSMS Message-ID: # HG changeset patch # User Dan Smith # Date 1217426536 25200 # Node ID dcffd5acd5e13b447a9eb0fd1fb3ee79586ad975 # Parent e3d4987d295d2905b921a1a3980430cd7bb03735 [TEST] #2 Verify functionality of MemoryRASD units specification for VSMS Changes: - Removed dead code - Removed unneeded try..except block Signed-off-by: Dan Smith diff -r e3d4987d295d -r dcffd5acd5e1 suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Wed Jul 30 07:02:16 2008 -0700 @@ -0,0 +1,130 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Dan Smith +# +# 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 pywbem +from VirtLib import live +from XenKvmLib import vsms +from XenKvmLib.test_doms import undefine_test_domain +from XenKvmLib.common_util import create_using_definesystem +from XenKvmLib import rasd +from XenKvmLib.classes import get_typed_class +from XenKvmLib import enumclass +from CimTest.Globals import do_main +from CimTest.Globals import logger +from CimTest.ReturnCodes import FAIL, PASS + +sup_types = ['Xen', 'XenFV', 'KVM'] +default_dom = "memrasd_test" + +mem_bytes = 2 << 30 + +values = [ + ("Bytes", 0), + ("KiloBytes", 10), + ("MegaBytes", 20), + ("GigaBytes", 30), + ] + +def try_define(options, vssd, units, value): + mrasd_class = vsms.get_masd_class(options.virt) + mrasd = mrasd_class(None, default_dom) + + mrasd.AllocationUnits = units + mrasd.VirtualQuantity = value + + params = { + "vssd" : vssd.mof(), + "rasd" : [mrasd.mof()], + } + + logger.info("Defining with %s = %i" % (units, value)) + rc = create_using_definesystem(default_dom, + options.ip, + params=params, + virt=options.virt) + + if rc != PASS: + logger.error("DefineSystem (%s) failed" % units) + return False + + return True + +def check_value(options): + mrasd_cn = get_typed_class(options.virt, rasd.masd_cn) + rasds = enumclass.enumerate_inst(options.ip, mrasd_cn, options.virt) + + the_rasd = None + mem_kb = mem_bytes >> 10 + + for _rasd in rasds: + if _rasd["InstanceID"] == "%s/mem" % default_dom: + the_rasd = _rasd + + if not the_rasd: + logger.error("Did not find test RASD on server") + return False + + if the_rasd["AllocationUnits"] != "KiloBytes": + logger.error("MRASD units are not kilobytes?") + return False + + cim_kb = int(the_rasd["VirtualQuantity"]) + + if cim_kb != mem_kb: + logger.error("CIM reports %i KB instead of %i KB" % (cim_kb, mem_kb)) + return False + + logger.info("Verified %i KB" % mem_kb) + + return True + + + at do_main(sup_types) +def main(): + options = main.options + + vssd_class = vsms.get_vssd_class(options.virt) + vssd = vssd_class(name=default_dom, virt=options.virt) + + status = PASS + + for units, shift in values: + value = mem_bytes >> shift + + if not try_define(options, vssd, units, value): + status = FAIL + break + + if not check_value(options): + status = FAIL + break + + undefine_test_domain(default_dom, options.ip, virt=options.virt) + + undefine_test_domain(default_dom, options.ip, virt=options.virt) + + + return status + +if __name__ == "__main__": + sys.exit(main()) From danms at us.ibm.com Wed Jul 30 14:12:22 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 30 Jul 2008 07:12:22 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #3 Check that the DefineSystem() result can be passed to GetInstance() Message-ID: # HG changeset patch # User Dan Smith # Date 1217427140 25200 # Node ID be869ee37ebd8cd304751dd67b7ac47ce6c642ce # Parent 753ddf4191cff036c917376039299a4e525db1c9 [TEST] #3 Check that the DefineSystem() result can be passed to GetInstance() Changes: - Check that ResultingSystem is a REF instead of an instance too - Handle case where results does not include a ResultingSystem - Undefine test domain before exit Signed-off-by: Dan Smith diff -r 753ddf4191cf -r be869ee37ebd suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_define_result.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_define_result.py Wed Jul 30 07:12:20 2008 -0700 @@ -0,0 +1,106 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Dan Smith +# +# 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 +# + +sup_types = ['Xen', 'XenFV', 'KVM'] +default_dom = "define_test" + +import sys +import pywbem +from CimTest.ReturnCodes import FAIL, PASS +from CimTest.Globals import do_main +from CimTest.Globals import logger +from CimTest import Globals +from XenKvmLib import vsms +from XenKvmLib.classes import get_typed_class +from XenKvmLib.test_doms import undefine_test_domain + +def define_system(host, virt, name, vssd, rasds): + vsms_class = eval("vsms." + \ + get_typed_class(virt, + "VirtualSystemManagementService")) + + service = vsms_class(host) + + rc, results = service.DefineSystem(SystemSettings=vssd, + ResourceSettings=rasds, + ReferenceConfiguration=' ') + + try: + system = results["ResultingSystem"] + except KeyError: + logger.error("DefineSystem() did not return a ResultingSystem") + return FAIL, None + + return rc, system + +def get_instance_by_ref(host, ref): + conn = pywbem.WBEMConnection('http://%s' % host, + (Globals.CIM_USER, Globals.CIM_PASS), + ref.namespace) + return conn.GetInstance(ref) + +def define_test_system(options): + vssd_class = vsms.get_vssd_class(options.virt) + vssd = vssd_class(name=default_dom, virt=options.virt) + + mrasd_class = vsms.get_masd_class(options.virt) + mrasd = mrasd_class(32, default_dom) + + rc, system = define_system(options.ip, + options.virt, + default_dom, + vssd.mof(), + [mrasd.mof()]) + + return rc, system + + at do_main(sup_types) +def main(): + options = main.options + + rc, systemref = define_test_system(options) + if systemref is None: + return rc + + if not isinstance(systemref, pywbem.CIMInstanceName): + logger.error("ResultingSystem is not a Reference!") + return FAIL + + if systemref.namespace is None: + logger.error("Returned reference had no namespace!") + return FAIL + + logger.info("GetInstance(%s)" % systemref) + system = get_instance_by_ref(options.ip, systemref) + + undefine_test_domain(default_dom, options.ip, virt=options.virt) + + if system["Name"] == default_dom: + logger.info("Validated resulting system instance") + return PASS + else: + logger.error("Result system was: %s instead of %s" % (system["Name"], + default_dom)) + return FAIL + +if __name__ == "__main__": + sys.exit(main()) From kaitlin at linux.vnet.ibm.com Wed Jul 30 15:20:14 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 30 Jul 2008 08:20:14 -0700 Subject: [Libvirt-cim] [PATCH 1 of 6] 1) Fixed get_cs_instance() debug statement In-Reply-To: References: Message-ID: <489086AE.3090201@linux.vnet.ibm.com> > > +def verify_err_desc(exp_rc, exp_desc, err_no, err_desc): > + if err_no == exp_rc and err_desc.find(exp_desc) >= 0: > + logger.info("Got expected exception where ") > + logger.info("Errno is '%s' ", exp_rc) > + logger.info("Error string is '%s'", exp_desc) > + return PASS > + else: > + logger.error("Unexpected rc code %s and description %s\n", > + (err_no, err_desc)) > + return FAIL > +\ I don't think we need to add this to a common library. The libraries are becoming cluttered, and it's often difficult to tell what library a function comes from. Checking an error description is fairly trivial and something that each test case can handle as needed. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 30 15:35:31 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 30 Jul 2008 08:35:31 -0700 Subject: [Libvirt-cim] [PATCH 3 of 6] 1) Added support for KVM In-Reply-To: <8c8ec47bc8492eacc1f5.1217332619@elm3b193.beaverton.ibm.com> References: <8c8ec47bc8492eacc1f5.1217332619@elm3b193.beaverton.ibm.com> Message-ID: <48908A43.3000602@linux.vnet.ibm.com> > - # undefine the vs > - undefine_test_domain(default_dom, options.ip, options.virt) > + if status != PASS: > + destroy_netpool(server, virt, test_network) > + destroy_and_undefine_domain(default_dom, server, virt) > + return status > + > + # try to suspend already suspended VS > + rq_state = SUSPND_STATE > + status = try_request_state_change(default_dom, server, > + rq_state, TIME, err_no, > + err_desc, virt) I'm not sure I see the benefit of this change. You're not verifying the state of the guest. It's possible for RequestStateChange() to return a success and for the guest to be in an unexpected state. > + > + destroy_netpool(server, virt, test_network) > + destroy_and_undefine_domain(default_dom, server, virt) > > return status -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 30 15:41:26 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 30 Jul 2008 08:41:26 -0700 Subject: [Libvirt-cim] [PATCH 5 of 6] 1) Added support for KVM In-Reply-To: References: Message-ID: <48908BA6.5090300@linux.vnet.ibm.com> > - # undefine the vs > - undefine_test_domain(default_dom, options.ip, options.virt) > + if status != PASS: > + destroy_netpool(server, virt, test_network) > + destroy_and_undefine_domain(default_dom, server, virt) > + return status > > + # Try to reboot the VS which is suspened > + rq_state = REBOOT_STATE > + status = try_request_state_change(default_dom, server, > + rq_state, TIME, err_no, > + err_desc, virt) > + Also here, you don't verify the guest has been rebooted properly. Is there a reason to pull this piece out of the loop? Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Wed Jul 30 17:45:26 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 30 Jul 2008 10:45:26 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Make ComputerSystem.EnabledState aware of snapshot Message-ID: This makes the state of a guest appear to be suspended if there is a snapshot for the domain and the domain is offline. This also makes sure to prevent the user from starting the domain when such a snapshot exists, to force them to either apply or delete the snapshot. From danms at us.ibm.com Wed Jul 30 17:45:27 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 30 Jul 2008 10:45:27 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Make guests with save images appear to be in the suspended state In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1217439903 25200 # Node ID e348d263e884ba9d0a2116f1e1b1ae706b654850 # Parent d7406e2f4670208cfe61ef9c0065164292ab3942 Make guests with save images appear to be in the suspended state and refuse to start a domain that has a snapshot. Signed-off-by: Dan Smith diff -r d7406e2f4670 -r e348d263e884 src/Makefile.am --- a/src/Makefile.am Tue Jul 29 12:34:38 2008 -0700 +++ b/src/Makefile.am Wed Jul 30 10:45:03 2008 -0700 @@ -67,6 +67,8 @@ libVirt_ElementSettingData.la libVirt_ComputerSystem_la_SOURCES = Virt_ComputerSystem.c +libVirt_ComputerSystem_la_DEPENDENCIES = libVirt_VirtualSystemSnapshotService.la +libVirt_ComputerSystem_la_LIBADD = -lVirt_VirtualSystemSnapshotService libVirt_Device_la_SOURCES = Virt_Device.c libVirt_ComputerSystemIndication_la_DEPENDENCIES = libVirt_ComputerSystem.la libVirt_HostSystem.la diff -r d7406e2f4670 -r e348d263e884 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Tue Jul 29 12:34:38 2008 -0700 +++ b/src/Virt_ComputerSystem.c Wed Jul 30 10:45:03 2008 -0700 @@ -43,6 +43,7 @@ #include "Virt_ComputerSystem.h" #include "Virt_HostSystem.h" +#include "Virt_VirtualSystemSnapshotService.h" const static CMPIBroker *_BROKER; @@ -229,6 +230,18 @@ } } +static uint16_t adjust_state_if_saved(const char *name, + uint16_t state) +{ + if (state != CIM_STATE_DISABLED) + return state; + + if (vsss_has_save_image(name)) + return CIM_STATE_SUSPENDED; + + return state; +} + static int set_state_from_dom(const CMPIBroker *broker, virDomainPtr dom, CMPIInstance *instance) @@ -248,6 +261,7 @@ return 0; cim_state = state_lv_to_cim((const int)info.state); + cim_state = adjust_state_if_saved(virDomainGetName(dom), cim_state); CMSetProperty(instance, "EnabledState", (CMPIValue *)&cim_state, CMPI_uint16); @@ -715,6 +729,29 @@ return ret; } +static CMPIStatus start_domain(virDomainPtr dom) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + + if (vsss_has_save_image(virDomainGetName(dom))) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_NOT_SUPPORTED, + "Domain has a snapshot"); + return s; + } + + if (virDomainCreate(dom) != 0) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to start domain"); + return s; + } + + set_scheduler_params(dom); + + return s; +} + static CMPIStatus state_change_enable(virDomainPtr dom, virDomainInfoPtr info) { CMPIStatus s = {CMPI_RC_OK, NULL}; @@ -723,8 +760,7 @@ switch (info->state) { case VIR_DOMAIN_SHUTOFF: CU_DEBUG("Start domain"); - ret = virDomainCreate(dom); - set_scheduler_params(dom); + s = start_domain(dom); break; case VIR_DOMAIN_PAUSED: CU_DEBUG("Unpause domain"); diff -r d7406e2f4670 -r e348d263e884 src/Virt_VirtualSystemSnapshotService.c --- a/src/Virt_VirtualSystemSnapshotService.c Tue Jul 29 12:34:38 2008 -0700 +++ b/src/Virt_VirtualSystemSnapshotService.c Wed Jul 30 10:45:03 2008 -0700 @@ -321,6 +321,24 @@ return path; } +bool vsss_has_save_image(const char *domname) +{ + char *path = NULL; + bool result = false; + + path = vsss_get_save_path(domname); + if (path == NULL) { + CU_DEBUG("Failed top get save path for %s", domname); + return false; + } + + result = access(path, R_OK | W_OK | F_OK) == 0; + + free(path); + + return result; +} + static struct snap_context *new_context(const char *name, CMPIStatus *s) { @@ -445,6 +463,30 @@ return s; } +CMPIStatus vsss_delete_snapshot(const char *domname) +{ + CMPIStatus s; + char *path = NULL; + + path = vsss_get_save_path(domname); + if (path == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get save_path"); + goto out; + } + + if (unlink(path) == -1) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to remove snapshot: %s", path); + } + out: + free(path); + + return s; +} + static CMPIStatus destroy_snapshot(CMPIMethodMI *self, const CMPIContext *context, const CMPIResult *results, @@ -455,7 +497,6 @@ CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIObjectPath *snap; char *name = NULL; - char *path = NULL; uint32_t retcode = CIM_RETURN_FAILED; if (cu_get_ref_arg(argsin, "AffectedSnapshot", &snap) != CMPI_RC_OK) { @@ -472,25 +513,15 @@ goto out; } - path = vsss_get_save_path(name); - if (path == NULL) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Unable to get save_path"); - goto out; - } + s = vsss_delete_snapshot(name); - if (unlink(path) == -1) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Unable to remove snapshot: %s", path); - } - - retcode = CIM_RETURN_COMPLETED; + if (s.rc == CMPI_RC_OK) + retcode = CIM_RETURN_COMPLETED; + else + retcode = CIM_RETURN_FAILED; out: CMReturnData(results, (CMPIValue *)&retcode, CMPI_uint32); - free(path); free(name); return s; diff -r d7406e2f4670 -r e348d263e884 src/Virt_VirtualSystemSnapshotService.h --- a/src/Virt_VirtualSystemSnapshotService.h Tue Jul 29 12:34:38 2008 -0700 +++ b/src/Virt_VirtualSystemSnapshotService.h Wed Jul 30 10:45:03 2008 -0700 @@ -21,6 +21,8 @@ /* Returns a malloc()'d string; caller must free() */ char *vsss_get_save_path(const char *domname); +bool vsss_has_save_image(const char *domname); +CMPIStatus vsss_delete_snapshot(const char *domname); CMPIStatus get_vsss(const CMPIBroker *broker, const CMPIObjectPath *ref, From danms at us.ibm.com Wed Jul 30 17:45:28 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 30 Jul 2008 10:45:28 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Make SnapshotService delete the snapshot image on resume In-Reply-To: Message-ID: <993c30cca30c370e1be4.1217439928@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1217439908 25200 # Node ID 993c30cca30c370e1be4e146d26443c7949737cc # Parent e348d263e884ba9d0a2116f1e1b1ae706b654850 Make SnapshotService delete the snapshot image on resume Signed-off-by: Dan Smith diff -r e348d263e884 -r 993c30cca30c src/Virt_VirtualSystemSnapshotService.c --- a/src/Virt_VirtualSystemSnapshotService.c Wed Jul 30 10:45:03 2008 -0700 +++ b/src/Virt_VirtualSystemSnapshotService.c Wed Jul 30 10:45:08 2008 -0700 @@ -195,6 +195,9 @@ snap_job_set_status(ctx, CIM_JOBSTATE_RUNNING, "Restore finished"); + + if (!ctx->save) + vsss_delete_snapshot(virDomainGetName(dom)); } CU_DEBUG("Snapshot (%s/%s) completed", From kaitlin at linux.vnet.ibm.com Wed Jul 30 19:21:05 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 30 Jul 2008 12:21:05 -0700 Subject: [Libvirt-cim] [PATCH] [TEST]#2 Update HostSystem.04 for XenFV/KVM/LXC support In-Reply-To: References: Message-ID: <4890BF21.7030304@linux.vnet.ibm.com> > + ret = vsxml.define(server) > + if not ret: > + logger.error("Failed to define the dom: '%s'", test_dom) > + return FAIL > + cleanup_restore(server, virt=virt) This call isn't needed. > # Verify DiskPool on machine > status = create_diskpool_file() > if status != PASS: > return status You'll need to clean up the guest before returning. > + # Create NetPool on machine > + status, net_name = create_netpool_conf(server, virt) By default, create_netpool_conf uses the existing network pool if one exists. You'll need to supply "False" here because you clean up the network pool below. The behavior of this function should change at some point, I think using the existing network pool should only be used in special conditions. > + if status != PASS: > + logger.error('Unable to create network pool') > + return FAIL You'll need to clean up the diskpool and the guest here. > > # Get the hostedResourcePool info first > cn = classname > - an = "Xen_HostedResourcePool" > + an = get_typed_class(virt, "HostedResourcePool") > qcn = "Device Pool" > - status, pool = get_assocname_info(server, cn, an, qcn, host_name) > + status, pool = get_assocname_info(server, cn, an, qcn, host_name, virt) > if status != PASS: > return status You'll need to clean up the diskpool and netpool before returning. > - > - # One pool for each Device type, hence len should be 4 > + # One pool for each Device type, hence len should be 4 > exp_len = 4 > status = status = check_len(an, pool, qcn, exp_len) > if status != PASS: > return FAIL You'll need to clean up the diskpool and netpool before returning. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 30 19:26:21 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 30 Jul 2008 12:26:21 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Call destroy_netpool() to remove the created netpool in tc In-Reply-To: <484734992819e5836997.1217401973@elm3b41.beaverton.ibm.com> References: <484734992819e5836997.1217401973@elm3b41.beaverton.ibm.com> Message-ID: <4890C05D.8030006@linux.vnet.ibm.com> yunguol at cn.ibm.com wrote: > # HG changeset patch > # User Guolian Yun > # Date 1217401967 25200 > # Node ID 484734992819e58369974ac579a6c39c1bcd0cfa > # Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb > [TEST] Call destroy_netpool() to remove the created netpool in tc > > Signed-off-by: Guolian Yun > > diff -r 2efc46fd30f3 -r 484734992819 suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py > --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Wed Jul 23 17:42:47 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Wed Jul 30 00:12:47 2008 -0700 > @@ -33,7 +33,7 @@ > from CimTest.Globals import logger, do_main > from CimTest.ReturnCodes import PASS, FAIL, XFAIL > from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ > -create_netpool_conf > +create_netpool_conf, destroy_netpool > > sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] > > @@ -152,6 +152,7 @@ > break > > cleanup_restore(options.ip, options.virt) > + destroy_netpool(options.ip, options.virt, test_network) > vsxml.undefine(options.ip) > return status This test uses the existing netpool, so you're deleting the existing one if you add this call. What I suggest to do is fix the create_diskpool_conf() function so that it creates a new netpool as the default. Then, you'll need to modify all the tests that call create_diskpool_conf() to cleanup the netpool when the test is done. And you'll need to change the tests that call create_diskpool_conf() with a False argument. Thoughts? > diff -r 2efc46fd30f3 -r 484734992819 suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py > --- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Jul 23 17:42:47 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Jul 30 00:12:47 2008 -0700 > @@ -63,7 +63,7 @@ > CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIATORS > from XenKvmLib.classes import get_typed_class > from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ > -create_netpool_conf > +create_netpool_conf, destroy_netpool > from XenKvmLib.common_util import print_field_error > > platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC'] > @@ -148,9 +148,9 @@ > > except Exception, detail: > logger.error("Exception: %s", detail) > - return FAIL, dpool, npool, mpool, ppool > + return FAIL, dpool, npool, mpool, ppool, test_network > > - return PASS, dpool, npool, mpool, ppool > + return PASS, dpool, npool, mpool, ppool, test_network > This is a lot of values to return from a function. Can you re-write this in such a way so that we return only a few values? I'd like to see no more than 2 if possible. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 30 20:01:33 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 30 Jul 2008 13:01:33 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add test for DiskRASD size parameter In-Reply-To: <871w1bttxf.fsf@caffeine.beaverton.ibm.com> References: <3c80ea156a3c45bc321f.1217005491@guaranine.danplanet.com> <488FC806.4020304@linux.vnet.ibm.com> <871w1bttxf.fsf@caffeine.beaverton.ibm.com> Message-ID: <4890C89D.5080208@linux.vnet.ibm.com> Dan Smith wrote: > KR> You'll need to create a diskpool using the diskpool functions in > KR> common_util. Otherwise, the test fails if a corresponding storage > KR> pool isn't present. > > Why? I just ran it on my system with all the storage pools destroyed > and it worked. The info log shows it retrieved the proper size for > the image as well. I was confusing myself yesterday. There's no need to worry about pools at all for this patch. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 30 20:06:23 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 30 Jul 2008 13:06:23 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #3 Check that the DefineSystem() result can be passed to GetInstance() In-Reply-To: References: Message-ID: <4890C9BF.5010602@linux.vnet.ibm.com> > + at do_main(sup_types) > +def main(): > + options = main.options > + > + rc, systemref = define_test_system(options) > + if systemref is None: > + return rc > + > + if not isinstance(systemref, pywbem.CIMInstanceName): > + logger.error("ResultingSystem is not a Reference!") > + return FAIL > + You'll need to undefine the guest before the return > + if systemref.namespace is None: > + logger.error("Returned reference had no namespace!") > + return FAIL Same here. > + > + logger.info("GetInstance(%s)" % systemref) > + system = get_instance_by_ref(options.ip, systemref) > + > + undefine_test_domain(default_dom, options.ip, virt=options.virt) > + -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Wed Jul 30 20:11:51 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 30 Jul 2008 13:11:51 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #3 Check that the DefineSystem() result can be passed to GetInstance() In-Reply-To: <4890C9BF.5010602@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Wed, 30 Jul 2008 13:06:23 -0700") References: <4890C9BF.5010602@linux.vnet.ibm.com> Message-ID: <87iqunqghk.fsf@caffeine.beaverton.ibm.com> KR> You'll need to undefine the guest before the return Whoops, I was thinking I handled all the cases by putting the undefine where I did. Sorry about that (again). I'll send a replacement :) -- 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 Jul 30 21:50:26 2008 From: danms at us.ibm.com (Dan Smith) Date: Wed, 30 Jul 2008 14:50:26 -0700 Subject: [Libvirt-cim] [PATCH] Fix type typo in VSMigrationService:raise_deleted_ind() Message-ID: <8b18b2a122d73a517c98.1217454626@guaranine.danplanet.com> # HG changeset patch # User Dan Smith # Date 1217447729 25200 # Node ID 8b18b2a122d73a517c98b971841ebe3642d33578 # Parent d7406e2f4670208cfe61ef9c0065164292ab3942 Fix type typo in VSMigrationService:raise_deleted_ind() Signed-off-by: Dan Smith diff -r d7406e2f4670 -r 8b18b2a122d7 src/Virt_VSMigrationService.c --- a/src/Virt_VSMigrationService.c Tue Jul 29 12:34:38 2008 -0700 +++ b/src/Virt_VSMigrationService.c Wed Jul 30 12:55:29 2008 -0700 @@ -857,7 +857,7 @@ ind = prepare_indication(_BROKER, inst, job->ref_ns, MIG_DELETED, &s); - rc = raise_indication(job->context, MIG_MODIFIED, job->ref_ns, + rc = raise_indication(job->context, MIG_DELETED, job->ref_ns, inst, ind); if (!rc) CU_DEBUG("Failed to raise indication"); From kaitlin at linux.vnet.ibm.com Wed Jul 30 22:45:36 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 30 Jul 2008 15:45:36 -0700 Subject: [Libvirt-cim] [PATCH] Fix type typo in VSMigrationService:raise_deleted_ind() In-Reply-To: <8b18b2a122d73a517c98.1217454626@guaranine.danplanet.com> References: <8b18b2a122d73a517c98.1217454626@guaranine.danplanet.com> Message-ID: <4890EF10.6040902@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1217447729 25200 > # Node ID 8b18b2a122d73a517c98b971841ebe3642d33578 > # Parent d7406e2f4670208cfe61ef9c0065164292ab3942 > Fix type typo in VSMigrationService:raise_deleted_ind() > > Signed-off-by: Dan Smith > > diff -r d7406e2f4670 -r 8b18b2a122d7 src/Virt_VSMigrationService.c +1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Jul 31 00:22:54 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 30 Jul 2008 17:22:54 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Make ComputerSystem.EnabledState aware of snapshot In-Reply-To: References: Message-ID: <489105DE.6070201@linux.vnet.ibm.com> Dan Smith wrote: > This makes the state of a guest appear to be suspended if there is a snapshot > for the domain and the domain is offline. This also makes sure to prevent > the user from starting the domain when such a snapshot exists, to force them > to either apply or delete the snapshot. > +1 for this set. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From yunguol at cn.ibm.com Thu Jul 31 02:31:50 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Wed, 30 Jul 2008 19:31:50 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #3 Update HostSystem.04 for XenFV/KVM/LXC support Message-ID: # HG changeset patch # User Guolian Yun # Date 1217471504 25200 # Node ID d095c79471e6b96828b560b6639f5945e86ba4f2 # Parent fc92abb3ae7cab32dec6718412be1c0d88874a4a [TEST] #3 Update HostSystem.04 for XenFV/KVM/LXC support Updates from 2 to 3: Clean up the diskpool/netpool/guest before returning Signed-off-by: Guolian Yun diff -r fc92abb3ae7c -r d095c79471e6 suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py --- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Wed Jul 30 06:55:31 2008 -0700 +++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Wed Jul 30 19:31:44 2008 -0700 @@ -52,17 +52,17 @@ from CimTest.Globals import logger, CIM_ from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES, \ CIM_ERROR_ASSOCIATORS from CimTest.Globals import do_main +from XenKvmLib.vxml import XenXML, KVMXML, get_class from XenKvmLib.assoc import AssociatorNames, Associators from XenKvmLib.common_util import get_host_info +from XenKvmLib.classes import get_typed_class from CimTest.ReturnCodes import PASS, FAIL, SKIP -from XenKvmLib.test_xml import testxml_bridge -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all -from VirtLib.live import network_by_bridge +from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib.logicaldevices import verify_device_values from XenKvmLib.common_util import cleanup_restore, test_dpath, \ -create_diskpool_file +create_diskpool_file, create_netpool_conf, destroy_netpool -sup_types = ['Xen'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "CrossClass_GuestDom" test_mac = "00:11:22:33:44:aa" @@ -72,30 +72,6 @@ diskid = "%s/%s" % ("DiskPool", test_dpa diskid = "%s/%s" % ("DiskPool", test_dpath) memid = "%s/%s" % ("MemoryPool", 0) procid = "%s/%s" % ("ProcessorPool", 0) - -def setup_env(server): - destroy_and_undefine_all(server) - test_xml, bridge = testxml_bridge(test_dom, mem = test_mem, - vcpus = test_vcpus, mac = test_mac, - disk = test_disk, server = server) - if bridge == None: - logger.error("Unable to find virtual bridge") - return SKIP - - if test_xml == None: - logger.error("Guest xml was not created properly") - return FAIL - - virt_network = network_by_bridge(bridge, server) - if virt_network == None: - logger.error("No virtual network found for bridge %s", bridge) - return SKIP - - ret = test_domain_function(test_xml, server, cmd = "create") - if not ret: - logger.error("Failed to create the dom: %s", test_dom) - return FAIL - return PASS def print_err(err, detail, cn): logger.error(err % cn) @@ -112,35 +88,43 @@ def pool_init_list(pool_assoc): in_pllist[classname_keyvalue] = instid return in_pllist -def eapf_list(): +def eapf_list(server, virt="Xen"): + disk_inst = get_typed_class(virt, "LogicalDisk") + proc_inst = get_typed_class(virt, "Processor") + net_inst = get_typed_class(virt, "NetworkPort") + mem_inst = get_typed_class(virt, "Memory") + disk = { 'SystemName' : test_dom, - 'CreationClassName' : "Xen_LogicalDisk", - 'DeviceID' : "%s/%s" % (test_dom,test_disk), + 'CreationClassName' : disk_inst, + 'DeviceID' : "%s/%s" % (test_dom, test_disk), 'Name' : test_disk } proc = { 'SystemName' : test_dom, - 'CreationClassName' : "Xen_Processor", + 'CreationClassName' : proc_inst, 'DeviceID' : "%s/%s" % (test_dom,0) } net = { 'SystemName' : test_dom, - 'CreationClassName' : "Xen_NetworkPort", + 'CreationClassName' : net_inst, 'DeviceID' : "%s/%s" % (test_dom, test_mac), 'NetworkAddresses' : test_mac } mem = { 'SystemName' : test_dom, - 'CreationClassName' : "Xen_Memory", + 'CreationClassName' : mem_inst, 'DeviceID' : "%s/%s" % (test_dom, "mem"), 'NumberOfBlocks' : test_mem * 1024 } - eaf_values = { "Xen_Processor" : proc, - "Xen_LogicalDisk" : disk, - "Xen_NetworkPort" : net, - "Xen_Memory" : mem - } + if virt == "LXC": + eaf_values = { mem_inst : mem} + else: + eaf_values = { proc_inst : proc, + disk_inst : disk, + net_inst : net, + mem_inst : mem + } return eaf_values def get_inst_for_dom(assoc_val): @@ -152,13 +136,14 @@ def get_inst_for_dom(assoc_val): return dom_list -def get_assocname_info(server, cn, an, qcn, hostname): +def get_assocname_info(server, cn, an, qcn, hostname, virt="Xen"): status = PASS assoc_info = [] try: assoc_info = AssociatorNames(server, an, cn, + virt, CreationClassName=cn, Name = hostname) if len(assoc_info) < 1: @@ -172,7 +157,6 @@ def get_assocname_info(server, cn, an, q if status != PASS: cleanup_restore(server, virt='Xen') - test_domain_function(test_dom, server, "destroy") return status, assoc_info @@ -183,24 +167,24 @@ def check_len(an, assoc_list_info, qcn, return FAIL return PASS -def verify_eafp_values(server, in_pllist): +def verify_eafp_values(server, in_pllist, virt="Xen"): # Looping through the in_pllist to get association for various pools. status = PASS - an = "Xen_ElementAllocatedFromPool" + an = get_typed_class(virt, "ElementAllocatedFromPool") exp_len = 1 qcn = "Logical Devices" - eafp_values = eapf_list() + eafp_values = eapf_list(server, virt) for cn, instid in sorted(in_pllist.items()): try: - assoc_info = Associators(server, an, cn, InstanceID = instid) + assoc_info = Associators(server, an, cn, virt, InstanceID = instid) inst_list = get_inst_for_dom(assoc_info) status = check_len(an, inst_list, qcn, exp_len) if status != PASS: break assoc_eafp_info = inst_list[0] CCName = assoc_eafp_info['CreationClassName'] - status = verify_device_values(assoc_eafp_info, CCName, - eafp_values, virt='Xen') + status = verify_device_values(assoc_eafp_info, + eafp_values, virt) if status != PASS: return status @@ -216,41 +200,69 @@ def main(): def main(): options= main.options server = options.ip - virt=options.virt + if options.virt == "XenFV": + virt = "Xen" + else: + virt=options.virt # Get the host info - status, host_name, classname = get_host_info(server) + status, host_name, classname = get_host_info(server, virt) if status != PASS: return status + destroy_and_undefine_all(server) + virt_type = get_class(virt) + if virt == 'LXC': + vsxml = virt_type(test_dom) + else: + vsxml = virt_type(test_dom, vcpus = test_vcpus, mac = test_mac, + disk = test_disk) + ret = vsxml.define(server) + if not ret: + logger.error("Failed to define the dom: '%s'", test_dom) + return FAIL # Verify DiskPool on machine status = create_diskpool_file() if status != PASS: - return status + logger.error("Failed to create diskpool") + vsxml.undefine(server) + return FAIL + # Create NetPool on machine + status, net_name = create_netpool_conf(server, virt, use_existing=False) + if status != PASS: + logger.error('Unable to create network pool') + vsxml.undefine(server) + cleanup_restore(server, virt=virt) + return FAIL # Get the hostedResourcePool info first cn = classname - an = "Xen_HostedResourcePool" + an = get_typed_class(virt, "HostedResourcePool") qcn = "Device Pool" - status, pool = get_assocname_info(server, cn, an, qcn, host_name) + status, pool = get_assocname_info(server, cn, an, qcn, host_name, virt) if status != PASS: + vsxml.undefine(server) + cleanup_restore(server, virt=virt) + destroy_netpool(server, virt, net_name) return status - - # One pool for each Device type, hence len should be 4 + # One pool for each Device type, hence len should be 4 exp_len = 4 - status = status = check_len(an, pool, qcn, exp_len) + status = check_len(an, pool, qcn, exp_len) if status != PASS: + vsxml.undefine(server) + cleanup_restore(server, virt=virt) + destroy_netpool(server, virt, net_name) return FAIL - status = setup_env(server) - if status != PASS: - cleanup_restore(server, virt=virt) - test_domain_function(test_dom, server, cmd = "destroy") - return status - in_pllist = pool_init_list(pool) - status = verify_eafp_values(server, in_pllist) - ret = test_domain_function(test_dom, server, cmd = "destroy") + if virt == 'LXC': + for cn, instid in in_pllist.items(): + if cn == 'LXC_MemoryPool': + in_pllist = {cn: instid} + break + status = verify_eafp_values(server, in_pllist, virt) + vsxml.undefine(server) cleanup_restore(server, virt=virt) + destroy_netpool(server, virt, net_name) return status if __name__ == "__main__": sys.exit(main()) From yunguol at cn.ibm.com Thu Jul 31 02:23:50 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 31 Jul 2008 10:23:50 +0800 Subject: [Libvirt-cim] [PATCH] [TEST] Call destroy_netpool() to remove the created netpool in tc In-Reply-To: <4890C05D.8030006@linux.vnet.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-31 03:26:21: > yunguol at cn.ibm.com wrote: > > # HG changeset patch > > # User Guolian Yun > > # Date 1217401967 25200 > > # Node ID 484734992819e58369974ac579a6c39c1bcd0cfa > > # Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb > > [TEST] Call destroy_netpool() to remove the created netpool in tc > > > > Signed-off-by: Guolian Yun > > > > diff -r 2efc46fd30f3 -r 484734992819 suites/libvirt- > cim/cimtest/ResourceAllocationFromPool/01_forward.py > > --- a/suites/libvirt- > cim/cimtest/ResourceAllocationFromPool/01_forward.py Wed Jul 23 > 17:42:47 2008 -0700 > > +++ b/suites/libvirt- > cim/cimtest/ResourceAllocationFromPool/01_forward.py Wed Jul 30 > 00:12:47 2008 -0700 > > @@ -33,7 +33,7 @@ > > from CimTest.Globals import logger, do_main > > from CimTest.ReturnCodes import PASS, FAIL, XFAIL > > from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ > > -create_netpool_conf > > +create_netpool_conf, destroy_netpool > > > > sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] > > > > @@ -152,6 +152,7 @@ > > break > > > > cleanup_restore(options.ip, options.virt) > > + destroy_netpool(options.ip, options.virt, test_network) > > vsxml.undefine(options.ip) > > return status > > This test uses the existing netpool, so you're deleting the existing one > if you add this call. > > What I suggest to do is fix the create_diskpool_conf() function so that > it creates a new netpool as the default. Then, you'll need to modify > all the tests that call create_diskpool_conf() to cleanup the netpool > when the test is done. > > And you'll need to change the tests that call create_diskpool_conf() > with a False argument. > > Thoughts? Cool. I will cool up a patch set for them. Thanks! > > > diff -r 2efc46fd30f3 -r 484734992819 suites/libvirt- > cim/cimtest/SettingsDefineCapabilities/01_forward.py > > --- a/suites/libvirt- > cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Jul 23 > 17:42:47 2008 -0700 > > +++ b/suites/libvirt- > cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Jul 30 > 00:12:47 2008 -0700 > > @@ -63,7 +63,7 @@ > > CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIATORS > > from XenKvmLib.classes import get_typed_class > > from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ > > -create_netpool_conf > > +create_netpool_conf, destroy_netpool > > from XenKvmLib.common_util import print_field_error > > > > platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC'] > > @@ -148,9 +148,9 @@ > > > > except Exception, detail: > > logger.error("Exception: %s", detail) > > - return FAIL, dpool, npool, mpool, ppool > > + return FAIL, dpool, npool, mpool, ppool, test_network > > > > - return PASS, dpool, npool, mpool, ppool > > + return PASS, dpool, npool, mpool, ppool, test_network > > > > This is a lot of values to return from a function. Can you re-write > this in such a way so that we return only a few values? I'd like to see > no more than 2 if possible. > > Thanks! > > -- > 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 Thu Jul 31 03:01:59 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Wed, 30 Jul 2008 20:01:59 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix the create_diskpool_conf() function to creates a new netpool as the default Message-ID: <66f3ea74ac3d93f77ca3.1217473319@elm3b217.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1217473313 25200 # Node ID 66f3ea74ac3d93f77ca3ca81eee75d080f27d558 # Parent fc92abb3ae7cab32dec6718412be1c0d88874a4a [TEST] Fix the create_diskpool_conf() function to creates a new netpool as the default Also, update ResourceAllocationFromPool.01 & 02 to cleanup the netpool when the test are done. Signed-off-by: Guolian Yun diff -r fc92abb3ae7c -r 66f3ea74ac3d suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Wed Jul 30 06:55:31 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Wed Jul 30 20:01:53 2008 -0700 @@ -33,7 +33,7 @@ from CimTest.Globals import logger, do_m from CimTest.Globals import logger, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ -create_netpool_conf +create_netpool_conf, destroy_netpool sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] @@ -152,6 +152,7 @@ def main(): break cleanup_restore(options.ip, options.virt) + destroy_netpool(options.ip, options.virt, test_network) vsxml.undefine(options.ip) return status diff -r fc92abb3ae7c -r 66f3ea74ac3d suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Wed Jul 30 06:55:31 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Wed Jul 30 20:01:53 2008 -0700 @@ -34,7 +34,7 @@ from CimTest.ReturnCodes import PASS, FA from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib import enumclass from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ -create_netpool_conf +create_netpool_conf, destroy_netpool sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] @@ -184,6 +184,7 @@ def main(): return status cleanup_restore(server, virt) + destroy_netpool(server, virt, test_network) vsxml.undefine(server) return status diff -r fc92abb3ae7c -r 66f3ea74ac3d suites/libvirt-cim/lib/XenKvmLib/common_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Wed Jul 30 06:55:31 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Wed Jul 30 20:01:53 2008 -0700 @@ -360,7 +360,7 @@ def create_diskpool_conf(server, virt): return status, diskid -def create_netpool_conf(server, virt, use_existing=True): +def create_netpool_conf(server, virt, use_existing=False): status = PASS test_network = None try: From yunguol at cn.ibm.com Thu Jul 31 04:12:25 2008 From: yunguol at cn.ibm.com (yunguol at cn.ibm.com) Date: Wed, 30 Jul 2008 21:12:25 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Rewrite get_pool_details() to return less valeus in SettingsDefineCapabilities.01 Message-ID: <780f9b713dcae42c3faf.1217477545@elm3b217.beaverton.ibm.com> # HG changeset patch # User Guolian Yun # Date 1217477534 25200 # Node ID 780f9b713dcae42c3faf0d73580c51c4c6d4a1e1 # Parent fc92abb3ae7cab32dec6718412be1c0d88874a4a [TEST] #2 Rewrite get_pool_details() to return less valeus in SettingsDefineCapabilities.01 Signed-off-by: Guolian Yun diff -r fc92abb3ae7c -r 780f9b713dca suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py --- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Jul 30 06:55:31 2008 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Jul 30 21:12:14 2008 -0700 @@ -63,7 +63,7 @@ CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIA CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIATORS from XenKvmLib.classes import get_typed_class from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ -create_netpool_conf +create_netpool_conf, destroy_netpool from XenKvmLib.common_util import print_field_error platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC'] @@ -130,27 +130,28 @@ def get_pool_info(virt, server, devid, p def get_pool_details(virt, server): dpool = npool = mpool = ppool = None + pool_set = [dpool, npool, mpool, ppool] try : status, diskid = create_diskpool_conf(server, virt) if status != PASS: - return status, dpool, npool, mpool, ppool + return status, pool_set, None dpool = get_pool_info(virt, server, diskid, poolname="DiskPool") mpool = get_pool_info(virt, server, memid, poolname= "MemoryPool") ppool = get_pool_info(virt, server, procid, poolname= "ProcessorPool") - + pool_set = [dpool, npool, mpool, ppool] status, test_network = create_netpool_conf(server, virt) if status != PASS: - return status, dpool, npool, mpool, ppool + return status, pool_set, None netid = "%s/%s" % ("NetworkPool", test_network) npool = get_pool_info(virt, server, netid, poolname= "NetworkPool") - + pool_set = [dpool, npool, mpool, ppool] except Exception, detail: logger.error("Exception: %s", detail) - return FAIL, dpool, npool, mpool, ppool + return FAIL, pool_set, test_network - return PASS, dpool, npool, mpool, ppool + return PASS, pool_set, test_network def verify_rasd_fields(loop, assoc_info, cllist, rtype, rangelist): for inst in assoc_info: @@ -200,14 +201,17 @@ def main(): server = options.ip virt = options.virt - status, dpool, npool, mpool, ppool = get_pool_details(virt, server) - if status != PASS or dpool.InstanceID == None or mpool.InstanceID == None \ - or npool.InstanceID == None or ppool.InstanceID == None: - cleanup_restore(server, virt) - return FAIL + status, pool_set, test_network = get_pool_details(virt, server) + for i in range(0, len(pool_set)): + if status != PASS or pool_set[i].InstanceID == None: + cleanup_restore(server, virt) + destroy_netpool(server, virt, test_network) + return FAIL - status = verify_sdc_with_ac(virt, server, dpool, npool, mpool, ppool) + status = verify_sdc_with_ac(virt, server, pool_set[0], pool_set[1], + pool_set[2], pool_set[3]) cleanup_restore(server, virt) + destroy_netpool(server, virt, test_network) return status if __name__ == "__main__": From deeptik at linux.vnet.ibm.com Thu Jul 31 06:02:21 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 31 Jul 2008 11:32:21 +0530 Subject: [Libvirt-cim] [PATCH 1 of 6] 1) Fixed get_cs_instance() debug statement In-Reply-To: <489086AE.3090201@linux.vnet.ibm.com> References: <489086AE.3090201@linux.vnet.ibm.com> Message-ID: <4891556D.6090009@linux.vnet.ibm.com> Kaitlin Rupert wrote: >> >> +def verify_err_desc(exp_rc, exp_desc, err_no, err_desc): >> + if err_no == exp_rc and err_desc.find(exp_desc) >= 0: >> + logger.info("Got expected exception where ") >> + logger.info("Errno is '%s' ", exp_rc) >> + logger.info("Error string is '%s'", exp_desc) >> + return PASS >> + else: >> + logger.error("Unexpected rc code %s and description %s\n", + >> (err_no, err_desc)) >> + return FAIL >> +\ > > I don't think we need to add this to a common library. The libraries > are becoming cluttered, and it's often difficult to tell what library > a function comes from. > > Checking an error description is fairly trivial and something that > each test case can handle as needed. The above statements which were moved are not used in the test cases, these were part of try_assoc() and try_getinstance() function in the library common_util.py. Also, something similar was needed by the try_request_state_change() function that I added to the common_util.py. I have just moved the repeating code to verify_err_desc(). Thanks and Regards, Deepti. From yunguol at cn.ibm.com Thu Jul 31 06:47:45 2008 From: yunguol at cn.ibm.com (Guo Lian Yun) Date: Thu, 31 Jul 2008 14:47:45 +0800 Subject: [Libvirt-cim] CimTest Report for KVM on F9 30-07-2008 In-Reply-To: <4890651E.7020303@linux.vnet.ibm.com> Message-ID: libvirt-cim-bounces at redhat.com wrote on 2008-07-30 20:57:02: > ======================================================================== > CIM Test Report for KVM on F9 with latest libvirt-cim and libcmpiutil > ======================================================================== > Distro : Fedora 9 Beta > Kernel : 2.6.25-0.121.rc5.git4.fc9 > Libvirt : libvirt-0.4.2-1.fc9.x86_64 > CIMOM : pegasus > PyWBEM : pywbem-0.6 > CIM Schema : cimv216Experimental > LibCMPIutil : 83 > LibVirtCIM : 651 > CIMTEST : 262 > ======================================================= > PASS : 113 > FAIL : 4 > XFAIL : 1 > SKIP : 12 > ----------------- > Total : 130 > ======================================================= > Here is one of the tc that failed > > ComputerSystemIndication - 01_created_indication.py: FAIL > ERROR - Waited too long for indication > Need to investigate into this. > Any more debug info? It passes for me. > VirtualSystemManagementService - 08_modifyresource.py: FAIL > ERROR - Got 0, exp 262144. > ERROR - Error invoking ModifyRS: mod_mem_res > ERROR - Error changing rs for mem > > VirtualSystemManagementService - 09_procrasd_persist.py: FAIL > ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed') > ERROR - Unable to start rstest_domain using RequestedStateChange() > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed > > > These above two test cases are failing since the tc is not able to > create a guest using the VSMS DefineSystem(). > This can be fixed if by passing appropriate values to the > AllocationUnits of MemRASD. > Will be sending a fix for the same shortly. > > VirtualSystemSettingDataComponent - 01_forward.py: FAIL > ERROR - Failed to define the dom: VSSDC_dom > Submitted fix for the above tc. > > Please find the complete report attached with the mail. > > Thanks and Regards, > Deepti. > > Starting test suite: libvirt-cim > Cleaned log files. > Testing KVM 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: PASS > ComputerSystem - 05_activate_defined_start.py: PASS > ComputerSystem - 06_paused_active_suspend.py: PASS > ComputerSystem - 22_define_suspend.py: PASS > ComputerSystem - 23_suspend_suspend.py: 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: 00001 > ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed') > ERROR - Exception: RequestedStateChange() could not be used to > start domain: 'test_domain' > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed > Bug:<00001> > ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP > ComputerSystem - 42_cs_gi_errs.py: PASS > ComputerSystemIndication - 01_created_indication.py: FAIL > ERROR - Waited too long for indication > ElementAllocatedFromPool - 01_forward.py: PASS > ElementAllocatedFromPool - 02_reverse.py: PASS > ElementAllocatedFromPool - 03_reverse_errs.py: PASS > ElementAllocatedFromPool - 04_forward_errs.py: PASS > ElementCapabilities - 01_forward.py: PASS > ElementCapabilities - 02_reverse.py: PASS > ElementCapabilities - 03_forward_errs.py: PASS > ElementCapabilities - 04_reverse_errs.py: PASS > ElementCapabilities - 05_hostsystem_cap.py: PASS > ElementConforms - 01_forward.py: PASS > ElementConforms - 02_reverse.py: PASS > ElementConforms - 03_ectp_fwd_errs.py: PASS > ElementConforms - 04_ectp_rev_errs.py: PASS > ElementSettingData - 01_forward.py: PASS > ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS > EnabledLogicalElementCapabilities - 01_enum.py: PASS > EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS > HostSystem - 01_enum.py: PASS > HostSystem - 02_hostsystem_to_rasd.py: PASS > HostSystem - 03_hs_to_settdefcap.py: PASS > HostSystem - 04_hs_to_EAPF.py: SKIP > HostSystem - 05_hs_gi_errs.py: PASS > HostSystem - 06_hs_to_vsms.py: PASS > HostedDependency - 01_forward.py: PASS > HostedDependency - 02_reverse.py: PASS > HostedDependency - 03_enabledstate.py: PASS > HostedDependency - 04_reverse_errs.py: PASS > HostedResourcePool - 01_forward.py: PASS > HostedResourcePool - 02_reverse.py: PASS > HostedResourcePool - 03_forward_errs.py: PASS > HostedResourcePool - 04_reverse_errs.py: PASS > HostedService - 01_forward.py: PASS > HostedService - 02_reverse.py: PASS > HostedService - 03_forward_errs.py: PASS > HostedService - 04_reverse_errs.py: PASS > LogicalDisk - 01_disk.py: PASS > LogicalDisk - 02_nodevs.py: PASS > LogicalDisk - 03_ld_gi_errs.py: PASS > Memory - 01_memory.py: PASS > Memory - 02_defgetmem.py: PASS > Memory - 03_mem_gi_errs.py: PASS > NetworkPort - 01_netport.py: PASS > NetworkPort - 02_np_gi_errors.py: PASS > NetworkPort - 03_user_netport.py: PASS > Processor - 01_processor.py: PASS > Processor - 02_definesys_get_procs.py: PASS > Processor - 03_proc_gi_errs.py: PASS > Profile - 01_enum.py: PASS > Profile - 02_profile_to_elec.py: SKIP > 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: PASS > ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS > ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS > SettingsDefine - 01_forward.py: PASS > SettingsDefine - 02_reverse.py: PASS > SettingsDefine - 03_sds_fwd_errs.py: PASS > SettingsDefine - 04_sds_rev_errs.py: PASS > SettingsDefineCapabilities - 01_forward.py: PASS > SettingsDefineCapabilities - 03_forward_errs.py: PASS > SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS > SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS > SystemDevice - 01_forward.py: PASS > SystemDevice - 02_reverse.py: PASS > SystemDevice - 03_fwderrs.py: PASS > VSSD - 01_enum.py: PASS > VSSD - 02_bootldr.py: SKIP > VSSD - 03_vssd_gi_errs.py: PASS > VSSD - 04_vssd_to_rasd.py: PASS > VirtualSystemManagementCapabilities - 01_enum.py: PASS > VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS > VirtualSystemManagementService - 01_definesystem_name.py: PASS > VirtualSystemManagementService - 02_destroysystem.py: PASS > VirtualSystemManagementService - 03_definesystem_ess.py: PASS > VirtualSystemManagementService - 04_definesystem_ers.py: PASS > VirtualSystemManagementService - 05_destroysystem_neg.py: PASS > VirtualSystemManagementService - 06_addresource.py: PASS > VirtualSystemManagementService - 07_addresource_neg.py: PASS > VirtualSystemManagementService - 08_modifyresource.py: FAIL > ERROR - Got 0, exp 262144. > ERROR - Error invoking ModifyRS: mod_mem_res > ERROR - Error changing rs for mem > VirtualSystemManagementService - 09_procrasd_persist.py: FAIL > ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed') > ERROR - Unable to start rstest_domain using RequestedStateChange() > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed > 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: FAIL > ERROR - Failed to define the dom: VSSDC_dom > VirtualSystemSettingDataComponent - 02_reverse.py: PASS > VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS > VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS > VirtualSystemSnapshotService - 01_enum.py: PASS > VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS > VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS > VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS > > _______________________________________________ > 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 Jul 31 07:54:46 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 31 Jul 2008 13:24:46 +0530 Subject: [Libvirt-cim] Re: Need CS state transition related info. In-Reply-To: <488F7715.4010205@linux.vnet.ibm.com> References: <488F0F1F.2030903@linux.vnet.ibm.com> <488F7715.4010205@linux.vnet.ibm.com> Message-ID: <48916FC6.7050809@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Deepti B Kalakeri wrote: >> >> Hi, >> >> I have following query regarding the CS provider state transition. >> >> 1) >> >> The following tc 32_start_reboot.py, which tries to use >> DefineSystem() to first define the VS and then change the state from >> Start to Reboot, fails for KVM with the following error. >> >> ComputerSystem - 32_start_reboot.py: FAIL >> ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed') >> ERROR - Unable to Reboot dom test_domain using RequestedStateChange() >> InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation >> Failed >> >> tc cannot be used to support KVM, because of the following debug >> statement >> >> *Virt_ComputerSystem.c(807): Reboot domain >> libvir: error : this function is not supported by the hypervisor: >> virDomainReboot* >> * >> *Is my analysis correct? > > What version of libvirt is this with? For KVM, we are more concerned > with newer version of libvirt. So this might be something we can get > fixed in libvirt. The previous version of the libvirt was 0.4.2. I updated the libvirt yesterday on my machine to 0.4.4. I still see the same error. Virt_ComputerSystem.c(807): Reboot domain libvir: error : this function is not supported by the hypervisor: virDomainReboot > >> >> 2) >> According to the state transition diagram in the DMTF VSP doc (Pg: >> 20) implies that a state transition from *Suspend* to *Active(through >> reboot) *is valid, >> but our provider returns an *exception. *What is the correct state >> transition to be considered? >> We can use 33_suspend_reboot.py tc to verify the same. > > This sounds like a bug.Can you capture the exception you're seeing and > send it to the external mailing list? I haven't had a chance today to > look into it. > Here is the provider exception that is thrown when the VS state is changed from suspend to reboot. ERROR - DETAILS IS (1, u'CIM_ERR_FAILED: Domain not running') InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain not running Thanks and Regards, Deepti. > Thanks! > From deeptik at linux.vnet.ibm.com Thu Jul 31 08:17:31 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 31 Jul 2008 13:47:31 +0530 Subject: [Libvirt-cim] [PATCH 5 of 6] 1) Added support for KVM In-Reply-To: <48908BA6.5090300@linux.vnet.ibm.com> References: <48908BA6.5090300@linux.vnet.ibm.com> Message-ID: <4891751B.2080008@linux.vnet.ibm.com> Kaitlin Rupert wrote: > >> - # undefine the vs >> - undefine_test_domain(default_dom, options.ip, options.virt) >> + if status != PASS: >> + destroy_netpool(server, virt, test_network) >> + destroy_and_undefine_domain(default_dom, server, virt) >> + return status >> >> + # Try to reboot the VS which is suspened >> + rq_state = REBOOT_STATE + status = >> try_request_state_change(default_dom, server, >> + rq_state, TIME, err_no, >> + err_desc, virt) >> + > > Also here, you don't verify the guest has been rebooted properly. Is > there a reason to pull this piece out of the loop? The test case returns an exception when we try to reboot VS when it is in suspended state. The part of the code in the loop which we execute is not suppose to return any exception. Hence the code in the loop and the one in try_request_state_change() cannot be combined together. Regarding validating the req_state value after try_request_state_change() can be done to make sure the state still remains the same as it was in before calling the RequestStateChange(). Thanks and Regards, Deepti. > > 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 From deeptik at linux.vnet.ibm.com Thu Jul 31 08:18:26 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 31 Jul 2008 13:48:26 +0530 Subject: [Libvirt-cim] [PATCH 3 of 6] 1) Added support for KVM In-Reply-To: <48908A43.3000602@linux.vnet.ibm.com> References: <8c8ec47bc8492eacc1f5.1217332619@elm3b193.beaverton.ibm.com> <48908A43.3000602@linux.vnet.ibm.com> Message-ID: <48917552.9040600@linux.vnet.ibm.com> Kaitlin Rupert wrote: >> - # undefine the vs >> - undefine_test_domain(default_dom, options.ip, options.virt) >> + if status != PASS: >> + destroy_netpool(server, virt, test_network) >> + destroy_and_undefine_domain(default_dom, server, virt) >> + return status >> + >> + # try to suspend already suspended VS >> + rq_state = SUSPND_STATE >> + status = try_request_state_change(default_dom, server, >> + rq_state, TIME, err_no, + err_desc, virt) > > I'm not sure I see the benefit of this change. You're not verifying > the state of the guest. > > It's possible for RequestStateChange() to return a success and for the > guest to be in an unexpected state. This particular test case was previously written with the assumption that moving an already suspended VS to suspend state will not return any exception from the provider and is a valid state transition. But this is not true anymore. Also, the the above test case used to XFAIL sometime back because of the problem in RequestedStateChange() bug. The provider now returns an exception when we try to suspend the VS which is already in suspended state. The exception is checked in the try_request_state_change() library function. The part of the code in the loop which we execute is not suppose to return any exception. Hence the code in the loop and the one in try_request_state_change() cannot be combined together. Regarding validating the req_state value after try_request_state_change() can be done to make sure the state still remains the same as it was in before calling the RequestStateChange(). Thanks and Regards, Deepti. > > >> + >> + destroy_netpool(server, virt, test_network) >> + destroy_and_undefine_domain(default_dom, server, virt) >> >> return status > From deeptik at linux.vnet.ibm.com Thu Jul 31 12:37:07 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 31 Jul 2008 18:07:07 +0530 Subject: [Libvirt-cim] Issue with DiskRASD size parameter on KVM with current sources. In-Reply-To: <3c80ea156a3c45bc321f.1217005491@guaranine.danplanet.com> References: <3c80ea156a3c45bc321f.1217005491@guaranine.danplanet.com> Message-ID: <4891B1F3.9020200@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1217005489 25200 > # Node ID 3c80ea156a3c45bc321f9c465ba7692c011ab2e0 > # Parent 2972728363defd7c9a7683ebfa85a4dfc8225e32 > [TEST] Add test for DiskRASD size parameter > > Signed-off-by: Dan Smith > > diff -r 2972728363de -r 3c80ea156a3c suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py Fri Jul 25 10:04:49 2008 -0700 > @@ -0,0 +1,127 @@ > +#!/usr/bin/python > +# > +# Copyright 2008 IBM Corp. > +# > +# Authors: > +# Dan Smith > +# > +# 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 > +# > + > +sup_types = ['Xen', 'XenFV', 'KVM'] > +default_dom = "diskrasd_test" > + > +import sys > + > +from CimTest.ReturnCodes import FAIL, PASS > +from CimTest.Globals import do_main > +from CimTest.Globals import logger > +from VirtLib import utils > +from XenKvmLib.test_doms import undefine_test_domain > +from XenKvmLib.common_util import create_using_definesystem > +from XenKvmLib import vsms > +from XenKvmLib import enumclass > + > +def make_image(ip, size): > + s, fn = utils.run_remote(ip, "mktemp") > + if s != 0: > + return None > + > + s, _ = utils.run_remote(ip, > + "dd if=/dev/zero of=%s bs=1 count=%i" % (fn, size)) > + if s != 0: > + return None > + > + return fn > + > +def kill_image(ip, name): > + s, _ = utils.run_remote(ip, "rm -f %s" % name) > + > + return s == 0 > + > +def check_rasd_size(rasd, size): > + if rasd["AllocationUnits"] != "Bytes": > + logger.error("AllocationUnits != Bytes?") > + return FAIL This test case fails with the current source on KVM. KVM_DiskRASD is not able to fetch the *AllocationUnits and VirtualQuantity *on F9 for KVM. Here is the xml file that I used to define the guest : f07987b1-6a8b-4b65-bff3-41dc54c011df diskrasd_test destroy destroy hvm 32768 32768 Here is the KVM_DiskRASD value for the above guest. wbemcli gi http://root:p at localhost:5988/root/virt:KVM_DiskResourceAllocationSettingData.InstanceID="diskrasd_test/hda" -nl localhost:5988/root/virt:KVM_DiskResourceAllocationSettingData.InstanceID="diskrasd_test/hda" -Caption -Description -InstanceID="diskrasd_test/hda" -ElementName -ConfigurationName -ChangeableType -ResourceType=17 -OtherResourceType -ResourceSubType -PoolID -ConsumerVisibility -HostResource *-AllocationUnits -VirtualQuantity *-Reservation -Limit -Weight -AutomaticAllocation -AutomaticDeallocation -Parent -Connection -Address="/tmp/tmp.RAKm7sLnUF" -MappingBehavior -VirtualDevice="hda" The details of the disk image used to define the guest is as below: *ll /tmp/tmp.RAKm7sLnUF -rw------- 1 root root 125952 2008-07-31 22:34 /tmp/tmp.RAKm7sLnUF *I suppose the value of *125952 *should be filled in *VirtualQuantity *field ?? While *AllocationUnits and VirtualQuantity* value is being set properly for Xen/XenFV. Since the test case has been accepted I am not sure if this is problem only on my machine. Thanks and Regards, Deepti. From deeptik at linux.vnet.ibm.com Thu Jul 31 13:16:35 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 31 Jul 2008 18:46:35 +0530 Subject: [Libvirt-cim] Re: Issue with DiskRASD size parameter on KVM with current sources. In-Reply-To: <4891B1F3.9020200@linux.vnet.ibm.com> References: <3c80ea156a3c45bc321f.1217005491@guaranine.danplanet.com> <4891B1F3.9020200@linux.vnet.ibm.com> Message-ID: <4891BB33.2040305@linux.vnet.ibm.com> The revision of the libvirt-cim on my machines is 651. Thanks and Regards, Deepti. Deepti B Kalakeri wrote: > > > Dan Smith wrote: >> # HG changeset patch >> # User Dan Smith >> # Date 1217005489 25200 >> # Node ID 3c80ea156a3c45bc321f9c465ba7692c011ab2e0 >> # Parent 2972728363defd7c9a7683ebfa85a4dfc8225e32 >> [TEST] Add test for DiskRASD size parameter >> >> Signed-off-by: Dan Smith >> >> diff -r 2972728363de -r 3c80ea156a3c >> suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py Fri Jul 25 >> 10:04:49 2008 -0700 >> @@ -0,0 +1,127 @@ >> +#!/usr/bin/python >> +# >> +# Copyright 2008 IBM Corp. >> +# >> +# Authors: >> +# Dan Smith >> +# >> +# 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 >> +# >> + >> +sup_types = ['Xen', 'XenFV', 'KVM'] >> +default_dom = "diskrasd_test" >> + >> +import sys >> + >> +from CimTest.ReturnCodes import FAIL, PASS >> +from CimTest.Globals import do_main >> +from CimTest.Globals import logger >> +from VirtLib import utils >> +from XenKvmLib.test_doms import undefine_test_domain >> +from XenKvmLib.common_util import create_using_definesystem >> +from XenKvmLib import vsms >> +from XenKvmLib import enumclass >> + >> +def make_image(ip, size): >> + s, fn = utils.run_remote(ip, "mktemp") >> + if s != 0: >> + return None >> + >> + s, _ = utils.run_remote(ip, >> + "dd if=/dev/zero of=%s bs=1 count=%i" % (fn, size)) >> + if s != 0: >> + return None >> + >> + return fn >> + >> +def kill_image(ip, name): >> + s, _ = utils.run_remote(ip, "rm -f %s" % name) >> + >> + return s == 0 >> + >> +def check_rasd_size(rasd, size): >> + if rasd["AllocationUnits"] != "Bytes": >> + logger.error("AllocationUnits != Bytes?") >> + return FAIL > This test case fails with the current source on KVM. > KVM_DiskRASD is not able to fetch the *AllocationUnits and > VirtualQuantity *on F9 for KVM. > Here is the xml file that I used to define the guest : > > > f07987b1-6a8b-4b65-bff3-41dc54c011df > diskrasd_test > destroy > destroy > > hvm > > > 32768 > 32768 > > > > > > > > > > Here is the KVM_DiskRASD value for the above guest. > > wbemcli gi > http://root:p at localhost:5988/root/virt:KVM_DiskResourceAllocationSettingData.InstanceID="diskrasd_test/hda" > -nl > localhost:5988/root/virt:KVM_DiskResourceAllocationSettingData.InstanceID="diskrasd_test/hda" > > -Caption > -Description > -InstanceID="diskrasd_test/hda" > -ElementName > -ConfigurationName > -ChangeableType > -ResourceType=17 > -OtherResourceType > -ResourceSubType > -PoolID > -ConsumerVisibility > -HostResource > *-AllocationUnits > -VirtualQuantity > *-Reservation > -Limit > -Weight > -AutomaticAllocation > -AutomaticDeallocation > -Parent > -Connection > -Address="/tmp/tmp.RAKm7sLnUF" > -MappingBehavior > -VirtualDevice="hda" > > The details of the disk image used to define the guest is as below: > *ll /tmp/tmp.RAKm7sLnUF > -rw------- 1 root root 125952 2008-07-31 22:34 /tmp/tmp.RAKm7sLnUF > > *I suppose the value of *125952 *should be filled in *VirtualQuantity > *field ?? > While *AllocationUnits and VirtualQuantity* value is being set > properly for Xen/XenFV. > > Since the test case has been accepted I am not sure if this is problem > only on my machine. > > Thanks and Regards, > Deepti. From kaitlin at linux.vnet.ibm.com Thu Jul 31 13:46:02 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 31 Jul 2008 06:46:02 -0700 Subject: [Libvirt-cim] [PATCH 1 of 6] 1) Fixed get_cs_instance() debug statement In-Reply-To: <4891556D.6090009@linux.vnet.ibm.com> References: <489086AE.3090201@linux.vnet.ibm.com> <4891556D.6090009@linux.vnet.ibm.com> Message-ID: <4891C21A.60202@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > > > Kaitlin Rupert wrote: >>> >>> +def verify_err_desc(exp_rc, exp_desc, err_no, err_desc): >>> + if err_no == exp_rc and err_desc.find(exp_desc) >= 0: >>> + logger.info("Got expected exception where ") >>> + logger.info("Errno is '%s' ", exp_rc) >>> + logger.info("Error string is '%s'", exp_desc) >>> + return PASS >>> + else: >>> + logger.error("Unexpected rc code %s and description %s\n", + >>> (err_no, err_desc)) >>> + return FAIL >>> +\ >> >> I don't think we need to add this to a common library. The libraries >> are becoming cluttered, and it's often difficult to tell what library >> a function comes from. >> >> Checking an error description is fairly trivial and something that >> each test case can handle as needed. > > The above statements which were moved are not used in the test cases, > these were part of try_assoc() and try_getinstance() function in the > library common_util.py. > Also, something similar was needed by the try_request_state_change() > function that I added to the common_util.py. > I have just moved the repeating code to verify_err_desc(). > Ah, oops. My mistake. That's fine then. Ignore my original comment. =) -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Jul 31 13:57:20 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 31 Jul 2008 06:57:20 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Fixing the tc 08_modifyresource.py and updating the others to accomdate the AllocationUnits field changes In-Reply-To: Message-ID: <75b131d1d9bf499d5da5.1217512640@elm3b193.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1217512627 25200 # Node ID 75b131d1d9bf499d5da56c8ff66327d32f026a7f # Parent 6cc6d0b3dbbacba5eaa5faf9e7cbef1fb24f4f78 [TEST] Fixing the tc 08_modifyresource.py and updating the others to accomdate the AllocationUnits field changes. The changes are tested with KVM, Xen , XenFV on the current sources. Signed-off-by: Deepti B. Kalakeri diff -r 6cc6d0b3dbba -r 75b131d1d9bf suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py --- a/suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py Thu Jul 31 06:52:50 2008 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py Thu Jul 31 06:57:07 2008 -0700 @@ -78,7 +78,7 @@ drasd = drasd_class("hda", temp, default_dom) mrasd_class = vsms.get_masd_class(options.virt) - mrasd = mrasd_class(32, default_dom) + mrasd = mrasd_class(32, "MegaBytes", default_dom) params = { "vssd" : vssd.mof(), diff -r 6cc6d0b3dbba -r 75b131d1d9bf suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py Thu Jul 31 06:52:50 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py Thu Jul 31 06:57:07 2008 -0700 @@ -41,6 +41,7 @@ cpu = 2 ncpu = 1 nmem = 256 +munits = "Megabytes" def cleanup_env(ip, virt, cxml, net_name): destroy_netpool(ip, virt, net_name) @@ -68,7 +69,9 @@ mac=cxml.xml_get_net_mac(), name=default_dom, virt_net=net_name) - masd = vsms.get_masd_class(options.virt)(megabytes=nmem, name=default_dom) + masd = vsms.get_masd_class(options.virt)(megabytes=nmem, + mallocunits=munits, + name=default_dom) pasd = vsms.get_pasd_class(options.virt)(vcpu=ncpu, name=default_dom) status = FAIL diff -r 6cc6d0b3dbba -r 75b131d1d9bf suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Thu Jul 31 06:52:50 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Thu Jul 31 06:57:07 2008 -0700 @@ -47,9 +47,8 @@ def try_define(options, vssd, units, value): mrasd_class = vsms.get_masd_class(options.virt) - mrasd = mrasd_class(None, default_dom) + mrasd = mrasd_class(None, units, default_dom) - mrasd.AllocationUnits = units mrasd.VirtualQuantity = value params = { From deeptik at linux.vnet.ibm.com Thu Jul 31 13:57:19 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 31 Jul 2008 06:57:19 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Adding AllocationUnits field to MemRASD and updating the call to MemRASD in the libraries where it is accessed In-Reply-To: Message-ID: <6cc6d0b3dbbacba5eaa5.1217512639@elm3b193.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1217512370 25200 # Node ID 6cc6d0b3dbbacba5eaa5faf9e7cbef1fb24f4f78 # Parent fc92abb3ae7cab32dec6718412be1c0d88874a4a [TEST] Adding AllocationUnits field to MemRASD and updating the call to MemRASD in the libraries where it is accessed. These changes are required to accomdate the recent RASD provider changes. The changes are tested with KVM, Xen , XenFV on the current sources. Signed-off-by: Deepti B. Kalakeri diff -r fc92abb3ae7c -r 6cc6d0b3dbba suites/libvirt-cim/lib/XenKvmLib/const.py --- a/suites/libvirt-cim/lib/XenKvmLib/const.py Wed Jul 30 06:55:31 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Thu Jul 31 06:52:50 2008 -0700 @@ -49,6 +49,7 @@ default_domname = 'domU1' default_memory = 128 default_vcpus = 1 +default_mallocunits="MegaBytes" _image_dir = '/tmp' diff -r fc92abb3ae7c -r 6cc6d0b3dbba suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Jul 30 06:55:31 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Thu Jul 31 06:52:50 2008 -0700 @@ -203,11 +203,14 @@ pass class CIM_MemResourceAllocationSettingData(CIMClassMOF): - def __init__(self, megabytes, name): + def __init__(self, megabytes, mallocunits, name): self.ResourceType = RASD_TYPE_MEM if megabytes != None: self.VirtualQuantity = megabytes + + if mallocunits != None: + self.AllocationUnits = mallocunits if name != None: self.InstanceID = '%s/mem' % name @@ -232,6 +235,7 @@ net_mac=const.Xen_default_mac, proc_vcpu=1, mem_mb=512, + malloc_units="MegaBytes", virt='Xen'): class_vssd = get_vssd_class(virt) vssd = class_vssd(name=dom_name, virt=virt) @@ -258,6 +262,7 @@ class_masd = get_masd_class(virt) m = class_masd( megabytes=mem_mb, + mallocunits=malloc_units, name=dom_name) if virt == 'LXC': return vssd.mof(), [d.mof(), m.mof()] diff -r fc92abb3ae7c -r 6cc6d0b3dbba suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Jul 30 06:55:31 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Thu Jul 31 06:52:50 2008 -0700 @@ -498,7 +498,7 @@ class VirtCIM: def __init__(self, virt, dom_name, disk_dev, disk_source, - net_type, net_mac, vcpus, mem): + net_type, net_mac, vcpus, mem, mem_allocunits): self.virt = virt self.domain_name = dom_name self.vssd = vsms.get_vssd_class(virt)(name=dom_name, virt=virt) @@ -509,7 +509,9 @@ 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) + self.masd = vsms.get_masd_class(virt)(megabytes=mem, + mallocunits=mem_allocunits, + name=dom_name) def cim_define(self, ip): service = vsms.get_vsms_class(self.virt)(ip) @@ -552,6 +554,7 @@ def __init__(self, test_dom=const.default_domname, mem=const.default_memory, + mem_allocunits=const.default_mallocunits, vcpus=const.default_vcpus, mac=const.Xen_default_mac, disk_file_path=const.Xen_disk_path, @@ -567,7 +570,7 @@ self._devices(disk_file_path, disk, ntype, mac) VirtCIM.__init__(self, 'Xen', test_dom, disk, disk_file_path, - ntype, mac, vcpus, mem) + ntype, mac, vcpus, mem, mem_allocunits) def _os(self, os_kernel, os_initrd): os = self.get_node('/domain/os') From deeptik at linux.vnet.ibm.com Thu Jul 31 13:57:18 2008 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 31 Jul 2008 06:57:18 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] Adding AllocationUnits field to MemRASD and updating the call to MemRASD in the libraries where it is accessed. Message-ID: From deeptik at linux.vnet.ibm.com Thu Jul 31 14:12:08 2008 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 31 Jul 2008 19:42:08 +0530 Subject: [Libvirt-cim] CimTest Report on XenFV 31-07-2008 Message-ID: <4891C838.5000102@linux.vnet.ibm.com> ====================================== CIM Test Report for XenFV ====================================== Distro : RHEL 5.2 Beta Kernel : 2.6.18-88.el5xen Xen version : 3.1.2-88.el5 Libvirt : libvirt-0.3.3-7.el5 CIMOM : pegasus PyWBEM : pywbem-3.14 CIM Schema : cimv216Experimental LibCMPIutil : 83 LibVirtCIM : 654 CIMTEST : 270 ====================================== PASS : 112 TOTAL FAILED : 12 [6 test cases passed when ran manually] ACTUAL FAILED : 6 XFAIL : 2 SKIP : 7 ------------------- Total : 133 ====================================== List of tc that are failing: ComputerSystem - 06_paused_active_suspend.py: FAIL Will send fix for the same. ComputerSystem - 23_suspend_suspend.py: FAIL ComputerSystem - 32_start_reboot.py: FAIL ComputerSystem - 33_suspend_reboot.py: FAIL ComputerSystem - 35_start_reset.py: FAIL The fix for the above is under review. VirtualSystemManagementService - 08_modifyresource.py: FAIL Unable to get vcpuinfo from virsh, using XML values INFO - good status for vcpu ERROR - Got 0, exp 262144. ERROR - Error invoking ModifyRS: mod_mem_res ERROR - Error changing rs for mem Fixing AllocationUnits = "MegaBytes" in vsms.py will fix this. Fix sent for the same. The following tc passed when run manually: LogicalDisk - 02_nodevs.py: FAIL LogicalDisk - 03_ld_gi_errs.py: FAIL Memory - 01_memory.py: FAIL NetworkPort - 01_netport.py: FAIL VSSD - 04_vssd_to_rasd.py: FAIL VirtualSystemManagementService - 09_procrasd_persist.py: FAIL Please find the complete report attached with the mail. Thanks and Regards, Deepti. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: July31-XenFV-report URL: From jfehlig at novell.com Thu Jul 31 14:56:42 2008 From: jfehlig at novell.com (Jim Fehlig) Date: Thu, 31 Jul 2008 08:56:42 -0600 Subject: [Libvirt-cim] [PATCH 0 of 2] Make ComputerSystem.EnabledState aware of snapshot In-Reply-To: References: Message-ID: <4891D2AA.6000009@novell.com> Dan Smith wrote: > This makes the state of a guest appear to be suspended if there is a snapshot > for the domain and the domain is offline. This also makes sure to prevent > the user from starting the domain when such a snapshot exists, to force them > to either apply or delete the snapshot. > +1 Just so I'm clear, CS.RequestStateChange(6==offline) will not suspend (aka save) the vm. This appears to be the case after a quick look at __state_change in Virt_ComputerSystem.c. In fact, RSC(6) would result in CMPI_RC_ERR_NOT_SUPPORTED. I assume this is noted in the capabilities :-). In order to do the equivalent of e.g. "xm save" in xen, one would invoke CreateSnapshot(). Following the operation, state would be suspended. To "restore", invoke ApplySnapshot(). Is this correct? Thanks, Jim From danms at us.ibm.com Thu Jul 31 14:59:44 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 31 Jul 2008 07:59:44 -0700 Subject: [Libvirt-cim] Re: Issue with DiskRASD size parameter on KVM with current sources. In-Reply-To: <4891BB33.2040305@linux.vnet.ibm.com> (Deepti B. Kalakeri's message of "Thu, 31 Jul 2008 18:46:35 +0530") References: <3c80ea156a3c45bc321f.1217005491@guaranine.danplanet.com> <4891B1F3.9020200@linux.vnet.ibm.com> <4891BB33.2040305@linux.vnet.ibm.com> Message-ID: <877ib2yu8v.fsf@caffeine.beaverton.ibm.com> DK> The revision of the libvirt-cim on my machines is 651. The changeset that added this functionality is 652, so please upgrade... :) -- 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 Jul 31 15:30:17 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 31 Jul 2008 08:30:17 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Make ComputerSystem.EnabledState aware of snapshot In-Reply-To: <4891D2AA.6000009@novell.com> (Jim Fehlig's message of "Thu, 31 Jul 2008 08:56:42 -0600") References: <4891D2AA.6000009@novell.com> Message-ID: <873alqysty.fsf@caffeine.beaverton.ibm.com> JF> Just so I'm clear, CS.RequestStateChange(6==offline) will not JF> suspend (aka save) the vm. This appears to be the case after a JF> quick look at __state_change in Virt_ComputerSystem.c. In fact, JF> RSC(6) would result in CMPI_RC_ERR_NOT_SUPPORTED. Correct. JF> I assume this is noted in the capabilities :-). It is. JF> In order to do the equivalent of e.g. "xm save" in xen, one would JF> invoke CreateSnapshot(). Following the operation, state would be JF> suspended. To "restore", invoke ApplySnapshot(). Is this JF> correct? That's correct. When libvirt supports coordinated disk/memory snapshots for things like KVM, the extra level of indirection will make more sense, I think. 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 Thu Jul 31 16:02:20 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 31 Jul 2008 09:02:20 -0700 Subject: [Libvirt-cim] [PATCH 3 of 6] 1) Added support for KVM In-Reply-To: <48917552.9040600@linux.vnet.ibm.com> References: <8c8ec47bc8492eacc1f5.1217332619@elm3b193.beaverton.ibm.com> <48908A43.3000602@linux.vnet.ibm.com> <48917552.9040600@linux.vnet.ibm.com> Message-ID: <4891E20C.3030408@linux.vnet.ibm.com> >>> + >>> + # try to suspend already suspended VS >>> + rq_state = SUSPND_STATE >>> + status = try_request_state_change(default_dom, server, >>> + rq_state, TIME, err_no, + err_desc, virt) >> >> I'm not sure I see the benefit of this change. You're not verifying >> the state of the guest. >> >> It's possible for RequestStateChange() to return a success and for the >> guest to be in an unexpected state. > This particular test case was previously written with the assumption > that moving an already suspended VS to suspend state will not return any > exception from the provider and is a valid state transition. But this is > not true anymore. Also, the the above test case used to XFAIL sometime > back because of the problem in RequestedStateChange() bug. > The provider now returns an exception when we try to suspend the VS > which is already in suspended state. The exception is checked in the > try_request_state_change() library function. > The part of the code in the loop which we execute is not suppose to > return any exception. Hence the code in the loop and the one in > try_request_state_change() cannot be combined together. > Regarding validating the req_state value after > try_request_state_change() can be done to make sure the state still > remains the same as it was in before calling the RequestStateChange(). I was thinking that all of the calls to RSC() should be handled the same way - because any call to RSC() could potentially cause an exception or an error. But in the case where you call suspend twice in a row, you don't have an easy way of distinguishing between the first suspend call and the second. So my logic fails here. You need some way to distinguish the two calls, and this works in that case. So I'm fine with this approach. ;) -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From danms at us.ibm.com Thu Jul 31 16:07:23 2008 From: danms at us.ibm.com (Dan Smith) Date: Thu, 31 Jul 2008 09:07:23 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Adding AllocationUnits field to MemRASD and updating the call to MemRASD in the libraries where it is accessed In-Reply-To: <6cc6d0b3dbbacba5eaa5.1217512639@elm3b193.beaverton.ibm.com> (Deepti B. Kalakeri's message of "Thu, 31 Jul 2008 06:57:19 -0700") References: <6cc6d0b3dbbacba5eaa5.1217512639@elm3b193.beaverton.ibm.com> Message-ID: <87y73ixcjo.fsf@caffeine.beaverton.ibm.com> DK> + def __init__(self, megabytes, mallocunits, name): DK> self.ResourceType = RASD_TYPE_MEM DK> if megabytes != None: DK> self.VirtualQuantity = megabytes DK> + DK> + if mallocunits != None: DK> + self.AllocationUnits = mallocunits These should be parameters with default values. The way you have it now, the caller must specify something for each, and if they don't, you create an invalid RASD. For example: class_masd(None, None, "foo") succeeds, but passes none of the required information in the RASD. A definition like this would be better: def __init__(self, name, megabytes=128, mallocunits="MegaBytes") So that someone can call it in any of the following ways: masd_class("foo") masd_class("foo", 256) masd_class("foo", 131076, "KiloBytes") Doing it this way will avoid the need to change every use of this function in places that don't need to know about whatever new parameter you add next time. -- 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 Jul 31 20:29:16 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 31 Jul 2008 13:29:16 -0700 Subject: [Libvirt-cim] Re: Need CS state transition related info. In-Reply-To: <48916FC6.7050809@linux.vnet.ibm.com> References: <488F0F1F.2030903@linux.vnet.ibm.com> <488F7715.4010205@linux.vnet.ibm.com> <48916FC6.7050809@linux.vnet.ibm.com> Message-ID: <4892209C.1010509@linux.vnet.ibm.com> >>> 1) >>> >>> The following tc 32_start_reboot.py, which tries to use >>> DefineSystem() to first define the VS and then change the state from >>> Start to Reboot, fails for KVM with the following error. >>> >>> ComputerSystem - 32_start_reboot.py: FAIL >>> ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed') >>> ERROR - Unable to Reboot dom test_domain using RequestedStateChange() >>> InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation >>> Failed >>> >>> tc cannot be used to support KVM, because of the following debug >>> statement >>> >>> *Virt_ComputerSystem.c(807): Reboot domain >>> libvir: error : this function is not supported by the hypervisor: >>> virDomainReboot* >>> * >>> *Is my analysis correct? >> >> What version of libvirt is this with? For KVM, we are more concerned >> with newer version of libvirt. So this might be something we can get >> fixed in libvirt. > The previous version of the libvirt was 0.4.2. I updated the libvirt > yesterday on my machine to 0.4.4. > I still see the same error. > Virt_ComputerSystem.c(807): Reboot domain > libvir: error : this function is not supported by the hypervisor: > virDomainReboot I was unable to catch up with the libvirt folks about this issue. However, we can handle this with the providers (instead of using the libvirt API call directly). I'd consider this test an XFAIL in the KVM case. >> >>> >>> 2) >>> According to the state transition diagram in the DMTF VSP doc (Pg: >>> 20) implies that a state transition from *Suspend* to *Active(through >>> reboot) *is valid, >>> but our provider returns an *exception. *What is the correct state >>> transition to be considered? >>> We can use 33_suspend_reboot.py tc to verify the same. >> >> This sounds like a bug.Can you capture the exception you're seeing and >> send it to the external mailing list? I haven't had a chance today to >> look into it. >> > Here is the provider exception that is thrown when the VS state is > changed from suspend to reboot. > > ERROR - DETAILS IS (1, u'CIM_ERR_FAILED: Domain not running') > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain not running > This is an issue I addressed in a patch I sent out last week. I need to make some modifications to that patch still. So this one is a provider bug. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Jul 31 21:46:16 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 31 Jul 2008 14:46:16 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Rewrite get_pool_details() to return less valeus in SettingsDefineCapabilities.01 In-Reply-To: <780f9b713dcae42c3faf.1217477545@elm3b217.beaverton.ibm.com> References: <780f9b713dcae42c3faf.1217477545@elm3b217.beaverton.ibm.com> Message-ID: <489232A8.6020703@linux.vnet.ibm.com> yunguol at cn.ibm.com wrote: > # HG changeset patch > # User Guolian Yun > # Date 1217477534 25200 > # Node ID 780f9b713dcae42c3faf0d73580c51c4c6d4a1e1 > # Parent fc92abb3ae7cab32dec6718412be1c0d88874a4a > [TEST] #2 Rewrite get_pool_details() to return less valeus in SettingsDefineCapabilities.01 > > Signed-off-by: Guolian Yun > > diff -r fc92abb3ae7c -r 780f9b713dca suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py > --- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Jul 30 06:55:31 2008 -0700 > +++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Jul 30 21:12:14 2008 -0700 > @@ -63,7 +63,7 @@ CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIA > CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIATORS > from XenKvmLib.classes import get_typed_class > from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ > -create_netpool_conf > +create_netpool_conf, destroy_netpool > from XenKvmLib.common_util import print_field_error > > platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC'] > @@ -130,27 +130,28 @@ def get_pool_info(virt, server, devid, p > > def get_pool_details(virt, server): > dpool = npool = mpool = ppool = None > + pool_set = [dpool, npool, mpool, ppool] This will cause the length of pool_set to be 4. You'll want to something like: pool_set = [] > try : > status, diskid = create_diskpool_conf(server, virt) > if status != PASS: > - return status, dpool, npool, mpool, ppool > + return status, pool_set, None > > dpool = get_pool_info(virt, server, diskid, poolname="DiskPool") > mpool = get_pool_info(virt, server, memid, poolname= "MemoryPool") > ppool = get_pool_info(virt, server, procid, poolname= "ProcessorPool") > - > + pool_set = [dpool, npool, mpool, ppool] You do this assignment twice in this function. I'd remove this one. > status, test_network = create_netpool_conf(server, virt) > if status != PASS: > - return status, dpool, npool, mpool, ppool > + return status, pool_set, None > > netid = "%s/%s" % ("NetworkPool", test_network) > npool = get_pool_info(virt, server, netid, poolname= "NetworkPool") > - > + pool_set = [dpool, npool, mpool, ppool] > except Exception, detail: > logger.error("Exception: %s", detail) > - return FAIL, dpool, npool, mpool, ppool > + return FAIL, pool_set, test_network > > - return PASS, dpool, npool, mpool, ppool > + return PASS, pool_set, test_network > > def verify_rasd_fields(loop, assoc_info, cllist, rtype, rangelist): > for inst in assoc_info: > @@ -200,14 +201,17 @@ def main(): > server = options.ip > virt = options.virt > > - status, dpool, npool, mpool, ppool = get_pool_details(virt, server) > - if status != PASS or dpool.InstanceID == None or mpool.InstanceID == None \ > - or npool.InstanceID == None or ppool.InstanceID == None: > - cleanup_restore(server, virt) > - return FAIL > + status, pool_set, test_network = get_pool_details(virt, server) > + for i in range(0, len(pool_set)): > + if status != PASS or pool_set[i].InstanceID == None: Since you return the status variable from get_pool_details(), you should check the status between looping through the array values. I'm not sure you need this loop here. Instead, in get_pool_details(), you should check to make sure the instance returned from get_pool_info() isn't None. > + cleanup_restore(server, virt) > + destroy_netpool(server, virt, test_network) > + return FAIL > > - status = verify_sdc_with_ac(virt, server, dpool, npool, mpool, ppool) > + status = verify_sdc_with_ac(virt, server, pool_set[0], pool_set[1], > + pool_set[2], pool_set[3]) verify_sdc_with_ac() can now just take pool_set and virt as arguments, no need to pass each value of the array as a separate param. > cleanup_restore(server, virt) -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Jul 31 22:26:06 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 31 Jul 2008 15:26:06 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Update ElementConforms 02 to use check_virsh_poll() work around In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1217542648 25200 # Node ID b53b5a20e8f561366ff90f2156ad6d26d90b5d1b # Parent d0c5bdff331b674690f973a70d4ef00878e484f4 Update ElementConforms 02 to use check_virsh_poll() work around. Also clean this test case some. Signed-off-by: Kaitlin Rupert diff -r d0c5bdff331b -r b53b5a20e8f5 suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py --- a/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Thu Jul 31 15:17:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Thu Jul 31 15:17:28 2008 -0700 @@ -52,6 +52,7 @@ from XenKvmLib.vxml import XenXML, KVMXML, get_class from XenKvmLib.classes import get_typed_class from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.common_util import check_virsh_poll, get_cs_instance sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] @@ -96,51 +97,41 @@ inst_list = [] + rc, cs = get_cs_instance(test_dom, options.ip, options.virt) + if rc != 0: + sys = check_virsh_poll(options.ip, options.virt, test_dom) + if sys is None: + logger.error("Instance for %s not created" % test_dom) + return FAIL + + inst_list.append(sys) + try: - 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: - logger.error("ERROR: Wrong number of instances returned") - return status - for item in cs_list: - if item.Name == test_dom: - inst_list.append(item) - break - - if len(inst_list) != 1: - logger.error("ERROR: Instance for %s not created" % test_dom) - return status - #Getting the hostname, to verify with the value returned by the assoc. host_sys = hostsystem.enumerate(options.ip, options.virt) if len(host_sys) < 1: logger.error("ERROR: Enumerate returned 0 host instances") - return status - elif host_sys[0].Name == "": - logger.error("ERROR: HostName seems to be empty") - return status - else: - # Instance of the HostSystem - inst_list.append(host_sys[0]) - except Exception , detail: - logger.error("Exception: %s" % detail) - return status + return FAIL + + inst_list.append(host_sys[0]) + + except Exception, details: + logger.error("Exception: %s" % details) + return FAIL prev_namespace = Globals.CIM_NS Globals.CIM_NS = 'root/interop' try: key_list = ["InstanceID"] - proflist = enumclass.enumerate(options.ip, \ - "RegisteredProfile", \ + proflist = enumclass.enumerate(options.ip, + "RegisteredProfile", key_list, options.virt) - except Exception, detail: - logger.error(CIM_ERROR_ENUMERATE, \ - 'RegisteredProfile') - logger.error("Exception: %s", detail) + except Exception, details: + logger.error(CIM_ERROR_ENUMERATE, 'RegisteredProfile') + logger.error("Exception: %s", details) return status Globals.CIM_NS = prev_namespace @@ -160,11 +151,12 @@ Name=name) if len(profs) != 1: logger.error("ElementConformsToProfile assoc failed") - return status + return FAIL status = verify_profile(profs[0], exp_list[cn]) if status != PASS: logger.error("Verification of profile instance failed") + return FAIL except Exception, detail: logger.error(CIM_ERROR_ASSOCIATORS, 'RegisteredProfile') From kaitlin at linux.vnet.ibm.com Thu Jul 31 22:26:04 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 31 Jul 2008 15:26:04 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] [RFC] Possible way of handling stale libvirt info Message-ID: Does this approach seem reasonable? From kaitlin at linux.vnet.ibm.com Thu Jul 31 22:26:05 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 31 Jul 2008 15:26:05 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Add function to poll for a guest In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1217542638 25200 # Node ID d0c5bdff331b674690f973a70d4ef00878e484f4 # Parent 365e478e317b6559dd8869051aeda8d54d358686 Add function to poll for a guest This function is a work around to deal with a stale data issue seen with libvirt on RHEL 5.x. Signed-off-by: Kaitlin Rupert diff -r 365e478e317b -r d0c5bdff331b suites/libvirt-cim/lib/XenKvmLib/common_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Thu Jul 31 15:19:33 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Thu Jul 31 15:17:18 2008 -0700 @@ -33,10 +33,12 @@ from pywbem.cim_obj import CIMInstanceName from XenKvmLib.devices import CIM_Instance from XenKvmLib.classes import get_typed_class -from CimTest.Globals import logger, log_param, CIM_ERROR_ENUMERATE +from CimTest.Globals import logger, log_param, CIM_ERROR_ENUMERATE, \ + CIM_ERROR_GETINSTANCE from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC -from VirtLib.live import diskpool_list, virsh_version, net_list +from VirtLib.live import diskpool_list, virsh_version, net_list, domain_list from XenKvmLib.vxml import PoolXML, NetXML +from XenKvmLib.enumclass import getInstance test_dpath = "foo" disk_file = '/etc/libvirt/diskpool.conf' @@ -57,7 +59,7 @@ return (1, cs) except Exception, detail: - logger.error(Globals.CIM_ERROR_GETINSTANCE, + logger.error(CIM_ERROR_GETINSTANCE, get_typed_class(virt, 'ComputerSystem')) logger.error("Exception: %s", detail) return (1, cs) @@ -397,3 +399,18 @@ return PASS +def check_virsh_poll(ip, virt, dom_name): + cs = None + + dom_list = domain_list(ip, virt) + if dom_name in dom_list: + timeout = 10 + + for i in range(0, timeout): + rc, cs = get_cs_instance(dom_name, ip, virt) + if rc == 0: + return cs + + sleep(1) + + return cs From kaitlin at linux.vnet.ibm.com Thu Jul 31 22:36:06 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 31 Jul 2008 15:36:06 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Make related indication_test.py changes Message-ID: <837943c970641071e556.1217543766@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1217543735 25200 # Node ID 837943c970641071e55637386d9ac30df5d41e4b # Parent b53b5a20e8f561366ff90f2156ad6d26d90b5d1b [TEST] Make related indication_test.py changes. The version of indication_tester.py in libcmpiutil has changed, so the version in libvirt needs to change as well. Signed-off-by: Kaitlin Rupert diff -r b53b5a20e8f5 -r 837943c97064 suites/libvirt-cim/lib/XenKvmLib/indication_tester.py --- a/suites/libvirt-cim/lib/XenKvmLib/indication_tester.py Thu Jul 31 15:17:28 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/indication_tester.py Thu Jul 31 15:35:35 2008 -0700 @@ -169,7 +169,7 @@ """ % (sysname, name, sysname, name) -def delete_inst_xml(name, type, sysname): +def delete_inst_xml(name, type, sysname, inst_name): return """ @@ -192,7 +192,7 @@ CIM_Indication%s - %s%s + %s @@ -200,7 +200,7 @@ ; - """ % (type, sysname, type, name, type); + """ % (type, sysname, type, inst_name); def delete_sub_xml(name, sysname): return """ @@ -298,15 +298,16 @@ self.server.indications.append(indication) class CIMIndicationSubscription: - def __init__(self, name, typ, ns, print_ind, sysname): + def __init__(self, name, typ, ns, print_ind, sysname, port=0): self.name = name self.type = typ self.ns = ns self.sysname = sysname - self.server = BaseHTTPServer.HTTPServer(('', 8000), CIMSocketHandler) + self.port = 8000 + port + self.server = BaseHTTPServer.HTTPServer(('', self.port), + CIMSocketHandler) self.server.print_ind = print_ind - self.port = 8000 self.server.indications = [] self.filter_xml = filter_xml(name, typ, ns, sysname) @@ -325,7 +326,7 @@ conn.request("POST", "/cimom", body, headers) resp = conn.getresponse() if not resp.getheader("content-length"): - raise Exception("Request Failed: %d %s" % + raise Exception("Request Failed: %d %s" % (resp.status, resp.reason)) resp.read() @@ -355,10 +356,12 @@ xml = delete_sub_xml(self.name, self.sysname) self.__do_cimpost(self.conn, xml, "DeleteInstance", auth_hdr) - xml = delete_inst_xml(self.name, "Handler", self.sysname) + xml = delete_inst_xml(self.name, "HandlerCIMXML", self.sysname, + "%sHandler" % self.name) self.__do_cimpost(self.conn, xml, "DeleteInstance", auth_hdr) - xml = delete_inst_xml(self.name, "Filter", self.sysname) + xml = delete_inst_xml(self.name, "Filter", self.sysname, + "%sFilter" % self.name) self.__do_cimpost(self.conn, xml, "DeleteInstance", auth_hdr) @@ -366,8 +369,9 @@ filter_str = filter_xml(name, typ, ns, sysname) handler_str = handler_xml(name, 8000, sysname) subscript_str = subscription_xml(name, sysname) - del_filter_str = delete_inst_xml(name, "Filter", sysname) - del_handler_str = delete_inst_xml(name, "Handler", sysname) + del_filter_str = delete_inst_xml(name, "Filter", sysname, "%sFilter" % name) + del_handler_str = delete_inst_xml(name, "HandlerCIMXML", sysname, + "%sHandler" % name) del_subscript_str = delete_sub_xml(name, sysname) print "CreateFilter:\n%s\n" % filter_str @@ -398,6 +402,8 @@ help="HTTP Auth username") parser.add_option("-P", "--pass", dest="password", default=None, help="HTTP Auth password") + parser.add_option("--port", dest="port", default=0, type=int, + help="Port increment value (server default: 8000)") (options, args) = parser.parse_args() @@ -413,14 +419,14 @@ if ":" in options.url: (sysname, port) = options.url.split(":") else: - sysname = url + sysname = options.url if options.dump: dump_xml(options.name, args[0], options.ns, sysname) sys.exit(0) sub = CIMIndicationSubscription(options.name, args[0], options.ns, - options.print_ind, sysname) + options.print_ind, sysname, options.port) sub.subscribe(options.url, auth) print "Watching for %s" % args[0] From kaitlin at linux.vnet.ibm.com Thu Jul 31 23:24:23 2008 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 31 Jul 2008 16:24:23 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Modify CSI test to support modified and deleted indications Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1217543970 25200 # Node ID a0f1042dd8dd0b685aa755e1cedbbd7cdd71bbfc # Parent 837943c970641071e55637386d9ac30df5d41e4b [TEST] Modify CSI test to support modified and deleted indications. This may fail on KVM with the following error message: "CIM_ERR_FAILED: Invalid state transition." Will follow up on this issue. Signed-off-by: Kaitlin Rupert diff -r 837943c97064 -r a0f1042dd8dd suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py --- a/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Thu Jul 31 15:35:35 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Thu Jul 31 15:39:30 2008 -0700 @@ -24,91 +24,163 @@ import os import signal import time +from pywbem.cim_obj import CIMInstanceName from CimTest.Globals import 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.common_util import create_using_definesystem, \ + call_request_state_change +from XenKvmLib.test_doms import destroy_and_undefine_domain from XenKvmLib.classes import get_typed_class from XenKvmLib.indication_tester import CIMIndicationSubscription from XenKvmLib.vxml import set_default +from XenKvmLib.vsms import get_vsms_class SUPPORTED_TYPES = ['Xen', 'XenFV', 'KVM'] test_dom = "domU" +REQ_STATE = 2 +TIME = "00000000000000.000000:000" + +def sub_ind(ip, virt): + dict = set_default(ip) + ind_names = {"define" : 'ComputerSystemCreatedIndication', + "start" : 'ComputerSystemModifiedIndication', + "destroy" : 'ComputerSystemDeletedIndication' + } + + sub_list = {} + port = 5 + + for ind, iname in ind_names.iteritems(): + ind_name = get_typed_class(virt, iname) + + sub_name = "Test%s" % ind_name + port += 1 + + sub = CIMIndicationSubscription(sub_name, ind_name, + dict['default_ns'], + dict['default_print_ind'], + dict['default_sysname'], + port) + sub.subscribe(dict['default_url'], dict['default_auth']) + logger.info("Watching for %s" % iname) + ind_names[ind] = ind_name + sub_list[ind] = sub + + return sub_list, ind_names, dict + +def gen_ind(test_dom, ip, vtype, ind): + if ind == "define": + return create_using_definesystem(test_dom, ip, virt=vtype) + + elif ind == "start": + rc = call_request_state_change(test_dom, ip, REQ_STATE, TIME, vtype) + if rc != 0: + logger.error("Failed to start domain: %s" % test_dom) + return FAIL + return PASS + + elif ind == "destroy": + service = get_vsms_class(vtype)(ip) + try: + classname = get_typed_class(vtype, 'ComputerSystem') + cs_ref = CIMInstanceName(classname, keybindings = { + 'Name':test_dom, + 'CreationClassName':classname}) + service.DestroySystem(AffectedSystem=cs_ref) + except Exception, details: + logger.error('Unknow exception happened') + logger.error(details) + return FAIL + return PASS + + return FAIL + +def handle_request(sub, ind_name): + sub.server.handle_request() + if len(sub.server.indications) == 0: + logger.error("No valid indications received") + return FAIL + elif str(sub.server.indications[0]) != ind_name: + logger.error("Received indication %s instead of %s" % \ + (str(sub.server.indications[0])), ind_name) + return FAIL + + return PASS + +def poll_for_ind(pid): + for i in range(0, 20): + pw = os.waitpid(pid, os.WNOHANG) + + # If pid exits, waitpid returns [pid, return_code] + # If pid is still running, waitpid returns [0, 0] + # Only return a success if waitpid returns the expected pid + # and the return code is 0. + if pw[0] == pid and pw[1] == 0: + logger.info("Great, got indication successfuly") + status = PASS + break + elif pw[1] == 0 and i < 19: + if i % 10 == 0: + logger.info("In child process, waiting for indication") + time.sleep(1) + else: + # Time is up and waitpid never returned the expected pid + if pw[0] != pid: + logger.error("Waited too long for indication") + os.kill(pid, signal.SIGKILL) + else: + logger.error("Received indication error: %d" % pw[1]) + + status = FAIL + break + + return status @do_main(SUPPORTED_TYPES) def main(): options = main.options 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") - os._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]))) - os._exit(2) + sub_list, ind_names, dict = sub_ind(options.ip, options.virt) + + ind_list = ["define", "start", "destroy"] + + for ind in ind_list: + sub = sub_list[ind] + ind_name = ind_names[ind] + + try: + pid = os.fork() + if pid == 0: + status = handle_request(sub, ind_name) + if status != PASS: + os._exit(1) + + os._exit(0) else: - os._exit(0) - else: - status = create_using_definesystem(test_dom, options.ip, None, None, - options.virt) - if status != PASS: - sub.unsubscribe(dict['default_auth']) - logger.info("Cancelling subscription for %s" % indication_name) - os.kill(pid, signal.SIGKILL) - return status + try: + status = gen_ind(test_dom, options.ip, options.virt, ind) + if status != PASS: + os.kill(pid, signal.SIGKILL) + return FAIL - status = FAIL - for i in range(0,100): - pw = os.waitpid(pid, os.WNOHANG) + status = poll_for_ind(pid) + except Exception, details: + logger.error("Exception: %s" % details) + os.kill(pid, signal.SIGKILL) + return FAIL - # If pid exits, waitpid returns [pid, return_code] - # If pid is still running, waitpid returns [0, 0] - # Only return a success if waitpid returns the expected pid - # and the return code is 0. - if pw[0] == pid and pw[1] == 0: - logger.info("Great, got indication successfuly") - status = PASS - break - elif pw[1] == 0 and i < 99: - if i % 10 == 0: - logger.info("In child process, waiting for indication") - time.sleep(1) - else: - status = FAIL - - # Time is up and waitpid never returned the expected pid - if pw[0] != pid: - logger.error("Waited too long for indication") - os.kill(pid, signal.SIGKILL) - else: - logger.error("Received indication error: %d" % pw[1]) - break + except Exception, details: + logger.error("Exception: %s" % details) + return FAIL - except Exception, details: - logger.error("Unknown exception happened") - logger.error(details) - - sub.unsubscribe(dict['default_auth']) - logger.info("Cancelling subscription for %s" % indication_name) - undefine_test_domain(test_dom, options.ip, options.virt) + for ind, sub in sub_list.iteritems(): + sub.unsubscribe(dict['default_auth']) + logger.info("Cancelling subscription for %s" % ind_names[ind]) + + destroy_and_undefine_domain(test_dom, options.ip, options.virt) return status