From deeptik at linux.vnet.ibm.com Wed Jul 1 14:40:29 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 01 Jul 2009 20:10:29 +0530 Subject: [Libvirt-cim] [PATCH 4 of 4] [TEST] #2 VSMS 08 Remove cleanup_guest_netpool() def and call it from vsmigration.py In-Reply-To: <401fcf44005919231ce6.1243632000@localhost.localdomain> References: <401fcf44005919231ce6.1243632000@localhost.localdomain> Message-ID: <4A4B755D.8060106@linux.vnet.ibm.com> The test passed for the Restart migration option, but failed for resume migration: Wed, 01 Jul 2009 07:35:52:TEST LOG:INFO - 'restart' Migration for 'VM_frm_elm3b25.beaverton.ibm.com PASSED' Wed, 01 Jul 2009 07:35:53:TEST LOG:INFO - Executing 'resume' migration for 'VM_frm_elm3b25.beaverton.ibm.com' from 'elm3b25.beaverton.ibm.com' to 'localhost' Wed, 01 Jul 2009 07:36:12:TEST LOG:INFO - Migrating 'VM_frm_elm3b25.beaverton.ibm.com'.. this will take some time. Wed, 01 Jul 2009 07:36:17:TEST LOG:ERROR - JobStatus for dom 'VM_frm_elm3b25.beaverton.ibm.com' has 'Migration Failed: Error 0' instead of 'Completed' Wed, 01 Jul 2009 07:36:17:TEST LOG:INFO - 'resume' Migration for 'VM_frm_elm3b25.beaverton.ibm.com FAILED' Wed, 01 Jul 2009 07:36:18:TEST LOG:ERROR - Restart migration 0 Wed, 01 Jul 2009 07:36:18:TEST LOG:ERROR - Resume migration 1 Wed, 01 Jul 2009 07:36:18:TEST LOG:INFO - Test case FAILED Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1242946256 25200 > # Node ID 401fcf44005919231ce6ea590029aff42e910152 > # Parent e21a60339e4be98d049db5ea146377e90a1f006b > [TEST] #2 VSMS 08 Remove cleanup_guest_netpool() def and call it from vsmigration.py > > Updates: > -Give guest time to fuly boot before rebooting > -Indicate the pass / failure of both the restart and resume cases > > Note: This test might fail with older versions of Xen - restart migration can > be unstable > > Signed-off-by: Kaitlin Rupert > > diff -r e21a60339e4b -r 401fcf440059 suites/libvirt-cim/cimtest/VirtualSystemMigrationService/08_remote_restart_resume_migration.py > --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/08_remote_restart_resume_migration.py Thu May 21 15:50:56 2009 -0700 > +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/08_remote_restart_resume_migration.py Thu May 21 15:50:56 2009 -0700 > @@ -28,6 +28,7 @@ > > import sys > import os > +from time import sleep > from socket import gethostname > from XenKvmLib import vxml > from XenKvmLib.xm_virt_util import domain_list, net_list > @@ -35,9 +36,9 @@ > from XenKvmLib.const import do_main, default_network_name > from CimTest.ReturnCodes import PASS, FAIL, SKIP > from XenKvmLib.classes import get_typed_class > -from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate > -from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf,\ > - destroy_netpool > +from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate, \ > + cleanup_guest_netpool > +from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf > > sup_types = ['KVM', 'Xen'] > > @@ -125,6 +126,9 @@ > status_resume = status_restart = None > cxml = None > > + status_restart = -1 > + status_resume = -1 > + > try: > > for mig_type in mig_types: > @@ -135,6 +139,10 @@ > logger.error("Error setting up the guest") > return status > > + # Generally, having a test sleep is a bad choice, but we need to > + # give the guest some time to fully boot before we reboot it > + sleep(15) > + > # create the networkpool used in the domain to be migrated > # on the target machine. > t_net_list = net_list(t_sysname, virt) > @@ -168,18 +176,14 @@ > cleanup_guest(virt, cxml, test_dom, t_sysname, s_sysname) > status = FAIL > > - # clean the networkpool created on the remote machine > - target_net_list = net_list(t_sysname, virt) > - if target_net_list != None and net_pool_name in target_net_list: > - ret_value = destroy_netpool(t_sysname, virt, net_pool_name) > - if ret_value != PASS: > - logger.info("Unable to destroy networkpool '%s' on '%s'", > - net_pool_name, t_sysname) > + cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, s_sysname) > > - if status_restart != PASS or status_resume != PASS: > + if status_restart == PASS and status_resume == PASS: > + status = PASS > + else: > + logger.error("Restart migration %d", status_restart) > + logger.error("Resume migration %d", status_resume) > status = FAIL > - else: > - status = PASS > > logger.info("Test case %s", str_status(status)) > return status > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Jul 1 14:39:05 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 01 Jul 2009 20:09:05 +0530 Subject: [Libvirt-cim] [PATCH 3 of 4] [TEST] 07 - Remove cleanup_guest_netpool() def and call it from vsmigration.py In-Reply-To: References: Message-ID: <4A4B7509.1030008@linux.vnet.ibm.com> The changes for the patch looks fine except when we run the 07_remote_offline_migration.py tc we get an message in the cimtest.log like below: Wed, 01 Jul 2009 07:31:07:TEST LOG:INFO - Failed to undefine the migrated domain 'VM_frm_elm3b25.beaverton.ibm.com' on 'localhost' This is beacuse here in the tc we only define the VM but when we call cleanup_guest_netpool() we destroy and undefine() the VM. Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1242946256 25200 > # Node ID e21a60339e4be98d049db5ea146377e90a1f006b > # Parent fdb53fac065cd041292fbc9b6dc0dcd712b99b0b > [TEST] 07 - Remove cleanup_guest_netpool() def and call it from vsmigration.py > > Signed-off-by: Kaitlin Rupert > > diff -r fdb53fac065c -r e21a60339e4b suites/libvirt-cim/cimtest/VirtualSystemMigrationService/07_remote_offline_migration.py > --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/07_remote_offline_migration.py Thu May 21 15:50:56 2009 -0700 > +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/07_remote_offline_migration.py Thu May 21 15:50:56 2009 -0700 > @@ -35,9 +35,9 @@ > from XenKvmLib.const import do_main, default_network_name > from CimTest.ReturnCodes import PASS, FAIL > from XenKvmLib.classes import get_typed_class > -from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate > -from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf,\ > - destroy_netpool > +from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate, \ > + cleanup_guest_netpool > +from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf > > sup_types = ['KVM', 'Xen'] > > @@ -60,35 +60,6 @@ > > return PASS, cxml > > -def cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, s_sysname): > - # Clean the domain on target machine. > - # This is req when migration is successful, also when migration is not > - # completely successful VM might be created on the target machine > - # and hence need to clean. > - target_list = domain_list(t_sysname, virt) > - if target_list != None and test_dom in target_list: > - ret_value = cxml.undefine(t_sysname) > - if not ret_value: > - logger.info("Failed to undefine the migrated domain '%s' on '%s'", > - test_dom, t_sysname) > - > - # clean the networkpool created on the remote machine > - target_net_list = net_list(t_sysname, virt) > - if target_net_list != None and default_network_name in target_net_list: > - ret_value = destroy_netpool(t_sysname, virt, default_network_name) > - if ret_value != PASS: > - logger.info("Unable to destroy networkpool '%s' on '%s'", > - default_network_name, t_sysname) > - > - # Remote Migration not Successful, clean the domain on src machine > - src_list = domain_list(s_sysname, virt) > - if src_list != None and test_dom in src_list: > - ret_value = cxml.undefine(s_sysname) > - if not ret_value: > - logger.info("Failed to undefine the domain '%s' on source '%s'", > - test_dom, s_sysname) > - > - > @do_main(sup_types) > def main(): > options = main.options > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 1 18:23:28 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 01 Jul 2009 11:23:28 -0700 Subject: [Libvirt-cim] [PATCH 4 of 4] [TEST] #2 VSMS 08 Remove cleanup_guest_netpool() def and call it from vsmigration.py In-Reply-To: <4A4B755D.8060106@linux.vnet.ibm.com> References: <401fcf44005919231ce6.1243632000@localhost.localdomain> <4A4B755D.8060106@linux.vnet.ibm.com> Message-ID: <4A4BA9A0.1050107@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > The test passed for the Restart migration option, but failed for resume > migration: > > Wed, 01 Jul 2009 07:35:52:TEST LOG:INFO - 'restart' Migration for > 'VM_frm_elm3b25.beaverton.ibm.com PASSED' > > Wed, 01 Jul 2009 07:35:53:TEST LOG:INFO - Executing 'resume' migration > for 'VM_frm_elm3b25.beaverton.ibm.com' from 'elm3b25.beaverton.ibm.com' > to 'localhost' > Wed, 01 Jul 2009 07:36:12:TEST LOG:INFO - Migrating > 'VM_frm_elm3b25.beaverton.ibm.com'.. this will take some time. > Wed, 01 Jul 2009 07:36:17:TEST LOG:ERROR - JobStatus for dom > 'VM_frm_elm3b25.beaverton.ibm.com' has 'Migration Failed: Error 0' > instead of 'Completed' > Wed, 01 Jul 2009 07:36:17:TEST LOG:INFO - 'resume' Migration for > 'VM_frm_elm3b25.beaverton.ibm.com FAILED' > > Wed, 01 Jul 2009 07:36:18:TEST LOG:ERROR - Restart migration 0 > Wed, 01 Jul 2009 07:36:18:TEST LOG:ERROR - Resume migration 1 > Wed, 01 Jul 2009 07:36:18:TEST LOG:INFO - Test case FAILED > Hmm.. can you include some provider debug and verify that your system is configured with Xen relocation enabled. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 1 19:52:55 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 01 Jul 2009 12:52:55 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Update get_exp_template_rasd_len() based on template RASD additions Message-ID: <857398f2e66069d7a842.1246477975@localhost.localdomain> # HG changeset patch # User Kaitlin Rupert # Date 1246477946 25200 # Node ID 857398f2e66069d7a8421c3229d821b8e82467ea # Parent a8b01b9726bf386defc29540e33f81e0850ac3a6 [TEST] Update get_exp_template_rasd_len() based on template RASD additions The providers now return template RASDs for both "bridge" and "network" interface types. In addition to that, the providers now return template DiskPoolRASDs for iSCSI pools Signed-off-by: Kaitlin Rupert diff -r a8b01b9726bf -r 857398f2e660 suites/libvirt-cim/lib/XenKvmLib/rasd.py --- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Wed Jul 01 11:23:00 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Wed Jul 01 12:52:26 2009 -0700 @@ -320,7 +320,7 @@ exp_len = exp_base_num if id == "DiskPool/0": - pool_types = 5 + pool_types = 6 return exp_base_num * pool_types if virt == 'Xen' or virt == 'XenFV': @@ -363,8 +363,9 @@ if rev >= net_rasd_template_changes: dev_types = 2 + net_types = 2 - return exp_base_num * dev_types + return exp_base_num * dev_types * net_types def get_exp_template_rasd_len(virt, ip, id): curr_cim_rev, changeset = get_provider_version(virt, ip) From kaitlin at linux.vnet.ibm.com Wed Jul 1 20:39:58 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 01 Jul 2009 13:39:58 -0700 Subject: [Libvirt-cim] [PATCH] Be sure to support "user" type interfaces Message-ID: <4ea22198d1848b0097e8.1246480798@localhost.localdomain> # HG changeset patch # User Kaitlin Rupert # Date 1246480792 25200 # Node ID 4ea22198d1848b0097e81268dcedc940f2fb9be5 # Parent b1a29661b142f455bcbb9b4d21ae2cb7c038f5e8 Be sure to support "user" type interfaces This patch is to fix a regression found by running the NetworkPort - 03_user_netport.py test. Also be sure to generate a template NetRASD for the user type. Signed-off-by: Kaitlin Rupert diff -r b1a29661b142 -r 4ea22198d184 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Tue Jun 30 14:33:31 2009 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Wed Jul 01 13:39:52 2009 -0700 @@ -578,9 +578,9 @@ const char *id; CMPIStatus s = {CMPI_RC_OK, NULL}; int i,j; - const char *type[] = {"network", "bridge"}; + const char *type[] = {"network", "bridge", "user"}; const char *model[] = {"e1000", NULL}; - const char *name[] = {NULL, "br0"}; + const char *name[] = {NULL, "br0", NULL}; switch (template_type) { case SDC_RASD_MIN: @@ -609,7 +609,7 @@ } - for (i = 0; i < 2; i++) { + for (i = 0; i < 3; i++) { for (j = 0; j < 2; j++) { s = set_net_props(template_type, ref, diff -r b1a29661b142 -r 4ea22198d184 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Tue Jun 30 14:33:31 2009 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Wed Jul 01 13:39:52 2009 -0700 @@ -61,6 +61,7 @@ #define DEFAULT_XEN_WEIGHT 1024 #define BRIDGE_TYPE "bridge" #define NETWORK_TYPE "network" +#define USER_TYPE "user" const static CMPIBroker *_BROKER; @@ -585,7 +586,8 @@ } dev->dev.net.source = strdup(network); - + } else if (STREQC(val, USER_TYPE)) { + dev->dev.net.type = strdup(USER_TYPE); } else return "Invalid Network Type specified"; free(dev->dev.net.model); From kaitlin at linux.vnet.ibm.com Wed Jul 1 23:04:35 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 01 Jul 2009 16:04:35 -0700 Subject: [Libvirt-cim] Test Run Summary (Jun 30 2009): KVM on Fedora release 11.90 (Rawhide) with sfcb In-Reply-To: <200906302321.n5UNLepd000876@d03av04.boulder.ibm.com> References: <200906302321.n5UNLepd000876@d03av04.boulder.ibm.com> Message-ID: <4A4BEB83.5080701@linux.vnet.ibm.com> > -------------------------------------------------------------------- > HostSystem - 03_hs_to_settdefcap.py: FAIL > ERROR - KVM_SettingsDefineCapabilities returned 16 RASD objects instead of 8 for NetworkPool/cimtest-networkpool > Class not found > -------------------------------------------------------------------- I've submitted a test case fix for this. See patch " Update get_exp_template_rasd_len() based on template RASD additions" > -------------------------------------------------------------------- > NetworkPort - 03_user_netport.py: FAIL > ERROR - Got CIM error ResourceSettings Error: Invalid Network Type specified with return code 1 > ERROR - Unable to define domain test_domain > InvokeMethod(DefineSystem): ResourceSettings Error: Invalid Network Type specified > -------------------------------------------------------------------- This is a provider regression. I've submitted the fix "Be sure to support "user" type interfaces" for this. > -------------------------------------------------------------------- > RASD - 07_parent_disk_pool.py: FAIL > ERROR - Exception details: Got 6 recs instead of 3 This is a test case issue and a provider issue. Patches for both to follow. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 1 23:16:57 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 01 Jul 2009 16:16:57 -0700 Subject: [Libvirt-cim] [PATCH] Change DevicePath to DevicePaths in SettingsDefineCapabilities Message-ID: <7bbb36258bf14bcf5ae4.1246490217@localhost.localdomain> # HG changeset patch # User Kaitlin Rupert # Date 1246490192 25200 # Node ID 7bbb36258bf14bcf5ae40ad54356ac977620b569 # Parent 4ea22198d1848b0097e81268dcedc940f2fb9be5 Change DevicePath to DevicePaths in SettingsDefineCapabilities Due to the logical pool changes, DevicePath changed to DevicePaths. It's now also an array type attribute. Signed-off-by: Kaitlin Rupert diff -r 4ea22198d184 -r 7bbb36258bf1 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Wed Jul 01 13:39:52 2009 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Wed Jul 01 16:16:32 2009 -0700 @@ -1256,6 +1256,7 @@ { const char *id; CMPIInstance *inst; + CMPIArray *array; CMPIStatus s = {CMPI_RC_OK, NULL}; const char *path = "/dev/null"; int type[7] = {DISK_POOL_DIR, @@ -1332,9 +1333,30 @@ break; } - if (dev_path != NULL) - CMSetProperty(inst, "DevicePath", - (CMPIValue *)dev_path, CMPI_chars); + if (dev_path != NULL) { + CMPIString *str = NULL; + + array = CMNewArray(_BROKER, 1, CMPI_string, &s); + if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(array))) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to create new array"); + goto out; + } + + str = CMNewString(_BROKER, dev_path, &s); + if ((s.rc = CMPI_RC_OK) || (CMIsNullObject(str))) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to create new string"); + goto out; + } + + CMSetArrayElementAt(array, 0, &str, CMPI_string); + + CMSetProperty(inst, "DevicePaths", + (CMPIValue *)&array, CMPI_stringA); + } if (host != NULL) CMSetProperty(inst, "Host", From deeptik at linux.vnet.ibm.com Thu Jul 2 05:14:29 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 02 Jul 2009 10:44:29 +0530 Subject: [Libvirt-cim] [PATCH 4 of 4] [TEST] #2 VSMS 08 Remove cleanup_guest_netpool() def and call it from vsmigration.py In-Reply-To: <4A4BA9A0.1050107@linux.vnet.ibm.com> References: <401fcf44005919231ce6.1243632000@localhost.localdomain> <4A4B755D.8060106@linux.vnet.ibm.com> <4A4BA9A0.1050107@linux.vnet.ibm.com> Message-ID: <4A4C4235.50403@linux.vnet.ibm.com> +1 works for me. Kaitlin Rupert wrote: > Deepti B Kalakeri wrote: >> The test passed for the Restart migration option, but failed for >> resume migration: >> >> Wed, 01 Jul 2009 07:35:52:TEST LOG:INFO - 'restart' Migration for >> 'VM_frm_elm3b25.beaverton.ibm.com PASSED' >> >> Wed, 01 Jul 2009 07:35:53:TEST LOG:INFO - Executing 'resume' >> migration for 'VM_frm_elm3b25.beaverton.ibm.com' from >> 'elm3b25.beaverton.ibm.com' to 'localhost' >> Wed, 01 Jul 2009 07:36:12:TEST LOG:INFO - Migrating >> 'VM_frm_elm3b25.beaverton.ibm.com'.. this will take some time. >> Wed, 01 Jul 2009 07:36:17:TEST LOG:ERROR - JobStatus for dom >> 'VM_frm_elm3b25.beaverton.ibm.com' has 'Migration Failed: Error 0' >> instead of 'Completed' >> Wed, 01 Jul 2009 07:36:17:TEST LOG:INFO - 'resume' Migration for >> 'VM_frm_elm3b25.beaverton.ibm.com FAILED' >> >> Wed, 01 Jul 2009 07:36:18:TEST LOG:ERROR - Restart migration 0 >> Wed, 01 Jul 2009 07:36:18:TEST LOG:ERROR - Resume migration 1 >> Wed, 01 Jul 2009 07:36:18:TEST LOG:INFO - Test case FAILED >> > > Hmm.. can you include some provider debug and verify that your system > is configured with Xen relocation enabled. > > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Jul 2 05:50:10 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 02 Jul 2009 11:20:10 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Update get_exp_template_rasd_len() based on template RASD additions In-Reply-To: <857398f2e66069d7a842.1246477975@localhost.localdomain> References: <857398f2e66069d7a842.1246477975@localhost.localdomain> Message-ID: <4A4C4A92.8010804@linux.vnet.ibm.com> Tc fails for Xen with the following error: Testing Xen hypervisor -------------------------------------------------------------------- HostSystem - 03_hs_to_settdefcap.py: FAIL ERROR - Xen_SettingsDefineCapabilities returned 80 RASD objects instead of 16 for DiskPool/cimtest-diskpool CIM_ERR_INVALID_CLASS: Linux_ComputerSystem -------------------------------------------------------------------- Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1246477946 25200 > # Node ID 857398f2e66069d7a8421c3229d821b8e82467ea > # Parent a8b01b9726bf386defc29540e33f81e0850ac3a6 > [TEST] Update get_exp_template_rasd_len() based on template RASD additions > > The providers now return template RASDs for both "bridge" and "network" > interface types. In addition to that, the providers now return template > DiskPoolRASDs for iSCSI pools > > Signed-off-by: Kaitlin Rupert > > diff -r a8b01b9726bf -r 857398f2e660 suites/libvirt-cim/lib/XenKvmLib/rasd.py > --- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Wed Jul 01 11:23:00 2009 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Wed Jul 01 12:52:26 2009 -0700 > @@ -320,7 +320,7 @@ > exp_len = exp_base_num > > if id == "DiskPool/0": > - pool_types = 5 > + pool_types = 6 > return exp_base_num * pool_types > > if virt == 'Xen' or virt == 'XenFV': > @@ -363,8 +363,9 @@ > > if rev >= net_rasd_template_changes: > dev_types = 2 > + net_types = 2 > > - return exp_base_num * dev_types > + return exp_base_num * dev_types * net_types > > def get_exp_template_rasd_len(virt, ip, id): > curr_cim_rev, changeset = get_provider_version(virt, ip) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Jul 2 07:23:37 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 02 Jul 2009 12:53:37 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Update get_exp_template_rasd_len() based on template RASD additions In-Reply-To: <4A4C4A92.8010804@linux.vnet.ibm.com> References: <857398f2e66069d7a842.1246477975@localhost.localdomain> <4A4C4A92.8010804@linux.vnet.ibm.com> Message-ID: <4A4C6079.3020904@linux.vnet.ibm.com> This is occurring because we are overwriting the exp_len calculation of line 337 with 339. Deepti B Kalakeri wrote: > Tc fails for Xen with the following error: > > Testing Xen hypervisor > -------------------------------------------------------------------- > HostSystem - 03_hs_to_settdefcap.py: FAIL > ERROR - Xen_SettingsDefineCapabilities returned 80 RASD objects > instead of 16 for DiskPool/cimtest-diskpool > CIM_ERR_INVALID_CLASS: Linux_ComputerSystem > -------------------------------------------------------------------- > > > Kaitlin Rupert wrote: >> # HG changeset patch >> # User Kaitlin Rupert >> # Date 1246477946 25200 >> # Node ID 857398f2e66069d7a8421c3229d821b8e82467ea >> # Parent a8b01b9726bf386defc29540e33f81e0850ac3a6 >> [TEST] Update get_exp_template_rasd_len() based on template RASD >> additions >> >> The providers now return template RASDs for both "bridge" and "network" >> interface types. In addition to that, the providers now return template >> DiskPoolRASDs for iSCSI pools >> >> Signed-off-by: Kaitlin Rupert >> >> diff -r a8b01b9726bf -r 857398f2e660 >> suites/libvirt-cim/lib/XenKvmLib/rasd.py >> --- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Wed Jul 01 11:23:00 >> 2009 -0700 >> +++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Wed Jul 01 12:52:26 >> 2009 -0700 >> @@ -320,7 +320,7 @@ >> exp_len = exp_base_num >> if id == "DiskPool/0": >> - pool_types = 5 >> + pool_types = 6 >> return exp_base_num * pool_types if virt == 'Xen' >> or virt == 'XenFV': >> @@ -363,8 +363,9 @@ >> if rev >= net_rasd_template_changes: >> dev_types = 2 >> + net_types = 2 >> >> - return exp_base_num * dev_types >> + return exp_base_num * dev_types * net_types >> >> def get_exp_template_rasd_len(virt, ip, id): >> curr_cim_rev, changeset = get_provider_version(virt, ip) >> >> _______________________________________________ >> Libvirt-cim mailing list >> Libvirt-cim at redhat.com >> https://www.redhat.com/mailman/listinfo/libvirt-cim >> > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Jul 2 09:09:05 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 02 Jul 2009 14:39:05 +0530 Subject: [Libvirt-cim] Test Run Summary (Jul 02 2009): KVM on SLES11 with sfcb Message-ID: <4A4C7931.6070505@linux.vnet.ibm.com> ================================================= Test Run Summary (Jul 02 2009): KVM on with sfcb ================================================= Distro: Kernel: 2.6.27.19-5-pae libvirt: 0.4.6 Hypervisor: QEMU 0.9.1 CIMOM: sfcb sfcbd 1.3.2 Libvirt-cim revision: 914 Libvirt-cim changeset: 2f0fb9e5d523+ Cimtest revision: 709 Cimtest changeset: 479f287a17fd ================================================= FAIL : 6 XFAIL : 4 SKIP : 9 PASS : 139 ----------------- Total : 158 ================================================= FAIL Test Summary: ComputerSystemIndication - 01_created_indication.py: FAIL HostSystem - 03_hs_to_settdefcap.py: FAIL NetworkPort - 03_user_netport.py: FAIL RASD - 07_parent_disk_pool.py: FAIL ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL SettingsDefineCapabilities - 01_forward.py: FAIL ================================================= XFAIL Test Summary: ComputerSystem - 32_start_reboot.py: XFAIL ComputerSystem - 33_suspend_reboot.py: XFAIL VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL VirtualSystemManagementService - 16_removeresource.py: XFAIL ================================================= SKIP Test Summary: ComputerSystem - 02_nosystems.py: SKIP LogicalDisk - 02_nodevs.py: SKIP VSSD - 02_bootldr.py: SKIP VirtualSystemMigrationService - 01_migratable_host.py: SKIP VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP ================================================= 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: PASS -------------------------------------------------------------------- ComputerSystem - 05_activate_defined_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 06_paused_active_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 22_define_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 23_pause_pause.py: PASS -------------------------------------------------------------------- ComputerSystem - 27_define_pause_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 32_start_reboot.py: XFAIL ERROR - Got CIM error Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot with return code 1 ERROR - Exception: Unable reboot dom 'cs_test_domain' InvokeMethod(RequestStateChange): Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot Bug:<00005> -------------------------------------------------------------------- ComputerSystem - 33_suspend_reboot.py: XFAIL ERROR - Got CIM error State not supported with return code 7 ERROR - Exception: Unable Suspend dom 'test_domain' InvokeMethod(RequestStateChange): State not supported Bug:<00012> -------------------------------------------------------------------- ComputerSystem - 35_start_reset.py: PASS -------------------------------------------------------------------- ComputerSystem - 40_RSC_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 41_cs_to_settingdefinestate.py: PASS -------------------------------------------------------------------- ComputerSystem - 42_cs_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for define indication ERROR - Waited too long for start indication ERROR - Waited too long for destroy 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: FAIL ERROR - KVM_SettingsDefineCapabilities returned 16 RASD objects instead of 8 for NetworkPool/cimtest-networkpool Class not found -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: PASS -------------------------------------------------------------------- HostSystem - 05_hs_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 06_hs_to_vsms.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 01_forward.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 02_reverse.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 -------------------------------------------------------------------- KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS -------------------------------------------------------------------- LogicalDisk - 01_disk.py: PASS -------------------------------------------------------------------- LogicalDisk - 02_nodevs.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- LogicalDisk - 03_ld_gi_errs.py: PASS -------------------------------------------------------------------- Memory - 01_memory.py: PASS -------------------------------------------------------------------- Memory - 02_defgetmem.py: PASS -------------------------------------------------------------------- Memory - 03_mem_gi_errs.py: PASS -------------------------------------------------------------------- NetworkPort - 01_netport.py: PASS -------------------------------------------------------------------- NetworkPort - 02_np_gi_errors.py: PASS -------------------------------------------------------------------- NetworkPort - 03_user_netport.py: FAIL ERROR - Got CIM error ResourceSettings Error: Invalid Network Type specified with return code 1 ERROR - Unable to define domain test_domain InvokeMethod(DefineSystem): ResourceSettings Error: Invalid Network Type specified -------------------------------------------------------------------- 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 -------------------------------------------------------------------- RASD - 04_disk_rasd_size.py: PASS -------------------------------------------------------------------- RASD - 05_disk_rasd_emu_type.py: PASS -------------------------------------------------------------------- RASD - 06_parent_net_pool.py: PASS -------------------------------------------------------------------- RASD - 07_parent_disk_pool.py: FAIL 07_parent_disk_pool.py:47: DeprecationWarning: the sets module is deprecated from sets import Set ERROR - Exception details: Got 6 recs instead of 3 -------------------------------------------------------------------- RedirectionService - 01_enum_crs.py: PASS -------------------------------------------------------------------- RedirectionService - 02_enum_crscap.py: PASS -------------------------------------------------------------------- RedirectionService - 03_RedirectionSAP_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: FAIL ERROR - Exception in create_pool() ERROR - Exception details: (1, u'*** Provider Virt_ResourcePoolConfigurationService(9745) exiting due to a SIGSEGV signal ') ERROR - Error in networkpool creation InvokeMethod(CreateChildResourcePool): *** Provider Virt_ResourcePoolConfigurationService(9745) exiting due to a SIGSEGV signal -------------------------------------------------------------------- ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 09_DeleteDiskPool.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 02_reverse.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefine - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 03_sds_fwd_errs.py: PASS -------------------------------------------------------------------- SettingsDefine - 04_sds_rev_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 01_forward.py: FAIL ERROR - KVM_SettingsDefineCapabilities returned 16 ResourcePool objects instead of 8 -------------------------------------------------------------------- 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: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL -------------------------------------------------------------------- VirtualSystemManagementService - 10_hv_version.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 12_referenced_config.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 13_refconfig_additional_devs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 14_define_sys_disk.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 15_mod_system_settings.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 16_removeresource.py: XFAIL ERROR - 0 RASD insts for domain/mouse:ps2 No such instance (no device domain/mouse:ps2) Bug:<00014> -------------------------------------------------------------------- VirtualSystemManagementService - 17_removeresource_neg.py: PASS -------------------------------------------------------------------- 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 -------------------------------------------------------------------- VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP -------------------------------------------------------------------- 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 -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS -------------------------------------------------------------------- -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Jul 2 10:00:43 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 02 Jul 2009 03:00:43 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing reporting.py to work for SLES Message-ID: <75e1ba2b6c209dc1610f.1246528843@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1246528835 25200 # Node ID 75e1ba2b6c209dc1610f05c647df00232fd123a5 # Parent 479f287a17fd08e4e22ac37459393f6f8327315a [TEST] Fixing reporting.py to work for SLES Tested with KVM and current sources on SLES11. Signed-off-by: Deepti B. Kalakeri diff -r 479f287a17fd -r 75e1ba2b6c20 suites/libvirt-cim/lib/XenKvmLib/reporting.py --- a/suites/libvirt-cim/lib/XenKvmLib/reporting.py Tue Jun 30 06:53:22 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/reporting.py Thu Jul 02 03:00:35 2009 -0700 @@ -87,7 +87,10 @@ def get_env_data(ip, virt): - distro = get_cmd_val("cat /etc/issue | awk 'NR<=1'", ip) + distro = get_cmd_val("cat /etc/issue | sed '/^$/d' | awk 'NR<=1'", ip) + if 'SUSE' in distro: + distro = (distro.split('-'))[0].split('to')[1] + kernel_ver = get_cmd_val("uname -r", ip) libvirt_ver, hyp_ver = get_libvirt_ver(ip) From deeptik at linux.vnet.ibm.com Thu Jul 2 11:32:40 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 02 Jul 2009 17:02:40 +0530 Subject: [Libvirt-cim] Re: Test Run Summary (Jul 02 2009): KVM on SLES11 with sfcb In-Reply-To: <4A4C7931.6070505@linux.vnet.ibm.com> References: <4A4C7931.6070505@linux.vnet.ibm.com> Message-ID: <4A4C9AD8.4070000@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > ================================================= > Test Run Summary (Jul 02 2009): KVM on with sfcb > ================================================= > Distro: Kernel: 2.6.27.19-5-pae > libvirt: 0.4.6 > Hypervisor: QEMU 0.9.1 > CIMOM: sfcb sfcbd 1.3.2 > Libvirt-cim revision: 914 > Libvirt-cim changeset: 2f0fb9e5d523+ > Cimtest revision: 709 > Cimtest changeset: 479f287a17fd > ================================================= > FAIL : 6 > XFAIL : 4 > SKIP : 9 > PASS : 139 > ----------------- > Total : 158 > ================================================= > FAIL Test Summary: > ComputerSystemIndication - 01_created_indication.py: FAIL Will look into this. > HostSystem - 03_hs_to_settdefcap.py: FAIL > NetworkPort - 03_user_netport.py: FAIL Fix for the above two are under review. > RASD - 07_parent_disk_pool.py: FAIL > ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL Need to check this. > SettingsDefineCapabilities - 01_forward.py: FAIL Fix for the above are under review. > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Mon Jul 6 16:40:57 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Mon, 06 Jul 2009 13:40:57 -0300 Subject: [Libvirt-cim] [PATCH] Verify specified UUID is not in use by existing guest In-Reply-To: <7417f62e29eb8b37acb6.1245863595@localhost.localdomain> References: <7417f62e29eb8b37acb6.1245863595@localhost.localdomain> Message-ID: <4A522919.3020703@linux.vnet.ibm.com> +1 Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1245863542 25200 > # Node ID 7417f62e29eb8b37acb66e616e49f51901f610c6 > # Parent 76be9533b5bab87a55c14ab68640c82cfd400b7b > Verify specified UUID is not in use by existing guest > > Before generating the XML needed to define a guest, make sure a guest with > the same UUID is not already defined. > > Signed-off-by: Kaitlin Rupert > > diff -r 76be9533b5ba -r 7417f62e29eb src/Virt_VirtualSystemManagementService.c > --- a/src/Virt_VirtualSystemManagementService.c Wed Jun 24 09:06:46 2009 -0700 > +++ b/src/Virt_VirtualSystemManagementService.c Wed Jun 24 10:12:22 2009 -0700 > @@ -1243,6 +1243,8 @@ > CMPIInstance *inst = NULL; > char *xml = NULL; > const char *msg = NULL; > + virConnectPtr conn = NULL; > + virDomainPtr dom = NULL; > > struct domain *domain = NULL; > > @@ -1268,6 +1270,26 @@ > goto out; > } > > + if (domain->uuid != NULL) { > + conn = connect_by_classname(_BROKER, CLASSNAME(ref), NULL); > + if (conn == NULL) { > + cu_statusf(_BROKER, s, > + CMPI_RC_ERR_FAILED, > + "Error connecting to libvirt"); > + goto out; > + } > + > + dom = virDomainLookupByUUIDString(conn, domain->uuid); > + if (dom != NULL) { > + cu_statusf(_BROKER, s, > + CMPI_RC_ERR_FAILED, > + "Guest '%s' is already defined with UUID %s", > + virDomainGetName(dom), > + domain->uuid); > + goto out; > + } > + } > + > msg = classify_resources(resources, NAMESPACE(ref), domain); > if (msg != NULL) { > CU_DEBUG("Failed to classify resources: %s", msg); > @@ -1295,6 +1317,8 @@ > out: > cleanup_dominfo(&domain); > free(xml); > + virDomainFree(dom); > + virConnectClose(conn); > > return inst; > } > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Mon Jul 6 16:59:13 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Mon, 06 Jul 2009 13:59:13 -0300 Subject: [Libvirt-cim] [PATCH] (#3) Add check to ensure PoolID specified in NetRASD has valid format In-Reply-To: References: Message-ID: <4A522D61.8090300@linux.vnet.ibm.com> +1 Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1246064238 25200 > # Node ID dd7ce21f085b956aa412af6f0665ab7e4eacfe07 > # Parent 2f7ac06918f55d89f099447972b48d06b0140669 > (#3) Add check to ensure PoolID specified in NetRASD has valid format > > Updated from 2 t 3: > -Rebase patch based on current sources > > Updates from 1 to 2: > -Add a proper subject and commit log to patch > > Signed-off-by: Kaitlin Rupert > > diff -r 2f7ac06918f5 -r dd7ce21f085b src/Virt_VirtualSystemManagementService.c > --- a/src/Virt_VirtualSystemManagementService.c Wed Jun 24 10:27:16 2009 -0700 > +++ b/src/Virt_VirtualSystemManagementService.c Fri Jun 26 17:57:18 2009 -0700 > @@ -539,6 +539,7 @@ > { > const char *val = NULL; > const char *msg = NULL; > + char *network = NULL; > > if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) { > val = _net_rand_mac(); > @@ -577,7 +578,14 @@ > return "No NetworkPool specified no default available"; > > free(dev->dev.net.source); > - dev->dev.net.source = name_from_pool_id(val); > + network = name_from_pool_id(val); > + if (network == NULL) { > + msg = "PoolID specified is not formatted properly"; > + goto out; > + } > + > + dev->dev.net.source = strdup(network); > + > } else > return "Invalid Network Type specified"; > free(dev->dev.net.model); > @@ -587,6 +595,7 @@ > else > dev->dev.net.model = strdup(val); > out: > + free(network); > return msg; > } > > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Mon Jul 6 18:30:21 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Mon, 06 Jul 2009 15:30:21 -0300 Subject: [Libvirt-cim] [PATCH] Be sure to support "user" type interfaces In-Reply-To: <4ea22198d1848b0097e8.1246480798@localhost.localdomain> References: <4ea22198d1848b0097e8.1246480798@localhost.localdomain> Message-ID: <4A5242BD.1070200@linux.vnet.ibm.com> +1 Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1246480792 25200 > # Node ID 4ea22198d1848b0097e81268dcedc940f2fb9be5 > # Parent b1a29661b142f455bcbb9b4d21ae2cb7c038f5e8 > Be sure to support "user" type interfaces > > This patch is to fix a regression found by running the NetworkPort - > 03_user_netport.py test. > > Also be sure to generate a template NetRASD for the user type. > > Signed-off-by: Kaitlin Rupert > > diff -r b1a29661b142 -r 4ea22198d184 src/Virt_SettingsDefineCapabilities.c > --- a/src/Virt_SettingsDefineCapabilities.c Tue Jun 30 14:33:31 2009 -0700 > +++ b/src/Virt_SettingsDefineCapabilities.c Wed Jul 01 13:39:52 2009 -0700 > @@ -578,9 +578,9 @@ > const char *id; > CMPIStatus s = {CMPI_RC_OK, NULL}; > int i,j; > - const char *type[] = {"network", "bridge"}; > + const char *type[] = {"network", "bridge", "user"}; > const char *model[] = {"e1000", NULL}; > - const char *name[] = {NULL, "br0"}; > + const char *name[] = {NULL, "br0", NULL}; > > switch (template_type) { > case SDC_RASD_MIN: > @@ -609,7 +609,7 @@ > } > > > - for (i = 0; i < 2; i++) { > + for (i = 0; i < 3; i++) { > for (j = 0; j < 2; j++) { > s = set_net_props(template_type, > ref, > diff -r b1a29661b142 -r 4ea22198d184 src/Virt_VirtualSystemManagementService.c > --- a/src/Virt_VirtualSystemManagementService.c Tue Jun 30 14:33:31 2009 -0700 > +++ b/src/Virt_VirtualSystemManagementService.c Wed Jul 01 13:39:52 2009 -0700 > @@ -61,6 +61,7 @@ > #define DEFAULT_XEN_WEIGHT 1024 > #define BRIDGE_TYPE "bridge" > #define NETWORK_TYPE "network" > +#define USER_TYPE "user" > > const static CMPIBroker *_BROKER; > > @@ -585,7 +586,8 @@ > } > > dev->dev.net.source = strdup(network); > - > + } else if (STREQC(val, USER_TYPE)) { > + dev->dev.net.type = strdup(USER_TYPE); > } else > return "Invalid Network Type specified"; > free(dev->dev.net.model); > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Mon Jul 6 18:43:02 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Mon, 06 Jul 2009 15:43:02 -0300 Subject: [Libvirt-cim] [PATCH] Change DevicePath to DevicePaths in SettingsDefineCapabilities In-Reply-To: <7bbb36258bf14bcf5ae4.1246490217@localhost.localdomain> References: <7bbb36258bf14bcf5ae4.1246490217@localhost.localdomain> Message-ID: <4A5245B6.7060909@linux.vnet.ibm.com> +1 Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1246490192 25200 > # Node ID 7bbb36258bf14bcf5ae40ad54356ac977620b569 > # Parent 4ea22198d1848b0097e81268dcedc940f2fb9be5 > Change DevicePath to DevicePaths in SettingsDefineCapabilities > > Due to the logical pool changes, DevicePath changed to DevicePaths. It's now > also an array type attribute. > > Signed-off-by: Kaitlin Rupert > > diff -r 4ea22198d184 -r 7bbb36258bf1 src/Virt_SettingsDefineCapabilities.c > --- a/src/Virt_SettingsDefineCapabilities.c Wed Jul 01 13:39:52 2009 -0700 > +++ b/src/Virt_SettingsDefineCapabilities.c Wed Jul 01 16:16:32 2009 -0700 > @@ -1256,6 +1256,7 @@ > { > const char *id; > CMPIInstance *inst; > + CMPIArray *array; > CMPIStatus s = {CMPI_RC_OK, NULL}; > const char *path = "/dev/null"; > int type[7] = {DISK_POOL_DIR, > @@ -1332,9 +1333,30 @@ > break; > } > > - if (dev_path != NULL) > - CMSetProperty(inst, "DevicePath", > - (CMPIValue *)dev_path, CMPI_chars); > + if (dev_path != NULL) { > + CMPIString *str = NULL; > + > + array = CMNewArray(_BROKER, 1, CMPI_string, &s); > + if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(array))) { > + cu_statusf(_BROKER, &s, > + CMPI_RC_ERR_FAILED, > + "Unable to create new array"); > + goto out; > + } > + > + str = CMNewString(_BROKER, dev_path, &s); > + if ((s.rc = CMPI_RC_OK) || (CMIsNullObject(str))) { > + cu_statusf(_BROKER, &s, > + CMPI_RC_ERR_FAILED, > + "Unable to create new string"); > + goto out; > + } > + > + CMSetArrayElementAt(array, 0, &str, CMPI_string); > + > + CMSetProperty(inst, "DevicePaths", > + (CMPIValue *)&array, CMPI_stringA); > + } > > if (host != NULL) > CMSetProperty(inst, "Host", > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Mon Jul 6 20:42:08 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Mon, 06 Jul 2009 17:42:08 -0300 Subject: [Libvirt-cim] [PATCH 0 of 3] Add support for SCSI (host bus adapter) type pools In-Reply-To: References: Message-ID: <4A5261A0.5080804@linux.vnet.ibm.com> +1 Kaitlin Rupert wrote: > This set of changes is for scsi pools that are based on a host bus adapter. These types of sotrage include FiberChannel attached storage devices, as well as > SANs. There's two different ways to define these pools: > > FiberChannel connected devices: > > hba0 > > > > > /dev/disk/by-id > > > > > SAN devices: > > npiv > > > > > /dev/disk/by-id > > > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Tue Jul 7 13:42:22 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 07 Jul 2009 06:42:22 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] Adding new tc for verifying Migration indication for KVM. Message-ID: From deeptik at linux.vnet.ibm.com Tue Jul 7 13:42:24 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 07 Jul 2009 06:42:24 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Adding new tc to verify Migration indications for KVM In-Reply-To: References: Message-ID: <26883d6afdb51457e0ed.1246974144@elm3b151.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1246973869 25200 # Node ID 26883d6afdb51457e0ed7e11e94fce6eb3470f2e # Parent 9903b1d91bd966f453392ddbd0378feb50a4f771 [TEST] Adding new tc to verify Migration indications for KVM. Tested with KVM and current sources on F10. Signed-off-by: Deepti B. Kalakeri diff -r 9903b1d91bd9 -r 26883d6afdb5 suites/libvirt-cim/cimtest/ComputerSystemMigrationJobIndication/01_csmig_ind_for_offline_mig.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ComputerSystemMigrationJobIndication/01_csmig_ind_for_offline_mig.py Tue Jul 07 06:37:49 2009 -0700 @@ -0,0 +1,201 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# +# This testcase is used to verify the Created|Modified|Deleted +# Migration Indications for offline VM Migration. +# +# Date : 06-07-2009 +# + +import sys +import os +from socket import gethostname +from XenKvmLib import vxml +from XenKvmLib.xm_virt_util import domain_list, net_list +from CimTest.Globals import logger +from XenKvmLib.const import do_main, default_network_name +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.classes import get_typed_class +from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate +from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf,\ + destroy_netpool +from XenKvmLib.vxml import set_default +from os import waitpid, kill, fork, _exit +from signal import SIGKILL +from XenKvmLib.indication_tester import CIMIndicationSubscription, sub_ind, \ + handle_request, poll_for_ind + +sup_types = ['KVM', 'Xen'] + +REQUESTED_STATE = 3 + +def setup_guest(test_dom, ip, virt): + virt_xml = vxml.get_class(virt) + cxml = virt_xml(test_dom) + ret = cxml.cim_define(ip) + if not ret: + logger.error("Error define domain %s", test_dom) + return FAIL, cxml + + status, dom_cs = poll_for_state_change(ip, virt, test_dom, + REQUESTED_STATE) + if status != PASS: + cxml.undefine(test_dom) + logger.error("'%s' didn't change state as expected" % test_dom) + return FAIL, cxml + + return PASS, cxml + +def cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, + s_sysname, clean_net=True): + # Clean the domain on target machine. + # This is req when migration is successful, also when migration is not + # completely successful VM might be created on the target machine + # and hence need to clean. + target_list = domain_list(t_sysname, virt) + if target_list != None and test_dom in target_list: + ret_value = cxml.undefine(t_sysname) + if not ret_value: + logger.info("Failed to undefine the migrated domain '%s' on '%s'", + test_dom, t_sysname) + + if clean_net != True: + return + + # clean the networkpool created on the remote machine + target_net_list = net_list(t_sysname, virt) + if target_net_list != None and default_network_name in target_net_list: + ret_value = destroy_netpool(t_sysname, virt, default_network_name) + if ret_value != PASS: + logger.info("Unable to destroy networkpool '%s' on '%s'", + default_network_name, t_sysname) + + # Remote Migration not Successful, clean the domain on src machine + src_list = domain_list(s_sysname, virt) + if src_list != None and test_dom in src_list: + ret_value = cxml.undefine(s_sysname) + if not ret_value: + logger.info("Failed to undefine the domain '%s' on source '%s'", + test_dom, s_sysname) + + +def gen_indication(test_dom, s_sysname, virt, t_sysname): + cxml = None + try: + status, cxml = setup_guest(test_dom, s_sysname, virt) + if status != PASS: + logger.error("Error setting up the guest") + return status, None + + # create the networkpool used in the domain to be migrated + # on the target machine. + t_net_list = net_list(t_sysname, virt) + if t_net_list != None and default_network_name not in t_net_list: + status, netpool = create_netpool_conf(t_sysname, virt, + net_name=default_network_name) + if status != PASS: + raise Exception("Unable to create network pool '%s' on '%s'" + % (default_network_name, t_sysname)) + + # Migrate the test_dom to t_sysname. + # Enable remote migration by setting remote_migrate=1 + status = local_remote_migrate(s_sysname, t_sysname, virt, + remote_migrate=1, + guest_name=test_dom, + mtype='offline') + + except Exception, details: + logger.error("Exception details :%s", details) + return FAIL, cxml + + return status, cxml + + + + at do_main(sup_types) +def main(): + options = main.options + virt = options.virt + status, s_sysname, t_sysname = check_mig_support(virt, options) + if status != PASS: + return status + + status = FAIL + test_dom = 'VM_frm_' + gethostname() + ind_names = { + 'create' : 'ComputerSystemMigrationJobCreatedIndication', + 'modify' : 'ComputerSystemMigrationJobModifiedIndication', + 'delete' : 'ComputerSystemMigrationJobDeletedIndication' + } + + sub_list, ind_names, dict = sub_ind(s_sysname, virt, ind_names) + for ind in ind_names.keys(): + sub = sub_list[ind] + ind_name = ind_names[ind] + logger.info("\n Verifying '%s' indications ....", ind_name) + try: + pid = fork() + if pid == 0: + status = handle_request(sub, ind_name, dict, + len(ind_names.keys())) + if status != PASS: + _exit(1) + + _exit(0) + else: + try: + status, cxml = gen_indication(test_dom, s_sysname, + virt, t_sysname) + if status != PASS: + kill(pid, SIGKILL) + raise Exception("Unable to generate indication") + + status = poll_for_ind(pid, ind_name) + except Exception, details: + kill(pid, SIGKILL) + raise Exception(details) + + except Exception, details: + logger.error("Exception: %s", details) + status = FAIL + + if status != PASS: + break + + cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, + s_sysname, clean_net=False) + + + #Make sure all subscriptions are really unsubscribed + for ind, sub in sub_list.iteritems(): + sub.unsubscribe(dict['default_auth']) + logger.info("Cancelling subscription for %s", ind_names[ind]) + + cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, + s_sysname) + return status + + +if __name__ == "__main__": + sys.exit(main()) + From deeptik at linux.vnet.ibm.com Tue Jul 7 13:42:23 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 07 Jul 2009 06:42:23 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Modified the indication_tester.py to support MigrationIndications In-Reply-To: References: Message-ID: <9903b1d91bd966f45339.1246974143@elm3b151.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1246972788 25200 # Node ID 9903b1d91bd966f453392ddbd0378feb50a4f771 # Parent 479f287a17fd08e4e22ac37459393f6f8327315a [TEST] Modified the indication_tester.py to support MigrationIndications. Modified indication_tester.py to include - sub_ind() --> Subscribe for the indications to be watched. - handle_request() --> Filters the required indications. - poll_for_ind() --> Wait for the required indications to be triggered. Tested with KVM and current sources on F10. Signed-off-by: Deepti B. Kalakeri diff -r 479f287a17fd -r 9903b1d91bd9 suites/libvirt-cim/lib/XenKvmLib/indication_tester.py --- a/suites/libvirt-cim/lib/XenKvmLib/indication_tester.py Tue Jun 30 06:53:22 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/indication_tester.py Tue Jul 07 06:19:48 2009 -0700 @@ -11,6 +11,13 @@ import httplib import base64 from xml.dom.minidom import parse, parseString +from os import kill, WNOHANG +from signal import SIGKILL +from CimTest.Globals import logger +from XenKvmLib.vxml import set_default +from XenKvmLib.classes import get_typed_class +from CimTest.ReturnCodes import PASS, FAIL +from os import waitpid, kill, fork, _exit, WNOHANG def filter_xml(name, type, ns, sysname): return """ @@ -381,6 +388,80 @@ print "CreateSubscription:\n%s\n" % subscript_str print "DeleteSubscription:\n%s\n" % del_subscript_str +def sub_ind(ip, virt, ind_names): + dict = set_default(ip) + 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 handle_request(sub, ind_name, dict, exp_ind_ct): + #sfcb delivers indications to all registrations, even if the indication + #isn't what the registration was subscribed to. So, for modified and + #deleted indications, we must loop through until the indication we are + #looking for is triggered. + for i in range(0, exp_ind_ct): + sub.server.handle_request() + if len(sub.server.indications) < 1: + logger.error("No valid indications received") + return FAIL + + if str(sub.server.indications[0]) == ind_name: + sub.unsubscribe(dict['default_auth']) + logger.info("Cancelling subscription for %s", ind_name) + return PASS + else: + sub.server.indications.remove(sub.server.indications[0]) + + logger.error("Did not recieve indication %s", ind_name) + return FAIL + +def poll_for_ind(pid, ind_name, timeout=20): + status = FAIL + for i in range(0, timeout): + pw = waitpid(pid, 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 '%s' indication successfully", ind_name) + status = PASS + break + elif pw[1] == 0 and i < timeout: + if i % 10 == 0: + logger.info("In child, waiting for '%s' indication", ind_name) + sleep(1) + else: + # Time is up and waitpid never returned the expected pid + if pw[0] != pid: + logger.error("Waited too long for '%s' indication", ind_name) + kill(pid, SIGKILL) + else: + logger.error("Received Indication error: '%d'", pw[1]) + + status = FAIL + break + + return status + def main(): usage = "usage: %prog [options] provider\nex: %prog CIM_InstModification" parser = OptionParser(usage) From kaitlin at linux.vnet.ibm.com Tue Jul 7 19:53:30 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 07 Jul 2009 12:53:30 -0700 Subject: [Libvirt-cim] [PATCH 4 of 4] [TEST] #2 VSMS 08 Remove cleanup_guest_netpool() def and call it from vsmigration.py In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1246472580 25200 # Node ID a8b01b9726bf386defc29540e33f81e0850ac3a6 # Parent 7672e676c7abbfea91cdc28b47cb591451090b89 [TEST] #2 VSMS 08 Remove cleanup_guest_netpool() def and call it from vsmigration.py Updates: -Give guest time to fuly boot before rebooting -Indicate the pass / failure of both the restart and resume cases Note: This test might fail with older versions of Xen - restart migration can be unstable Signed-off-by: Kaitlin Rupert diff -r 7672e676c7ab -r a8b01b9726bf suites/libvirt-cim/cimtest/VirtualSystemMigrationService/08_remote_restart_resume_migration.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/08_remote_restart_resume_migration.py Wed Jul 01 11:07:53 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/08_remote_restart_resume_migration.py Wed Jul 01 11:23:00 2009 -0700 @@ -28,6 +28,7 @@ import sys import os +from time import sleep from socket import gethostname from XenKvmLib import vxml from XenKvmLib.xm_virt_util import domain_list, net_list @@ -35,9 +36,9 @@ from XenKvmLib.const import do_main, default_network_name from CimTest.ReturnCodes import PASS, FAIL, SKIP from XenKvmLib.classes import get_typed_class -from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate -from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf,\ - destroy_netpool +from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate, \ + cleanup_guest_netpool +from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf sup_types = ['KVM', 'Xen'] @@ -125,6 +126,9 @@ status_resume = status_restart = None cxml = None + status_restart = -1 + status_resume = -1 + try: for mig_type in mig_types: @@ -135,6 +139,10 @@ logger.error("Error setting up the guest") return status + # Generally, having a test sleep is a bad choice, but we need to + # give the guest some time to fully boot before we reboot it + sleep(15) + # create the networkpool used in the domain to be migrated # on the target machine. t_net_list = net_list(t_sysname, virt) @@ -168,18 +176,14 @@ cleanup_guest(virt, cxml, test_dom, t_sysname, s_sysname) status = FAIL - # clean the networkpool created on the remote machine - target_net_list = net_list(t_sysname, virt) - if target_net_list != None and net_pool_name in target_net_list: - ret_value = destroy_netpool(t_sysname, virt, net_pool_name) - if ret_value != PASS: - logger.info("Unable to destroy networkpool '%s' on '%s'", - net_pool_name, t_sysname) + cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, s_sysname) - if status_restart != PASS or status_resume != PASS: + if status_restart == PASS and status_resume == PASS: + status = PASS + else: + logger.error("Restart migration %d", status_restart) + logger.error("Resume migration %d", status_resume) status = FAIL - else: - status = PASS logger.info("Test case %s", str_status(status)) return status From kaitlin at linux.vnet.ibm.com Tue Jul 7 19:53:29 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 07 Jul 2009 12:53:29 -0700 Subject: [Libvirt-cim] [PATCH 3 of 4] [TEST] #2 07 -Remove cleanup_guest_netpool() def and call it from vsmigration.py In-Reply-To: References: Message-ID: <7672e676c7abbfea91cd.1246996409@localhost.localdomain> # HG changeset patch # User Kaitlin Rupert # Date 1246471673 25200 # Node ID 7672e676c7abbfea91cdc28b47cb591451090b89 # Parent 896b0360aebfe0c69ddda55567fa096c4d7d4236 [TEST] #2 07 -Remove cleanup_guest_netpool() def and call it from vsmigration.py Updates from 1 to 2: -Don't attempt to destroy() or undefine() the guest unless the guest is present on the system Signed-off-by: Kaitlin Rupert diff -r 896b0360aebf -r 7672e676c7ab suites/libvirt-cim/cimtest/VirtualSystemMigrationService/07_remote_offline_migration.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/07_remote_offline_migration.py Wed Jul 01 11:04:13 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/07_remote_offline_migration.py Wed Jul 01 11:07:53 2009 -0700 @@ -35,9 +35,9 @@ from XenKvmLib.const import do_main, default_network_name from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.classes import get_typed_class -from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate -from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf,\ - destroy_netpool +from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate, \ + cleanup_guest_netpool +from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf sup_types = ['KVM', 'Xen'] @@ -60,35 +60,6 @@ return PASS, cxml -def cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, s_sysname): - # Clean the domain on target machine. - # This is req when migration is successful, also when migration is not - # completely successful VM might be created on the target machine - # and hence need to clean. - target_list = domain_list(t_sysname, virt) - if target_list != None and test_dom in target_list: - ret_value = cxml.undefine(t_sysname) - if not ret_value: - logger.info("Failed to undefine the migrated domain '%s' on '%s'", - test_dom, t_sysname) - - # clean the networkpool created on the remote machine - target_net_list = net_list(t_sysname, virt) - if target_net_list != None and default_network_name in target_net_list: - ret_value = destroy_netpool(t_sysname, virt, default_network_name) - if ret_value != PASS: - logger.info("Unable to destroy networkpool '%s' on '%s'", - default_network_name, t_sysname) - - # Remote Migration not Successful, clean the domain on src machine - src_list = domain_list(s_sysname, virt) - if src_list != None and test_dom in src_list: - ret_value = cxml.undefine(s_sysname) - if not ret_value: - logger.info("Failed to undefine the domain '%s' on source '%s'", - test_dom, s_sysname) - - @do_main(sup_types) def main(): options = main.options diff -r 896b0360aebf -r 7672e676c7ab suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Wed Jul 01 11:04:13 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Wed Jul 01 11:07:53 2009 -0700 @@ -30,7 +30,7 @@ from CimTest.ReturnCodes import PASS, FAIL, SKIP from XenKvmLib.enumclass import EnumInstances from XenKvmLib.classes import get_typed_class, virt_types -from XenKvmLib.xm_virt_util import domain_list, net_list +from XenKvmLib.xm_virt_util import domain_list, net_list, active_domain_list from XenKvmLib.const import get_provider_version, default_network_name from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS, \ CIM_ERROR_ENUMERATE @@ -435,13 +435,15 @@ # This is req when migration is successful, also when migration is not # completely successful VM might be created on the target machine # and hence need to clean. - target_list = domain_list(t_sysname, virt) - if target_list != None and test_dom in target_list: + target_list = active_domain_list(t_sysname, virt) + if target_list != None and test_dom in target_list: ret_value = cxml.cim_destroy(t_sysname) if not ret_value: logger.info("Failed to destroy the migrated domain '%s' on '%s'", test_dom, t_sysname) + target_list = domain_list(t_sysname, virt) + if target_list != None and test_dom in target_list: ret_value = cxml.undefine(t_sysname) if not ret_value: logger.info("Failed to undefine the migrated domain '%s' on '%s'", From kaitlin at linux.vnet.ibm.com Tue Jul 7 19:53:26 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 07 Jul 2009 12:53:26 -0700 Subject: [Libvirt-cim] [PATCH 0 of 4] [TEST] #2 Misc migration test fixes Message-ID: This tests enable localhost migration to work with Xen guests From kaitlin at linux.vnet.ibm.com Tue Jul 7 19:53:28 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 07 Jul 2009 12:53:28 -0700 Subject: [Libvirt-cim] [PATCH 2 of 4] [TEST] 06 - Remove cleanup_guest_netpool() def and call it from vsmigration.py In-Reply-To: References: Message-ID: <896b0360aebfe0c69ddd.1246996408@localhost.localdomain> # HG changeset patch # User Kaitlin Rupert # Date 1246471453 25200 # Node ID 896b0360aebfe0c69ddda55567fa096c4d7d4236 # Parent f26dc340488dd97f242fc9dec3cac46279e0cc9e [TEST] 06 - Remove cleanup_guest_netpool() def and call it from vsmigration.py Signed-off-by: Kaitlin Rupert diff -r f26dc340488d -r 896b0360aebf suites/libvirt-cim/cimtest/VirtualSystemMigrationService/06_remote_live_migration.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/06_remote_live_migration.py Wed Jul 01 10:56:19 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/06_remote_live_migration.py Wed Jul 01 11:04:13 2009 -0700 @@ -35,9 +35,9 @@ from XenKvmLib.const import do_main, default_network_name from CimTest.ReturnCodes import PASS, FAIL, SKIP from XenKvmLib.classes import get_typed_class -from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate -from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf,\ - destroy_netpool +from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate, \ + cleanup_guest_netpool +from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf sup_types = ['KVM', 'Xen'] @@ -67,45 +67,6 @@ return PASS, cxml -def cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, s_sysname): - # Clean the domain on target machine. - # This is req when migration is successful, also when migration is not - # completely successful VM might be created on the target machine - # and hence need to clean. - target_list = domain_list(t_sysname, virt) - if target_list != None and test_dom in target_list: - ret_value = cxml.destroy(t_sysname) - if not ret_value: - logger.info("Failed to destroy the migrated domain '%s' on '%s'", - test_dom, t_sysname) - - ret_value = cxml.undefine(t_sysname) - if not ret_value: - logger.info("Failed to undefine the migrated domain '%s' on '%s'", - test_dom, t_sysname) - - # clean the networkpool created on the remote machine - target_net_list = net_list(t_sysname, virt) - if target_net_list != None and default_network_name in target_net_list: - ret_value = destroy_netpool(t_sysname, virt, default_network_name) - if ret_value != PASS: - logger.info("Unable to destroy networkpool '%s' on '%s'", - default_network_name, t_sysname) - - # Remote Migration not Successful, clean the domain on src machine - src_list = domain_list(s_sysname, virt) - if src_list != None and test_dom in src_list: - ret_value = cxml.cim_destroy(s_sysname) - if not ret_value: - logger.info("Failed to destroy the domain '%s' on the source '%s'", - test_dom, s_sysname) - - ret_value = cxml.undefine(s_sysname) - if not ret_value: - logger.info("Failed to undefine the domain '%s' on source '%s'", - test_dom, s_sysname) - - @do_main(sup_types) def main(): options = main.options From kaitlin at linux.vnet.ibm.com Tue Jul 7 19:53:27 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 07 Jul 2009 12:53:27 -0700 Subject: [Libvirt-cim] [PATCH 1 of 4] [TEST] #2 Move cleanup_guest_netpool() to vsmigrations.py In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1246470979 25200 # Node ID f26dc340488dd97f242fc9dec3cac46279e0cc9e # Parent 479f287a17fd08e4e22ac37459393f6f8327315a [TEST] #2 Move cleanup_guest_netpool() to vsmigrations.py Migration test 06 - 08 duplicate this same code. Also, if the migration is a localhost one, set the hostname to localhost. Otherwise, the providers will return an error saying the guest already exists on the target (because the providers haven't detected a localhost migration). If the target system name is localhost, the migration will always be a local migration. Be sure to set remote_migration accordingly. Update from 1 to 2: -Change destroy() to cim_destroy() Signed-off-by: Kaitlin Rupert diff -r 479f287a17fd -r f26dc340488d suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Tue Jun 30 06:53:22 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Wed Jul 01 10:56:19 2009 -0700 @@ -30,10 +30,11 @@ from CimTest.ReturnCodes import PASS, FAIL, SKIP from XenKvmLib.enumclass import EnumInstances from XenKvmLib.classes import get_typed_class, virt_types -from XenKvmLib.xm_virt_util import domain_list -from XenKvmLib.const import get_provider_version +from XenKvmLib.xm_virt_util import domain_list, net_list +from XenKvmLib.const import get_provider_version, default_network_name from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS, \ CIM_ERROR_ENUMERATE +from XenKvmLib.common_util import destroy_netpool # Migration constants CIM_MIGRATE_OFFLINE=1 @@ -94,9 +95,14 @@ def check_mig_support(virt, options): s_sysname = gethostbyaddr(options.ip)[0] t_sysname = gethostbyaddr(options.t_url)[0] - if virt == 'KVM' and (t_sysname == s_sysname or t_sysname in s_sysname): - logger.info("Libvirt does not support local migration for KVM") - return SKIP, s_sysname, t_sysname + + if t_sysname == s_sysname or t_sysname in s_sysname: + if virt == 'KVM': + logger.info("Libvirt does not support local migration for KVM") + return SKIP, s_sysname, t_sysname + + #localhost migration is supported by Xen + return PASS, s_sysname, "localhost" return PASS, s_sysname, t_sysname @@ -364,12 +370,15 @@ logger.error("Guest to be migrated not specified.") return FAIL + if t_sysname == "localhost": + remote_migrate = 0 + try: if remote_migrate == 1: - status, req_image, backup_image = remote_copy_guest_image(virt, - s_sysname, - t_sysname, - guest_name) + status, req_image, bkup_image = remote_copy_guest_image(virt, + s_sysname, + t_sysname, + guest_name) if status != PASS: raise Exception("Failure from remote_copy_guest_image()") @@ -397,7 +406,10 @@ logger.info("Migrating '%s'.. this will take some time.", guest_name) # Migrate the guest to t_sysname - status, ret = migrate_guest_to_host(vsmservice, guest_ref, t_sysname, msd) + status, ret = migrate_guest_to_host(vsmservice, + guest_ref, + t_sysname, + msd) if status == FAIL: raise Exception("Failed to Migrate guest '%s' from '%s' to '%s'" \ % (guest_name, s_sysname, t_sysname)) @@ -413,5 +425,50 @@ logger.error("Exception details %s", details) status = FAIL - cleanup_image(backup_image, req_image, t_sysname, remote_migrate=1) + if remote_migrate == 1: + cleanup_image(bkup_image, req_image, t_sysname, remote_migrate=1) + return status + +def cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, s_sysname): + # Clean the domain on target machine. + # This is req when migration is successful, also when migration is not + # completely successful VM might be created on the target machine + # and hence need to clean. + target_list = domain_list(t_sysname, virt) + if target_list != None and test_dom in target_list: + ret_value = cxml.cim_destroy(t_sysname) + if not ret_value: + logger.info("Failed to destroy the migrated domain '%s' on '%s'", + test_dom, t_sysname) + + ret_value = cxml.undefine(t_sysname) + if not ret_value: + logger.info("Failed to undefine the migrated domain '%s' on '%s'", + test_dom, t_sysname) + + # Done cleaning environment + if t_sysname == "localhost": + return + + # Remote Migration not Successful, clean the domain on src machine + src_list = domain_list(s_sysname, virt) + if src_list != None and test_dom in src_list: + ret_value = cxml.cim_destroy(s_sysname) + if not ret_value: + logger.info("Failed to destroy the domain '%s' on the source '%s'", + test_dom, s_sysname) + + ret_value = cxml.undefine(s_sysname) + if not ret_value: + logger.info("Failed to undefine the domain '%s' on source '%s'", + test_dom, s_sysname) + + # clean the networkpool created on the remote machine + target_net_list = net_list(t_sysname, virt) + if target_net_list != None and default_network_name in target_net_list: + ret_value = destroy_netpool(t_sysname, virt, default_network_name) + if ret_value != PASS: + logger.info("Unable to destroy networkpool '%s' on '%s'", + default_network_name, t_sysname) + From snmishra at us.ibm.com Tue Jul 7 21:17:32 2009 From: snmishra at us.ibm.com (Sharad Mishra) Date: Tue, 07 Jul 2009 14:17:32 -0700 Subject: [Libvirt-cim] [PATCH] Enum instance of net RASD wasn't parsing network name properly Message-ID: <78a5d3cd29f9a5596e42.1247001452@elm3b24.beaverton.ibm.com> # HG changeset patch # User snmishra at us.ibm.com # Date 1247001210 25200 # Node ID 78a5d3cd29f9a5596e42437ceed49626b7674460 # Parent 2f0fb9e5d52301fc00212d543d593e24d89ba0f0 Enum instance of net RASD wasn't parsing network name properly. Updated device parsing code and net RASD to get network name for bridge devices. Signed-off-by: Sharad Mishra diff -r 2f0fb9e5d523 -r 78a5d3cd29f9 libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Wed Jun 24 11:46:08 2009 -0700 +++ b/libxkutil/device_parsing.c Tue Jul 07 14:13:30 2009 -0700 @@ -307,8 +307,8 @@ if (ndev->mac == NULL) goto err; } else if (XSTREQ(child->name, "source")) { - ndev->source = get_attr_value(child, "bridge"); - if (ndev->source != NULL) + ndev->name = get_attr_value(child, "bridge"); + if (ndev->name != NULL) continue; ndev->source = get_attr_value(child, "network"); if (ndev->source != NULL) diff -r 2f0fb9e5d523 -r 78a5d3cd29f9 src/Virt_RASD.c --- a/src/Virt_RASD.c Wed Jun 24 11:46:08 2009 -0700 +++ b/src/Virt_RASD.c Tue Jul 07 14:13:30 2009 -0700 @@ -404,6 +404,13 @@ (CMPIValue *)dev->dev.net.mac, CMPI_chars); + if ((dev->dev.net.name != NULL) && + (STREQ(dev->dev.net.type, "bridge"))) + CMSetProperty(inst, + "NetworkName", + (CMPIValue *)dev->dev.net.name, + CMPI_chars); + if (dev->dev.net.model != NULL) CMSetProperty(inst, "ResourceSubType", From kaitlin at linux.vnet.ibm.com Wed Jul 8 00:16:26 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 07 Jul 2009 17:16:26 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Update get_exp_template_rasd_len() based on template RASD additions Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1246489133 25200 # Node ID d5f1540750c4dbe483ec90e1b278be90d76de1b9 # Parent a8b01b9726bf386defc29540e33f81e0850ac3a6 [TEST] #2 Update get_exp_template_rasd_len() based on template RASD additions The providers now return template RASDs for both "bridge" and "network" interface types. In addition to that, the providers now return template DiskPoolRASDs for iSCSI pools Updates: -Be sure not to overwrite expected len value. -Changes related to recent NetRASD and DiskRASD updates Signed-off-by: Kaitlin Rupert diff -r a8b01b9726bf -r d5f1540750c4 suites/libvirt-cim/lib/XenKvmLib/rasd.py --- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Wed Jul 01 11:23:00 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Wed Jul 01 15:58:53 2009 -0700 @@ -320,7 +320,7 @@ exp_len = exp_base_num if id == "DiskPool/0": - pool_types = 5 + pool_types = 7 return exp_base_num * pool_types if virt == 'Xen' or virt == 'XenFV': @@ -333,10 +333,11 @@ exp_len = exp_base_num + exp_cdrom elif rev >= libvirt_rasd_dpool_changes and libvirt_ver >= '0.4.1': - volumes = enum_volumes(virt, ip) - exp_len = ((volumes * exp_base_num) + exp_cdrom) * xen_multi + volumes = enum_volumes(virt, ip) + exp_len = ((volumes * exp_base_num) + exp_cdrom) * xen_multi - exp_len = (exp_base_num + exp_cdrom) * xen_multi + else: + exp_len = (exp_base_num + exp_cdrom) * xen_multi elif virt == 'KVM': if rev >= libvirt_rasd_new_changes and \ @@ -363,8 +364,9 @@ if rev >= net_rasd_template_changes: dev_types = 2 + net_types = 3 - return exp_base_num * dev_types + return exp_base_num * dev_types * net_types def get_exp_template_rasd_len(virt, ip, id): curr_cim_rev, changeset = get_provider_version(virt, ip) From deeptik at linux.vnet.ibm.com Wed Jul 8 10:35:28 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 08 Jul 2009 16:05:28 +0530 Subject: [Libvirt-cim] Test Run Summary (Jul 08 2009): KVM on Fedora release 10.90 (Rawhide) with Pegasus Message-ID: <4A547670.4080309@linux.vnet.ibm.com> ================================================= Test Run Summary (Jul 08 2009): KVM on Fedora release 10.90 (Rawhide) with Pegasus ================================================= Distro: Fedora release 10.90 (Rawhide) Kernel: 2.6.29-0.38.rc1.git4.fc11.x86_64 libvirt: 0.6.2 Hypervisor: QEMU 0.10.0 CIMOM: Pegasus 2.7.2 Libvirt-cim revision: 921 Libvirt-cim changeset: 0fb4613252c1 Cimtest revision: 710 Cimtest changeset: 75e1ba2b6c20 ================================================= FAIL : 7 XFAIL : 3 SKIP : 6 PASS : 142 ----------------- Total : 158 ================================================= FAIL Test Summary: ComputerSystemIndication - 01_created_indication.py: FAIL HostSystem - 03_hs_to_settdefcap.py: FAIL RASD - 07_parent_disk_pool.py: FAIL SettingsDefineCapabilities - 01_forward.py: FAIL VirtualSystemManagementService - 15_mod_system_settings.py: FAIL VirtualSystemMigrationService - 06_remote_live_migration.py: FAIL VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: FAIL ================================================= XFAIL Test Summary: ComputerSystem - 32_start_reboot.py: XFAIL ComputerSystem - 33_suspend_reboot.py: XFAIL VirtualSystemManagementService - 16_removeresource.py: XFAIL ================================================= SKIP Test Summary: ComputerSystem - 02_nosystems.py: SKIP LogicalDisk - 02_nodevs.py: SKIP VSSD - 02_bootldr.py: SKIP VirtualSystemMigrationService - 01_migratable_host.py: SKIP VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP ================================================= 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: PASS -------------------------------------------------------------------- ComputerSystem - 05_activate_defined_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 06_paused_active_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 22_define_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 23_pause_pause.py: PASS -------------------------------------------------------------------- ComputerSystem - 27_define_pause_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 32_start_reboot.py: XFAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot with return code 1 ERROR - Exception: Unable reboot dom 'cs_test_domain' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot Bug:<00005> -------------------------------------------------------------------- ComputerSystem - 33_suspend_reboot.py: XFAIL ERROR - Got CIM error CIM_ERR_NOT_SUPPORTED: State not supported with return code 7 ERROR - Exception: Unable Suspend dom 'test_domain' InvokeMethod(RequestStateChange): CIM_ERR_NOT_SUPPORTED: State not supported Bug:<00012> -------------------------------------------------------------------- ComputerSystem - 35_start_reset.py: PASS -------------------------------------------------------------------- ComputerSystem - 40_RSC_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 41_cs_to_settingdefinestate.py: PASS -------------------------------------------------------------------- ComputerSystem - 42_cs_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for destroy 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: FAIL ERROR - KVM_SettingsDefineCapabilities returned 24 RASD objects instead of 8 for NetworkPool/cimtest-networkpool CIM_ERR_INVALID_CLASS: Linux_ComputerSystem -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: PASS -------------------------------------------------------------------- HostSystem - 05_hs_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 06_hs_to_vsms.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 01_forward.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 02_reverse.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 -------------------------------------------------------------------- KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS -------------------------------------------------------------------- LogicalDisk - 01_disk.py: PASS -------------------------------------------------------------------- LogicalDisk - 02_nodevs.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- 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: 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 -------------------------------------------------------------------- RASD - 04_disk_rasd_size.py: PASS -------------------------------------------------------------------- RASD - 05_disk_rasd_emu_type.py: PASS -------------------------------------------------------------------- RASD - 06_parent_net_pool.py: PASS -------------------------------------------------------------------- RASD - 07_parent_disk_pool.py: FAIL 07_parent_disk_pool.py:47: DeprecationWarning: the sets module is deprecated from sets import Set ERROR - Exception details: Got 7 recs instead of 3 -------------------------------------------------------------------- RedirectionService - 01_enum_crs.py: PASS -------------------------------------------------------------------- RedirectionService - 02_enum_crscap.py: PASS -------------------------------------------------------------------- RedirectionService - 03_RedirectionSAP_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 -------------------------------------------------------------------- ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 09_DeleteDiskPool.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 02_reverse.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefine - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 03_sds_fwd_errs.py: PASS -------------------------------------------------------------------- SettingsDefine - 04_sds_rev_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 01_forward.py: FAIL ERROR - KVM_SettingsDefineCapabilities returned 24 ResourcePool objects instead of 8 -------------------------------------------------------------------- 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: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 10_hv_version.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 12_referenced_config.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 13_refconfig_additional_devs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 14_define_sys_disk.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 15_mod_system_settings.py: FAIL ERROR - CIMError : (1, u'CIM_ERR_FAILED: Unable to parse embedded object') Traceback (most recent call last): File "./lib/XenKvmLib/const.py", line 139, in do_try File "15_mod_system_settings.py", line 103, in main ret = service.ModifySystemSettings(SystemSettings=vssd) File "/data/users/deepti/F10_runs/cimtest/lib/CimTest/CimExt.py", line 32, in __call__ return self.__invoker(self.__name, args) File "/data/users/deepti/F10_runs/cimtest/lib/CimTest/CimExt.py", line 44, in __invoke return self.conn.InvokeMethod(method, self.inst, **params) File "/usr/lib/python2.6/site-packages/pywbem/cim_operations.py", line 801, in InvokeMethod result = self.methodcall(MethodName, obj, **params) File "/usr/lib/python2.6/site-packages/pywbem/cim_operations.py", line 362, in methodcall raise CIMError(code, tt[0][1]['DESCRIPTION']) CIMError: (1, u'CIM_ERR_FAILED: Unable to parse embedded object') ERROR - None InvokeMethod(ModifySystemSettings): CIM_ERR_FAILED: Unable to parse embedded object -------------------------------------------------------------------- VirtualSystemManagementService - 16_removeresource.py: XFAIL ERROR - 0 RASD insts for domain/mouse:ps2 CIM_ERR_NOT_FOUND: No such instance (no device domain/mouse:ps2) Bug:<00014> -------------------------------------------------------------------- VirtualSystemManagementService - 17_removeresource_neg.py: PASS -------------------------------------------------------------------- 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 -------------------------------------------------------------------- VirtualSystemMigrationService - 06_remote_live_migration.py: FAIL ERROR - JobStatus for dom 'VM_frm_elm3a148.beaverton.ibm.com' has 'Migration Failed: Error 0' instead of 'Completed' -------------------------------------------------------------------- VirtualSystemMigrationService - 07_remote_offline_migration.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: FAIL ERROR - JobStatus for dom 'VM_frm_elm3a148.beaverton.ibm.com' has 'Migration Failed: Error 0' instead of 'Completed' ERROR - Cleanup failed after 'resume' migration -------------------------------------------------------------------- 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 -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS -------------------------------------------------------------------- -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Jul 8 10:59:57 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 08 Jul 2009 16:29:57 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Update get_exp_template_rasd_len() based on template RASD additions In-Reply-To: References: Message-ID: <4A547C2D.9000500@linux.vnet.ibm.com> +1 for me. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 8 21:51:10 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 08 Jul 2009 14:51:10 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Adding new tc to verify Migration indications for KVM In-Reply-To: <26883d6afdb51457e0ed.1246974144@elm3b151.beaverton.ibm.com> References: <26883d6afdb51457e0ed.1246974144@elm3b151.beaverton.ibm.com> Message-ID: <4A5514CE.5050906@linux.vnet.ibm.com> > +import sys > +import os You have an import os statement later on, so no need to include this one. > +from socket import gethostname > +from XenKvmLib import vxml Same here, you have an import vxml statement later on; this one can be removed. > + if status != PASS: > + break Instead of breaking here, you can break after calling cleanup_guest_netpool(), this way, you won't need to call cleanup_guest_netpool() after you unsubscribe the indications. > + > + cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, > + s_sysname, clean_net=False) > + > + > + #Make sure all subscriptions are really unsubscribed > + for ind, sub in sub_list.iteritems(): > + sub.unsubscribe(dict['default_auth']) > + logger.info("Cancelling subscription for %s", ind_names[ind]) > + > + cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, > + s_sysname) > + return status > + -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 8 21:55:01 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 08 Jul 2009 14:55:01 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Modified the indication_tester.py to support MigrationIndications In-Reply-To: <9903b1d91bd966f45339.1246974143@elm3b151.beaverton.ibm.com> References: <9903b1d91bd966f45339.1246974143@elm3b151.beaverton.ibm.com> Message-ID: <4A5515B5.1050805@linux.vnet.ibm.com> Deepti B. Kalakeri wrote: > # HG changeset patch > # User Deepti B. Kalakeri > # Date 1246972788 25200 > # Node ID 9903b1d91bd966f453392ddbd0378feb50a4f771 > # Parent 479f287a17fd08e4e22ac37459393f6f8327315a > [TEST] Modified the indication_tester.py to support MigrationIndications. > > Modified indication_tester.py to include > - sub_ind() --> Subscribe for the indications to be watched. > - handle_request() --> Filters the required indications. > - poll_for_ind() --> Wait for the required indications to be triggered. > > Tested with KVM and current sources on F10. > Signed-off-by: Deepti B. Kalakeri > > diff -r 479f287a17fd -r 9903b1d91bd9 suites/libvirt-cim/lib/XenKvmLib/indication_tester.py I'm torn on whether to include these changes in this file. Really, the indication_tester.py was a standalone tool that wasn't originally included in the cimtest tree. It was pulled in later so that the automated test cases could leverage its functionality. Anytime a change is made to other copy, the changes need to be pushed to the other so that the two remain in sync. These changes won't ever be used by the indication_tester.py itself, so I'm inclined to suggest moving them into their own module. Generally, I'm against having lots of different modules - I am in favor of consolidating where appropriate. However, I think this makes sense given that indication_tester is a special case. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 8 23:38:21 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 08 Jul 2009 16:38:21 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Support for VNC password and sdl type graphics devices Message-ID: From kaitlin at linux.vnet.ibm.com Wed Jul 8 23:38:22 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 08 Jul 2009 16:38:22 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Add Password attribute to GraphicsRASD In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1247095850 25200 # Node ID f609e31b0c17ea550f27426dd8e329c362f4db3e # Parent 0fb4613252c19abb6bf5496a8b7031793ba7f298 Add Password attribute to GraphicsRASD Also add necessary changes to the graphics struct and generating XML with the passwd attribute. The passwd won't show up in the XML we get back from libvirt, so pulling the passwd from the guest XML isn't included in parse_graphics_device(). Signed-off-by: Kaitlin Rupert diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Tue Jun 30 14:33:31 2009 -0700 +++ b/libxkutil/device_parsing.c Wed Jul 08 16:30:50 2009 -0700 @@ -81,6 +81,7 @@ free(dev->port); free(dev->host); free(dev->keymap); + free(dev->passwd); } static void cleanup_input_device(struct input_device *dev) diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/device_parsing.h --- a/libxkutil/device_parsing.h Tue Jun 30 14:33:31 2009 -0700 +++ b/libxkutil/device_parsing.h Wed Jul 08 16:30:50 2009 -0700 @@ -70,6 +70,7 @@ char *port; char *host; char *keymap; + char *passwd; }; struct input_device { diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/xmlgen.c --- a/libxkutil/xmlgen.c Tue Jun 30 14:33:31 2009 -0700 +++ b/libxkutil/xmlgen.c Wed Jul 08 16:30:50 2009 -0700 @@ -338,11 +338,21 @@ return XML_ERROR; xmlNewProp(tmp, BAD_CAST "type", BAD_CAST dev->type); + + if (STREQC(dev->type, "sdl")) + goto out; + xmlNewProp(tmp, BAD_CAST "port", BAD_CAST dev->port); xmlNewProp(tmp, BAD_CAST "listen", BAD_CAST dev->host); xmlNewProp(tmp, BAD_CAST "keymap", BAD_CAST dev->keymap); + + if (dev->passwd != NULL) + xmlNewProp(tmp, + BAD_CAST "passwd", + BAD_CAST dev->passwd); } + out: return NULL; } diff -r 0fb4613252c1 -r f609e31b0c17 schema/ResourceAllocationSettingData.mof --- a/schema/ResourceAllocationSettingData.mof Tue Jun 30 14:33:31 2009 -0700 +++ b/schema/ResourceAllocationSettingData.mof Wed Jul 08 16:30:50 2009 -0700 @@ -132,6 +132,9 @@ { [Description ("Keyboard keymapping")] string KeyMap; + + [Description ("VNC password")] + string Password; }; [Description ("KVM virtual graphics device"), @@ -141,6 +144,9 @@ { [Description ("Keyboard keymapping")] string KeyMap; + + [Description ("VNC password")] + string Password; }; [Description ("LXC virtual graphics device"), @@ -150,6 +156,9 @@ { [Description ("Keyboard keymapping")] string KeyMap; + + [Description ("VNC password")] + string Password; }; [Description ("Xen virtual input device"), From kaitlin at linux.vnet.ibm.com Wed Jul 8 23:38:23 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 08 Jul 2009 16:38:23 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Add support for specifying a password for VNC connections to VSMS In-Reply-To: References: Message-ID: <48442a47da882ce635ec.1247096303@localhost.localdomain> # HG changeset patch # User Kaitlin Rupert # Date 1247095850 25200 # Node ID 48442a47da882ce635ec043086613eb6d15d596f # Parent f609e31b0c17ea550f27426dd8e329c362f4db3e Add support for specifying a password for VNC connections to VSMS Also support sdl type graphics devices. Generate template RASDs for both types. Signed-off-by: Kaitlin Rupert diff -r f609e31b0c17 -r 48442a47da88 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Wed Jul 08 16:30:50 2009 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Wed Jul 08 16:30:50 2009 -0700 @@ -1429,14 +1429,42 @@ return s; } +static CMPIStatus set_graphics_props(const CMPIObjectPath *ref, + const char *id, + const char *type, + struct inst_list *list) +{ + CMPIInstance *inst; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_GRAPHICS, DEVICE_RASD); + + CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars); + + if (STREQC(type, "vnc")) { + const char *addr = "127.0.0.1:-1"; + + CMSetProperty(inst, "Address", (CMPIValue *)addr, CMPI_chars); + + CMSetProperty(inst, "KeyMap", (CMPIValue *)"en-us", CMPI_chars); + } + + CMSetProperty(inst, "ResourceSubType", (CMPIValue *)type, CMPI_chars); + + inst_list_add(list, inst); + + return s; +} + static CMPIStatus graphics_template(const CMPIObjectPath *ref, int template_type, struct inst_list *list) { const char *id; - const char *addr; - CMPIInstance *inst; CMPIStatus s = {CMPI_RC_OK, NULL}; + const char *type[] = {"vnc", "sdl"}; + int type_ct = 2; + int i; switch(template_type) { case SDC_RASD_MIN: @@ -1458,17 +1486,11 @@ goto out; } - inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_GRAPHICS, DEVICE_RASD); - - CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars); - - addr = "127.0.0.1:-1"; - CMSetProperty(inst, "Address", (CMPIValue *)addr, CMPI_chars); - - CMSetProperty(inst, "KeyMap", (CMPIValue *)"en-us", CMPI_chars); - CMSetProperty(inst, "ResourceSubType", (CMPIValue *)"vnc", CMPI_chars); - - inst_list_add(list, inst); + for (i = 0; i < type_ct; i++) { + s = set_graphics_props(ref, id, type[i], list); + if (s.rc != CMPI_RC_OK) + goto out; + } out: return s; diff -r f609e31b0c17 -r 48442a47da88 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Jul 08 16:30:50 2009 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Wed Jul 08 16:30:50 2009 -0700 @@ -771,7 +771,11 @@ const char *keymap; int ret; - dev->dev.graphics.type = strdup("vnc"); + if (cu_get_str_prop(inst, "ResourceSubType", &val) != CMPI_RC_OK) { + msg = "GraphicsRASD ResourceSubType field not valid"; + goto out; + } + dev->dev.graphics.type = strdup(val); /* FIXME: Add logic to prevent address:port collisions */ if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) { @@ -792,6 +796,12 @@ dev->dev.graphics.keymap = strdup(keymap); + if (cu_get_str_prop(inst, "Password", &val) != CMPI_RC_OK) { + dev->dev.graphics.passwd = NULL; + } else { + dev->dev.graphics.passwd = strdup(val); + } + out: return msg; From deeptik at linux.vnet.ibm.com Thu Jul 9 12:13:37 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 09 Jul 2009 17:43:37 +0530 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Adding new tc to verify Migration indications for KVM In-Reply-To: <4A5514CE.5050906@linux.vnet.ibm.com> References: <26883d6afdb51457e0ed.1246974144@elm3b151.beaverton.ibm.com> <4A5514CE.5050906@linux.vnet.ibm.com> Message-ID: <4A55DEF1.2030903@linux.vnet.ibm.com> Kaitlin Rupert wrote: > >> +import sys >> +import os > > You have an import os statement later on, so no need to include this one. > >> +from socket import gethostname >> +from XenKvmLib import vxml > > Same here, you have an import vxml statement later on; this one can be > removed. > > >> + if status != PASS: >> + break > > Instead of breaking here, you can break after calling > cleanup_guest_netpool(), this way, you won't need to call > cleanup_guest_netpool() after you unsubscribe the indications. > The call to cleanup_guest_netpool() are little different .. the call after the status check is designed to not delete the network pool that is created on the target machine so that we can reuse it through the loop without having to create it every time we want to migrate the guest. >> + >> + cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, + s_sysname, >> clean_net=False) >> + >> + >> + #Make sure all subscriptions are really unsubscribed >> + for ind, sub in sub_list.iteritems(): >> + sub.unsubscribe(dict['default_auth']) >> + logger.info("Cancelling subscription for %s", ind_names[ind]) >> + >> + cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, + s_sysname) >> + return status >> + > > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Jul 9 12:46:39 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 09 Jul 2009 18:16:39 +0530 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Modified the indication_tester.py to support MigrationIndications In-Reply-To: <4A5515B5.1050805@linux.vnet.ibm.com> References: <9903b1d91bd966f45339.1246974143@elm3b151.beaverton.ibm.com> <4A5515B5.1050805@linux.vnet.ibm.com> Message-ID: <4A55E6AF.8020705@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Deepti B. Kalakeri wrote: >> # HG changeset patch >> # User Deepti B. Kalakeri >> # Date 1246972788 25200 >> # Node ID 9903b1d91bd966f453392ddbd0378feb50a4f771 >> # Parent 479f287a17fd08e4e22ac37459393f6f8327315a >> [TEST] Modified the indication_tester.py to support >> MigrationIndications. >> >> Modified indication_tester.py to include >> - sub_ind() --> Subscribe for the indications to be watched. >> - handle_request() --> Filters the required indications. >> - poll_for_ind() --> Wait for the required indications to be triggered. >> >> Tested with KVM and current sources on F10. >> Signed-off-by: Deepti B. Kalakeri >> >> diff -r 479f287a17fd -r 9903b1d91bd9 >> suites/libvirt-cim/lib/XenKvmLib/indication_tester.py > > I'm torn on whether to include these changes in this file. Really, the > indication_tester.py was a standalone tool that wasn't originally > included in the cimtest tree. It was pulled in later so that the > automated test cases could leverage its functionality. > > Anytime a change is made to other copy, the changes need to be pushed > to the other so that the two remain in sync. These changes won't ever > be used by the indication_tester.py itself, so I'm inclined to suggest > moving them into their own module. > > Generally, I'm against having lots of different modules - I am in > favor of consolidating where appropriate. However, I think this makes > sense given that indication_tester is a special case. > I agree with you.. I too came up with the same problem of whether to extend the indication_tester.py to include the new fns(). I have moved the required fns() for Indications to a new file called indications.py, so now indication_tester.py is independent to be moved after the CSI/01_created_indication.py is modified to use the indications.py fns(). I think since we have a different dir which standalone tc, we can move the indication_tester.py to suites/libvirt-cim/misc_cimtests/, and how about migration_tester.py ...thoughts ?? -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Jul 9 12:55:36 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 09 Jul 2009 05:55:36 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] Adding new tc for verifying Migration indication for KVM. Message-ID: Moved the indications related to fns to new lib indications.py. Removed some un necessary import stmts From deeptik at linux.vnet.ibm.com Thu Jul 9 12:55:37 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 09 Jul 2009 05:55:37 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Added the indications.py to support Indications In-Reply-To: References: Message-ID: <73aedcd4026381023be4.1247144137@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1247143660 25200 # Node ID 73aedcd4026381023be4d25d741ce74113b8f8e6 # Parent 7b18b827fca6916fd87ff417f79a96c8a19b4913 [TEST] Added the indications.py to support Indications. Included the following important functions in indications.py - sub_ind() --> Subscribe for the indications to be watched. - handle_request() --> Filters the required indications. - poll_for_ind() --> Wait for the required indications to be triggered. Tested with KVM and current sources on F10. Signed-off-by: Deepti B. Kalakeri diff -r 7b18b827fca6 -r 73aedcd40263 suites/libvirt-cim/lib/XenKvmLib/indications.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/lib/XenKvmLib/indications.py Thu Jul 09 05:47:40 2009 -0700 @@ -0,0 +1,461 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# + +import httplib +import base64 +import BaseHTTPServer +from xml.dom.minidom import parseString +from signal import SIGKILL +from CimTest.Globals import logger +from XenKvmLib.vxml import set_default +from XenKvmLib.classes import get_typed_class +from CimTest.ReturnCodes import PASS, FAIL +from os import waitpid, kill, WNOHANG + +def filter_xml(name, type, ns, sysname): + return """ + + + + + + + + + + + + + CIM_ComputerSystem + + + %s + + + CIM_IndicationFilter + + + %sFilter + + + SELECT * FROM %s + + + + WQL + + + %s + + + + + + + + """ % (sysname, name, type, ns) + +def handler_xml(name, port, sysname): + return """ + + + + + + + + + + + + + CIM_ComputerSystem + + + %s + + + CIM_IndicationHandlerCIMXML + + + %sHandler + + + http://localhost:%i + + + + + + + + """ % (sysname, name, port) + +def subscription_xml(name, sysname): + return """ + + + + + + + + + + + + + + + + + CIM_ComputerSystem + + + + + %s + + + + + CIM_IndicationFilter + + + + + %sFilter + + + + + + + + + + + CIM_ComputerSystem + + + + + %s + + + + + CIM_IndicationHandlerCIMXML + + + + + %sHandler + + + + + + + 2 + + + + + + + + """ % (sysname, name, sysname, name) + +def delete_inst_xml(name, type, sysname, inst_name): + return """ + + + + + + + + + + + + + CIM_ComputerSystem + + + %s + + + CIM_Indication%s + + + %s + + + + + + + ; + """ % (type, sysname, type, inst_name); + +def delete_sub_xml(name, sysname): + return """ + + + + + + + + + + + + + + + + + CIM_ComputerSystem + + + + + %s + + + + + CIM_IndicationFilter + + + + + %sFilter + + + + + + + + + + + CIM_ComputerSystem + + + + + %s + + + + + CIM_IndicationHandlerCIMXML + + + + + %sHandler + + + + + + + + + + + ; + """ % (sysname, name, sysname, name) + +class CIMIndication: + def __init__(self, xmldata): + dom = parseString(xmldata) + + instances = dom.getElementsByTagName("INSTANCE") + attrs = instances[0].attributes.items() + self.name = attrs[0][1] + + def __str__(self): + return self.name + +class CIMSocketHandler(BaseHTTPServer.BaseHTTPRequestHandler): + def do_POST(self): + length = self.headers.getheader('content-length') + data = self.rfile.read(int(length)) + + indication = CIMIndication(data) + print "Got indication: %s" % indication + if self.server.print_ind: + print "%s\n\n" % data + self.server.indications.append(indication) + +class CIMIndicationSubscription: + def __init__(self, name, typ, ns, print_ind, sysname, port=0): + self.name = name + self.type = typ + self.ns = ns + self.sysname = sysname + + self.port = 8000 + port + self.server = BaseHTTPServer.HTTPServer(('', self.port), + CIMSocketHandler) + self.server.print_ind = print_ind + self.server.indications = [] + + self.filter_xml = filter_xml(name, typ, ns, sysname) + self.handler_xml = handler_xml(name, self.port, sysname) + self.subscription_xml = subscription_xml(name, sysname) + + def __do_cimpost(self, conn, body, method, auth_hdr=None): + headers = {"CIMOperation" : "MethodCall", + "CIMMethod" : method, + "CIMObject" : "root/PG_Interop", + "Content-Type" : 'application/xml; charset="utf-8"'} + + if auth_hdr: + headers["Authorization"] = "Basic %s" % auth_hdr + + conn.request("POST", "/cimom", body, headers) + resp = conn.getresponse() + if not resp.getheader("content-length"): + raise Exception("Request Failed: %d %s" % + (resp.status, resp.reason)) + + resp.read() + + def subscribe(self, url, cred=None): + self.conn = httplib.HTTPConnection(url) + if cred: + (u, p) = cred + auth_hdr = base64.b64encode("%s:%s" % (u, p)) + else: + auth_hdr = None + + self.__do_cimpost(self.conn, self.filter_xml, + "CreateInstance", auth_hdr) + self.__do_cimpost(self.conn, self.handler_xml, + "CreateInstance", auth_hdr) + self.__do_cimpost(self.conn, self.subscription_xml, + "CreateInstance", auth_hdr) + + def unsubscribe(self, cred=None): + if cred: + (u, p) = cred + auth_hdr = base64.b64encode("%s:%s" % (u, p)) + else: + auth_hdr = None + + xml = delete_sub_xml(self.name, self.sysname) + self.__do_cimpost(self.conn, xml, + "DeleteInstance", auth_hdr) + 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, + "%sFilter" % self.name) + self.__do_cimpost(self.conn, xml, + "DeleteInstance", auth_hdr) + + +def sub_ind(ip, virt, ind_names): + dict = set_default(ip) + 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 handle_request(sub, ind_name, dict, exp_ind_ct): + #sfcb delivers indications to all registrations, even if the indication + #isn't what the registration was subscribed to. So, for modified and + #deleted indications, we must loop through until the indication we are + #looking for is triggered. + for i in range(0, exp_ind_ct): + sub.server.handle_request() + if len(sub.server.indications) < 1: + logger.error("No valid indications received") + return FAIL + + if str(sub.server.indications[0]) == ind_name: + sub.unsubscribe(dict['default_auth']) + logger.info("Cancelling subscription for %s", ind_name) + return PASS + else: + sub.server.indications.remove(sub.server.indications[0]) + + logger.error("Did not recieve indication %s", ind_name) + return FAIL + +def poll_for_ind(pid, ind_name, timeout=20): + status = FAIL + for i in range(0, timeout): + pw = waitpid(pid, 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 '%s' indication successfully", ind_name) + status = PASS + break + elif pw[1] == 0 and i < timeout: + if i % 10 == 0: + logger.info("In child, waiting for '%s' indication", ind_name) + sleep(1) + else: + # Time is up and waitpid never returned the expected pid + if pw[0] != pid: + logger.error("Waited too long for '%s' indication", ind_name) + kill(pid, SIGKILL) + else: + logger.error("Received Indication error: '%d'", pw[1]) + + status = FAIL + break + + return status From deeptik at linux.vnet.ibm.com Thu Jul 9 12:55:38 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 09 Jul 2009 05:55:38 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Adding new tc to verify Migration indications for KVM In-Reply-To: References: Message-ID: <246937db436f15084972.1247144138@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1247144016 25200 # Node ID 246937db436f15084972c0afb787666faf1280e9 # Parent 73aedcd4026381023be4d25d741ce74113b8f8e6 [TEST] Adding new tc to verify Migration indications for KVM. Tested with KVM and current sources on F10. Signed-off-by: Deepti B. Kalakeri diff -r 73aedcd40263 -r 246937db436f suites/libvirt-cim/cimtest/ComputerSystemMigrationJobIndication/01_csmig_ind_for_offline_mig.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ComputerSystemMigrationJobIndication/01_csmig_ind_for_offline_mig.py Thu Jul 09 05:53:36 2009 -0700 @@ -0,0 +1,195 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# +# This testcase is used to verify the Created|Modified|Deleted +# Migration Indications for offline VM Migration. +# +# Date : 06-07-2009 +# + +import sys +from signal import SIGKILL +from socket import gethostname +from os import kill, fork, _exit +from XenKvmLib.vxml import get_class +from XenKvmLib.xm_virt_util import domain_list, net_list +from CimTest.Globals import logger +from XenKvmLib.const import do_main, default_network_name +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate +from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf,\ + destroy_netpool +from XenKvmLib.indications import sub_ind, handle_request, poll_for_ind + +sup_types = ['KVM', 'Xen'] + +REQUESTED_STATE = 3 + +def setup_guest(test_dom, ip, virt): + virt_xml = get_class(virt) + cxml = virt_xml(test_dom) + ret = cxml.cim_define(ip) + if not ret: + logger.error("Error define domain %s", test_dom) + return FAIL, cxml + + status, dom_cs = poll_for_state_change(ip, virt, test_dom, + REQUESTED_STATE) + if status != PASS: + cxml.undefine(test_dom) + logger.error("'%s' didn't change state as expected" % test_dom) + return FAIL, cxml + + return PASS, cxml + +def cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, + s_sysname, clean_net=True): + # Clean the domain on target machine. + # This is req when migration is successful, also when migration is not + # completely successful VM might be created on the target machine + # and hence need to clean. + target_list = domain_list(t_sysname, virt) + if target_list != None and test_dom in target_list: + ret_value = cxml.undefine(t_sysname) + if not ret_value: + logger.info("Failed to undefine the migrated domain '%s' on '%s'", + test_dom, t_sysname) + + if clean_net != True: + return + + # clean the networkpool created on the remote machine + target_net_list = net_list(t_sysname, virt) + if target_net_list != None and default_network_name in target_net_list: + ret_value = destroy_netpool(t_sysname, virt, default_network_name) + if ret_value != PASS: + logger.info("Unable to destroy networkpool '%s' on '%s'", + default_network_name, t_sysname) + + # Remote Migration not Successful, clean the domain on src machine + src_list = domain_list(s_sysname, virt) + if src_list != None and test_dom in src_list: + ret_value = cxml.undefine(s_sysname) + if not ret_value: + logger.info("Failed to undefine the domain '%s' on source '%s'", + test_dom, s_sysname) + + +def gen_indication(test_dom, s_sysname, virt, t_sysname): + cxml = None + try: + status, cxml = setup_guest(test_dom, s_sysname, virt) + if status != PASS: + logger.error("Error setting up the guest") + return status, None + + # create the networkpool used in the domain to be migrated + # on the target machine. + t_net_list = net_list(t_sysname, virt) + if t_net_list != None and default_network_name not in t_net_list: + status, netpool = create_netpool_conf(t_sysname, virt, + net_name=default_network_name) + if status != PASS: + raise Exception("Unable to create network pool '%s' on '%s'" + % (default_network_name, t_sysname)) + + # Migrate the test_dom to t_sysname. + # Enable remote migration by setting remote_migrate=1 + status = local_remote_migrate(s_sysname, t_sysname, virt, + remote_migrate=1, + guest_name=test_dom, + mtype='offline') + + except Exception, details: + logger.error("Exception details :%s", details) + return FAIL, cxml + + return status, cxml + + at do_main(sup_types) +def main(): + options = main.options + virt = options.virt + status, s_sysname, t_sysname = check_mig_support(virt, options) + if status != PASS: + return status + + status = FAIL + test_dom = 'VM_frm_' + gethostname() + ind_names = { + 'create' : 'ComputerSystemMigrationJobCreatedIndication', + 'modify' : 'ComputerSystemMigrationJobModifiedIndication', + 'delete' : 'ComputerSystemMigrationJobDeletedIndication' + } + + sub_list, ind_names, dict = sub_ind(s_sysname, virt, ind_names) + for ind in ind_names.keys(): + sub = sub_list[ind] + ind_name = ind_names[ind] + logger.info("\n Verifying '%s' indications ....", ind_name) + try: + pid = fork() + if pid == 0: + status = handle_request(sub, ind_name, dict, + len(ind_names.keys())) + if status != PASS: + _exit(1) + + _exit(0) + else: + try: + status, cxml = gen_indication(test_dom, s_sysname, + virt, t_sysname) + if status != PASS: + kill(pid, SIGKILL) + raise Exception("Unable to generate indication") + + status = poll_for_ind(pid, ind_name) + except Exception, details: + kill(pid, SIGKILL) + raise Exception(details) + + except Exception, details: + logger.error("Exception: %s", details) + status = FAIL + + if status != PASS: + break + + cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, + s_sysname, clean_net=False) + + + #Make sure all subscriptions are really unsubscribed + for ind, sub in sub_list.iteritems(): + sub.unsubscribe(dict['default_auth']) + logger.info("Cancelling subscription for %s", ind_names[ind]) + + cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, + s_sysname) + return status + + +if __name__ == "__main__": + sys.exit(main()) + From kaitlin at linux.vnet.ibm.com Thu Jul 9 21:55:19 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 09 Jul 2009 14:55:19 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Adding new tc to verify Migration indications for KVM In-Reply-To: <4A55DEF1.2030903@linux.vnet.ibm.com> References: <26883d6afdb51457e0ed.1246974144@elm3b151.beaverton.ibm.com> <4A5514CE.5050906@linux.vnet.ibm.com> <4A55DEF1.2030903@linux.vnet.ibm.com> Message-ID: <4A566747.8040207@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > > > Kaitlin Rupert wrote: >> >>> +import sys >>> +import os >> >> You have an import os statement later on, so no need to include this one. >> >>> +from socket import gethostname >>> +from XenKvmLib import vxml >> >> Same here, you have an import vxml statement later on; this one can be >> removed. >> >> >>> + if status != PASS: >>> + break >> >> Instead of breaking here, you can break after calling >> cleanup_guest_netpool(), this way, you won't need to call >> cleanup_guest_netpool() after you unsubscribe the indications. >> > The call to cleanup_guest_netpool() are little different .. the call > after the status check is designed to not delete the network pool that > is created on the target machine so that we can reuse it through the > loop without having to create it every time we want to migrate the guest. Ah, yes -thanks for the correction. I missed the "clean_net=False" param in the call below. >>> + >>> + cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, + s_sysname, >>> clean_net=False) >>> + >>> + >>> + #Make sure all subscriptions are really unsubscribed >>> + for ind, sub in sub_list.iteritems(): >>> + sub.unsubscribe(dict['default_auth']) >>> + logger.info("Cancelling subscription for %s", ind_names[ind]) >>> + >>> + cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, + s_sysname) >>> + return status >>> + >> >> > -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Jul 9 21:58:02 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 09 Jul 2009 14:58:02 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Modified the indication_tester.py to support MigrationIndications In-Reply-To: <4A55E6AF.8020705@linux.vnet.ibm.com> References: <9903b1d91bd966f45339.1246974143@elm3b151.beaverton.ibm.com> <4A5515B5.1050805@linux.vnet.ibm.com> <4A55E6AF.8020705@linux.vnet.ibm.com> Message-ID: <4A5667EA.8070008@linux.vnet.ibm.com> >> >> Anytime a change is made to other copy, the changes need to be pushed >> to the other so that the two remain in sync. These changes won't ever >> be used by the indication_tester.py itself, so I'm inclined to suggest >> moving them into their own module. >> >> Generally, I'm against having lots of different modules - I am in >> favor of consolidating where appropriate. However, I think this makes >> sense given that indication_tester is a special case. >> > I agree with you.. I too came up with the same problem of whether to > extend the indication_tester.py to include the new fns(). > I have moved the required fns() for Indications to a new file called > indications.py, so now indication_tester.py is independent to be moved > after the CSI/01_created_indication.py is modified to use the > indications.py fns(). > I think since we have a different dir which standalone tc, we can move > the indication_tester.py to suites/libvirt-cim/misc_cimtests/, and how > about migration_tester.py ...thoughts ?? > I think this is an excellent idea. The tests will need to import CIMIndicationSubscription from indication_tester still, but it doesn't matter where the tester is located. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Jul 9 22:10:12 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 09 Jul 2009 15:10:12 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Added the indications.py to support Indications In-Reply-To: <73aedcd4026381023be4.1247144137@elm3a148.beaverton.ibm.com> References: <73aedcd4026381023be4.1247144137@elm3a148.beaverton.ibm.com> Message-ID: <4A566AC4.5090006@linux.vnet.ibm.com> Deepti B. Kalakeri wrote: > # HG changeset patch > # User Deepti B.Kalakeri > # Date 1247143660 25200 > # Node ID 73aedcd4026381023be4d25d741ce74113b8f8e6 > # Parent 7b18b827fca6916fd87ff417f79a96c8a19b4913 > [TEST] Added the indications.py to support Indications. > > Included the following important functions in indications.py > - sub_ind() --> Subscribe for the indications to be watched. > - handle_request() --> Filters the required indications. > - poll_for_ind() --> Wait for the required indications to be triggered. > Oops, I think I was unclear in my previous mail. I think the indication tester should stay intact... The reason we decided to copy the indication_tester from libcmpiutil to cimtest is so that in bugs that get fixed in one get fixed in the other. That's why they need to stay in sync. So, if you find a bug in filter_xml(), you want to be sure its fixed in both places. The problem was that cimtest wasn't publicly available at the time, and indications aren't trivial to test using standard CIM related tools. So we wanted to offer users a way to test their indications, which is why it exists in libcmpiutil. We could remove the indication_tester.py from libcmpiutil and leave the only copy in cimtest, however, I think we should have two copies of the same code in cimtest. So, I suggest leave indication_tester.py as is and place the functions below in their own file. Does that seem reasonable? That way, we don't duplicate code - if we fix a bug in one spot, we won't have to fix the same bug somewhere else. > +def sub_ind(ip, virt, ind_names): > + dict = set_default(ip) > + 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 handle_request(sub, ind_name, dict, exp_ind_ct): > + #sfcb delivers indications to all registrations, even if the indication > + #isn't what the registration was subscribed to. So, for modified and > + #deleted indications, we must loop through until the indication we are > + #looking for is triggered. > + for i in range(0, exp_ind_ct): > + sub.server.handle_request() > + if len(sub.server.indications) < 1: > + logger.error("No valid indications received") > + return FAIL > + > + if str(sub.server.indications[0]) == ind_name: > + sub.unsubscribe(dict['default_auth']) > + logger.info("Cancelling subscription for %s", ind_name) > + return PASS > + else: > + sub.server.indications.remove(sub.server.indications[0]) > + > + logger.error("Did not recieve indication %s", ind_name) > + return FAIL > + > +def poll_for_ind(pid, ind_name, timeout=20): > + status = FAIL > + for i in range(0, timeout): > + pw = waitpid(pid, 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 '%s' indication successfully", ind_name) > + status = PASS > + break > + elif pw[1] == 0 and i < timeout: > + if i % 10 == 0: > + logger.info("In child, waiting for '%s' indication", ind_name) > + sleep(1) > + else: > + # Time is up and waitpid never returned the expected pid > + if pw[0] != pid: > + logger.error("Waited too long for '%s' indication", ind_name) > + kill(pid, SIGKILL) > + else: > + logger.error("Received Indication error: '%d'", pw[1]) > + > + status = FAIL > + break > + > + return status -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Fri Jul 10 06:57:27 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 10 Jul 2009 12:27:27 +0530 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Added the indications.py to support Indications In-Reply-To: <4A566AC4.5090006@linux.vnet.ibm.com> References: <73aedcd4026381023be4.1247144137@elm3a148.beaverton.ibm.com> <4A566AC4.5090006@linux.vnet.ibm.com> Message-ID: <4A56E657.5030702@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Deepti B. Kalakeri wrote: >> # HG changeset patch >> # User Deepti B.Kalakeri >> # Date 1247143660 25200 >> # Node ID 73aedcd4026381023be4d25d741ce74113b8f8e6 >> # Parent 7b18b827fca6916fd87ff417f79a96c8a19b4913 >> [TEST] Added the indications.py to support Indications. >> >> Included the following important functions in indications.py >> - sub_ind() --> Subscribe for the indications to be watched. >> - handle_request() --> Filters the required indications. >> - poll_for_ind() --> Wait for the required indications to be triggered. >> > > Oops, I think I was unclear in my previous mail. I think the > indication tester should stay intact... The reason we decided to copy > the indication_tester from libcmpiutil to cimtest is so that in bugs > that get fixed in one get fixed in the other. That's why they need to > stay in sync. > > So, if you find a bug in filter_xml(), you want to be sure its fixed > in both places. The problem was that cimtest wasn't publicly available > at the time, and indications aren't trivial to test using standard CIM > related tools. So we wanted to offer users a way to test their > indications, which is why it exists in libcmpiutil. > > We could remove the indication_tester.py from libcmpiutil and leave > the only copy in cimtest, however, I think we should have two copies > of the same code in cimtest. I guess you meant to say "I think we not should have two copies" ??? > > So, I suggest leave indication_tester.py as is and place the functions > below in their own file. Does that seem reasonable? That way, we don't > duplicate code - if we fix a bug in one spot, we won't have to fix the > same bug somewhere else. ok sure. done.. > >> +def sub_ind(ip, virt, ind_names): >> + dict = set_default(ip) >> + 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 handle_request(sub, ind_name, dict, exp_ind_ct): >> + #sfcb delivers indications to all registrations, even if the >> indication >> + #isn't what the registration was subscribed to. So, for modified >> and + #deleted indications, we must loop through until the indication >> we are >> + #looking for is triggered. >> + for i in range(0, exp_ind_ct): >> + sub.server.handle_request() + if len(sub.server.indications) < 1: >> + logger.error("No valid indications received") >> + return FAIL >> + >> + if str(sub.server.indications[0]) == ind_name: >> + sub.unsubscribe(dict['default_auth']) >> + logger.info("Cancelling subscription for %s", ind_name) >> + return PASS >> + else: >> + sub.server.indications.remove(sub.server.indications[0]) >> + >> + logger.error("Did not recieve indication %s", ind_name) >> + return FAIL >> + >> +def poll_for_ind(pid, ind_name, timeout=20): >> + status = FAIL >> + for i in range(0, timeout): >> + pw = waitpid(pid, 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 '%s' indication successfully", ind_name) >> + status = PASS >> + break >> + elif pw[1] == 0 and i < timeout: >> + if i % 10 == 0: >> + logger.info("In child, waiting for '%s' indication", ind_name) >> + sleep(1) >> + else: >> + # Time is up and waitpid never returned the expected pid >> + if pw[0] != pid: >> + logger.error("Waited too long for '%s' indication", ind_name) >> + kill(pid, SIGKILL) >> + else: >> + logger.error("Received Indication error: '%d'", pw[1]) >> + >> + status = FAIL >> + break >> + >> + return status > > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Fri Jul 10 07:54:29 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 10 Jul 2009 00:54:29 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] Adding new tc for verifying Migration indication for KVM. Message-ID: Moved the indications related to fns to new lib indications.py. Removed some un necessary import stmts From deeptik at linux.vnet.ibm.com Fri Jul 10 07:54:30 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 10 Jul 2009 00:54:30 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] #2 Added the indications.py to support Indications In-Reply-To: References: Message-ID: <52f4ebd26215d017e98e.1247212470@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1247212053 25200 # Node ID 52f4ebd26215d017e98e984d9c79fe47af9d66ab # Parent 7b18b827fca6916fd87ff417f79a96c8a19b4913 [TEST] #2 Added the indications.py to support Indications. Included the following important functions in indications.py - sub_ind() --> Subscribe for the indications to be watched. - handle_request() --> Filters the required indications. - poll_for_ind() --> Wait for the required indications to be triggered. Patch 2: -------- Retained only the new fns listed above in indications.py Tested with KVM and current sources on F10. Signed-off-by: Deepti B. Kalakeri diff -r 7b18b827fca6 -r 52f4ebd26215 suites/libvirt-cim/lib/XenKvmLib/indications.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/lib/XenKvmLib/indications.py Fri Jul 10 00:47:33 2009 -0700 @@ -0,0 +1,104 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# + +from signal import SIGKILL +from CimTest.Globals import logger +from XenKvmLib.indication_tester import CIMIndicationSubscription +from XenKvmLib.vxml import set_default +from XenKvmLib.classes import get_typed_class +from CimTest.ReturnCodes import PASS, FAIL +from os import waitpid, kill, WNOHANG + +def sub_ind(ip, virt, ind_names): + dict = set_default(ip) + 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 handle_request(sub, ind_name, dict, exp_ind_ct): + #sfcb delivers indications to all registrations, even if the indication + #isn't what the registration was subscribed to. So, for modified and + #deleted indications, we must loop through until the indication we are + #looking for is triggered. + for i in range(0, exp_ind_ct): + sub.server.handle_request() + if len(sub.server.indications) < 1: + logger.error("No valid indications received") + return FAIL + + if str(sub.server.indications[0]) == ind_name: + sub.unsubscribe(dict['default_auth']) + logger.info("Cancelling subscription for %s", ind_name) + return PASS + else: + sub.server.indications.remove(sub.server.indications[0]) + + logger.error("Did not recieve indication %s", ind_name) + return FAIL + +def poll_for_ind(pid, ind_name, timeout=20): + status = FAIL + for i in range(0, timeout): + pw = waitpid(pid, 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 '%s' indication successfully", ind_name) + status = PASS + break + elif pw[1] == 0 and i < timeout: + if i % 10 == 0: + logger.info("In child, waiting for '%s' indication", ind_name) + sleep(1) + else: + # Time is up and waitpid never returned the expected pid + if pw[0] != pid: + logger.error("Waited too long for '%s' indication", ind_name) + kill(pid, SIGKILL) + else: + logger.error("Received Indication error: '%d'", pw[1]) + + status = FAIL + break + + return status From deeptik at linux.vnet.ibm.com Fri Jul 10 07:54:31 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 10 Jul 2009 00:54:31 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Adding new tc to verify Migration indications for KVM In-Reply-To: References: Message-ID: # HG changeset patch # User Deepti B.Kalakeri # Date 1247212079 25200 # Node ID f8a983f28ce47c137c4ecf14bbd8c81d936abc3f # Parent 52f4ebd26215d017e98e984d9c79fe47af9d66ab [TEST] Adding new tc to verify Migration indications for KVM. Tested with KVM and current sources on F10. Signed-off-by: Deepti B. Kalakeri diff -r 52f4ebd26215 -r f8a983f28ce4 suites/libvirt-cim/cimtest/ComputerSystemMigrationJobIndication/01_csmig_ind_for_offline_mig.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ComputerSystemMigrationJobIndication/01_csmig_ind_for_offline_mig.py Fri Jul 10 00:47:59 2009 -0700 @@ -0,0 +1,195 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# +# This testcase is used to verify the Created|Modified|Deleted +# Migration Indications for offline VM Migration. +# +# Date : 06-07-2009 +# + +import sys +from signal import SIGKILL +from socket import gethostname +from os import kill, fork, _exit +from XenKvmLib.vxml import get_class +from XenKvmLib.xm_virt_util import domain_list, net_list +from CimTest.Globals import logger +from XenKvmLib.const import do_main, default_network_name +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.vsmigrations import check_mig_support, local_remote_migrate +from XenKvmLib.common_util import poll_for_state_change, create_netpool_conf,\ + destroy_netpool +from XenKvmLib.indications import sub_ind, handle_request, poll_for_ind + +sup_types = ['KVM', 'Xen'] + +REQUESTED_STATE = 3 + +def setup_guest(test_dom, ip, virt): + virt_xml = get_class(virt) + cxml = virt_xml(test_dom) + ret = cxml.cim_define(ip) + if not ret: + logger.error("Error define domain %s", test_dom) + return FAIL, cxml + + status, dom_cs = poll_for_state_change(ip, virt, test_dom, + REQUESTED_STATE) + if status != PASS: + cxml.undefine(test_dom) + logger.error("'%s' didn't change state as expected" % test_dom) + return FAIL, cxml + + return PASS, cxml + +def cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, + s_sysname, clean_net=True): + # Clean the domain on target machine. + # This is req when migration is successful, also when migration is not + # completely successful VM might be created on the target machine + # and hence need to clean. + target_list = domain_list(t_sysname, virt) + if target_list != None and test_dom in target_list: + ret_value = cxml.undefine(t_sysname) + if not ret_value: + logger.info("Failed to undefine the migrated domain '%s' on '%s'", + test_dom, t_sysname) + + if clean_net != True: + return + + # clean the networkpool created on the remote machine + target_net_list = net_list(t_sysname, virt) + if target_net_list != None and default_network_name in target_net_list: + ret_value = destroy_netpool(t_sysname, virt, default_network_name) + if ret_value != PASS: + logger.info("Unable to destroy networkpool '%s' on '%s'", + default_network_name, t_sysname) + + # Remote Migration not Successful, clean the domain on src machine + src_list = domain_list(s_sysname, virt) + if src_list != None and test_dom in src_list: + ret_value = cxml.undefine(s_sysname) + if not ret_value: + logger.info("Failed to undefine the domain '%s' on source '%s'", + test_dom, s_sysname) + + +def gen_indication(test_dom, s_sysname, virt, t_sysname): + cxml = None + try: + status, cxml = setup_guest(test_dom, s_sysname, virt) + if status != PASS: + logger.error("Error setting up the guest") + return status, None + + # create the networkpool used in the domain to be migrated + # on the target machine. + t_net_list = net_list(t_sysname, virt) + if t_net_list != None and default_network_name not in t_net_list: + status, netpool = create_netpool_conf(t_sysname, virt, + net_name=default_network_name) + if status != PASS: + raise Exception("Unable to create network pool '%s' on '%s'" + % (default_network_name, t_sysname)) + + # Migrate the test_dom to t_sysname. + # Enable remote migration by setting remote_migrate=1 + status = local_remote_migrate(s_sysname, t_sysname, virt, + remote_migrate=1, + guest_name=test_dom, + mtype='offline') + + except Exception, details: + logger.error("Exception details :%s", details) + return FAIL, cxml + + return status, cxml + + at do_main(sup_types) +def main(): + options = main.options + virt = options.virt + status, s_sysname, t_sysname = check_mig_support(virt, options) + if status != PASS: + return status + + status = FAIL + test_dom = 'VM_frm_' + gethostname() + ind_names = { + 'create' : 'ComputerSystemMigrationJobCreatedIndication', + 'modify' : 'ComputerSystemMigrationJobModifiedIndication', + 'delete' : 'ComputerSystemMigrationJobDeletedIndication' + } + + sub_list, ind_names, dict = sub_ind(s_sysname, virt, ind_names) + for ind in ind_names.keys(): + sub = sub_list[ind] + ind_name = ind_names[ind] + logger.info("\n Verifying '%s' indications ....", ind_name) + try: + pid = fork() + if pid == 0: + status = handle_request(sub, ind_name, dict, + len(ind_names.keys())) + if status != PASS: + _exit(1) + + _exit(0) + else: + try: + status, cxml = gen_indication(test_dom, s_sysname, + virt, t_sysname) + if status != PASS: + kill(pid, SIGKILL) + raise Exception("Unable to generate indication") + + status = poll_for_ind(pid, ind_name) + except Exception, details: + kill(pid, SIGKILL) + raise Exception(details) + + except Exception, details: + logger.error("Exception: %s", details) + status = FAIL + + if status != PASS: + break + + cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, + s_sysname, clean_net=False) + + + #Make sure all subscriptions are really unsubscribed + for ind, sub in sub_list.iteritems(): + sub.unsubscribe(dict['default_auth']) + logger.info("Cancelling subscription for %s", ind_names[ind]) + + cleanup_guest_netpool(virt, cxml, test_dom, t_sysname, + s_sysname) + return status + + +if __name__ == "__main__": + sys.exit(main()) + From kaitlin at linux.vnet.ibm.com Fri Jul 10 16:17:11 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 10 Jul 2009 09:17:11 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Added the indications.py to support Indications In-Reply-To: <4A56E657.5030702@linux.vnet.ibm.com> References: <73aedcd4026381023be4.1247144137@elm3a148.beaverton.ibm.com> <4A566AC4.5090006@linux.vnet.ibm.com> <4A56E657.5030702@linux.vnet.ibm.com> Message-ID: <4A576987.9000606@linux.vnet.ibm.com> >> >> We could remove the indication_tester.py from libcmpiutil and leave >> the only copy in cimtest, however, I think we should have two copies >> of the same code in cimtest. > I guess you meant to say "I think we not should have two copies" ??? Ah, yes - that's where the confusion came in. My apologies for the typo here. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Fri Jul 10 19:27:45 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Fri, 10 Jul 2009 16:27:45 -0300 Subject: [Libvirt-cim] [PATCH] Enum instance of net RASD wasn't parsing network name properly In-Reply-To: <78a5d3cd29f9a5596e42.1247001452@elm3b24.beaverton.ibm.com> References: <78a5d3cd29f9a5596e42.1247001452@elm3b24.beaverton.ibm.com> Message-ID: <4A579631.6060501@linux.vnet.ibm.com> +1 Sharad Mishra wrote: > # HG changeset patch > # User snmishra at us.ibm.com > # Date 1247001210 25200 > # Node ID 78a5d3cd29f9a5596e42437ceed49626b7674460 > # Parent 2f0fb9e5d52301fc00212d543d593e24d89ba0f0 > Enum instance of net RASD wasn't parsing network name properly. > > Updated device parsing code and net RASD to get network name for > bridge devices. > > Signed-off-by: Sharad Mishra > > diff -r 2f0fb9e5d523 -r 78a5d3cd29f9 libxkutil/device_parsing.c > --- a/libxkutil/device_parsing.c Wed Jun 24 11:46:08 2009 -0700 > +++ b/libxkutil/device_parsing.c Tue Jul 07 14:13:30 2009 -0700 > @@ -307,8 +307,8 @@ > if (ndev->mac == NULL) > goto err; > } else if (XSTREQ(child->name, "source")) { > - ndev->source = get_attr_value(child, "bridge"); > - if (ndev->source != NULL) > + ndev->name = get_attr_value(child, "bridge"); > + if (ndev->name != NULL) > continue; > ndev->source = get_attr_value(child, "network"); > if (ndev->source != NULL) > diff -r 2f0fb9e5d523 -r 78a5d3cd29f9 src/Virt_RASD.c > --- a/src/Virt_RASD.c Wed Jun 24 11:46:08 2009 -0700 > +++ b/src/Virt_RASD.c Tue Jul 07 14:13:30 2009 -0700 > @@ -404,6 +404,13 @@ > (CMPIValue *)dev->dev.net.mac, > CMPI_chars); > > + if ((dev->dev.net.name != NULL) && > + (STREQ(dev->dev.net.type, "bridge"))) > + CMSetProperty(inst, > + "NetworkName", > + (CMPIValue *)dev->dev.net.name, > + CMPI_chars); > + > if (dev->dev.net.model != NULL) > CMSetProperty(inst, > "ResourceSubType", > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Fri Jul 10 20:28:29 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Fri, 10 Jul 2009 17:28:29 -0300 Subject: [Libvirt-cim] [PATCH 1 of 2] Add Password attribute to GraphicsRASD In-Reply-To: References: Message-ID: <4A57A46D.5020604@linux.vnet.ibm.com> I think you should at least print the Password property as an empty property (or even with asterisks) in the set_graphics_rasd_parameters(). It's kinda weird to print it on the template rasd, but not on the real rasd instance. Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1247095850 25200 > # Node ID f609e31b0c17ea550f27426dd8e329c362f4db3e > # Parent 0fb4613252c19abb6bf5496a8b7031793ba7f298 > Add Password attribute to GraphicsRASD > > Also add necessary changes to the graphics struct and generating XML with the > passwd attribute. > > The passwd won't show up in the XML we get back from libvirt, so pulling the > passwd from the guest XML isn't included in parse_graphics_device(). > > Signed-off-by: Kaitlin Rupert > > diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/device_parsing.c > --- a/libxkutil/device_parsing.c Tue Jun 30 14:33:31 2009 -0700 > +++ b/libxkutil/device_parsing.c Wed Jul 08 16:30:50 2009 -0700 > @@ -81,6 +81,7 @@ > free(dev->port); > free(dev->host); > free(dev->keymap); > + free(dev->passwd); > } > > static void cleanup_input_device(struct input_device *dev) > diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/device_parsing.h > --- a/libxkutil/device_parsing.h Tue Jun 30 14:33:31 2009 -0700 > +++ b/libxkutil/device_parsing.h Wed Jul 08 16:30:50 2009 -0700 > @@ -70,6 +70,7 @@ > char *port; > char *host; > char *keymap; > + char *passwd; > }; > > struct input_device { > diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/xmlgen.c > --- a/libxkutil/xmlgen.c Tue Jun 30 14:33:31 2009 -0700 > +++ b/libxkutil/xmlgen.c Wed Jul 08 16:30:50 2009 -0700 > @@ -338,11 +338,21 @@ > return XML_ERROR; > > xmlNewProp(tmp, BAD_CAST "type", BAD_CAST dev->type); > + > + if (STREQC(dev->type, "sdl")) > + goto out; > + > xmlNewProp(tmp, BAD_CAST "port", BAD_CAST dev->port); > xmlNewProp(tmp, BAD_CAST "listen", BAD_CAST dev->host); > xmlNewProp(tmp, BAD_CAST "keymap", BAD_CAST dev->keymap); > + > + if (dev->passwd != NULL) > + xmlNewProp(tmp, > + BAD_CAST "passwd", > + BAD_CAST dev->passwd); > } > > + out: > return NULL; > } > > diff -r 0fb4613252c1 -r f609e31b0c17 schema/ResourceAllocationSettingData.mof > --- a/schema/ResourceAllocationSettingData.mof Tue Jun 30 14:33:31 2009 -0700 > +++ b/schema/ResourceAllocationSettingData.mof Wed Jul 08 16:30:50 2009 -0700 > @@ -132,6 +132,9 @@ > { > [Description ("Keyboard keymapping")] > string KeyMap; > + > + [Description ("VNC password")] > + string Password; > }; > > [Description ("KVM virtual graphics device"), > @@ -141,6 +144,9 @@ > { > [Description ("Keyboard keymapping")] > string KeyMap; > + > + [Description ("VNC password")] > + string Password; > }; > > [Description ("LXC virtual graphics device"), > @@ -150,6 +156,9 @@ > { > [Description ("Keyboard keymapping")] > string KeyMap; > + > + [Description ("VNC password")] > + string Password; > }; > > [Description ("Xen virtual input device"), > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Jul 10 21:53:17 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 10 Jul 2009 14:53:17 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Add Password attribute to GraphicsRASD In-Reply-To: <4A57A46D.5020604@linux.vnet.ibm.com> References: <4A57A46D.5020604@linux.vnet.ibm.com> Message-ID: <4A57B84D.50601@linux.vnet.ibm.com> Richard Maciel wrote: > I think you should at least print the Password property as an empty > property (or even with asterisks) in the set_graphics_rasd_parameters(). > > It's kinda weird to print it on the template rasd, but not on the real > rasd instance. > Yeah, I agree it's weird. The problem is that when you call virDomainGetXMLDesc(), libvirt doesn't return any kind of information that a password has been set for the given guest. What we could do is persist a flag that indicates whether a password have been set and then set the Password attribute accordingly. > Kaitlin Rupert wrote: >> # HG changeset patch >> # User Kaitlin Rupert >> # Date 1247095850 25200 >> # Node ID f609e31b0c17ea550f27426dd8e329c362f4db3e >> # Parent 0fb4613252c19abb6bf5496a8b7031793ba7f298 >> Add Password attribute to GraphicsRASD >> >> Also add necessary changes to the graphics struct and generating XML >> with the >> passwd attribute. >> >> The passwd won't show up in the XML we get back from libvirt, so >> pulling the >> passwd from the guest XML isn't included in parse_graphics_device(). >> >> Signed-off-by: Kaitlin Rupert >> >> diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/device_parsing.c >> --- a/libxkutil/device_parsing.c Tue Jun 30 14:33:31 2009 -0700 >> +++ b/libxkutil/device_parsing.c Wed Jul 08 16:30:50 2009 -0700 >> @@ -81,6 +81,7 @@ >> free(dev->port); >> free(dev->host); >> free(dev->keymap); >> + free(dev->passwd); >> } >> >> static void cleanup_input_device(struct input_device *dev) >> diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/device_parsing.h >> --- a/libxkutil/device_parsing.h Tue Jun 30 14:33:31 2009 -0700 >> +++ b/libxkutil/device_parsing.h Wed Jul 08 16:30:50 2009 -0700 >> @@ -70,6 +70,7 @@ >> char *port; >> char *host; >> char *keymap; >> + char *passwd; >> }; >> >> struct input_device { >> diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/xmlgen.c >> --- a/libxkutil/xmlgen.c Tue Jun 30 14:33:31 2009 -0700 >> +++ b/libxkutil/xmlgen.c Wed Jul 08 16:30:50 2009 -0700 >> @@ -338,11 +338,21 @@ >> return XML_ERROR; >> >> xmlNewProp(tmp, BAD_CAST "type", BAD_CAST dev->type); >> + >> + if (STREQC(dev->type, "sdl")) >> + goto out; >> + >> xmlNewProp(tmp, BAD_CAST "port", BAD_CAST dev->port); >> xmlNewProp(tmp, BAD_CAST "listen", BAD_CAST dev->host); >> xmlNewProp(tmp, BAD_CAST "keymap", BAD_CAST >> dev->keymap); >> + >> + if (dev->passwd != NULL) >> + xmlNewProp(tmp, >> + BAD_CAST "passwd", >> + BAD_CAST dev->passwd); >> } >> >> + out: >> return NULL; >> } >> >> diff -r 0fb4613252c1 -r f609e31b0c17 >> schema/ResourceAllocationSettingData.mof >> --- a/schema/ResourceAllocationSettingData.mof Tue Jun 30 14:33:31 >> 2009 -0700 >> +++ b/schema/ResourceAllocationSettingData.mof Wed Jul 08 16:30:50 >> 2009 -0700 >> @@ -132,6 +132,9 @@ >> { >> [Description ("Keyboard keymapping")] >> string KeyMap; >> + >> + [Description ("VNC password")] >> + string Password; >> }; >> >> [Description ("KVM virtual graphics device"), >> @@ -141,6 +144,9 @@ >> { >> [Description ("Keyboard keymapping")] >> string KeyMap; >> + >> + [Description ("VNC password")] >> + string Password; >> }; >> >> [Description ("LXC virtual graphics device"), >> @@ -150,6 +156,9 @@ >> { >> [Description ("Keyboard keymapping")] >> string KeyMap; >> + >> + [Description ("VNC password")] >> + string Password; >> }; >> >> [Description ("Xen virtual input device"), >> >> _______________________________________________ >> Libvirt-cim mailing list >> Libvirt-cim at redhat.com >> https://www.redhat.com/mailman/listinfo/libvirt-cim > > -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Jul 10 23:52:46 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 10 Jul 2009 16:52:46 -0700 Subject: [Libvirt-cim] [PATCH 1 of 4] Add Password attribute to GraphicsRASD In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1247095850 25200 # Node ID f609e31b0c17ea550f27426dd8e329c362f4db3e # Parent 0fb4613252c19abb6bf5496a8b7031793ba7f298 Add Password attribute to GraphicsRASD Also add necessary changes to the graphics struct and generating XML with the passwd attribute. The passwd won't show up in the XML we get back from libvirt, so pulling the passwd from the guest XML isn't included in parse_graphics_device(). Signed-off-by: Kaitlin Rupert diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Tue Jun 30 14:33:31 2009 -0700 +++ b/libxkutil/device_parsing.c Wed Jul 08 16:30:50 2009 -0700 @@ -81,6 +81,7 @@ free(dev->port); free(dev->host); free(dev->keymap); + free(dev->passwd); } static void cleanup_input_device(struct input_device *dev) diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/device_parsing.h --- a/libxkutil/device_parsing.h Tue Jun 30 14:33:31 2009 -0700 +++ b/libxkutil/device_parsing.h Wed Jul 08 16:30:50 2009 -0700 @@ -70,6 +70,7 @@ char *port; char *host; char *keymap; + char *passwd; }; struct input_device { diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/xmlgen.c --- a/libxkutil/xmlgen.c Tue Jun 30 14:33:31 2009 -0700 +++ b/libxkutil/xmlgen.c Wed Jul 08 16:30:50 2009 -0700 @@ -338,11 +338,21 @@ return XML_ERROR; xmlNewProp(tmp, BAD_CAST "type", BAD_CAST dev->type); + + if (STREQC(dev->type, "sdl")) + goto out; + xmlNewProp(tmp, BAD_CAST "port", BAD_CAST dev->port); xmlNewProp(tmp, BAD_CAST "listen", BAD_CAST dev->host); xmlNewProp(tmp, BAD_CAST "keymap", BAD_CAST dev->keymap); + + if (dev->passwd != NULL) + xmlNewProp(tmp, + BAD_CAST "passwd", + BAD_CAST dev->passwd); } + out: return NULL; } diff -r 0fb4613252c1 -r f609e31b0c17 schema/ResourceAllocationSettingData.mof --- a/schema/ResourceAllocationSettingData.mof Tue Jun 30 14:33:31 2009 -0700 +++ b/schema/ResourceAllocationSettingData.mof Wed Jul 08 16:30:50 2009 -0700 @@ -132,6 +132,9 @@ { [Description ("Keyboard keymapping")] string KeyMap; + + [Description ("VNC password")] + string Password; }; [Description ("KVM virtual graphics device"), @@ -141,6 +144,9 @@ { [Description ("Keyboard keymapping")] string KeyMap; + + [Description ("VNC password")] + string Password; }; [Description ("LXC virtual graphics device"), @@ -150,6 +156,9 @@ { [Description ("Keyboard keymapping")] string KeyMap; + + [Description ("VNC password")] + string Password; }; [Description ("Xen virtual input device"), From kaitlin at linux.vnet.ibm.com Fri Jul 10 23:52:47 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 10 Jul 2009 16:52:47 -0700 Subject: [Libvirt-cim] [PATCH 2 of 4] Add methods for setting/getting boolean values from the infostore In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1247095850 25200 # Node ID f915b6e4d1a3748fe8541cf2a3030a4613675945 # Parent f609e31b0c17ea550f27426dd8e329c362f4db3e Add methods for setting/getting boolean values from the infostore This will be used for determining whether a guest has a VNC password set since we cannot determine this info from the guest's XML alone. Signed-off-by: Kaitlin Rupert diff -r f609e31b0c17 -r f915b6e4d1a3 libxkutil/infostore.c --- a/libxkutil/infostore.c Wed Jul 08 16:30:50 2009 -0700 +++ b/libxkutil/infostore.c Wed Jul 08 16:30:50 2009 -0700 @@ -419,6 +419,36 @@ return xpath_set_string(ctx, key, val); } +bool infostore_get_bool(struct infostore_ctx *ctx, const char *key) +{ + char *sval = NULL; + bool val = false; + + sval = xpath_query_string(ctx, key); + if (sval == NULL) + goto out; + + if (STREQC(sval, "true")) + return true; + + out: + free(sval); + + return val; +} + +bool infostore_set_bool(struct infostore_ctx *ctx, const char *key, bool val) +{ + bool ret; + + if (val) + ret = xpath_set_string(ctx, key, "true"); + else + ret = xpath_set_string(ctx, key, "false"); + + return ret; +} + /* * Local Variables: * mode: C diff -r f609e31b0c17 -r f915b6e4d1a3 libxkutil/infostore.h --- a/libxkutil/infostore.h Wed Jul 08 16:30:50 2009 -0700 +++ b/libxkutil/infostore.h Wed Jul 08 16:30:50 2009 -0700 @@ -40,6 +40,9 @@ bool infostore_set_str(struct infostore_ctx *ctx, const char *key, const char * val); +bool infostore_get_bool(struct infostore_ctx *ctx, const char *key); +bool infostore_set_bool(struct infostore_ctx *ctx, + const char *key, bool val); #endif From kaitlin at linux.vnet.ibm.com Fri Jul 10 23:52:49 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 10 Jul 2009 16:52:49 -0700 Subject: [Libvirt-cim] [PATCH 4 of 4] (#2) Generate template RASDs for both types In-Reply-To: References: Message-ID: <580c1f5bf6cdb8ca7015.1247269969@localhost.localdomain> # HG changeset patch # User Kaitlin Rupert # Date 1247095850 25200 # Node ID 580c1f5bf6cdb8ca70150bf2014dce8422515928 # Parent 7b8eeb3b3fcbe2f9b6cb5eabe10569545244472e (#2) Generate template RASDs for both types... Also return a value for the Password attribute in the case that the guest has a VNC password set. Updates: -Add support for setting the Password attribute in Virt_RASD.c Signed-off-by: Kaitlin Rupert diff -r 7b8eeb3b3fcb -r 580c1f5bf6cd src/Virt_RASD.c --- a/src/Virt_RASD.c Wed Jul 08 16:30:50 2009 -0700 +++ b/src/Virt_RASD.c Wed Jul 08 16:30:50 2009 -0700 @@ -276,11 +276,17 @@ } static CMPIStatus set_graphics_rasd_params(const struct virt_device *dev, - CMPIInstance *inst) + CMPIInstance *inst, + const char *name, + const char *classname) { int rc; char *addr_str = NULL; CMPIStatus s = {CMPI_RC_OK, NULL}; + virConnectPtr conn = NULL; + virDomainPtr dom = NULL; + struct infostore_ctx *infostore = NULL; + bool has_passwd = false; CMSetProperty(inst, "ResourceSubType", (CMPIValue *)dev->dev.graphics.type, CMPI_chars); @@ -300,8 +306,33 @@ (CMPIValue *)dev->dev.graphics.keymap, CMPI_chars); } + conn = connect_by_classname(_BROKER, classname, &s); + if (conn == NULL) + goto out; + + dom = virDomainLookupByName(conn, name); + if (dom == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_NOT_FOUND, + "Domain %s not found", + name); + goto out; + } + + infostore = infostore_open(dom); + if (infostore != NULL) + has_passwd = infostore_get_bool(infostore, "has_vnc_passwd"); + + if (has_passwd) + CMSetProperty(inst, "Password", + (CMPIValue *)"********", CMPI_chars); + + infostore_close(infostore); + out: free(addr_str); + virDomainFree(dom); + virConnectClose(conn); return s; } @@ -423,7 +454,7 @@ } else if (dev->type == CIM_RES_TYPE_PROC) { set_proc_rasd_params(broker, ref, dev, host, inst); } else if (dev->type == CIM_RES_TYPE_GRAPHICS) { - s = set_graphics_rasd_params(dev, inst); + s = set_graphics_rasd_params(dev, inst, host, CLASSNAME(ref)); } else if (dev->type == CIM_RES_TYPE_INPUT) { s = set_input_rasd_params(dev, inst); } diff -r 7b8eeb3b3fcb -r 580c1f5bf6cd src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Wed Jul 08 16:30:50 2009 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Wed Jul 08 16:30:50 2009 -0700 @@ -1429,14 +1429,42 @@ return s; } +static CMPIStatus set_graphics_props(const CMPIObjectPath *ref, + const char *id, + const char *type, + struct inst_list *list) +{ + CMPIInstance *inst; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_GRAPHICS, DEVICE_RASD); + + CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars); + + if (STREQC(type, "vnc")) { + const char *addr = "127.0.0.1:-1"; + + CMSetProperty(inst, "Address", (CMPIValue *)addr, CMPI_chars); + + CMSetProperty(inst, "KeyMap", (CMPIValue *)"en-us", CMPI_chars); + } + + CMSetProperty(inst, "ResourceSubType", (CMPIValue *)type, CMPI_chars); + + inst_list_add(list, inst); + + return s; +} + static CMPIStatus graphics_template(const CMPIObjectPath *ref, int template_type, struct inst_list *list) { const char *id; - const char *addr; - CMPIInstance *inst; CMPIStatus s = {CMPI_RC_OK, NULL}; + const char *type[] = {"vnc", "sdl"}; + int type_ct = 2; + int i; switch(template_type) { case SDC_RASD_MIN: @@ -1458,17 +1486,11 @@ goto out; } - inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_GRAPHICS, DEVICE_RASD); - - CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars); - - addr = "127.0.0.1:-1"; - CMSetProperty(inst, "Address", (CMPIValue *)addr, CMPI_chars); - - CMSetProperty(inst, "KeyMap", (CMPIValue *)"en-us", CMPI_chars); - CMSetProperty(inst, "ResourceSubType", (CMPIValue *)"vnc", CMPI_chars); - - inst_list_add(list, inst); + for (i = 0; i < type_ct; i++) { + s = set_graphics_props(ref, id, type[i], list); + if (s.rc != CMPI_RC_OK) + goto out; + } out: return s; From kaitlin at linux.vnet.ibm.com Fri Jul 10 23:52:48 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 10 Jul 2009 16:52:48 -0700 Subject: [Libvirt-cim] [PATCH 3 of 4] (#2) Add support for specifying a password for VNC connections to VSMS In-Reply-To: References: Message-ID: <7b8eeb3b3fcbe2f9b6cb.1247269968@localhost.localdomain> # HG changeset patch # User Kaitlin Rupert # Date 1247095850 25200 # Node ID 7b8eeb3b3fcbe2f9b6cb5eabe10569545244472e # Parent f915b6e4d1a3748fe8541cf2a3030a4613675945 (#2) Add support for specifying a password for VNC connections to VSMS Also support sdl type graphics devices. Be sure to write to the infostore whether the guest has a VNC password set. Updates: -Add support for updating the infostore with info as to whether the guest has a VNC password set Signed-off-by: Kaitlin Rupert diff -r f915b6e4d1a3 -r 7b8eeb3b3fcb src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Jul 08 16:30:50 2009 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Wed Jul 08 16:30:50 2009 -0700 @@ -771,7 +771,11 @@ const char *keymap; int ret; - dev->dev.graphics.type = strdup("vnc"); + if (cu_get_str_prop(inst, "ResourceSubType", &val) != CMPI_RC_OK) { + msg = "GraphicsRASD ResourceSubType field not valid"; + goto out; + } + dev->dev.graphics.type = strdup(val); /* FIXME: Add logic to prevent address:port collisions */ if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) { @@ -792,8 +796,13 @@ dev->dev.graphics.keymap = strdup(keymap); + if (cu_get_str_prop(inst, "Password", &val) != CMPI_RC_OK) { + dev->dev.graphics.passwd = NULL; + } else { + dev->dev.graphics.passwd = strdup(val); + } + out: - return msg; } @@ -893,7 +902,7 @@ dev->type = (int)type; if (domain->type == DOMAIN_LXC) - msg = _container_rasd_to_vdev(inst, dev, type, ns); + msg = _container_rasd_to_vdev(inst, dev, type, ns); else msg = _sysvirt_rasd_to_vdev(inst, dev, type, ns); out: @@ -1137,6 +1146,13 @@ infostore_set_u64(ctx, "weight", dev->dev.vcpu.weight); infostore_set_u64(ctx, "limit", dev->dev.vcpu.limit); + + dev = dominfo->dev_graphics; + if (dev->dev.graphics.passwd != NULL) + infostore_set_bool(ctx, "has_vnc_passwd", true); + else + infostore_set_bool(ctx, "has_vnc_passwd", false); + out: infostore_close(ctx); From kaitlin at linux.vnet.ibm.com Fri Jul 10 23:52:45 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 10 Jul 2009 16:52:45 -0700 Subject: [Libvirt-cim] [PATCH 0 of 4] Support for VNC password and sdl type graphics devices Message-ID: Add support for persisting whether a guest as a VNC password in the infostore. From deeptik at linux.vnet.ibm.com Mon Jul 13 11:59:22 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Mon, 13 Jul 2009 17:29:22 +0530 Subject: [Libvirt-cim] [PATCH 0 of 4] [TEST] #2 Misc migration test fixes In-Reply-To: References: Message-ID: <4A5B219A.8050506@linux.vnet.ibm.com> +1 for the patchset. Kaitlin Rupert wrote: > This tests enable localhost migration to work with Xen guests > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From anantyog at linux.vnet.ibm.com Mon Jul 13 13:14:46 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Mon, 13 Jul 2009 06:14:46 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] [Test] Start domain with bridge interface In-Reply-To: References: Message-ID: <0c06e9ac259999a35d3b.1247490886@elm3b151.beaverton.ibm.com> # HG changeset patch # User anantyog at linux.vnet.ibm.com # Date 1247490372 25200 # Node ID 0c06e9ac259999a35d3b08d1735822a5dc579fa7 # Parent 624d673032ea550914dc569d993081d510321e6c [Test] Start domain with bridge interface This test verifies definig and starting domain with bridge interface. Signed-off-by: Yogananth Subramanian diff -r 624d673032ea -r 0c06e9ac2599 suites/libvirt-cim/cimtest/VirtualSystemManagementService/18_define_sys_bridge.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/18_define_sys_bridge.py Mon Jul 13 06:06:12 2009 -0700 @@ -0,0 +1,76 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Yogananth subramanian +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# This testcase verifies defining and starting domain with bridge interface +# + +import sys +import random +from XenKvmLib import vxml +from CimTest.Globals import logger +from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib.const import default_network_name, do_main +from XenKvmLib.common_util import create_netpool_conf, destroy_netpool + +sup_types = ['Xen', 'KVM', 'XenFV'] +default_dom = 'brgtest_domain' +nmac = '99:aa:bb:cc:ee:ff' +npool_name = default_network_name + str(random.randint(1, 100)) +brg_name = "br" + str(random.randint(1, 100)) + + at do_main(sup_types) +def main(): + options = main.options + + status, net_name = create_netpool_conf(options.ip, options.virt, + use_existing=False, + net_name=npool_name, + bridge_name=brg_name) + if status != PASS: + logger.error('Unable to create network pool') + return FAIL + cxml = vxml.get_class(options.virt)(default_dom, mac=nmac, + ntype="bridge", + net_name=brg_name) + + try: + ret = cxml.cim_define(options.ip) + if not ret: + raise Exception("Failed to define the dom: %s" % default_dom) + ret = cxml.cim_start(options.ip) + if ret: + cxml.undefine(options.ip) + raise Exception("Failed to start the dom: %s" % default_dom) + + cxml.cim_destroy(options.ip) + cxml.undefine(options.ip) + + except Exception, details: + logger.error(details) + status = FAIL + + destroy_netpool(options.ip, options.virt, net_name) + + return status + +if __name__ == "__main__": + sys.exit(main()) + From anantyog at linux.vnet.ibm.com Mon Jul 13 13:14:44 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Mon, 13 Jul 2009 06:14:44 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] [Test] Patches to test bridge interface Message-ID: Hello everyone, I like to submit a set of patches to enable and test bridge interface uisng cimtest. The first patch,'patch1', enables to create domain with bridge interface. The seocnd patch,'patch2', is a testcase to test the above feature. The third parthc,'patch3', is a testcase to verify various error conditions with both 'network' and 'bridge' network type. Thanks and Regards Yogi From anantyog at linux.vnet.ibm.com Mon Jul 13 13:14:47 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Mon, 13 Jul 2009 06:14:47 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] [Test] Verify error conditions with different network types In-Reply-To: References: Message-ID: <44aa65341aeafc675430.1247490887@elm3b151.beaverton.ibm.com> # HG changeset patch # User anantyog at linux.vnet.ibm.com # Date 1247490378 25200 # Node ID 44aa65341aeafc675430fe33be2665ae103b2e9b # Parent 0c06e9ac259999a35d3b08d1735822a5dc579fa7 [Test] Verify error conditions with different network types The test verifies if the expected error message are recived when invalid params are used to define a bridge or a network interace. If a network is defined with a None, the 'default' network pool is used, so no exception is raised for tht condition in tht test. Signed-off-by: Yogananth Subramanian diff -r 0c06e9ac2599 -r 44aa65341aea suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py Mon Jul 13 06:06:18 2009 -0700 @@ -0,0 +1,125 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Yogananth subramanian +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# The testcase verifies if the expected error messages are received when +# invalid params are used to define a bridge or a network interface. +# If a network is defined with a None, the 'default' network pool is used +# so no exception is raised for tht condition in the test. +# + +import sys +import random +from pywbem import CIM_ERR_FAILED +from XenKvmLib import vxml +from CimTest.Globals import logger +from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib.const import default_network_name, do_main +from XenKvmLib.common_util import create_netpool_conf, destroy_netpool + +sup_types = ['Xen', 'KVM', 'XenFV'] +default_dom = 'brgtest_domain' +nmac = '99:aa:bb:cc:ee:ff' +npool_name = default_network_name + str(random.randint(1, 100)) +brg_name = "br" + str(random.randint(1, 100)) + +exp_rc = CIM_ERR_FAILED + +def verify_error(exp_rc, exp_desc,cxml): + status = cxml.verify_error_msg(exp_rc, exp_desc) + return status + + at do_main(sup_types) +def main(): + options = main.options + + nettypes = ['bridge','network'] + + expected_values = { + "invalid" : {'bridge' : 'internal error Failed to add tap interface', + 'network' : "internal error Network 'invalid'" }, + "empty" : {'bridge' : 'Bridge name is empty', + 'network' : "internal error Network '' not found"}, + "none" : {'bridge' : 'No Network bridge name specified', + 'network' : "Valid param "} + } + + tc_scen = { + 'invalid' : 'invalid', + 'empty' : '', + 'none' : None + } + + + status, net_name = create_netpool_conf(options.ip, options.virt, + use_existing=False, + net_name=npool_name, + bridge_name=brg_name) + if status != PASS: + logger.error('Unable to create network pool') + return FAIL + + status = PASS + for nettype in nettypes: + for tc, field in tc_scen.iteritems(): + cxml = vxml.get_class(options.virt)(default_dom, mac=nmac, + ntype=nettype, + net_name=field) + exp_desc = expected_values[tc][nettype] + try: + ret = cxml.cim_define(options.ip) + + if not ret: + status = verify_error(exp_rc, exp_desc, cxml) + if status != PASS: + raise Exception('Defing domain with invalid %s name %s' + ' gave unexpected rc code %s and ' + 'description:\n %s'% (nettype, field, + cxml.err_rc, cxml.err_desc)) + continue + ret = cxml.cim_start(options.ip) + if ret: + status = verify_error(exp_rc, exp_desc, cxml) + cxml.undefine(options.ip) + if status != PASS: + raise Exception('Starting domain with invalid %s name' + ' %s gave unexpected rc code %s and ' + 'description:\n %s'% (nettype, field, + cxml.err_rc, cxml.err_desc)) + continue + + cxml.cim_destroy(options.ip) + cxml.undefine(options.ip) + if nettype != 'network' and field != None: + raise Exception('Was able to define a domain with invalid' + ' %s name %s' % (nettype, field)) + + except Exception,details: + logger.error(details) + destroy_netpool(options.ip, options.virt, net_name) + return FAIL + + destroy_netpool(options.ip, options.virt, net_name) + + return status + +if __name__ == "__main__": + sys.exit(main()) + From anantyog at linux.vnet.ibm.com Mon Jul 13 13:14:45 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Mon, 13 Jul 2009 06:14:45 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] [Test] Patch to enable bridge type network in cimtest In-Reply-To: References: Message-ID: <624d673032ea550914dc.1247490885@elm3b151.beaverton.ibm.com> # HG changeset patch # User anantyog at linux.vnet.ibm.com # Date 1247490357 25200 # Node ID 624d673032ea550914dc569d993081d510321e6c # Parent f8a983f28ce47c137c4ecf14bbd8c81d936abc3f [Test] Patch to enable bridge type network in cimtest This patch enables creating a bridge type network pool and also defining a domain with bridge interface in cimtest. Signed-off-by: Yogananth Subramanian diff -r f8a983f28ce4 -r 624d673032ea suites/libvirt-cim/lib/XenKvmLib/common_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Fri Jul 10 00:47:59 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Mon Jul 13 06:05:57 2009 -0700 @@ -40,7 +40,8 @@ domain_list, virt2uri, net_destroy from XenKvmLib.vxml import PoolXML, NetXML from VirtLib import utils -from XenKvmLib.const import default_pool_name, default_network_name +from XenKvmLib.const import default_pool_name, default_network_name,\ + default_bridge_name disk_file = '/etc/libvirt/diskpool.conf' exports_file = '/etc/exports' @@ -381,7 +382,8 @@ return PASS def create_netpool_conf(server, virt, use_existing=False, - net_name=default_network_name): + net_name=default_network_name, + bridge_name=default_bridge_name): status = PASS test_network = None try: @@ -400,7 +402,8 @@ net_name) return FAIL, "Unknown" - netxml = NetXML(server, virt=virt, networkname=net_name) + netxml = NetXML(server, virt=virt, networkname=net_name, + bridgename=bridge_name) ret = netxml.create_vnet() if not ret: logger.error("Failed to create Virtual Network '%s'", diff -r f8a983f28ce4 -r 624d673032ea suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Fri Jul 10 00:47:59 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Mon Jul 13 06:05:57 2009 -0700 @@ -164,7 +164,10 @@ self.ResourceType = RASD_TYPE_NET_ETHER if virt_net != None : - self.PoolID = "NetworkPool/%s" % virt_net + if type == 'network': + self.PoolID = "NetworkPool/%s" % virt_net + elif type == 'bridge': + self.NetworkName = virt_net if mac != None: self.InstanceID = '%s/%s' % (name, mac) From kaitlin at linux.vnet.ibm.com Mon Jul 13 17:04:14 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 13 Jul 2009 10:04:14 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] For NetworkPoolRASDs, be sure to return a value in all cases Message-ID: <3a4e961d8628698392ed.1247504654@localhost.localdomain> # HG changeset patch # User Kaitlin Rupert # Date 1247504645 25200 # Node ID 3a4e961d8628698392edcc1f0943281f219ff658 # Parent 66daf8a0a7da34f4135e83cf9398ece22bb2738b [TEST] For NetworkPoolRASDs, be sure to return a value in all cases If both if conditions aren't met, we still need to return a default value. Signed-off-by: Kaitlin Rupert diff -r 66daf8a0a7da -r 3a4e961d8628 suites/libvirt-cim/lib/XenKvmLib/rasd.py --- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Wed Jul 01 11:23:00 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Mon Jul 13 10:04:05 2009 -0700 @@ -368,6 +368,8 @@ return exp_base_num * dev_types * net_types + return exp_base_num + def get_exp_template_rasd_len(virt, ip, id): curr_cim_rev, changeset = get_provider_version(virt, ip) From kaitlin at linux.vnet.ibm.com Mon Jul 13 17:41:05 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 13 Jul 2009 10:41:05 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix RPCS 08 to work with older version of libvirt-cim Message-ID: <89d8b84653726ba7508c.1247506865@localhost.localdomain> # HG changeset patch # User Kaitlin Rupert # Date 1247506857 25200 # Node ID 89d8b84653726ba7508c17a5da75cc695c9da304 # Parent 3a4e961d8628698392edcc1f0943281f219ff658 [TEST] Fix RPCS 08 to work with older version of libvirt-cim... For versions that don't support dir, netfs pool creation, or DiskPoolRASD templates. Signed-off-by: Kaitlin Rupert diff -r 3a4e961d8628 -r 89d8b8465372 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py Mon Jul 13 10:04:05 2009 -0700 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py Mon Jul 13 10:40:57 2009 -0700 @@ -61,9 +61,11 @@ libvirt_disk_pool_support=837 libvirt_netfs_pool_support=869 -def get_pool_attr(server, pool_type, dp_types): +def get_pool_attr(server, pool_type, dp_types, rev): pool_attr = { "Path" : "/tmp" } - if pool_type == dp_types['DISK_POOL_NETFS']: + + if rev >= libvirt_netfs_pool_support and \ + pool_type == dp_types['DISK_POOL_NETFS']: status , src_mnt_dir, dir_mnt_dir = nfs_netfs_setup(server) if status != PASS: logger.error("Failed to get pool_attr for NETFS diskpool type") @@ -107,7 +109,8 @@ try: logger.info("Verifying '%s'.....", key) test_pool = key - status, pool_attr = get_pool_attr(server, value, dp_types) + status, pool_attr = get_pool_attr(server, value, dp_types, + curr_cim_rev) if status != PASS: return FAIL @@ -144,6 +147,8 @@ logger.error("Exception details: %s", details) if key == 'DISK_POOL_NETFS': netfs_cleanup(server, pool_attr) + if status == SKIP: + return status return FAIL return status From kaitlin at linux.vnet.ibm.com Mon Jul 13 17:45:55 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 13 Jul 2009 10:45:55 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix RPCS to work with older versions of libvirt-cim Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1247507138 25200 # Node ID de91439de07c3cc8e3ca5a5e398f3fad35d0a664 # Parent 89d8b84653726ba7508c17a5da75cc695c9da304 [TEST] Fix RPCS to work with older versions of libvirt-cim... If DiskPoolRASD templates aren't supported, then create_pool() return a SKIP status error. Return this instead of a FAIL. Signed-off-by: Kaitlin Rupert diff -r 89d8b8465372 -r de91439de07c suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/09_DeleteDiskPool.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/09_DeleteDiskPool.py Mon Jul 13 10:40:57 2009 -0700 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/09_DeleteDiskPool.py Mon Jul 13 10:45:38 2009 -0700 @@ -92,7 +92,7 @@ pool_type="DiskPool", mode_type=TYPE) if status != PASS: logger.error("Failed to create diskpool '%s'", test_pool) - return FAIL + return status status = verify_pool(server, virt, test_pool, pool_attr, pool_type="DiskPool") From kaitlin at linux.vnet.ibm.com Mon Jul 13 17:53:29 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 13 Jul 2009 10:53:29 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix VSSS to work with older versions of libvirt-cim Message-ID: <46932b337bb4387cb836.1247507609@localhost.localdomain> # HG changeset patch # User Kaitlin Rupert # Date 1247507590 25200 # Node ID 46932b337bb4387cb8366cb9529d73e212e11c1d # Parent de91439de07c3cc8e3ca5a5e398f3fad35d0a664 [TEST] Fix VSSS to work with older versions of libvirt-cim... To work with versions that don't return a ResultingSnapshot result from CreateSnapshot(). Signed-off-by: Kaitlin Rupert diff -r de91439de07c -r 46932b337bb4 suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/03_create_snapshot.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/03_create_snapshot.py Mon Jul 13 10:45:38 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/03_create_snapshot.py Mon Jul 13 10:53:10 2009 -0700 @@ -28,7 +28,7 @@ from pywbem import cim_types from CimTest.Globals import logger from CimTest.ReturnCodes import PASS, FAIL -from XenKvmLib.const import do_main +from XenKvmLib.const import do_main, get_provider_version from XenKvmLib.vxml import get_class from XenKvmLib.classes import get_typed_class, inst_to_mof from XenKvmLib.enumclass import EnumNames, EnumInstances, GetInstance @@ -41,6 +41,8 @@ SNAPSHOT = cim_types.Uint16(32769) test_dom = "snapshot_vm" +libvirt_cim_res_snap_rev = 876 + def get_cs_ref(virt, ip): cs_cn = get_typed_class(virt, "ComputerSystem") @@ -130,7 +132,9 @@ if output[1]['Job'] is None: raise Exception("CreateSnapshot failed to return a CIM job inst") - if output[1]['ResultingSnapshot'] is None: + rev, changeset = get_provider_version(options.virt, options.ip) + if rev >= libvirt_cim_res_snap_rev and \ + output[1]['ResultingSnapshot'] is None: raise Exception("CreateSnapshot failed to return ResultingSnapshot") except Exception, detail: From deeptik at linux.vnet.ibm.com Mon Jul 13 17:58:46 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 13 Jul 2009 10:58:46 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Added logical pool support to create_verify_storagepool.py Message-ID: <6d123f20bb563f881233.1247507926@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1247507891 25200 # Node ID 6d123f20bb563f881233713ef90fa31496cae3a4 # Parent 66daf8a0a7da34f4135e83cf9398ece22bb2738b [TEST] Added logical pool support to create_verify_storagepool.py. Verified with Xen and current sources. Signed-off-by: Deepti B. Kalakeri diff -r 66daf8a0a7da -r 6d123f20bb56 suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py --- a/suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py Wed Jul 01 11:23:00 2009 -0700 +++ b/suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py Mon Jul 13 10:58:11 2009 -0700 @@ -26,9 +26,16 @@ # # The test case is not run in the batch run and we need to run it using # the following command: -# python create_verify_storagepool.py -t 2 -d /dev/sda4 -m /tmp/mnt -n diskfs +# For Fs pool type: +# ---------------- +# python create_verify_storagepool.py -t fs -d /dev/sda4 -m /tmp/mnt -n diskfs # -v Xen -u -p # +# For logical pool type: +# ---------------------- +# python create_verify_storagepool.py -t logical -d /dev/VolGroup01 +# -n VolGroup01 -v Xen -u -p +# # Where t can be : # 2 - FileSystem # 4 - Logical etc @@ -45,26 +52,27 @@ sys.path.append('../../../lib') from CimTest import Globals from CimTest.Globals import logger, log_param -from CimTest.ReturnCodes import PASS, FAIL +from CimTest.ReturnCodes import PASS, FAIL, SKIP sys.path.append('../lib') from XenKvmLib.classes import inst_to_mof, get_typed_class from XenKvmLib.pool import get_pool_rasds from XenKvmLib.common_util import pre_check from XenKvmLib.enumclass import EnumInstances +from XenKvmLib.const import get_provider_version TEST_LOG="cimtest.log" +libvirt_cim_fs_changes = 857 +libvirt_cim_logical_changes = 906 + supp_types = [ 'Xen', 'KVM' , 'LXC' ] -pool_types = { 'DISK_POOL_FS' : 2 } +pool_types = { 'DISK_POOL_FS' : 2 , 'DISK_POOL_LOGICAL' : 6 } -def verify_cmd_options(options): +def verify_cmd_options(options, parser): try: if options.part_dev == None: raise Exception("Free Partition to be mounted not specified") - if options.mnt_pt == None: - raise Exception("Mount points to be used not specified") - if options.pool_name == None: raise Exception("Must specify the Pool Name to be created") @@ -74,8 +82,11 @@ if options.pool_type == None: raise Exception("Must specify pool type to be tested") + if options.mnt_pt == None and options.pool_type != 'logical': + raise Exception("Mount points to be used not specified") + except Exception, details: - print "FATAL: ", details + print "\nFATAL: ", details , "\n" print parser.print_help() return FAIL @@ -101,13 +112,37 @@ def get_pooltype(pooltype, virt): if pooltype == "fs": pool_type = pool_types['DISK_POOL_FS'] + elif pooltype == "logical": + pool_type = pool_types['DISK_POOL_LOGICAL'] else: logger.error("Invalid pool type ....") return None, None return PASS, pool_type -def verify_inputs(part_dev, mount_pt): +def verify_inputs(part_dev, mount_pt, pool_type, pool_name): del_dir = False + + if pool_type == pool_types['DISK_POOL_LOGICAL']: + if not os.path.exists("/sbin/lvm"): + logger.error("LVM support does not exist on the machine") + return FAIL, del_dir + + cmd = "lvm vgs | sed '1 d' 2>>/dev/null" + status, output = getstatusoutput(cmd) + if status != PASS: + logger.error("Failed to get lvm output") + return FAIL, del_dir + + vgname_list = [] + for line in output.split('\n'): + vgname_list.append(line.split()[0]) + + if not pool_name in vgname_list: + logger.error("Please specify existing VolGroup for Poolname") + return FAIL, del_dir + + return PASS, del_dir + cmd = "mount" status, mount_info = getstatusoutput(cmd) if status != PASS: @@ -165,10 +200,13 @@ for dpool_rasd in dp_rasds: if dpool_rasd['Type'] == pooltype and \ dpool_rasd['InstanceID'] == 'Default': - dpool_rasd['DevicePaths'] = [part_dev] - dpool_rasd['Path'] = mount_pt dp_pid = "%s/%s" % ("DiskPool", pool_name) dpool_rasd['PoolID'] = dpool_rasd['InstanceID'] = dp_pid + if pooltype == pool_types['DISK_POOL_FS']: + dpool_rasd['Path'] = mount_pt + dpool_rasd['DevicePaths'] = [part_dev] + elif pooltype == pool_types['DISK_POOL_LOGICAL']: + dpool_rasd['Path'] = part_dev break if not pool_name in dpool_rasd['InstanceID']: @@ -234,13 +272,14 @@ parser.add_option("-t", "--pool-type", dest="pool_type", default=None, help="Pool type:[ fs | logical ]") parser.add_option("-d", "--part-dev", dest="part_dev", default=None, - help="specify the free partition to be used") + help="specify the free partition to be used for " \ + "fs pool type or the predefined Vol Group" \ + " for logical pool type") parser.add_option("-m", "--mnt_pt", dest="mnt_pt", default=None, help="Mount point to be used") parser.add_option("-n", "--pool-name", dest="pool_name", default=None, help="Pool to be created") - parser.add_option("-c", "--clean-log", - action="store_true", dest="clean", + parser.add_option("-c", "--clean-log", action="store_true", dest="clean", help="Will remove existing log files before test run") parser.add_option("-l", "--debug-output", action="store_true", dest="debug", help="Duplicate the output to stderr") @@ -248,7 +287,7 @@ (options, args) = parser.parse_args() # Verify command line options - status = verify_cmd_options(options) + status = verify_cmd_options(options, parser) if status != PASS: return status @@ -275,10 +314,28 @@ status, pooltype = get_pooltype(options.pool_type, virt) if status != PASS: return FAIL + + os.environ['CIM_NS'] = Globals.CIM_NS = options.ns + os.environ['CIM_USER'] = Globals.CIM_USER = options.username + os.environ['CIM_PASS'] = Globals.CIM_PASS = options.password + + curr_cim_rev, changeset = get_provider_version(virt, sysname) + if curr_cim_rev < libvirt_cim_fs_changes and \ + pooltype == pool_types['DISK_POOL_FS']: + logger.info("Test Skipped for %s pool type, Support for File System "\ + "Pool is available in revision %s", options.pool_type, + libvirt_cim_fs_changes) + return SKIP + elif curr_cim_rev < libvirt_cim_logical_changes and \ + pooltype == pool_types['DISK_POOL_LOGICAL']: + logger.info("Test Skipped for %s pool type, Support for Logical Pool" \ + " is available in revision %s", options.pool_type, \ + libvirt_cim_logical_changes) + return SKIP pooltype = cim_types.Uint16(pooltype) - status, del_dir = verify_inputs(part_dev, mount_pt) + status, del_dir = verify_inputs(part_dev, mount_pt, pooltype, pool_name) if status != PASS: if del_dir == True: cmd ="rm -rf %s" % mount_pt @@ -286,10 +343,6 @@ logger.error("Input verification failed") return status - - os.environ['CIM_NS'] = Globals.CIM_NS = options.ns - os.environ['CIM_USER'] = Globals.CIM_USER = options.username - os.environ['CIM_PASS'] = Globals.CIM_PASS = options.password cn = "DiskPool" dp_cn = get_typed_class(virt, cn) dp_id = "%s/%s" % (cn, pool_name) @@ -299,6 +352,9 @@ if status == PASS: logger.error("Pool --> '%s' already exist", pool_name) logger.error("Specify some other pool name") + if del_dir == True: + cmd ="rm -rf %s" % mount_pt + status, out = getstatusoutput(cmd) return status res = [FAIL] From rmaciel at linux.vnet.ibm.com Mon Jul 13 17:59:47 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Mon, 13 Jul 2009 14:59:47 -0300 Subject: [Libvirt-cim] [PATCH 0 of 4] Support for VNC password and sdl type graphics devices In-Reply-To: References: Message-ID: <4A5B7613.9090009@linux.vnet.ibm.com> +1 Kaitlin Rupert wrote: > Add support for persisting whether a guest as a VNC password in the infostore. > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 14 00:28:41 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 13 Jul 2009 17:28:41 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix rasd_init_list() - XenFV guests with newer vesions of libvirt Message-ID: <5443392e87298a0d1a94.1247531321@localhost.localdomain> # HG changeset patch # User Kaitlin Rupert # Date 1247531298 25200 # Node ID 5443392e87298a0d1a94eee50485e20fb815a5be # Parent c72a55c4533250a84ae5bcd25cab08a083f2e8d5 [TEST] Fix rasd_init_list() - XenFV guests with newer vesions of libvirt... Use ps2 input devices, not usb. Set ps2 as the default, otherwise, the guest could end up with both ps2 and usb devices, which breaks some of the tests. This is because the test is only expecting one input device, but libvirt adds an additional ps2 device (in the case usb is specified). Signed-off-by: Kaitlin Rupert diff -r c72a55c45332 -r 5443392e8729 suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py --- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Mon Jul 13 16:12:22 2009 -0700 +++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Mon Jul 13 17:28:18 2009 -0700 @@ -149,7 +149,8 @@ status, rasd_values, in_list = rasd_init_list(vsxml, virt, test_disk, test_dom, - test_mac, test_mem) + test_mac, test_mem, + server) if status != PASS: return status diff -r c72a55c45332 -r 5443392e8729 suites/libvirt-cim/cimtest/RASD/02_enum.py --- a/suites/libvirt-cim/cimtest/RASD/02_enum.py Mon Jul 13 16:12:22 2009 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/02_enum.py Mon Jul 13 17:28:18 2009 -0700 @@ -147,7 +147,7 @@ status, rasd_values_list, in_list = rasd_init_list(vsxml, virt, test_disk, test_dom, test_mac, - test_mem) + test_mem, server) if status != PASS: return status diff -r c72a55c45332 -r 5443392e8729 suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py --- a/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Mon Jul 13 16:12:22 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Mon Jul 13 17:28:18 2009 -0700 @@ -165,10 +165,10 @@ status = FAIL return status, vssdc_assoc_info -def verify_rasd_values(rasd_values_info): +def verify_rasd_values(rasd_values_info, server): status, rasd_values_list, in_list = rasd_init_list(vsxml, virt, test_disk, test_dom, test_mac, - test_mem) + test_mem, server) if status != PASS: return status @@ -229,12 +229,12 @@ if status != PASS or len(vssd_values) == 0: return status - status, rasd_values = get_rasd_values_from_vssdc_assoc(vssd_values) + status, rasd_values = get_rasd_values_from_vssdc_assoc(vssd_values) if status != PASS or len(rasd_values) == 0: vsxml.undefine(server) return status - status = verify_rasd_values(rasd_values) + status = verify_rasd_values(rasd_values, server) try: vsxml.undefine(server) except Exception, detail: diff -r c72a55c45332 -r 5443392e8729 suites/libvirt-cim/lib/XenKvmLib/rasd.py --- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Mon Jul 13 16:12:22 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Mon Jul 13 17:28:18 2009 -0700 @@ -47,7 +47,7 @@ dccn = 'DisplayController' pdcn = 'PointingDevice' -def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem): +def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem, server): """ Creating the lists that will be used for comparisons. """ @@ -72,7 +72,9 @@ if virt == 'LXC': disk_path = '/tmp/lxc_files' - if virt == 'LXC' or virt == 'XenFV': + libvirt_version = virsh_version(server, virt) + + if virt == 'LXC' or (virt == 'XenFV' and libvirt_version < "0.6.3"): point_device = "%s/%s" %(t_dom, "mouse:usb") elif virt == 'Xen': point_device = "%s/%s" %(t_dom, "mouse:xen") diff -r c72a55c45332 -r 5443392e8729 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Jul 13 16:12:22 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Jul 13 17:28:18 2009 -0700 @@ -916,7 +916,7 @@ net_name=const.default_network_name, emu_type=None, grstype="vnc", address="127.0.0.1", port_num='-1', keymap="en-us", - irstype="mouse", btype="usb"): + irstype="mouse", btype="ps2"): if not os.path.exists(disk_file_path): logger.error('Error: Disk image does not exist') sys.exit(1) From deeptik at linux.vnet.ibm.com Tue Jul 14 11:10:48 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 14 Jul 2009 16:40:48 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] For NetworkPoolRASDs, be sure to return a value in all cases In-Reply-To: <3a4e961d8628698392ed.1247504654@localhost.localdomain> References: <3a4e961d8628698392ed.1247504654@localhost.localdomain> Message-ID: <4A5C67B8.2080308@linux.vnet.ibm.com> +1 for me. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Tue Jul 14 14:17:26 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 14 Jul 2009 19:47:26 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fix RPCS 08 to work with older version of libvirt-cim In-Reply-To: <89d8b84653726ba7508c.1247506865@localhost.localdomain> References: <89d8b84653726ba7508c.1247506865@localhost.localdomain> Message-ID: <4A5C9376.4030605@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1247506857 25200 > # Node ID 89d8b84653726ba7508c17a5da75cc695c9da304 > # Parent 3a4e961d8628698392edcc1f0943281f219ff658 > [TEST] Fix RPCS 08 to work with older version of libvirt-cim... > > For versions that don't support dir, netfs pool creation, or DiskPoolRASD > templates. > > Signed-off-by: Kaitlin Rupert > > diff -r 3a4e961d8628 -r 89d8b8465372 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py > --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py Mon Jul 13 10:04:05 2009 -0700 > +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py Mon Jul 13 10:40:57 2009 -0700 > @@ -61,9 +61,11 @@ > libvirt_disk_pool_support=837 > libvirt_netfs_pool_support=869 > > -def get_pool_attr(server, pool_type, dp_types): > +def get_pool_attr(server, pool_type, dp_types, rev): > pool_attr = { "Path" : "/tmp" } > - if pool_type == dp_types['DISK_POOL_NETFS']: > + > + if rev >= libvirt_netfs_pool_support and \ > + pool_type == dp_types['DISK_POOL_NETFS']: > status , src_mnt_dir, dir_mnt_dir = nfs_netfs_setup(server) > if status != PASS: > logger.error("Failed to get pool_attr for NETFS diskpool type") > @@ -107,7 +109,8 @@ > try: > logger.info("Verifying '%s'.....", key) > test_pool = key > - status, pool_attr = get_pool_attr(server, value, dp_types) > + status, pool_attr = get_pool_attr(server, value, dp_types, > + curr_cim_rev) > if status != PASS: > return FAIL > > @@ -144,6 +147,8 @@ > logger.error("Exception details: %s", details) > if key == 'DISK_POOL_NETFS': > netfs_cleanup(server, pool_attr) > + if status == SKIP: > + return status > return FAIL > Instead of the two return statements you can use return status instead above without checking status == SKIP. > > return status > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Tue Jul 14 14:19:39 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 14 Jul 2009 19:49:39 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fix RPCS to work with older versions of libvirt-cim In-Reply-To: References: Message-ID: <4A5C93FB.10904@linux.vnet.ibm.com> +1 for me. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Tue Jul 14 14:35:04 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 14 Jul 2009 20:05:04 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fix rasd_init_list() - XenFV guests with newer vesions of libvirt In-Reply-To: <5443392e87298a0d1a94.1247531321@localhost.localdomain> References: <5443392e87298a0d1a94.1247531321@localhost.localdomain> Message-ID: <4A5C9798.9070200@linux.vnet.ibm.com> +1 for me. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Tue Jul 14 14:21:35 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 14 Jul 2009 19:51:35 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fix VSSS to work with older versions of libvirt-cim In-Reply-To: <46932b337bb4387cb836.1247507609@localhost.localdomain> References: <46932b337bb4387cb836.1247507609@localhost.localdomain> Message-ID: <4A5C946F.2040109@linux.vnet.ibm.com> +1 for me. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 14 17:21:33 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 14 Jul 2009 10:21:33 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix RPCS 08 to work with older version of libvirt-cim Message-ID: <05d74ccb64b9ca5b313d.1247592093@localhost.localdomain> # HG changeset patch # User Kaitlin Rupert # Date 1247591737 25200 # Node ID 05d74ccb64b9ca5b313d8ccb5a89138f1dfc1aea # Parent ad683039dafd91ced940b28c28689bdc1e3e829c [TEST] #2 Fix RPCS 08 to work with older version of libvirt-cim... For versions that don't support dir, netfs pool creation, or DiskPoolRASD templates. Instead of checking for SKIP return value, just return status. Signed-off-by: Kaitlin Rupert diff -r ad683039dafd -r 05d74ccb64b9 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py Tue Jul 14 10:17:19 2009 -0700 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py Tue Jul 14 10:15:37 2009 -0700 @@ -61,9 +61,11 @@ libvirt_disk_pool_support=837 libvirt_netfs_pool_support=869 -def get_pool_attr(server, pool_type, dp_types): +def get_pool_attr(server, pool_type, dp_types, rev): pool_attr = { "Path" : "/tmp" } - if pool_type == dp_types['DISK_POOL_NETFS']: + + if rev >= libvirt_netfs_pool_support and \ + pool_type == dp_types['DISK_POOL_NETFS']: status , src_mnt_dir, dir_mnt_dir = nfs_netfs_setup(server) if status != PASS: logger.error("Failed to get pool_attr for NETFS diskpool type") @@ -107,7 +109,8 @@ try: logger.info("Verifying '%s'.....", key) test_pool = key - status, pool_attr = get_pool_attr(server, value, dp_types) + status, pool_attr = get_pool_attr(server, value, dp_types, + curr_cim_rev) if status != PASS: return FAIL @@ -144,7 +147,7 @@ logger.error("Exception details: %s", details) if key == 'DISK_POOL_NETFS': netfs_cleanup(server, pool_attr) - return FAIL + return status return status From kaitlin at linux.vnet.ibm.com Tue Jul 14 20:53:03 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 14 Jul 2009 13:53:03 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Remove stale XenFV guest if migration fails in VSMS/02 Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1247604765 25200 # Node ID a3ff36c310b2729052991032cf6c8f5cee85e838 # Parent 05d74ccb64b9ca5b313d8ccb5a89138f1dfc1aea [TEST] Remove stale XenFV guest if migration fails in VSMS/02 Sometimes xend gets hung doing a local migration of XenFV guests. The guest will show up in "xm list" as "migrating-guest_name". The problem with this is that libvirt sees the guest as "guest_name", so libvirt is unable to undefine the guest. In this case, we need to do an xm destroy to remove the guest. Signed-off-by: Kaitlin Rupert diff -r 05d74ccb64b9 -r a3ff36c310b2 suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Tue Jul 14 10:15:37 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Tue Jul 14 13:52:45 2009 -0700 @@ -34,6 +34,7 @@ from CimTest.Globals import logger, CIM_ERROR_ENUMERATE from XenKvmLib.const import do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL +from XenKvmLib.xm_virt_util import xm_destroy sup_types = ['Xen', 'XenFV'] @@ -182,7 +183,11 @@ if local_migrate == 0 and cxml is not None: cxml.destroy(options.ip) - cxml.undefine(options.ip) + rc = cxml.undefine(options.ip) + if rc == 1: + #Problem migrating guest locally, forcefully remove guest + xen_guest_name = "migrating-%s" % guest_name + xm_destroy(options.ip, xen_guest_name) except Exception, details: logger.error("Exception details: %s", details) diff -r 05d74ccb64b9 -r a3ff36c310b2 suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Tue Jul 14 10:15:37 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Tue Jul 14 13:52:45 2009 -0700 @@ -38,6 +38,13 @@ return out +def xm_destroy(ip, domid): + + cmd = "xm destroy %s" % domid + + rc, out = utils.run_remote(ip, cmd) + return rc + def list_guests_on_bridge(ip, bridge): """Returns a list of domU names that have vifs in the specified bridge. From kaitlin at linux.vnet.ibm.com Tue Jul 14 21:28:37 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 14 Jul 2009 14:28:37 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix ESD 01: XenFV guest should use ps2 style input device Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1247606914 25200 # Node ID c6049e5fdac67a46ffc0bdc3f5cf41e83f0507a7 # Parent a3ff36c310b2729052991032cf6c8f5cee85e838 [TEST] Fix ESD 01: XenFV guest should use ps2 style input device Signed-off-by: Kaitlin Rupert diff -r a3ff36c310b2 -r c6049e5fdac6 suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Tue Jul 14 13:52:45 2009 -0700 +++ b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Tue Jul 14 14:28:34 2009 -0700 @@ -127,7 +127,7 @@ else: vdisk = "hda" - if options.virt == 'LXC' or options.virt == 'XenFV': + if options.virt == 'LXC': input_device = "%s/%s" %(test_dom, "mouse:usb") elif options.virt == 'Xen': input_device = "%s/%s" %(test_dom, "mouse:xen") From kaitlin at linux.vnet.ibm.com Tue Jul 14 22:12:06 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 14 Jul 2009 15:12:06 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] A few more usb vs ps2 related fixes Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1247609514 25200 # Node ID ca15cd2e09bc3d6f36a17ba13ad4e1971980f633 # Parent c6049e5fdac67a46ffc0bdc3f5cf41e83f0507a7 [TEST] A few more usb vs ps2 related fixes Signed-off-by: Kaitlin Rupert diff -r c6049e5fdac6 -r ca15cd2e09bc suites/libvirt-cim/cimtest/SystemDevice/01_forward.py --- a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Tue Jul 14 14:28:34 2009 -0700 +++ b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Tue Jul 14 15:11:54 2009 -0700 @@ -105,7 +105,7 @@ if curr_cim_rev >= input_graphics_pool_rev: input_cn = get_typed_class(virt, "PointingDevice") graphics_cn = get_typed_class(virt, "DisplayController") - if virt == 'XenFV': + if virt == 'LXC': point_device = "%s/%s" %(test_dom, "mouse:usb") elif virt == 'Xen': point_device = "%s/%s" %(test_dom, "mouse:xen") diff -r c6049e5fdac6 -r ca15cd2e09bc suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Tue Jul 14 14:28:34 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Tue Jul 14 15:11:54 2009 -0700 @@ -86,7 +86,7 @@ rlist[3] : "%s/%s" % (test_dom, "proc") } - if virt == 'LXC' or virt == 'XenFV': + if virt == 'LXC': input_device = "mouse:usb" elif virt == 'Xen': input_device = "mouse:xen" diff -r c6049e5fdac6 -r ca15cd2e09bc suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Tue Jul 14 14:28:34 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Tue Jul 14 15:11:54 2009 -0700 @@ -82,7 +82,7 @@ verified. """ status = PASS - if virt == 'LXC' or virt == 'XenFV': + if virt == 'LXC': input_device = "mouse:usb" elif virt == 'Xen': input_device = "mouse:xen" From kaitlin at linux.vnet.ibm.com Tue Jul 14 22:43:18 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 14 Jul 2009 15:43:18 -0700 Subject: [Libvirt-cim] Release of libvirt-cim 0.5.6 Message-ID: <4A5D0A06.5060008@linux.vnet.ibm.com> A new release of libvirt-cim is now available at: ftp://libvirt.org/libvirt-cim/ * Features: - Support for specifying NIC model type for virtual NICs - Allow user to specify UUID to use when guest is created - Schema update from 2.16 to 2.21 - Additional storage pool support: *fs *netfs *disk *iscsi *logical *scsi - Support for a list of boot devices instead of just one device - Support for specifying the BusType of a virtual disk - Support for generating KVM migration job indications - Users can now specify bridge type interfaces - Support for specifying VNC passwords * Bug fixes: - Allow users to specify ForwardDevice attribute for network pools - Generate tag properly for XenFV guests - Set the InitPath for LXC guests - Return ResultingSnapshot parameter from CreateSnapshot() - Expose OperationalStatus attribute of VirtualSystemManagementService - Set the PreviousInstance of a ComputerSystemModifiedInstance indication properly - Verified a UUID specified is not in use by an existing guest (when attempting to define a new guest) - Check to see if PoolID in NetRASD has valid format -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 15 00:43:00 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 14 Jul 2009 17:43:00 -0700 Subject: [Libvirt-cim] Release of libcmpiutil 0.5 Message-ID: <4A5D2614.8040101@linux.vnet.ibm.com> A new release of libvirt-cim is now available at: ftp://libvirt.org/libvirt-cim/ * Features: - Add support to parse arrays of strings - Additional commenting - Indication_tester.py enhancements *ability to specify a port *ability to specify name of indication filter - Report disabled indications * Bug fixes: - Workaround for sfcb, which doesn't provide actual names of registered classes, just provides subclass names - Add link to libxml2 - MOF parser will ignore NULL properties - Fix handling of invalid class in mof parser -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 15 00:53:49 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 14 Jul 2009 17:53:49 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Updates to VSMS 19_definenetwork_ers.py Message-ID: <2daf5abc8b907906380f.1247619229@localhost.localdomain> # HG changeset patch # User Kaitlin Rupert # Date 1247619180 25200 # Node ID 2daf5abc8b907906380fa9b911a0711d23aaa19f # Parent b2eb25caa1c8b2736418c39e448b6f228fc153bc [TEST] Updates to VSMS 19_definenetwork_ers.py Skip bridge type networks with provider versions that don't support setting the bridge type via the providers. Set different expected error messages for Xen guests, and for older versions of libvirt. Signed-off-by: Kaitlin Rupert diff -r b2eb25caa1c8 -r 2daf5abc8b90 suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py Tue Jul 14 16:14:07 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py Tue Jul 14 17:53:00 2009 -0700 @@ -31,8 +31,9 @@ from XenKvmLib import vxml from CimTest.Globals import logger from CimTest.ReturnCodes import FAIL, PASS -from XenKvmLib.const import default_network_name, do_main +from XenKvmLib.const import default_network_name, do_main, get_provider_version from XenKvmLib.common_util import create_netpool_conf, destroy_netpool +from XenKvmLib.xm_virt_util import virsh_version sup_types = ['Xen', 'KVM', 'XenFV'] default_dom = 'brgtest_domain' @@ -40,6 +41,8 @@ npool_name = default_network_name + str(random.randint(1, 100)) brg_name = "br" + str(random.randint(1, 100)) +bridge_support_rev = 900 + exp_rc = CIM_ERR_FAILED def verify_error(exp_rc, exp_desc,cxml): @@ -50,7 +53,11 @@ def main(): options = main.options - nettypes = ['bridge','network'] + nettypes = ['network'] + + rev, changeset = get_provider_version(options.virt, options.ip) + if rev >= bridge_support_rev: + nettypes.append('bridge') expected_values = { "invalid" : {'bridge' : 'internal error Failed to add tap interface', @@ -61,6 +68,27 @@ 'network' : "Valid param "} } + if options.virt == "Xen" or options.virt == "XenFV": + libvirt_version = virsh_version(options.ip, options.virt) + if libvirt_version <= "0.3.3": + expected_values['empty']['network'] = "no network with matching name" + expected_values['invalid']['network'] = "no network with matching name" + + inv_br_str = "POST operation failed: (xend.err 'Device 0 (vif) " + \ + "could not be connected. Could not find bridge device " + \ + "invalid')" + + expected_values['invalid']['bridge'] = inv_br_str + + else: + expected_values['empty']['network'] = "Network not found" + expected_values['invalid']['network'] = "Network not found" + + inv_br_str = "POST operation failed: xend_post: error from xen " + \ + "daemon: (xend.err 'Device 0 (vif) could not be " + \ + "connected. Could not find bridge device invalid')" + expected_values['invalid']['bridge'] = inv_br_str + tc_scen = { 'invalid' : 'invalid', 'empty' : '', From snmishra at us.ibm.com Wed Jul 15 05:16:32 2009 From: snmishra at us.ibm.com (Sharad Mishra) Date: Tue, 14 Jul 2009 22:16:32 -0700 Subject: [Libvirt-cim] [PATCH] Check for duplicate MAC addresses Message-ID: # HG changeset patch # User snmishra at us.ibm.com # Date 1247634781 25200 # Node ID ab9ad4cf3cb6f65ef082f4fb0fce23258e2af199 # Parent 3730865ecff94af45926b110373817e6ce38576d Check for duplicate MAC addresses. This patch gets all MAC addresses assigned to the VMs on the host and verifies that the generated or passed MAC does not conflict with an existing MAC. Signed-off-by: Sharad Mishra diff -r 3730865ecff9 -r ab9ad4cf3cb6 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Tue Jul 07 14:13:30 2009 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Tue Jul 14 22:13:01 2009 -0700 @@ -534,6 +534,69 @@ return _mac; } +static const char *filter_by_address(struct inst_list *src, + const char *address) +{ + int i; + CMPIrc ret; + const char *addr; + const char *msg = NULL; + CMPIInstance *inst; + + for (i = 0; i < src->cur; i++) { + inst = src->list[i]; + ret = cu_get_str_prop(inst, "Address", &addr); + + if (ret != CMPI_RC_OK) + continue; + + if (STREQ(addr, address)) { + msg = "Conflicting MAC Addresses"; + goto out; + } + } +out: + return msg; + +} + +static const char *check_duplicate_mac(CMPIInstance *inst, + const char *mac, + const char *ns) +{ + CMPIObjectPath *op = NULL; + CMPIStatus s; + const char *msg = NULL; + const char *props[] = {"Address", NULL}; + struct inst_list in_list; + + op = CMGetObjectPath(inst, &s); + if ((op == NULL) || (s.rc != CMPI_RC_OK)) { + msg = "Unable to get a reference to the guest"; + goto out; + } + + /* FIXME: This is a Pegasus work around. Pegsus loses the namespace + when an ObjectPath is pulled from an instance */ + + if (STREQ(NAMESPACE(op), "")) + CMSetNameSpace(op, ns); + + inst_list_init(&in_list); + s = enum_rasds(_BROKER, op, NULL, CIM_RES_TYPE_NET, props, &in_list); + if (s.rc != CMPI_RC_OK) { + msg = "Failed to enumerate network instances"; + goto out; + } + + msg = filter_by_address(&in_list, mac); + +out: + inst_list_free(&in_list); + return msg; +} + + static const char *net_rasd_to_vdev(CMPIInstance *inst, struct virt_device *dev, const char *ns) @@ -550,6 +613,11 @@ } } + msg = check_duplicate_mac(inst, val, ns); + if (msg != NULL) { + goto out; + } + free(dev->dev.net.mac); dev->dev.net.mac = strdup(val); From deeptik at linux.vnet.ibm.com Wed Jul 15 12:26:28 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 15 Jul 2009 17:56:28 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix RPCS 08 to work with older version of libvirt-cim In-Reply-To: <05d74ccb64b9ca5b313d.1247592093@localhost.localdomain> References: <05d74ccb64b9ca5b313d.1247592093@localhost.localdomain> Message-ID: <4A5DCAF4.1040802@linux.vnet.ibm.com> +1 for me. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Jul 15 12:38:10 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 15 Jul 2009 18:08:10 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Remove stale XenFV guest if migration fails in VSMS/02 In-Reply-To: References: Message-ID: <4A5DCDB2.5070300@linux.vnet.ibm.com> The test case failed with the following error: Testing XenFV hypervisor -------------------------------------------------------------------- VirtualSystemMigrationService - 02_host_migrate_type.py: FAIL ERROR - Migration timed out.... ERROR - Increase timeout > 50 and try again.. -------------------------------------------------------------------- Is this patch for only removing the stale guest or with this change the 02_host_migrate_type.py Passes ? If its just to clean up the XenFV guest then +1 for me. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Jul 15 12:40:39 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 15 Jul 2009 18:10:39 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fix ESD 01: XenFV guest should use ps2 style input device In-Reply-To: References: Message-ID: <4A5DCE47.3020304@linux.vnet.ibm.com> +1 for me. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Jul 15 13:11:45 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 15 Jul 2009 18:41:45 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] A few more usb vs ps2 related fixes In-Reply-To: References: Message-ID: <4A5DD591.3060402@linux.vnet.ibm.com> +1 for me. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Jul 15 13:20:50 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 15 Jul 2009 18:50:50 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Updates to VSMS 19_definenetwork_ers.py In-Reply-To: <2daf5abc8b907906380f.1247619229@localhost.localdomain> References: <2daf5abc8b907906380f.1247619229@localhost.localdomain> Message-ID: <4A5DD7B2.9080306@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1247619180 25200 > # Node ID 2daf5abc8b907906380fa9b911a0711d23aaa19f > # Parent b2eb25caa1c8b2736418c39e448b6f228fc153bc > [TEST] Updates to VSMS 19_definenetwork_ers.py > > Skip bridge type networks with provider versions that don't support setting the > bridge type via the providers. > > Set different expected error messages for Xen guests, and for older versions of > libvirt. > > Signed-off-by: Kaitlin Rupert > > diff -r b2eb25caa1c8 -r 2daf5abc8b90 suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py > --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py Tue Jul 14 16:14:07 2009 -0700 > +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py Tue Jul 14 17:53:00 2009 -0700 > @@ -31,8 +31,9 @@ > from XenKvmLib import vxml > from CimTest.Globals import logger > from CimTest.ReturnCodes import FAIL, PASS > -from XenKvmLib.const import default_network_name, do_main > +from XenKvmLib.const import default_network_name, do_main, get_provider_version > from XenKvmLib.common_util import create_netpool_conf, destroy_netpool > +from XenKvmLib.xm_virt_util import virsh_version > > sup_types = ['Xen', 'KVM', 'XenFV'] > default_dom = 'brgtest_domain' > @@ -40,6 +41,8 @@ > npool_name = default_network_name + str(random.randint(1, 100)) > brg_name = "br" + str(random.randint(1, 100)) > > +bridge_support_rev = 900 > + > exp_rc = CIM_ERR_FAILED > > def verify_error(exp_rc, exp_desc,cxml): > @@ -50,7 +53,11 @@ > def main(): > options = main.options > > - nettypes = ['bridge','network'] > + nettypes = ['network'] > + > + rev, changeset = get_provider_version(options.virt, options.ip) > + if rev >= bridge_support_rev: > + nettypes.append('bridge') > > expected_values = { > "invalid" : {'bridge' : 'internal error Failed to add tap interface', > @@ -61,6 +68,27 @@ > 'network' : "Valid param "} > } > > + if options.virt == "Xen" or options.virt == "XenFV": > + libvirt_version = virsh_version(options.ip, options.virt) > + if libvirt_version <= "0.3.3": > + expected_values['empty']['network'] = "no network with matching name" > + expected_values['invalid']['network'] = "no network with matching name" > + > + inv_br_str = "POST operation failed: (xend.err 'Device 0 (vif) " + \ > + "could not be connected. Could not find bridge device " + \ > + "invalid')" > + > + expected_values['invalid']['bridge'] = inv_br_str > + > + else: > + expected_values['empty']['network'] = "Network not found" > + expected_values['invalid']['network'] = "Network not found" > + > + inv_br_str = "POST operation failed: xend_post: error from xen " + \ > + "daemon: (xend.err 'Device 0 (vif) could not be " + \ > + "connected. Could not find bridge device invalid')" > + expected_values['invalid']['bridge'] = inv_br_str > We can use a common variable to assign these error messages get the assignment to the expected_values fields before coming out of the if options.virt == "Xen" or options.virt == "XenFV": check. > + > tc_scen = { > 'invalid' : 'invalid', > 'empty' : '', > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 15 21:42:11 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 15 Jul 2009 14:42:11 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Remove stale XenFV guest if migration fails in VSMS/02 In-Reply-To: <4A5DCDB2.5070300@linux.vnet.ibm.com> References: <4A5DCDB2.5070300@linux.vnet.ibm.com> Message-ID: <4A5E4D33.4000403@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > The test case failed with the following error: > > Testing XenFV hypervisor > -------------------------------------------------------------------- > VirtualSystemMigrationService - 02_host_migrate_type.py: FAIL > ERROR - Migration timed out.... > ERROR - Increase timeout > 50 and try again.. > -------------------------------------------------------------------- > > Is this patch for only removing the stale guest or with this change the > 02_host_migrate_type.py Passes ? > If its just to clean up the XenFV guest then +1 for me. > Oh, I meant to include more info about that in the commit log. This is just to cleanup the guest when the migration fails. It appears that this test is failing due to an issue with the Xen localhost migration. It doesn't appear to be related to the providers themselves. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 15 21:45:36 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 15 Jul 2009 14:45:36 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Updates to VSMS 19_definenetwork_ers.py In-Reply-To: <4A5DD7B2.9080306@linux.vnet.ibm.com> References: <2daf5abc8b907906380f.1247619229@localhost.localdomain> <4A5DD7B2.9080306@linux.vnet.ibm.com> Message-ID: <4A5E4E00.4060807@linux.vnet.ibm.com> >> >> + if options.virt == "Xen" or options.virt == "XenFV": >> + libvirt_version = virsh_version(options.ip, options.virt) >> + if libvirt_version <= "0.3.3": >> + expected_values['empty']['network'] = "no network with >> matching name" >> + expected_values['invalid']['network'] = "no network with >> matching name" >> + >> + inv_br_str = "POST operation failed: (xend.err 'Device 0 >> (vif) " + \ >> + "could not be connected. Could not find >> bridge device " + \ >> + "invalid')" >> + >> + expected_values['invalid']['bridge'] = inv_br_str >> + >> + else: >> + expected_values['empty']['network'] = "Network not found" >> + expected_values['invalid']['network'] = "Network not found" >> + + inv_br_str = "POST operation failed: >> xend_post: error from xen " + \ >> + "daemon: (xend.err 'Device 0 (vif) could not >> be " + \ >> + "connected. Could not find bridge device >> invalid')" >> + expected_values['invalid']['bridge'] = inv_br_str >> > We can use a common variable to assign these error messages get the > assignment to the expected_values fields before coming out of the > > if options.virt == "Xen" or options.virt == "XenFV": check. > Not sure what you mean here... But any suggestions appreciated, because what I have here isn't very pretty. =) -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Jul 16 05:53:10 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 16 Jul 2009 11:23:10 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Updates to VSMS 19_definenetwork_ers.py In-Reply-To: <4A5E4E00.4060807@linux.vnet.ibm.com> References: <2daf5abc8b907906380f.1247619229@localhost.localdomain> <4A5DD7B2.9080306@linux.vnet.ibm.com> <4A5E4E00.4060807@linux.vnet.ibm.com> Message-ID: <4A5EC046.1060401@linux.vnet.ibm.com> Kaitlin Rupert wrote: >>> >>> + if options.virt == "Xen" or options.virt == "XenFV": >>> + libvirt_version = virsh_version(options.ip, options.virt) >>> + if libvirt_version <= "0.3.3": >>> + expected_values['empty']['network'] = "no network with >>> matching name" >>> + expected_values['invalid']['network'] = "no network >>> with matching name" >>> + >>> + inv_br_str = "POST operation failed: (xend.err 'Device >>> 0 (vif) " + \ >>> + "could not be connected. Could not find >>> bridge device " + \ >>> + "invalid')" >>> + >>> + expected_values['invalid']['bridge'] = inv_br_str >>> + >>> + else: >>> + expected_values['empty']['network'] = "Network not found" >>> + expected_values['invalid']['network'] = "Network not >>> found" >>> + + inv_br_str = "POST operation failed: >>> xend_post: error from xen " + \ >>> + "daemon: (xend.err 'Device 0 (vif) could >>> not be " + \ >>> + "connected. Could not find bridge device >>> invalid')" >>> + expected_values['invalid']['bridge'] = inv_br_str >>> >> We can use a common variable to assign these error messages get the >> assignment to the expected_values fields before coming out of the >> >> inv_br_str check. >> > > Not sure what you mean here... > > But any suggestions appreciated, because what I have here isn't very > pretty. =) > Sorry for not being clear. What I meant is the fields expected_values['empty']['network'] and expected_values['invalid']['network'] have similar values that are assigned so we can use one var inside the if conditions to assign appropriate value. Also, the value for the field expected_values['invalid']['bridge'] is stored in inv_br_str . We can use the variables in which the values are assigned after the if else and assign it for once instead of repeating the same separately in the if and else conditions. For ex: if options.virt == "Xen" or options.virt == "XenFV": libvirt_version = virsh_version(options.ip, options.virt) if libvirt_version <= "0.3.3": net_invalid_empty = "no network with matching name" inv_br_str = "POST operation failed: (xend.err 'Device 0 (vif) " + \ "could not be connected. Could not find bridge device " + \ "invalid')" else: net_invalid_empty = "Network not found" inv_br_str = "POST operation failed: xend_post: error from xen " + \ "daemon: (xend.err 'Device 0 (vif) could not be " + \ "connected. Could not find bridge device invalid')" expected_values['empty']['network'] = expected_values['invalid']['network'] = net_invalid_empty expected_values['invalid']['bridge'] = inv_br_str -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Jul 16 10:02:44 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 16 Jul 2009 03:02:44 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Modify vsms.py and vxml.py to include vnc_passwd filed for GRASD In-Reply-To: References: Message-ID: <79a855700d0a7c4f2319.1247738564@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1247738103 25200 # Node ID 79a855700d0a7c4f23199cb2abd2db6d7720f32c # Parent ec760853195bcb5920e3822d1a8f5ba37c5b2c48 [TEST] Modify vsms.py and vxml.py to include vnc_passwd filed for GRASD. Tested with KVM and current sources on F10 and SLES. Signed-off-by: Deepti B. Kalakeri diff -r ec760853195b -r 79a855700d0a suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Jul 15 14:52:43 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Thu Jul 16 02:55:03 2009 -0700 @@ -243,7 +243,7 @@ class CIM_GraphicsResourceAllocationSettingData(CIMClassMOF): def __init__(self, name, res_sub_type="vnc", ip="127.0.0.1", - lport='-1', keymap="en-us"): + lport='-1', keymap="en-us", vnc_passwd=None): self.InstanceID = '%s/graphics' %name self.ResourceType = RASD_TYPE_GRAPHICS @@ -255,6 +255,9 @@ if keymap != None: self.KeyMap = keymap + + if vnc_passwd != None: + self.Password = vnc_passwd class Xen_GraphicsResourceAllocationSettingData(CIM_GraphicsResourceAllocationSettingData): diff -r ec760853195b -r 79a855700d0a suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Jul 15 14:52:43 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Thu Jul 16 02:55:03 2009 -0700 @@ -558,7 +558,7 @@ def __init__(self, virt, dom_name, disk_dev, disk_source, net_type, net_name, net_mac, vcpus, mem, mem_allocunits, emu_type, grstype, ip, - port_num, kmap, irstype, btype): + port_num, kmap, irstype, btype, vnc_passwd): self.virt = virt self.domain_name = dom_name self.err_rc = None @@ -581,7 +581,8 @@ name=dom_name) self.gasd = vsms.get_gasd_class(virt)(name=dom_name, res_sub_type=grstype, ip=ip, - lport=port_num, keymap=kmap) + lport=port_num, keymap=kmap, + vnc_passwd=vnc_passwd) self.iasd = vsms.get_iasd_class(virt)(name=dom_name, res_sub_type=irstype, bus_type=btype) @@ -796,7 +797,7 @@ net_name=const.default_network_name, emu_type=None, grstype="vnc", address="127.0.0.1", port_num='-1', keymap="en-us", irstype="mouse", - btype="xen"): + btype="xen", vnc_passwd=None): if not (os.path.exists(const.Xen_kernel_path) \ and os.path.exists(const.Xen_init_path)): logger.error('ERROR: Either the kernel image ' @@ -809,7 +810,7 @@ VirtCIM.__init__(self, 'Xen', test_dom, disk, disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, port_num, keymap, irstype, - btype) + btype, vnc_passwd) def _os(self, os_kernel, os_initrd): os = self.get_node('/domain/os') @@ -861,7 +862,7 @@ net_name=const.default_network_name, emu_type=None, grstype="vnc", address="127.0.0.1", port_num='-1', keymap="en-us", irstype="mouse", - btype="ps2"): + btype="ps2", vnc_passwd=None): if not os.path.exists(disk_file_path): logger.error('Error: Disk image does not exist') sys.exit(1) @@ -869,7 +870,7 @@ VirtCIM.__init__(self, 'KVM', test_dom, disk, disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, - port_num, keymap, irstype, btype) + port_num, keymap, irstype, btype, vnc_passwd) self._os() self._devices(const.KVM_default_emulator, ntype, disk_file_path, disk, mac, net_name) @@ -916,7 +917,7 @@ net_name=const.default_network_name, emu_type=None, grstype="vnc", address="127.0.0.1", port_num='-1', keymap="en-us", - irstype="mouse", btype="ps2"): + irstype="mouse", btype="ps2", vnc_passwd=None): if not os.path.exists(disk_file_path): logger.error('Error: Disk image does not exist') sys.exit(1) @@ -924,7 +925,7 @@ VirtCIM.__init__(self, 'XenFV', test_dom, disk, disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, port_num, keymap, - irstype, btype) + irstype, btype, vnc_passwd) self._features() self._os(const.XenFV_default_loader) self._devices(const.XenFV_default_emulator, @@ -973,12 +974,12 @@ net_name=const.default_network_name, tty=const.LXC_default_tty, grstype="vnc", address="127.0.0.1", port_num='-1', keymap="en-us", - irstype="mouse", btype="usb"): + irstype="mouse", btype="usb", vnc_passwd=None): VirtXML.__init__(self, 'lxc', test_dom, set_uuid(), mem, vcpus) VirtCIM.__init__(self, 'LXC', test_dom, const.LXC_default_mp, const.LXC_default_source, ntype, net_name, mac, vcpus, mem, const.default_mallocunits, None, grstype, - address, port_num, keymap, irstype, btype) + address, port_num, keymap, irstype, btype, vnc_passwd) self._os(const.LXC_init_path) self._devices(mac, ntype, net_name, const.LXC_default_tty) self.create_lxc_file(CIM_IP, const.LXC_init_path) From deeptik at linux.vnet.ibm.com Thu Jul 16 10:02:42 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 16 Jul 2009 03:02:42 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] Add new tc to verify the VNC password field of the Domain. Message-ID: From deeptik at linux.vnet.ibm.com Thu Jul 16 10:02:43 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 16 Jul 2009 03:02:43 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Add new tc to verify the VNC password field of the Domain In-Reply-To: References: Message-ID: # HG changeset patch # User Deepti B.Kalakeri # Date 1247738498 25200 # Node ID acc1498869a9322e6dd7e965d946b347a548ab6f # Parent 79a855700d0a7c4f23199cb2abd2db6d7720f32c [TEST] Add new tc to verify the VNC password field of the Domain. Verified with KVM and current sources on F10 and SLES11. Signed-off-by: Deepti B. Kalakeri diff -r 79a855700d0a -r acc1498869a9 suites/libvirt-cim/cimtest/VirtualSystemManagementService/20_verify_vnc_password.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/20_verify_vnc_password.py Thu Jul 16 03:01:38 2009 -0700 @@ -0,0 +1,108 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# This testcase verifies VNC password can be specified via GRASD +# for the guest and the same is set in the Password field of GRASD. +# +# Date: 16-07-2009 +# + +import sys +from XenKvmLib import vxml +from CimTest.Globals import logger +from XenKvmLib.enumclass import EnumInstances +from CimTest.ReturnCodes import FAIL, PASS, SKIP +from XenKvmLib.const import do_main, get_provider_version +from XenKvmLib.classes import get_typed_class + +libvirtcim_vnc_passwd_changes=925 + +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] +default_dom = 'vncpasswd_domain' +passwd = 'cimtest123' + +def verify_grasd_passwd_value(virt, server): + rasd_list = [] + classname = get_typed_class(virt, "GraphicsResourceAllocationSettingData") + try: + rasd_list = EnumInstances(server, classname, ret_cim_inst=True) + if len(rasd_list) < 1: + logger.error("%s returned %i instances, excepted at least 1.", + classname, len(rasd_list)) + return FAIL + + inst_id = "%s/graphics" % default_dom + for rasd in rasd_list: + # Verify the Password for the domain is set + if rasd['InstanceID'] == inst_id: + if rasd['Password'] != "" and "*" in rasd['Password']: + logger.info("Password for '%s' is set.", default_dom) + return PASS + + except Exception, detail: + logger.error("Exception: %s", detail) + return FAIL + + logger.error("Password for '%s' is not set.", default_dom) + return FAIL + + + at do_main(sup_types) +def main(): + options = main.options + virt = options.virt + server = options.ip + + curr_cim_rev, changeset = get_provider_version(virt, server) + if curr_cim_rev < libvirtcim_vnc_passwd_changes: + logger.info("VNC Password support not available, feature available in"\ + " '%s' revision..", libvirtcim_vnc_passwd_changes) + return SKIP + + + try: + cxml = vxml.get_class(virt)(default_dom, vnc_passwd=passwd) + ret = cxml.cim_define(server) + if not ret: + raise Exception("Failed to define the dom: %s" % default_dom) + + ret = cxml.cim_start(server) + if ret != PASS: + cxml.undefine(server) + raise Exception("Failed to start the dom: %s" % default_dom) + + status = verify_grasd_passwd_value(virt, server) + if status != PASS: + logger.error("Failed to verify the Password field for domain '%s'", + default_dom) + + cxml.cim_destroy(server) + cxml.undefine(server) + + except Exception, details: + logger.error(details) + status = FAIL + + return status + +if __name__ == "__main__": + sys.exit(main()) + From deeptik at linux.vnet.ibm.com Thu Jul 16 14:28:59 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 16 Jul 2009 07:28:59 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing rcps/07*py which fails with sfcb Message-ID: <14b666e2a803048c1ce4.1247754539@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1247754531 25200 # Node ID 14b666e2a803048c1ce4e71b550a49c62915b3a3 # Parent ec760853195bcb5920e3822d1a8f5ba37c5b2c48 [TEST] Fixing rcps/07*py which fails with sfcb. Tested with SLES11, with current source and sfcb. Signed-off-by: Deepti B. Kalakeri diff -r ec760853195b -r 14b666e2a803 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py Wed Jul 15 14:52:43 2009 -0700 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py Thu Jul 16 07:28:51 2009 -0700 @@ -86,7 +86,7 @@ "Netmask" : "255.255.255.0", "IPRangeStart" : "192.168.0.9", "IPRangeEnd" : "192.168.0.15", - "ForwardMode" : "nat" + "ForwardMode" : pywbem.cim_types.Uint16(1) } status = create_pool(options.ip, options.virt, test_pool, pool_attr) From deeptik at linux.vnet.ibm.com Thu Jul 16 14:38:39 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 16 Jul 2009 20:08:39 +0530 Subject: [Libvirt-cim] Test Run Summary (Jul 16 2009): KVM on Fedora release 10.90 (Rawhide) with Pegasus Message-ID: <4A5F3B6F.6040903@linux.vnet.ibm.com> ================================================= Test Run Summary (Jul 16 2009): KVM on Fedora release 10.90 (Rawhide) with Pegasus ================================================= Distro: Fedora release 10.90 (Rawhide) Kernel: 2.6.29-0.38.rc1.git4.fc11.x86_64 libvirt: 0.6.5 Hypervisor: QEMU 0.10.0 CIMOM: Pegasus 2.7.2 Libvirt-cim revision: 929 Libvirt-cim changeset: 1f48bb4249af Cimtest revision: 730 Cimtest changeset: ec760853195b ================================================= FAIL : 6 XFAIL : 3 SKIP : 6 PASS : 146 ----------------- Total : 161 ================================================= FAIL Test Summary: ComputerSystemIndication - 01_created_indication.py: FAIL RASD - 07_parent_disk_pool.py: FAIL VirtualSystemManagementService - 13_refconfig_additional_devs.py: FAIL VirtualSystemManagementService - 15_mod_system_settings.py: FAIL VirtualSystemMigrationService - 07_remote_offline_migration.py: FAIL VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: FAIL ================================================= XFAIL Test Summary: ComputerSystem - 32_start_reboot.py: XFAIL ComputerSystem - 33_suspend_reboot.py: XFAIL VirtualSystemManagementService - 16_removeresource.py: XFAIL ================================================= SKIP Test Summary: ComputerSystem - 02_nosystems.py: SKIP LogicalDisk - 02_nodevs.py: SKIP VSSD - 02_bootldr.py: SKIP VirtualSystemMigrationService - 01_migratable_host.py: SKIP VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP ================================================= 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: PASS -------------------------------------------------------------------- ComputerSystem - 05_activate_defined_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 06_paused_active_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 22_define_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 23_pause_pause.py: PASS -------------------------------------------------------------------- ComputerSystem - 27_define_pause_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 32_start_reboot.py: XFAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot with return code 1 ERROR - Exception: Unable reboot dom 'cs_test_domain' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot Bug:<00005> -------------------------------------------------------------------- ComputerSystem - 33_suspend_reboot.py: XFAIL ERROR - Got CIM error CIM_ERR_NOT_SUPPORTED: State not supported with return code 7 ERROR - Exception: Unable Suspend dom 'test_domain' InvokeMethod(RequestStateChange): CIM_ERR_NOT_SUPPORTED: State not supported Bug:<00012> -------------------------------------------------------------------- ComputerSystem - 35_start_reset.py: PASS -------------------------------------------------------------------- ComputerSystem - 40_RSC_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 41_cs_to_settingdefinestate.py: PASS -------------------------------------------------------------------- ComputerSystem - 42_cs_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for destroy indication -------------------------------------------------------------------- ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.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 -------------------------------------------------------------------- HostedAccessPoint - 01_forward.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 02_reverse.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 -------------------------------------------------------------------- KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS -------------------------------------------------------------------- LogicalDisk - 01_disk.py: PASS -------------------------------------------------------------------- LogicalDisk - 02_nodevs.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- 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: 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 -------------------------------------------------------------------- RASD - 04_disk_rasd_size.py: PASS -------------------------------------------------------------------- RASD - 05_disk_rasd_emu_type.py: PASS -------------------------------------------------------------------- RASD - 06_parent_net_pool.py: PASS -------------------------------------------------------------------- RASD - 07_parent_disk_pool.py: FAIL 07_parent_disk_pool.py:47: DeprecationWarning: the sets module is deprecated from sets import Set ERROR - Exception details: Got 7 recs instead of 3 -------------------------------------------------------------------- RedirectionService - 01_enum_crs.py: PASS -------------------------------------------------------------------- RedirectionService - 02_enum_crscap.py: PASS -------------------------------------------------------------------- RedirectionService - 03_RedirectionSAP_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 -------------------------------------------------------------------- ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 09_DeleteDiskPool.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 02_reverse.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 02_reverse.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: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 10_hv_version.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 12_referenced_config.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 13_refconfig_additional_devs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Unable define domain rstest_domain2 ERROR - Unable to define rstest_domain2 InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemManagementService - 14_define_sys_disk.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 15_mod_system_settings.py: FAIL ERROR - CIMError : (1, u'CIM_ERR_FAILED: Unable to parse embedded object') Traceback (most recent call last): File "./lib/XenKvmLib/const.py", line 139, in do_try File "15_mod_system_settings.py", line 103, in main ret = service.ModifySystemSettings(SystemSettings=vssd) File "/data/users/deepti/F10_runs/cimtest/lib/CimTest/CimExt.py", line 32, in __call__ return self.__invoker(self.__name, args) File "/data/users/deepti/F10_runs/cimtest/lib/CimTest/CimExt.py", line 44, in __invoke return self.conn.InvokeMethod(method, self.inst, **params) File "/usr/lib/python2.6/site-packages/pywbem/cim_operations.py", line 801, in InvokeMethod result = self.methodcall(MethodName, obj, **params) File "/usr/lib/python2.6/site-packages/pywbem/cim_operations.py", line 362, in methodcall raise CIMError(code, tt[0][1]['DESCRIPTION']) CIMError: (1, u'CIM_ERR_FAILED: Unable to parse embedded object') ERROR - None InvokeMethod(ModifySystemSettings): CIM_ERR_FAILED: Unable to parse embedded object -------------------------------------------------------------------- VirtualSystemManagementService - 16_removeresource.py: XFAIL ERROR - 0 RASD insts for domain/mouse:ps2 CIM_ERR_NOT_FOUND: No such instance (no device domain/mouse:ps2) Bug:<00014> -------------------------------------------------------------------- VirtualSystemManagementService - 17_removeresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 18_define_sys_bridge.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 19_definenetwork_ers.py: PASS -------------------------------------------------------------------- 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 -------------------------------------------------------------------- VirtualSystemMigrationService - 06_remote_live_migration.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationService - 07_remote_offline_migration.py: FAIL ERROR - JobStatus for dom 'VM_frm_elm3a148.beaverton.ibm.com' has 'Remote already has domain `VM_frm_elm3a148.beaverton.ibm.com'' instead of 'Completed' ERROR - Got CIM error Unauthorized with return code 0 InvokeMethod(DestroySystem): Unauthorized -------------------------------------------------------------------- VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: FAIL ERROR - JobStatus for dom 'VM_frm_elm3a148.beaverton.ibm.com' has 'Remote already has domain `VM_frm_elm3a148.beaverton.ibm.com'' instead of 'Completed' ERROR - Cleanup failed after 'restart' migration ERROR - Restart migration 1 ERROR - Resume migration -1 -------------------------------------------------------------------- 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 -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS -------------------------------------------------------------------- -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Jul 16 14:40:20 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 16 Jul 2009 20:10:20 +0530 Subject: [Libvirt-cim] Test Run Summary (Jul 16 2009): KVM on SUSE Linux Enterprise Server 11 (i586) with sfcb Message-ID: <4A5F3BD4.6050201@linux.vnet.ibm.com> ================================================= Test Run Summary (Jul 16 2009): KVM on SUSE Linux Enterprise Server 11 (i586) with sfcb ================================================= Distro: SUSE Linux Enterprise Server 11 (i586) Kernel: 2.6.27.19-5-pae libvirt: 0.4.6 Hypervisor: QEMU 0.9.1 CIMOM: sfcb sfcbd 1.3.2 Libvirt-cim revision: 929 Libvirt-cim changeset: 1f48bb4249af+ Cimtest revision: 730 Cimtest changeset: ec760853195b ================================================= FAIL : 8 XFAIL : 4 SKIP : 6 PASS : 143 ----------------- Total : 161 ================================================= FAIL Test Summary: ComputerSystemIndication - 01_created_indication.py: FAIL ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: FAIL RASD - 07_parent_disk_pool.py: FAIL ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL VirtualSystemManagementService - 13_refconfig_additional_devs.py: FAIL VirtualSystemMigrationService - 06_remote_live_migration.py: FAIL VirtualSystemMigrationService - 07_remote_offline_migration.py: FAIL VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: FAIL ================================================= XFAIL Test Summary: ComputerSystem - 32_start_reboot.py: XFAIL ComputerSystem - 33_suspend_reboot.py: XFAIL VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL VirtualSystemManagementService - 16_removeresource.py: XFAIL ================================================= SKIP Test Summary: ComputerSystem - 02_nosystems.py: SKIP LogicalDisk - 02_nodevs.py: SKIP VSSD - 02_bootldr.py: SKIP VirtualSystemMigrationService - 01_migratable_host.py: SKIP VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP ================================================= 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: PASS -------------------------------------------------------------------- ComputerSystem - 05_activate_defined_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 06_paused_active_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 22_define_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 23_pause_pause.py: PASS -------------------------------------------------------------------- ComputerSystem - 27_define_pause_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 32_start_reboot.py: XFAIL ERROR - Got CIM error Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot with return code 1 ERROR - Exception: Unable reboot dom 'cs_test_domain' InvokeMethod(RequestStateChange): Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot Bug:<00005> -------------------------------------------------------------------- ComputerSystem - 33_suspend_reboot.py: XFAIL ERROR - Got CIM error State not supported with return code 7 ERROR - Exception: Unable Suspend dom 'test_domain' InvokeMethod(RequestStateChange): State not supported Bug:<00012> -------------------------------------------------------------------- ComputerSystem - 35_start_reset.py: PASS -------------------------------------------------------------------- ComputerSystem - 40_RSC_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 41_cs_to_settingdefinestate.py: PASS -------------------------------------------------------------------- ComputerSystem - 42_cs_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for define indication ERROR - Waited too long for start indication ERROR - Waited too long for destroy indication -------------------------------------------------------------------- ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: FAIL ERROR - Failed to create Virtual Network 'cimtest-networkpool' ERROR - Exception details :Unable to create network pool 'cimtest-networkpool' on 'elm3b25.beaverton.ibm.com' ERROR - Exception: Unable to generate 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: PASS -------------------------------------------------------------------- HostSystem - 05_hs_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 06_hs_to_vsms.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 01_forward.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 02_reverse.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 -------------------------------------------------------------------- KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS -------------------------------------------------------------------- LogicalDisk - 01_disk.py: PASS -------------------------------------------------------------------- LogicalDisk - 02_nodevs.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- 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: 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 -------------------------------------------------------------------- RASD - 04_disk_rasd_size.py: PASS -------------------------------------------------------------------- RASD - 05_disk_rasd_emu_type.py: PASS -------------------------------------------------------------------- RASD - 06_parent_net_pool.py: PASS -------------------------------------------------------------------- RASD - 07_parent_disk_pool.py: FAIL 07_parent_disk_pool.py:47: DeprecationWarning: the sets module is deprecated from sets import Set ERROR - Exception details: Got 7 recs instead of 3 -------------------------------------------------------------------- RedirectionService - 01_enum_crs.py: PASS -------------------------------------------------------------------- RedirectionService - 02_enum_crscap.py: PASS -------------------------------------------------------------------- RedirectionService - 03_RedirectionSAP_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: FAIL ERROR - Exception in create_pool() ERROR - Exception details: (1, u'*** Provider Virt_ResourcePoolConfigurationService(9436) exiting due to a SIGSEGV signal ') ERROR - Error in networkpool creation InvokeMethod(CreateChildResourcePool): *** Provider Virt_ResourcePoolConfigurationService(9436) exiting due to a SIGSEGV signal -------------------------------------------------------------------- ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 09_DeleteDiskPool.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 02_reverse.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 02_reverse.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: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL -------------------------------------------------------------------- VirtualSystemManagementService - 10_hv_version.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 12_referenced_config.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 13_refconfig_additional_devs.py: FAIL ERROR - Got CIM error ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Unable define domain rstest_domain2 ERROR - Unable to define rstest_domain2 InvokeMethod(DefineSystem): ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemManagementService - 14_define_sys_disk.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 15_mod_system_settings.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 16_removeresource.py: XFAIL ERROR - 0 RASD insts for domain/mouse:ps2 No such instance (no device domain/mouse:ps2) Bug:<00014> -------------------------------------------------------------------- VirtualSystemManagementService - 17_removeresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 18_define_sys_bridge.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 19_definenetwork_ers.py: PASS -------------------------------------------------------------------- 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 -------------------------------------------------------------------- VirtualSystemMigrationService - 06_remote_live_migration.py: FAIL ERROR - Failed to create Virtual Network 'cimtest-networkpool' ERROR - Exception details :Unable to create network pool 'cimtest-networkpool' on 'elm3b25.beaverton.ibm.com' -------------------------------------------------------------------- VirtualSystemMigrationService - 07_remote_offline_migration.py: FAIL ERROR - Failed to create Virtual Network 'cimtest-networkpool' ERROR - Exception details :Unable to create network pool 'cimtest-networkpool' on 'elm3b25.beaverton.ibm.com' -------------------------------------------------------------------- VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: FAIL ERROR - Failed to create Virtual Network 'cimtest-networkpool' ERROR - Exception details is :Unable to create network pool 'cimtest-networkpool' on 'elm3b25.beaverton.ibm.com' ERROR - Restart migration -1 ERROR - Resume migration -1 -------------------------------------------------------------------- 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 -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS -------------------------------------------------------------------- -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Fri Jul 17 11:47:05 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 17 Jul 2009 04:47:05 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixed the RASD/07_parent_disk_pool.py Message-ID: # HG changeset patch # User Deepti B.Kalakeri # Date 1247831194 25200 # Node ID d78ebff2b762c75fec14de6bb4a012146ec4b86b # Parent 14b666e2a803048c1ce4e71b550a49c62915b3a3 [TEST] Fixed the RASD/07_parent_disk_pool.py Verified with KVM and current sources on F10 and SLES11. Signed-off-by: Deepti B. Kalakeri diff -r 14b666e2a803 -r d78ebff2b762 suites/libvirt-cim/cimtest/RASD/07_parent_disk_pool.py --- a/suites/libvirt-cim/cimtest/RASD/07_parent_disk_pool.py Thu Jul 16 07:28:51 2009 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/07_parent_disk_pool.py Fri Jul 17 04:46:34 2009 -0700 @@ -51,7 +51,7 @@ from XenKvmLib.pool import get_pool_rasds sup_types = ['KVM', 'Xen', 'XenFV'] -DISKPOOL_REC_LEN = 3 +DISKPOOL_REC_LEN = 7 def get_rec(diskpool_rasd, inst_id='Default'): recs = [] @@ -72,14 +72,21 @@ inst_list = [ 'Default', 'Minimum', 'Maximum', 'Increment' ] n_rec_val = { 'ResourceType' : 17, 'PoolID' : "DiskPool/0", - 'Path' : "/dev/null", } - exp_type_path_host_dir = [('1', 'None', 'None', 'None'), - ('2', '/dev/sda100', 'None', 'None'), - ('3', 'None', 'host_sys.domain.com', - '/var/lib/images')] - - + + pval = "/dev/null" + exp_t_dp_h_sdir_path = sorted([(1L, None, None, None, pval), + (2L, [u'/dev/sda100'], None, None, pval), + (3L, None, u'host_sys.domain.com', + u'/var/lib/images', pval), + (4L, [u'/dev/VolGroup00/LogVol100'], + None, None, pval), + (5L, [u'iscsi-target'], + u'host_sys.domain.com', None, pval), + (6L, None, None, None, pval), + (7L, None, None, None, + "/dev/disk/by-id")]) + for inst_type in inst_list: logger.info("Verifying '%s' records", inst_type) @@ -89,17 +96,30 @@ raise Exception("Got %s recs instead of %s" %(len(n_rec), DISKPOOL_REC_LEN)) - res_type_path_host_dir = [] + res_t_dp_h_sdir_path = [] for rec in n_rec: - l = (str(rec['Type']), str(rec['DevicePath']), - str(rec['Host']), str(rec['SourceDirectory'])) - res_type_path_host_dir.append(l) + l = ((rec['Type']), (rec['DevicePaths']), + (rec['Host']), (rec['SourceDirectory']), + (rec['Path'])) + res_t_dp_h_sdir_path.append(l) + res_t_dp_h_sdir_path = sorted(res_t_dp_h_sdir_path) - if len(Set(exp_type_path_host_dir) & Set(res_type_path_host_dir)) \ - != DISKPOOL_REC_LEN : - raise Exception("Mismatching values, \nGot %s,\nExpected %s"\ - %(exp_type_path_host_dir, - res_type_path_host_dir)) + for exp_item in exp_t_dp_h_sdir_path: + i = 0 + for j in range(0, len(exp_item)): + exp_val = exp_t_dp_h_sdir_path[i][j] + res_val = res_t_dp_h_sdir_path[i][j] + if type(list).__name__ == 'list': + cmp_exp = (len(Set(res_val) - Set(exp_val)) != 0) + elif type(list).__name__ != 'NoneType': + cmp_exp = (exp_val != res_val) + elif type(list).__name__ == 'NoneType': + continue + + if cmp_exp: + raise Exception("Mismatching values, \nGot %s,\nExpected %s"\ + %(exp_val, res_val)) + i += 1 for key in n_rec_val.keys(): for rec in n_rec: From kaitlin at linux.vnet.ibm.com Fri Jul 17 16:53:17 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 17 Jul 2009 09:53:17 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Updates to VSMS 19_definenetwork_ers.py In-Reply-To: <4A5EC046.1060401@linux.vnet.ibm.com> References: <2daf5abc8b907906380f.1247619229@localhost.localdomain> <4A5DD7B2.9080306@linux.vnet.ibm.com> <4A5E4E00.4060807@linux.vnet.ibm.com> <4A5EC046.1060401@linux.vnet.ibm.com> Message-ID: <4A60AC7D.5030602@linux.vnet.ibm.com> >> Not sure what you mean here... >> >> But any suggestions appreciated, because what I have here isn't very >> pretty. =) >> > Sorry for not being clear. > What I meant is the fields expected_values['empty']['network'] and > expected_values['invalid']['network'] have similar values that are > assigned so we can use one var inside the if conditions to assign > appropriate value. > Also, the value for the field expected_values['invalid']['bridge'] is > stored in inv_br_str . > We can use the variables in which the values are assigned after the if > else and assign it for once instead of repeating the same separately in > the if and else conditions. > > For ex: > > if options.virt == "Xen" or options.virt == "XenFV": > libvirt_version = virsh_version(options.ip, options.virt) > if libvirt_version <= "0.3.3": > net_invalid_empty = "no network with matching name" > inv_br_str = "POST operation failed: (xend.err 'Device 0 > (vif) " + \ > "could not be connected. Could not find bridge > device " + \ > "invalid')" > > else: > net_invalid_empty = "Network not found" > > inv_br_str = "POST operation failed: xend_post: error from > xen " + \ > "daemon: (xend.err 'Device 0 (vif) could not be > " + \ > "connected. Could not find bridge device invalid')" > > expected_values['empty']['network'] = > expected_values['invalid']['network'] = net_invalid_empty > expected_values['invalid']['bridge'] = inv_br_str > Oh yes! I got what you mean.. thanks for the clarification =) I'll make this change and resubmit. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Jul 17 19:11:32 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 17 Jul 2009 12:11:32 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Updates to VSMS 19_definenetwork_ers.py Message-ID: <69e3ab27d1a8b0e50afa.1247857892@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1247619180 25200 # Node ID 69e3ab27d1a8b0e50afa395f72a5c0cdc211c735 # Parent 031cff68b4d3ab0fc1ed9b34127b8f4e27cb27c9 [TEST] #2 Updates to VSMS 19_definenetwork_ers.py Skip bridge type networks with provider versions that don't support setting the bridge type via the providers. Set different expected error messages for Xen guests, and for older versions of libvirt. Updates: -Improve code reuse - in the if Xen / XenFV block Signed-off-by: Kaitlin Rupert diff -r 031cff68b4d3 -r 69e3ab27d1a8 suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py Fri Jul 17 12:07:44 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py Tue Jul 14 17:53:00 2009 -0700 @@ -31,8 +31,9 @@ from XenKvmLib import vxml from CimTest.Globals import logger from CimTest.ReturnCodes import FAIL, PASS -from XenKvmLib.const import default_network_name, do_main +from XenKvmLib.const import default_network_name, do_main, get_provider_version from XenKvmLib.common_util import create_netpool_conf, destroy_netpool +from XenKvmLib.xm_virt_util import virsh_version sup_types = ['Xen', 'KVM', 'XenFV'] default_dom = 'brgtest_domain' @@ -40,6 +41,8 @@ npool_name = default_network_name + str(random.randint(1, 100)) brg_name = "br" + str(random.randint(1, 100)) +bridge_support_rev = 900 + exp_rc = CIM_ERR_FAILED def verify_error(exp_rc, exp_desc,cxml): @@ -50,7 +53,11 @@ def main(): options = main.options - nettypes = ['bridge','network'] + nettypes = ['network'] + + rev, changeset = get_provider_version(options.virt, options.ip) + if rev >= bridge_support_rev: + nettypes.append('bridge') expected_values = { "invalid" : {'bridge' : 'internal error Failed to add tap interface', @@ -61,6 +68,27 @@ 'network' : "Valid param "} } + if options.virt == "Xen" or options.virt == "XenFV": + libvirt_version = virsh_version(options.ip, options.virt) + if libvirt_version <= "0.3.3": + inv_empty_network = "no network with matching name" + + inv_br_str = "POST operation failed: (xend.err 'Device 0 (vif) " + \ + "could not be connected. Could not find bridge " + \ + "device invalid')" + + else: + inv_empty_network = "Network not found" + + inv_br_str = "POST operation failed: xend_post: error from xen " + \ + "daemon: (xend.err 'Device 0 (vif) could not be " + \ + "connected. Could not find bridge device invalid')" + + expected_values['invalid']['network'] = inv_empty_network + expected_values['empty']['network'] = inv_empty_network + + expected_values['invalid']['bridge'] = inv_br_str + tc_scen = { 'invalid' : 'invalid', 'empty' : '', From kaitlin at linux.vnet.ibm.com Fri Jul 17 19:30:28 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 17 Jul 2009 12:30:28 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Add new tc to verify the VNC password field of the Domain In-Reply-To: References: Message-ID: <4A60D154.6030500@linux.vnet.ibm.com> Nice work here Deepti - I just pushed this feature in recently =) Just a minor change.. > + try: > + cxml = vxml.get_class(virt)(default_dom, vnc_passwd=passwd) > + ret = cxml.cim_define(server) > + if not ret: > + raise Exception("Failed to define the dom: %s" % default_dom) > + > + ret = cxml.cim_start(server) > + if ret != PASS: > + cxml.undefine(server) > + raise Exception("Failed to start the dom: %s" % default_dom) > + > + status = verify_grasd_passwd_value(virt, server) > + if status != PASS: > + logger.error("Failed to verify the Password field for domain '%s'", > + default_dom) > + > + cxml.cim_destroy(server) > + cxml.undefine(server) I'd place this after the exception. If for some reason, a random exception is hit in the try block before cim_distroy() is called, the guest will still be cleaned up. > + > + except Exception, details: > + logger.error(details) > + status = FAIL > + > + return status > + > +if __name__ == "__main__": > + sys.exit(main()) > + -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Jul 17 19:46:35 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 17 Jul 2009 12:46:35 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixed the RASD/07_parent_disk_pool.py In-Reply-To: References: Message-ID: <4A60D51B.10908@linux.vnet.ibm.com> Deepti B. Kalakeri wrote: > # HG changeset patch > # User Deepti B.Kalakeri > # Date 1247831194 25200 > # Node ID d78ebff2b762c75fec14de6bb4a012146ec4b86b > # Parent 14b666e2a803048c1ce4e71b550a49c62915b3a3 > [TEST] Fixed the RASD/07_parent_disk_pool.py > > Verified with KVM and current sources on F10 and SLES11. > Signed-off-by: Deepti B. Kalakeri > > diff -r 14b666e2a803 -r d78ebff2b762 suites/libvirt-cim/cimtest/RASD/07_parent_disk_pool.py > --- a/suites/libvirt-cim/cimtest/RASD/07_parent_disk_pool.py Thu Jul 16 07:28:51 2009 -0700 > +++ b/suites/libvirt-cim/cimtest/RASD/07_parent_disk_pool.py Fri Jul 17 04:46:34 2009 -0700 > @@ -51,7 +51,7 @@ > from XenKvmLib.pool import get_pool_rasds > > sup_types = ['KVM', 'Xen', 'XenFV'] > -DISKPOOL_REC_LEN = 3 > +DISKPOOL_REC_LEN = 7 > > def get_rec(diskpool_rasd, inst_id='Default'): > recs = [] > @@ -72,14 +72,21 @@ > inst_list = [ 'Default', 'Minimum', 'Maximum', 'Increment' ] > n_rec_val = { 'ResourceType' : 17, > 'PoolID' : "DiskPool/0", > - 'Path' : "/dev/null", > } > - exp_type_path_host_dir = [('1', 'None', 'None', 'None'), > - ('2', '/dev/sda100', 'None', 'None'), > - ('3', 'None', 'host_sys.domain.com', > - '/var/lib/images')] > - > - > + > + pval = "/dev/null" > + exp_t_dp_h_sdir_path = sorted([(1L, None, None, None, pval), > + (2L, [u'/dev/sda100'], None, None, pval), > + (3L, None, u'host_sys.domain.com', > + u'/var/lib/images', pval), > + (4L, [u'/dev/VolGroup00/LogVol100'], > + None, None, pval), > + (5L, [u'iscsi-target'], > + u'host_sys.domain.com', None, pval), > + (6L, None, None, None, pval), > + (7L, None, None, None, > + "/dev/disk/by-id")]) This seems confusing here. I'm not sure what the various values mean just by looking at the structure. I can tell the first value is the type, the remaining order is confusing. I think this would be better as a dictionary (or some other Python structure) that allows you to give names to the different positions. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Mon Jul 20 09:15:06 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 20 Jul 2009 02:15:06 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] #2 Add new tc to verify the VNC password field of the Domain. Message-ID: From deeptik at linux.vnet.ibm.com Mon Jul 20 09:15:07 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 20 Jul 2009 02:15:07 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] #2 Add new tc to verify the VNC password field of the Domain In-Reply-To: References: Message-ID: # HG changeset patch # User Deepti B.Kalakeri # Date 1248080978 25200 # Node ID d8ce1c1e439da8f1f26bc65e1c192ba5d590445b # Parent 14b666e2a803048c1ce4e71b550a49c62915b3a3 [TEST] #2 Add new tc to verify the VNC password field of the Domain. Patch2 : --------- Moved the destroy and undefine after the exception Verified with KVM and current sources on F10 and SLES11. Signed-off-by: Deepti B. Kalakeri diff -r 14b666e2a803 -r d8ce1c1e439d suites/libvirt-cim/cimtest/VirtualSystemManagementService/20_verify_vnc_password.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/20_verify_vnc_password.py Mon Jul 20 02:09:38 2009 -0700 @@ -0,0 +1,107 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# This testcase verifies VNC password can be specified via GRASD +# for the guest and the same is set in the Password field of GRASD. +# +# Date: 16-07-2009 +# + +import sys +from XenKvmLib import vxml +from CimTest.Globals import logger +from XenKvmLib.enumclass import EnumInstances +from CimTest.ReturnCodes import FAIL, PASS, SKIP +from XenKvmLib.const import do_main, get_provider_version +from XenKvmLib.classes import get_typed_class + +libvirtcim_vnc_passwd_changes=925 + +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] +default_dom = 'vncpasswd_domain' +passwd = 'cimtest123' + +def verify_grasd_passwd_value(virt, server): + rasd_list = [] + classname = get_typed_class(virt, "GraphicsResourceAllocationSettingData") + try: + rasd_list = EnumInstances(server, classname, ret_cim_inst=True) + if len(rasd_list) < 1: + logger.error("%s returned %i instances, excepted at least 1.", + classname, len(rasd_list)) + return FAIL + + inst_id = "%s/graphics" % default_dom + for rasd in rasd_list: + # Verify the Password for the domain is set + if rasd['InstanceID'] == inst_id: + if rasd['Password'] != "" and "*" in rasd['Password']: + logger.info("Password for '%s' is set.", default_dom) + return PASS + + except Exception, detail: + logger.error("Exception: %s", detail) + return FAIL + + logger.error("Password for '%s' is not set.", default_dom) + return FAIL + + + at do_main(sup_types) +def main(): + options = main.options + virt = options.virt + server = options.ip + + curr_cim_rev, changeset = get_provider_version(virt, server) + if curr_cim_rev < libvirtcim_vnc_passwd_changes: + logger.info("VNC Password support not available, feature available in"\ + " '%s' revision..", libvirtcim_vnc_passwd_changes) + return SKIP + + cxml = vxml.get_class(virt)(default_dom, vnc_passwd=passwd) + + try: + ret = cxml.cim_define(server) + if not ret: + raise Exception("Failed to define the dom: %s" % default_dom) + + ret = cxml.cim_start(server) + if ret != PASS: + cxml.undefine(server) + raise Exception("Failed to start the dom: %s" % default_dom) + + status = verify_grasd_passwd_value(virt, server) + if status != PASS: + logger.error("Failed to verify the Password field for domain '%s'", + default_dom) + + except Exception, details: + logger.error(details) + status = FAIL + + cxml.cim_destroy(server) + cxml.undefine(server) + return status + +if __name__ == "__main__": + sys.exit(main()) + From sunil_botre at persistent.co.in Mon Jul 20 09:44:55 2009 From: sunil_botre at persistent.co.in (Sunil Botre) Date: Mon, 20 Jul 2009 15:14:55 +0530 Subject: [Libvirt-cim] Libvirt-cim postinsatllation fail Message-ID: Hi I want to install libvirt-cim-0.5 on Fedora 7 hypervisor machine I have also installed Pegasus2.9 and libvirt-0.4.0-4.fc7 and libvirt-devel-0.4.0-4.fc7 package But while Installing libvirt-cim-0.5 step of postinstallation fails. #Sudo Make postinstall sh provider-register.sh -v -t pegasus -n root/virt -r schema/ComputerSystem.registration schema/LogicalDisk.registration schema/NetworkPort.registration schema/Memory.registration schema/Processor.registration schema/SystemDevice.registration schema/VSSD.registration schema/HostSystem.registration schema/HostedDependency.registration schema/VirtualSystemManagementService.registration schema/VirtualSystemManagementCapabilities.registration schema/EnabledLogicalElementCapabilities.registration schema/AllocationCapabilities.registration schema/SettingsDefineCapabilities.registration schema/MemoryPool.registration schema/ElementCapabilities.registration schema/ProcessorPool.registration schema/DiskPool.registration schema/HostedResourcePool.registration schema/ComputerSystemIndication.registration schema/ComputerSystemMigrationIndication.registration schema/ResourceAllocationSettingData.registration schema/ResourcePoolConfigurationService.registration schema/ResourcePoolConfigurationCapabilities.registration schema/VSSDComponent.registration schema/SettingsDefineState.registration schema/NetPool.registration schema/ResourceAllocationFromPool.registration schema/ElementAllocatedFromPool.registration schema/HostedService.registration schema/ElementSettingData.registration schema/VSMigrationCapabilities.registration schema/VSMigrationService.registration schema/ElementConformsToProfile.registration schema/VSMigrationSettingData.registration schema/VirtualSystemSnapshotService.registration schema/VirtualSystemSnapshotServiceCapabilities.registration -m schema/ComputerSystem.mof schema/LogicalDisk.mof schema/NetworkPort.mof schema/Memory.mof schema/Processor.mof schema/SystemDevice.mof schema/VSSD.mof schema/HostSystem.mof schema/HostedDependency.mof schema/VirtualSystemManagementService.mof schema/VirtualSystemManagementCapabilities.mof schema/EnabledLogicalElementCapabilities.mof schema/AllocationCapabilities.mof schema/SettingsDefineCapabilities.mof schema/MemoryPool.mof schema/ElementCapabilities.mof schema/ProcessorPool.mof schema/DiskPool.mof schema/HostedResourcePool.mof schema/RegisteredProfile.mof schema/ElementConformsToProfile.mof schema/ComputerSystemIndication.mof schema/ComputerSystemMigrationIndication.mof schema/ResourceAllocationSettingData.mof schema/ResourcePoolConfigurationService.mof schema/ResourcePoolConfigurationCapabilities.mof schema/VSSDComponent.mof schema/SettingsDefineState.mof schema/NetPool.mof schema/ResourceAllocationFromPool.mof schema/ElementAllocatedFromPool.mof schema/HostedService.mof schema/ElementSettingData.mof schema/VSMigrationCapabilities.mof schema/VSMigrationService.mof schema/VSMigrationSettingData.mof schema/VirtualSystemSnapshotService.mof schema/VirtualSystemSnapshotServiceCapabilities.mof Processing provider modules: Virt_AllocationCapabilities Virt_ComputerSystem Virt_ComputerSystemIndication Virt_ComputerSystemMigrationIndication Virt_Device Virt_DevicePool Virt_ElementAllocatedFromPool Virt_ElementCapabilities Virt_ElementConformsToProfile Virt_ElementSettingData Virt_EnabledLogicalElementCapabilities Virt_HostedDependency Virt_HostedResourcePool Virt_HostedService Virt_HostSystem Virt_RASD Virt_ResourceAllocationFromPool Virt_ResourcePoolConfigurationCapabilities Virt_ResourcePoolConfigurationService Virt_SettingsDefineCapabilities Virt_SettingsDefineState Virt_SystemDevice Virt_VirtualSystemManagementCapabilities Virt_VirtualSystemManagementService Virt_VirtualSystemSnapshotService Virt_VirtualSystemSnapshotServiceCapabilities Virt_VSMigrationCapabilities Virt_VSMigrationService Virt_VSMigrationSettingData Virt_VSSD Virt_VSSDComponent Registering providers with active cimserver Parsing error: parse error: Error adding class Xen_VirtualSystemSnapshotServiceCapabilities to the repository: CIM_ERR_INVALID_SUPERCLASS: CIM_VirtualSystemSnapshotServiceCapabilities make: *** [postinstall] Error 250 Please let me know if any suggestions. Regards, Sunil Botre| Software Engineer | Persistent Systems Limited sunil_botre at persistent.co.in | Cell: +91 9604854768| Tel: +91 (20) 3023 6653 Persistent Systems - Innovation in software product design, development and delivery - www.persistentsys.com DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails. -------------- next part -------------- An HTML attachment was scrubbed... URL: From deeptik at linux.vnet.ibm.com Mon Jul 20 09:15:08 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 20 Jul 2009 02:15:08 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Modify vsms.py and vxml.py to include vnc_passwd filed for GRASD In-Reply-To: References: Message-ID: <7a453b4c7749159ee7e7.1248081308@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1248081035 25200 # Node ID 7a453b4c7749159ee7e740dc7b8e0e6c69790ad0 # Parent d8ce1c1e439da8f1f26bc65e1c192ba5d590445b [TEST] Modify vsms.py and vxml.py to include vnc_passwd filed for GRASD. Tested with KVM and current sources on F10 and SLES. Signed-off-by: Deepti B. Kalakeri diff -r d8ce1c1e439d -r 7a453b4c7749 suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Mon Jul 20 02:09:38 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Mon Jul 20 02:10:35 2009 -0700 @@ -243,7 +243,7 @@ class CIM_GraphicsResourceAllocationSettingData(CIMClassMOF): def __init__(self, name, res_sub_type="vnc", ip="127.0.0.1", - lport='-1', keymap="en-us"): + lport='-1', keymap="en-us", vnc_passwd=None): self.InstanceID = '%s/graphics' %name self.ResourceType = RASD_TYPE_GRAPHICS @@ -255,6 +255,9 @@ if keymap != None: self.KeyMap = keymap + + if vnc_passwd != None: + self.Password = vnc_passwd class Xen_GraphicsResourceAllocationSettingData(CIM_GraphicsResourceAllocationSettingData): diff -r d8ce1c1e439d -r 7a453b4c7749 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Jul 20 02:09:38 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Jul 20 02:10:35 2009 -0700 @@ -558,7 +558,7 @@ def __init__(self, virt, dom_name, disk_dev, disk_source, net_type, net_name, net_mac, vcpus, mem, mem_allocunits, emu_type, grstype, ip, - port_num, kmap, irstype, btype): + port_num, kmap, irstype, btype, vnc_passwd): self.virt = virt self.domain_name = dom_name self.err_rc = None @@ -581,7 +581,8 @@ name=dom_name) self.gasd = vsms.get_gasd_class(virt)(name=dom_name, res_sub_type=grstype, ip=ip, - lport=port_num, keymap=kmap) + lport=port_num, keymap=kmap, + vnc_passwd=vnc_passwd) self.iasd = vsms.get_iasd_class(virt)(name=dom_name, res_sub_type=irstype, bus_type=btype) @@ -796,7 +797,7 @@ net_name=const.default_network_name, emu_type=None, grstype="vnc", address="127.0.0.1", port_num='-1', keymap="en-us", irstype="mouse", - btype="xen"): + btype="xen", vnc_passwd=None): if not (os.path.exists(const.Xen_kernel_path) \ and os.path.exists(const.Xen_init_path)): logger.error('ERROR: Either the kernel image ' @@ -809,7 +810,7 @@ VirtCIM.__init__(self, 'Xen', test_dom, disk, disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, port_num, keymap, irstype, - btype) + btype, vnc_passwd) def _os(self, os_kernel, os_initrd): os = self.get_node('/domain/os') @@ -861,7 +862,7 @@ net_name=const.default_network_name, emu_type=None, grstype="vnc", address="127.0.0.1", port_num='-1', keymap="en-us", irstype="mouse", - btype="ps2"): + btype="ps2", vnc_passwd=None): if not os.path.exists(disk_file_path): logger.error('Error: Disk image does not exist') sys.exit(1) @@ -869,7 +870,7 @@ VirtCIM.__init__(self, 'KVM', test_dom, disk, disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, - port_num, keymap, irstype, btype) + port_num, keymap, irstype, btype, vnc_passwd) self._os() self._devices(const.KVM_default_emulator, ntype, disk_file_path, disk, mac, net_name) @@ -916,7 +917,7 @@ net_name=const.default_network_name, emu_type=None, grstype="vnc", address="127.0.0.1", port_num='-1', keymap="en-us", - irstype="mouse", btype="ps2"): + irstype="mouse", btype="ps2", vnc_passwd=None): if not os.path.exists(disk_file_path): logger.error('Error: Disk image does not exist') sys.exit(1) @@ -924,7 +925,7 @@ VirtCIM.__init__(self, 'XenFV', test_dom, disk, disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, port_num, keymap, - irstype, btype) + irstype, btype, vnc_passwd) self._features() self._os(const.XenFV_default_loader) self._devices(const.XenFV_default_emulator, @@ -973,12 +974,12 @@ net_name=const.default_network_name, tty=const.LXC_default_tty, grstype="vnc", address="127.0.0.1", port_num='-1', keymap="en-us", - irstype="mouse", btype="usb"): + irstype="mouse", btype="usb", vnc_passwd=None): VirtXML.__init__(self, 'lxc', test_dom, set_uuid(), mem, vcpus) VirtCIM.__init__(self, 'LXC', test_dom, const.LXC_default_mp, const.LXC_default_source, ntype, net_name, mac, vcpus, mem, const.default_mallocunits, None, grstype, - address, port_num, keymap, irstype, btype) + address, port_num, keymap, irstype, btype, vnc_passwd) self._os(const.LXC_init_path) self._devices(mac, ntype, net_name, const.LXC_default_tty) self.create_lxc_file(CIM_IP, const.LXC_init_path) From deeptik at linux.vnet.ibm.com Mon Jul 20 10:34:32 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Mon, 20 Jul 2009 16:04:32 +0530 Subject: [Libvirt-cim] Libvirt-cim postinsatllation fail In-Reply-To: References: Message-ID: <4A644838.4040605@linux.vnet.ibm.com> Sunil Botre wrote: > > Hi > > > > I want to install libvirt-cim-0.5 on Fedora 7 hypervisor machine > > I have also installed Pegasus2.9 and libvirt-0.4.0-4.fc7 and > libvirt-devel-0.4.0-4.fc7 package > > > > But while Installing libvirt-cim-0.5 step of postinstallation fails. > > > > #Sudo Make postinstall > > > > > *Registering providers with active cimserver* > > *Parsing error: parse error: Error adding class > Xen_VirtualSystemSnapshotServiceCapabilities to the repository: > CIM_ERR_INVALID_SUPERCLASS: CIM_VirtualSystemSnapshotServiceCapabilities* > > *make: *** [postinstall] Error 250* > Can you make sure if *CIM_VirtualSystemSnapshotServiceCapabilities *is installed in the /root/virt namespace. you can verify this by using the following command: query : wbemcli ecn http://root/@localhost/root/virt | grep CIM_VirtualSystemSnapshotServiceCapabilities o/p: localhost:5988/root/virt:CIM_VirtualSystemSnapshotServiceCapabilities If you don't get the above o/p then, try to reinstall your pegasus repository. Also, before running the postinstall step please execute make preinstall --> This makes sure all the necessary base providers are installed. ** > > > > Please let me know if any suggestions. > > > > Regards, > Sunil Botre| Software Engineer | Persistent Systems Limited > sunil_botre at persistent.co.in | > Cell: +91 9604854768| Tel: +91 (20) 3023 6653 > > Persistent Systems - Innovation in software product design, > development and delivery - www.persistentsys.com > > > DISCLAIMER ========== This e-mail may contain privileged and > confidential information which is the property of Persistent Systems > Ltd. It is intended only for the use of the individual or entity to > which it is addressed. If you are not the intended recipient, you are > not authorized to read, retain, copy, print, distribute or use this > message. If you have received this communication in error, please > notify the sender and delete all copies of this message. Persistent > Systems Ltd. does not accept any liability for virus infected mails. > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Mon Jul 20 15:25:48 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 20 Jul 2009 08:25:48 -0700 Subject: [Libvirt-cim] [PATCH] [TEST]#2 Fixed the RASD/07_parent_disk_pool.py Message-ID: # HG changeset patch # User Deepti B.Kalakeri # Date 1248103418 25200 # Node ID fc0ce87139b4f1e8a1967e927bf28e442ca3175d # Parent 14b666e2a803048c1ce4e71b550a49c62915b3a3 [TEST]#2 Fixed the RASD/07_parent_disk_pool.py Patch 2: ------- 1) Improved the code Verified with KVM and current sources on F10 and SLES11. Signed-off-by: Deepti B. Kalakeri diff -r 14b666e2a803 -r fc0ce87139b4 suites/libvirt-cim/cimtest/RASD/07_parent_disk_pool.py --- a/suites/libvirt-cim/cimtest/RASD/07_parent_disk_pool.py Thu Jul 16 07:28:51 2009 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/07_parent_disk_pool.py Mon Jul 20 08:23:38 2009 -0700 @@ -37,7 +37,7 @@ # -PoolID="DiskPool/0" # -Type=3 [ For Type 1 and 2 as well ] # -Path="/dev/null" -# -DevicePath= +# -DevicePaths= # -Host="host_sys.domain.com" # -SourceDirectory="/var/lib/images" # @@ -45,13 +45,51 @@ import sys from sets import Set +from copy import copy from CimTest.Globals import logger from XenKvmLib.const import do_main from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.pool import get_pool_rasds sup_types = ['KVM', 'Xen', 'XenFV'] -DISKPOOL_REC_LEN = 3 +DISKPOOL_REC_LEN = 7 + +def init_list(): + pval = "/dev/null" + ptype1 = { 'ResourceType' : 17, + 'PoolID' : "DiskPool/0", + 'Type' : 1L, 'DevicePaths': None, + 'Host' : None, 'SourceDirectory': None, + 'Path' : pval } + + ptype2 = ptype1.copy() + ptype2['Type'] = 2L + ptype2['DevicePaths'] = [u'/dev/sda100'] + + ptype3 = ptype1.copy() + ptype3['Type'] = 3L + ptype3['Host'] = u'host_sys.domain.com' + ptype3['SourceDirectory'] = u'/var/lib/images' + + ptype4 = ptype1.copy() + ptype4['Type'] = 4L + ptype4['DevicePaths'] = [u'/dev/VolGroup00/LogVol100'] + + ptype5 = ptype1.copy() + ptype5['Type'] = 5L + ptype5['DevicePaths'] = [u'iscsi-target'] + ptype3['Host'] = u'host_sys.domain.com' + + ptype6 = ptype1.copy() + ptype6['Type'] = 6L + + ptype7 = ptype1.copy() + ptype7['Type'] = 7L + ptype7['Path'] = '/dev/disk/by-id' + + exp_t_dp_h_sdir_path = [ ptype1, ptype2, ptype3, ptype4, + ptype5, ptype6, ptype7 ] + return exp_t_dp_h_sdir_path def get_rec(diskpool_rasd, inst_id='Default'): recs = [] @@ -70,16 +108,9 @@ if status != PASS: return status inst_list = [ 'Default', 'Minimum', 'Maximum', 'Increment' ] - n_rec_val = { 'ResourceType' : 17, - 'PoolID' : "DiskPool/0", - 'Path' : "/dev/null", - } - exp_type_path_host_dir = [('1', 'None', 'None', 'None'), - ('2', '/dev/sda100', 'None', 'None'), - ('3', 'None', 'host_sys.domain.com', - '/var/lib/images')] - - + + exp_t_dp_h_sdir_path = init_list() + for inst_type in inst_list: logger.info("Verifying '%s' records", inst_type) @@ -89,23 +120,30 @@ raise Exception("Got %s recs instead of %s" %(len(n_rec), DISKPOOL_REC_LEN)) - res_type_path_host_dir = [] for rec in n_rec: - l = (str(rec['Type']), str(rec['DevicePath']), - str(rec['Host']), str(rec['SourceDirectory'])) - res_type_path_host_dir.append(l) + found = False + for item in exp_t_dp_h_sdir_path: + if rec['Type'] == item['Type']: + found = True + for key, val in item.iteritems(): + exp_val = val + res_val = rec[key] + if type(val).__name__ == 'list': + cmp_exp = (len(Set(res_val) - \ + Set(exp_val)) != 0) + elif type(val).__name__ != 'NoneType': + cmp_exp = (exp_val != res_val) + elif type(val).__name__ == 'NoneType': + continue - if len(Set(exp_type_path_host_dir) & Set(res_type_path_host_dir)) \ - != DISKPOOL_REC_LEN : - raise Exception("Mismatching values, \nGot %s,\nExpected %s"\ - %(exp_type_path_host_dir, - res_type_path_host_dir)) + if cmp_exp: + raise Exception("Mismatching values, "\ + "\nGot %s, \nExpected %s"\ + % (res_val, exp_val)) - for key in n_rec_val.keys(): - for rec in n_rec: - if n_rec_val[key] != rec[key]: - raise Exception("'%s' Mismatch, Got %s, Expected %s" \ - % (key, rec[key], n_rec_val[key])) + if found == False: + raise Exception("Failed to get records for pooltype" \ + " %s" % rec['Type']) except Exception, details: logger.error("Exception details: %s", details) From deeptik at linux.vnet.ibm.com Mon Jul 20 15:40:36 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Mon, 20 Jul 2009 21:10:36 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Updates to VSMS 19_definenetwork_ers.py In-Reply-To: <69e3ab27d1a8b0e50afa.1247857892@elm3a148.beaverton.ibm.com> References: <69e3ab27d1a8b0e50afa.1247857892@elm3a148.beaverton.ibm.com> Message-ID: <4A648FF4.1060502@linux.vnet.ibm.com> +1 -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Jul 20 17:27:44 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 20 Jul 2009 10:27:44 -0700 Subject: [Libvirt-cim] Libvirt-cim postinsatllation fail In-Reply-To: References: Message-ID: <4A64A910.9060307@linux.vnet.ibm.com> Hi Sunil =) Welcome to the list! Sunil Botre wrote: > Hi > > > > I want to install libvirt-cim-0.5 on Fedora 7 hypervisor machine This version is a year old.. just out of curiosity, any reason to use such an old version? > > I have also installed Pegasus2.9 and libvirt-0.4.0-4.fc7 and > libvirt-devel-0.4.0-4.fc7 package > > > > But while Installing libvirt-cim-0.5 step of postinstallation fails. > > > > #Sudo Make postinstall Did you run "sudo make preinstall" and then restart the CIMOM prior to runing "sudo make postinstall"? Running "make preinstall" will register the base schema in the root/virt namespace. > > > > sh provider-register.sh -v -t pegasus -n root/virt -r > schema/ComputerSystem.registration schema/LogicalDisk.registration > schema/NetworkPort.registration schema/Memory.registration > schema/Processor.registration schema/SystemDevice.registration > schema/VSSD.registration schema/HostSystem.registration > schema/HostedDependency.registration > schema/VirtualSystemManagementService.registration > schema/VirtualSystemManagementCapabilities.registration > schema/EnabledLogicalElementCapabilities.registration > schema/AllocationCapabilities.registration > schema/SettingsDefineCapabilities.registration > schema/MemoryPool.registration schema/ElementCapabilities.registration > schema/ProcessorPool.registration schema/DiskPool.registration > schema/HostedResourcePool.registration > schema/ComputerSystemIndication.registration > schema/ComputerSystemMigrationIndication.registration > schema/ResourceAllocationSettingData.registration > schema/ResourcePoolConfigurationService.registration > schema/ResourcePoolConfigurationCapabilities.registration > schema/VSSDComponent.registration > schema/SettingsDefineState.registration schema/NetPool.registration > schema/ResourceAllocationFromPool.registration > schema/ElementAllocatedFromPool.registration > schema/HostedService.registration schema/ElementSettingData.registration > schema/VSMigrationCapabilities.registration > schema/VSMigrationService.registration > schema/ElementConformsToProfile.registration > schema/VSMigrationSettingData.registration > schema/VirtualSystemSnapshotService.registration > schema/VirtualSystemSnapshotServiceCapabilities.registration -m > schema/ComputerSystem.mof schema/LogicalDisk.mof schema/NetworkPort.mof > schema/Memory.mof schema/Processor.mof schema/SystemDevice.mof > schema/VSSD.mof schema/HostSystem.mof schema/HostedDependency.mof > schema/VirtualSystemManagementService.mof > schema/VirtualSystemManagementCapabilities.mof > schema/EnabledLogicalElementCapabilities.mof > schema/AllocationCapabilities.mof schema/SettingsDefineCapabilities.mof > schema/MemoryPool.mof schema/ElementCapabilities.mof > schema/ProcessorPool.mof schema/DiskPool.mof > schema/HostedResourcePool.mof schema/RegisteredProfile.mof > schema/ElementConformsToProfile.mof schema/ComputerSystemIndication.mof > schema/ComputerSystemMigrationIndication.mof > schema/ResourceAllocationSettingData.mof > schema/ResourcePoolConfigurationService.mof > schema/ResourcePoolConfigurationCapabilities.mof > schema/VSSDComponent.mof schema/SettingsDefineState.mof > schema/NetPool.mof schema/ResourceAllocationFromPool.mof > schema/ElementAllocatedFromPool.mof schema/HostedService.mof > schema/ElementSettingData.mof schema/VSMigrationCapabilities.mof > schema/VSMigrationService.mof schema/VSMigrationSettingData.mof > schema/VirtualSystemSnapshotService.mof > schema/VirtualSystemSnapshotServiceCapabilities.mof > > Processing provider modules: Virt_AllocationCapabilities > Virt_ComputerSystem Virt_ComputerSystemIndication > Virt_ComputerSystemMigrationIndication Virt_Device Virt_DevicePool > Virt_ElementAllocatedFromPool Virt_ElementCapabilities > Virt_ElementConformsToProfile Virt_ElementSettingData > Virt_EnabledLogicalElementCapabilities Virt_HostedDependency > Virt_HostedResourcePool Virt_HostedService Virt_HostSystem Virt_RASD > Virt_ResourceAllocationFromPool > Virt_ResourcePoolConfigurationCapabilities > Virt_ResourcePoolConfigurationService Virt_SettingsDefineCapabilities > Virt_SettingsDefineState Virt_SystemDevice > Virt_VirtualSystemManagementCapabilities > Virt_VirtualSystemManagementService Virt_VirtualSystemSnapshotService > Virt_VirtualSystemSnapshotServiceCapabilities > Virt_VSMigrationCapabilities Virt_VSMigrationService > Virt_VSMigrationSettingData Virt_VSSD Virt_VSSDComponent > > *Registering providers with active cimserver* > > *Parsing error: parse error: Error adding class > Xen_VirtualSystemSnapshotServiceCapabilities to the repository: > CIM_ERR_INVALID_SUPERCLASS: CIM_VirtualSystemSnapshotServiceCapabilities* > > *make: *** [postinstall] Error 250* > > > > Please let me know if any suggestions. > > > > Regards, > Sunil Botre| Software Engineer | Persistent Systems Limited > sunil_botre at persistent.co.in | > Cell: +91 9604854768| Tel: +91 (20) 3023 6653 > > Persistent Systems - Innovation in software product design, development > and delivery - www.persistentsys.com > > DISCLAIMER ========== This e-mail may contain privileged and > confidential information which is the property of Persistent Systems > Ltd. It is intended only for the use of the individual or entity to > which it is addressed. If you are not the intended recipient, you are > not authorized to read, retain, copy, print, distribute or use this > message. If you have received this communication in error, please notify > the sender and delete all copies of this message. Persistent Systems > Ltd. does not accept any liability for virus infected mails. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Jul 20 18:25:44 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 20 Jul 2009 11:25:44 -0700 Subject: [Libvirt-cim] [PATCH] [TEST]#2 Fixed the RASD/07_parent_disk_pool.py In-Reply-To: References: Message-ID: <4A64B6A8.7030103@linux.vnet.ibm.com> > +def init_list(): > + pval = "/dev/null" > + ptype1 = { 'ResourceType' : 17, > + 'PoolID' : "DiskPool/0", > + 'Type' : 1L, 'DevicePaths': None, > + 'Host' : None, 'SourceDirectory': None, > + 'Path' : pval } > + > + ptype2 = ptype1.copy() > + ptype2['Type'] = 2L > + ptype2['DevicePaths'] = [u'/dev/sda100'] > + > + ptype3 = ptype1.copy() > + ptype3['Type'] = 3L > + ptype3['Host'] = u'host_sys.domain.com' > + ptype3['SourceDirectory'] = u'/var/lib/images' > + > + ptype4 = ptype1.copy() > + ptype4['Type'] = 4L > + ptype4['DevicePaths'] = [u'/dev/VolGroup00/LogVol100'] > + > + ptype5 = ptype1.copy() > + ptype5['Type'] = 5L > + ptype5['DevicePaths'] = [u'iscsi-target'] > + ptype3['Host'] = u'host_sys.domain.com' > + > + ptype6 = ptype1.copy() > + ptype6['Type'] = 6L > + > + ptype7 = ptype1.copy() > + ptype7['Type'] = 7L > + ptype7['Path'] = '/dev/disk/by-id' Can you include some comments here? It's not clear which pool type has which values set. Instead of using comments, you could define the pool type values in pool.py. Then you could do something like: ptype6['Type'] = LOGICAL_POOL - this will make it easier to tell which type is which. > + > + exp_t_dp_h_sdir_path = [ ptype1, ptype2, ptype3, ptype4, > + ptype5, ptype6, ptype7 ] I would use more descriptive names... instead of ptype1, use something like dir, fs, etc - that'll also make it more clear which dictionary belongs to a given pool. > + return exp_t_dp_h_sdir_path > > def get_rec(diskpool_rasd, inst_id='Default'): > recs = [] > @@ -70,16 +108,9 @@ > if status != PASS: > return status > inst_list = [ 'Default', 'Minimum', 'Maximum', 'Increment' ] > - n_rec_val = { 'ResourceType' : 17, > - 'PoolID' : "DiskPool/0", > - 'Path' : "/dev/null", > - } > - exp_type_path_host_dir = [('1', 'None', 'None', 'None'), > - ('2', '/dev/sda100', 'None', 'None'), > - ('3', 'None', 'host_sys.domain.com', > - '/var/lib/images')] > - > - > + > + exp_t_dp_h_sdir_path = init_list() > + > for inst_type in inst_list: > logger.info("Verifying '%s' records", inst_type) > > @@ -89,23 +120,30 @@ > raise Exception("Got %s recs instead of %s" %(len(n_rec), > DISKPOOL_REC_LEN)) > > - res_type_path_host_dir = [] > for rec in n_rec: > - l = (str(rec['Type']), str(rec['DevicePath']), > - str(rec['Host']), str(rec['SourceDirectory'])) > - res_type_path_host_dir.append(l) > + found = False > + for item in exp_t_dp_h_sdir_path: > + if rec['Type'] == item['Type']: > + found = True > + for key, val in item.iteritems(): > + exp_val = val > + res_val = rec[key] > + if type(val).__name__ == 'list': > + cmp_exp = (len(Set(res_val) - \ > + Set(exp_val)) != 0) > + elif type(val).__name__ != 'NoneType': > + cmp_exp = (exp_val != res_val) > + elif type(val).__name__ == 'NoneType': > + continue This is a lot of indention. Can some of this be moved out to a helper function? -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Thu Jul 16 19:00:32 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 16 Jul 2009 16:00:32 -0300 Subject: [Libvirt-cim] [PATCH] Fix segfault VSMS provider when passing an incorrect namespace Message-ID: <7f2654e5776c0528dfb6.1247770832@F11> # HG changeset patch # User Richard Maciel # Date 1247770802 10800 # Node ID 7f2654e5776c0528dfb69a80f3b626dca47464ce # Parent 39a2f25cda5d49863f319236c3edb5272f3602ba Fix segfault VSMS provider when passing an incorrect namespace Checks if the vssd_to_domain function in Virt_VirtualSystemManagementService.c can get the object path from the CMPIInstance parameter. Signed-off-by: Richard Maciel diff -r 39a2f25cda5d -r 7f2654e5776c src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Thu Jul 16 15:28:11 2009 -0300 +++ b/src/Virt_VirtualSystemManagementService.c Thu Jul 16 16:00:02 2009 -0300 @@ -388,8 +388,16 @@ const char *cn; char *pfx = NULL; bool fullvirt; + CMPIObjectPath *opathp = NULL; - cn = CLASSNAME(CMGetObjectPath(inst, NULL)); + + opathp = CMGetObjectPath(inst, NULL); + if (opathp == NULL) { + CU_DEBUG("Got a null object path"); + return 0; + } + + cn = CLASSNAME(opathp); pfx = class_prefix_name(cn); if (pfx == NULL) { CU_DEBUG("Unknown prefix for class: %s", cn); From kaitlin at linux.vnet.ibm.com Mon Jul 20 21:00:51 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 20 Jul 2009 14:00:51 -0700 Subject: [Libvirt-cim] [PATCH 0 of 4] Add support for new storage volume template RASDS Message-ID: There's not too much that can be done with the template RASD until support for the image creation methods are in place. For now, the new storage volume template RASDs can be viewed by following SDC: wbemcli ai -ac KVM_SettingsDefineCapabilities 'http://localhost/root/virt:KVM_AllocationCapabilities.InstanceID="DiskPool/data"' -nl From kaitlin at linux.vnet.ibm.com Mon Jul 20 21:00:53 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 20 Jul 2009 14:00:53 -0700 Subject: [Libvirt-cim] [PATCH 2 of 4] Add code to be able to parse an existing storage pool's XML In-Reply-To: References: Message-ID: <67c4f2ab76c74753438a.1248123653@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1248121657 25200 # Node ID 67c4f2ab76c74753438aa94db0bc4867e869ff97 # Parent 5eefe23b2be112a925b834931897e61b97d2cd06 Add code to be able to parse an existing storage pool's XML This is needed in order to determine the storage pool type. For the upcoming image creation support, only directory type pools will be supported initially. Signed-off-by: Kaitlin Rupert diff -r 5eefe23b2be1 -r 67c4f2ab76c7 libxkutil/pool_parsing.c --- a/libxkutil/pool_parsing.c Mon Jul 20 13:53:31 2009 -0700 +++ b/libxkutil/pool_parsing.c Mon Jul 20 13:27:37 2009 -0700 @@ -31,6 +31,7 @@ #include #include "pool_parsing.h" +#include "device_parsing.h" #include "../src/svpc_types.h" /* @@ -86,6 +87,160 @@ *pool = NULL; } +static int parse_disk_target(xmlNode *node, struct disk_pool *pool) +{ + xmlNode *child; + + for (child = node->children; child != NULL; child = child->next) { + if (XSTREQ(child->name, "path")) { + STRPROP(pool, path, child); + break; + } + } + + return 1; +} + +static int parse_disk_source(xmlNode *node, struct disk_pool *pool) +{ + xmlNode *child; + + for (child = node->children; child != NULL; child = child->next) { + if (XSTREQ(child->name, "device")) { + const char *path; + path = get_attr_value(child, "path"); + /* Build device path array here */ + } else if (XSTREQ(child->name, "host")) { + pool->host = get_attr_value(child, "name"); + if (pool->host == NULL) + goto err; + } else if (XSTREQ(child->name, "dir")) { + pool->src_dir = get_attr_value(child, "path"); + if (pool->src_dir == NULL) + goto err; + } else if (XSTREQ(child->name, "dir")) { + pool->src_dir = get_attr_value(child, "path"); + if (pool->src_dir == NULL) + goto err; + } else if (XSTREQ(child->name, "adapter")) { + pool->adapter = get_attr_value(child, "name"); + pool->port_name = get_attr_value(child, "wwpn"); + pool->node_name = get_attr_value(child, "wwnn"); + } + } + + err: + + return 1; +} + +static const char *parse_disk_pool(xmlNodeSet *nsv, struct disk_pool *pool) +{ + xmlNode **nodes = nsv->nodeTab; + xmlNode *child; + const char *type_str; + const char *name; + int type = 0; + + type_str = get_attr_value(nodes[0], "type"); + + if (STREQC(type_str, "dir")) + type = DISK_POOL_DIR; + else if (STREQC(type_str, "fs")) + type = DISK_POOL_FS; + else if (STREQC(type_str, "netfs")) + type = DISK_POOL_NETFS; + else if (STREQC(type_str, "disk")) + type = DISK_POOL_DISK; + else if (STREQC(type_str, "iscsi")) + type = DISK_POOL_ISCSI; + else if (STREQC(type_str, "logical")) + type = DISK_POOL_LOGICAL; + else if (STREQC(type_str, "scsi")) + type = DISK_POOL_SCSI; + else + type = DISK_POOL_UNKNOWN; + + pool->pool_type = type; + + for (child = nodes[0]->children; child != NULL; child = child->next) { + if (XSTREQ(child->name, "name")) { + name = get_node_content(child); + } else if (XSTREQ(child->name, "target")) + parse_disk_target(child, pool); + else if (XSTREQ(child->name, "source")) + parse_disk_source(child, pool); + } + + return name; +} + +int get_pool_from_xml(const char *xml, struct virt_pool *pool, int type) +{ + int len; + int ret = 0; + xmlDoc *xmldoc; + xmlXPathContext *xpathctx; + xmlXPathObject *xpathobj; + const xmlChar *xpathstr = (xmlChar *)"/pool"; + const char *name; + + len = strlen(xml) + 1; + + if ((xmldoc = xmlParseMemory(xml, len)) == NULL) + goto err1; + + if ((xpathctx = xmlXPathNewContext(xmldoc)) == NULL) + goto err2; + + if ((xpathobj = xmlXPathEvalExpression(xpathstr, xpathctx)) == NULL) + goto err3; + + /* FIXME: Add support for parsing network pools */ + if (type == CIM_RES_TYPE_NET) { + ret = 0; + goto err1; + } + + memset(pool, 0, sizeof(*pool)); + + pool->type = CIM_RES_TYPE_DISK; + name = parse_disk_pool(xpathobj->nodesetval, + &(pool)->pool_info.disk); + if (name == NULL) + ret = 0; + + pool->id = strdup(name); + + xmlXPathFreeObject(xpathobj); + err3: + xmlXPathFreeContext(xpathctx); + err2: + xmlFreeDoc(xmldoc); + err1: + return ret; +} + +int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool) +{ + char *xml; + int ret; + + xml = virStoragePoolGetXMLDesc(poolptr, 0); + if (xml == NULL) + return 0; + + *pool = malloc(sizeof(**pool)); + if (*pool == NULL) + return 0; + + ret = get_pool_from_xml(xml, *pool, CIM_RES_TYPE_DISK); + + free(xml); + + return ret; +} + int define_pool(virConnectPtr conn, const char *xml, int res_type) { int ret = 1; diff -r 5eefe23b2be1 -r 67c4f2ab76c7 libxkutil/pool_parsing.h --- a/libxkutil/pool_parsing.h Mon Jul 20 13:53:31 2009 -0700 +++ b/libxkutil/pool_parsing.h Mon Jul 20 13:27:37 2009 -0700 @@ -66,6 +66,9 @@ void cleanup_virt_pool(struct virt_pool **pool); +int get_pool_from_xml(const char *xml, struct virt_pool *pool, int type); +int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool); + int define_pool(virConnectPtr conn, const char *xml, int res_type); int destroy_pool(virConnectPtr conn, const char *name, int res_type); From kaitlin at linux.vnet.ibm.com Mon Jul 20 21:00:55 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 20 Jul 2009 14:00:55 -0700 Subject: [Libvirt-cim] [PATCH 4 of 4] Expose template RASDs that can be used for defining new storage volumes In-Reply-To: References: Message-ID: <3976c5e9c8ace6b1c6d2.1248123655@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1248121657 25200 # Node ID 3976c5e9c8ace6b1c6d23d14ab80d5b737d6702f # Parent 5fad1c4642449d39d40c7f8c90b8e71371b90d58 Expose template RASDs that can be used for defining new storage volumes Also: -Change volume_template() to avail_volume_template() to distinguish from template RASDs that represent existing storage volumes in a pool vs the template RASDs that are used for creating a new storage volume within a given pool -Change disk_dev_or_pool_template() to disk_res_template() since it now handles more than existing storage volumes and disk pool templates. Signed-off-by: Kaitlin Rupert diff -r 5fad1c464244 -r 3976c5e9c8ac src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Mon Jul 20 13:27:37 2009 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Mon Jul 20 13:27:37 2009 -0700 @@ -71,6 +71,7 @@ #define DEVICE_RASD 0 #define POOL_RASD 1 +#define NEW_VOL_RASD 2 static bool system_has_vt(virConnectPtr conn) { @@ -280,6 +281,10 @@ ret = rasd_classname_from_type(resource_type, &base); else if (rasd_type == POOL_RASD) ret = pool_rasd_classname_from_type(resource_type, &base); + else if (rasd_type == NEW_VOL_RASD) { + base = "StorageVolumeResourceAllocationSettingData"; + ret = 0; + } if (ret != CMPI_RC_OK) { cu_statusf(_BROKER, s, @@ -1023,10 +1028,76 @@ } #if VIR_USE_LIBVIRT_STORAGE -static CMPIStatus volume_template(const CMPIObjectPath *ref, - int template_type, - virStorageVolPtr volume_ptr, - struct inst_list *list) +static CMPIStatus new_volume_template(const CMPIObjectPath *ref, + int template_type, + virStoragePoolPtr poolptr, + struct inst_list *list) +{ + const char *id; + CMPIStatus s = {CMPI_RC_OK, NULL}; + int ret = 0; + struct virt_pool *pool = NULL; + CMPIInstance *inst = NULL; + int type = 0; + const char *path; + + switch(template_type) { + case SDC_RASD_MIN: + id = "New Storage Volume Minimum"; + break; + case SDC_RASD_MAX: + id = "New Storage Volume Maximum"; + break; + case SDC_RASD_INC: + id = "New Storage Volume Increment"; + break; + case SDC_RASD_DEF: + id = "New Storage Volume Default"; + break; + default: + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unsupported sdc_rasd type"); + goto out; + } + + ret = get_disk_pool(poolptr, &pool); + if (ret == 1) { + virt_set_status(_BROKER, &s, + CMPI_RC_ERR_FAILED, + virStoragePoolGetConnect(poolptr), + "Error getting referenced configuration"); + goto out; + } + + type = pool->pool_info.disk.pool_type; + if (type != DISK_POOL_DIR) { + CU_DEBUG("Image creation for this pool type is not supported"); + goto out; + } + + inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_IMAGE, NEW_VOL_RASD); + if ((inst == NULL) || (s.rc != CMPI_RC_OK)) + goto out; + + CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars); + CMSetProperty(inst, "Type", (CMPIValue *)&type, CMPI_uint16); + + path = "/var/lib/libvirt/images/"; + CMSetProperty(inst, "Path", (CMPIValue *)path, CMPI_chars); + + inst_list_add(list, inst); + + out: + cleanup_virt_pool(&pool); + + return s; +} + +static CMPIStatus avail_volume_template(const CMPIObjectPath *ref, + int template_type, + virStorageVolPtr volume_ptr, + struct inst_list *list) { char *pfx = NULL; const char *id; @@ -1163,6 +1234,10 @@ goto out; } + s = new_volume_template(ref, template_type, poolptr, list); + if (s.rc != CMPI_RC_OK) + goto out; + if ((numvols = virStoragePoolNumOfVolumes(poolptr)) == -1) { virt_set_status(_BROKER, &s, CMPI_RC_ERR_FAILED, @@ -1206,7 +1281,7 @@ goto out; } - s = volume_template(ref, template_type, volptr, list); + s = avail_volume_template(ref, template_type, volptr, list); virStorageVolFree(volptr); @@ -1388,9 +1463,9 @@ return s; } -static CMPIStatus disk_dev_or_pool_template(const CMPIObjectPath *ref, - int template_type, - struct inst_list *list) +static CMPIStatus disk_res_template(const CMPIObjectPath *ref, + int template_type, + struct inst_list *list) { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst; @@ -1421,7 +1496,7 @@ if (val) s = disk_pool_template(ref, template_type, list); - else + else s = disk_template(ref, template_type, list); out: @@ -1648,7 +1723,7 @@ else if (type == CIM_RES_TYPE_NET) s = net_dev_or_pool_template(ref, i, list); else if (type == CIM_RES_TYPE_DISK) - s = disk_dev_or_pool_template(ref, i, list); + s = disk_res_template(ref, i, list); else if (type == CIM_RES_TYPE_GRAPHICS) s = graphics_template(ref, i, list); else if (type == CIM_RES_TYPE_INPUT) From kaitlin at linux.vnet.ibm.com Mon Jul 20 21:00:52 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 20 Jul 2009 14:00:52 -0700 Subject: [Libvirt-cim] [PATCH 1 of 4] Make get_node_content(), get_attr_value() non static In-Reply-To: References: Message-ID: <5eefe23b2be112a925b8.1248123652@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1248123211 25200 # Node ID 5eefe23b2be112a925b834931897e61b97d2cd06 # Parent 1f48bb4249af07d7598308b8ac7c1aad5e2e3743 Make get_node_content(), get_attr_value() non static This makes these functions to be available for use in pool_parsing.c Also, move XSTREQ() and STRPROP() to device_parsing.h so it can be used in pool_parsing.c Signed-off-by: Kaitlin Rupert diff -r 1f48bb4249af -r 5eefe23b2be1 libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Tue Jul 14 22:13:01 2009 -0700 +++ b/libxkutil/device_parsing.c Mon Jul 20 13:53:31 2009 -0700 @@ -27,9 +27,6 @@ #include #include #include -#include -#include -#include #include @@ -49,7 +46,6 @@ #define DEFAULT_BRIDGE "xenbr0" #define DEFAULT_NETWORK "default" -#define XSTREQ(x, y) (STREQ((char *)x, y)) #define MAX(a,b) (((a)>(b))?(a):(b)) static void cleanup_disk_device(struct disk_device *dev) @@ -123,7 +119,7 @@ *_devs = NULL; } -static char *get_attr_value(xmlNode *node, char *attrname) +char *get_attr_value(xmlNode *node, char *attrname) { char *buf = NULL; char *ret = NULL; @@ -137,7 +133,7 @@ return ret; } -static char *get_node_content(xmlNode *node) +char *get_node_content(xmlNode *node) { char *buf = NULL; xmlChar *ret = NULL; @@ -809,8 +805,6 @@ return 1; } -#define STRPROP(d, p, n) (d->p = get_node_content(n)) - static int parse_os(struct domain *dominfo, xmlNode *os) { xmlNode *child; diff -r 1f48bb4249af -r 5eefe23b2be1 libxkutil/device_parsing.h --- a/libxkutil/device_parsing.h Tue Jul 14 22:13:01 2009 -0700 +++ b/libxkutil/device_parsing.h Mon Jul 20 13:53:31 2009 -0700 @@ -27,6 +27,9 @@ #include #include #include +#include +#include +#include #include "../src/svpc_types.h" @@ -169,6 +172,9 @@ void cleanup_virt_device(struct virt_device *dev); void cleanup_virt_devices(struct virt_device **devs, int count); +char *get_node_content(xmlNode *node); +char *get_attr_value(xmlNode *node, char *attrname); + char *get_fq_devid(char *host, char *_devid); int parse_fq_devid(const char *devid, char **host, char **device); @@ -176,6 +182,9 @@ int detach_device(virDomainPtr dom, struct virt_device *dev); int change_device(virDomainPtr dom, struct virt_device *dev); +#define XSTREQ(x, y) (STREQ((char *)x, y)) +#define STRPROP(d, p, n) (d->p = get_node_content(n)) + #endif /* From kaitlin at linux.vnet.ibm.com Mon Jul 20 21:00:54 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 20 Jul 2009 14:00:54 -0700 Subject: [Libvirt-cim] [PATCH 3 of 4] Add StorageVolumeResourceAllocationSettingData class, new resource type In-Reply-To: References: Message-ID: <5fad1c4642449d39d40c.1248123654@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1248121657 25200 # Node ID 5fad1c4642449d39d40c7f8c90b8e71371b90d58 # Parent 67c4f2ab76c74753438aa94db0bc4867e869ff97 Add StorageVolumeResourceAllocationSettingData class, new resource type The new class and resource type will be used to distinguish a template RASD used for defining a new storage volume (image file) from template RASDs that can be used to create a new virtual disk (assign an existing storage volume to a guest). Signed-off-by: Kaitlin Rupert diff -r 67c4f2ab76c7 -r 5fad1c464244 schema/ResourceAllocationSettingData.mof --- a/schema/ResourceAllocationSettingData.mof Mon Jul 20 13:27:37 2009 -0700 +++ b/schema/ResourceAllocationSettingData.mof Mon Jul 20 13:27:37 2009 -0700 @@ -290,3 +290,22 @@ string NodeName; }; + +[Description ("Xen storage volume settings"), + Provider("cmpi::Virt_SettingsDefineCapabilities") +] +class Xen_StorageVolumeResourceAllocationSettingData : Xen_ResourceAllocationSettingData +{ + string Path; + uint16 Type; +}; + +[Description ("KVM storage volume settings"), + Provider("cmpi::Virt_SettingsDefineCapabilities") +] +class KVM_StorageVolumeResourceAllocationSettingData : KVM_ResourceAllocationSettingData +{ + string Path; + uint16 Type; +}; + diff -r 67c4f2ab76c7 -r 5fad1c464244 src/svpc_types.h --- a/src/svpc_types.h Mon Jul 20 13:27:37 2009 -0700 +++ b/src/svpc_types.h Mon Jul 20 13:27:37 2009 -0700 @@ -33,6 +33,7 @@ #define CIM_RES_TYPE_GRAPHICS 24 #define CIM_RES_TYPE_INPUT 13 #define CIM_RES_TYPE_UNKNOWN 1000 +#define CIM_RES_TYPE_IMAGE 32768 #define CIM_RES_TYPE_COUNT 6 const static int cim_res_types[CIM_RES_TYPE_COUNT] = From deeptik at linux.vnet.ibm.com Tue Jul 21 08:41:59 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 21 Jul 2009 01:41:59 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add new tc to verify a MAC address is generated for the domain Message-ID: <76407aac7701beedc970.1248165719@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1248165703 25200 # Node ID 76407aac7701beedc970f5add3b0c3eeef12c7cb # Parent 910a44242f106fb6993e94f4431edacf3dedcba3 [TEST] Add new tc to verify a MAC address is generated for the domain. This test case verifies that, if user does not specify MAC Address, a MAC address is generated for the domain by the provider. Verified with KVM and current sources on F10 and SLES11. Signed-off-by: Deepti B. Kalakeri diff -r 910a44242f10 -r 76407aac7701 suites/libvirt-cim/cimtest/VirtualSystemManagementService/21_createVS_verifyMAC.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/21_createVS_verifyMAC.py Tue Jul 21 01:41:43 2009 -0700 @@ -0,0 +1,96 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# This test case verifies that, if user does not specify MAC Address, +# a MAC address is generated for the domain by the provider. +# Date: 21-07-2009 +# + +import sys +from XenKvmLib.const import do_main +from CimTest.Globals import logger +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.vxml import get_class +from XenKvmLib.enumclass import EnumInstances +from XenKvmLib.classes import get_typed_class + +SUPPORTED_TYPES = ['Xen', 'KVM', 'XenFV', 'LXC'] +default_dom = 'dom_mac_notspecified' +MAC_ADDR_LEN = 6 + + +def verify_nrasd_mac_value(virt, server): + rasd_list = [] + classname = get_typed_class(virt, "NetResourceAllocationSettingData") + try: + rasd_list = EnumInstances(server, classname, ret_cim_inst=True) + if len(rasd_list) < 1: + logger.error("%s returned %i instances, excepted at least 1.", + classname, len(rasd_list)) + return FAIL + + for rasd in rasd_list: + # Verify the Mac Address for the domain is generated and set + if default_dom in rasd['InstanceID']: + mac_addr_len = len(rasd['Address'].split(":")) + if rasd['Address'] != "" and mac_addr_len == MAC_ADDR_LEN: + logger.info("Mac Address for dom '%s' is set to '%s'", \ + default_dom, rasd['Address']) + return PASS + + except Exception, detail: + logger.error("Exception: %s", detail) + return FAIL + + logger.error("Mac Address for dom '%s' is not set", default_dom) + return FAIL + + at do_main(SUPPORTED_TYPES) +def main(): + options = main.options + + cxml = get_class(options.virt)(default_dom, mac=None) + + try: + ret = cxml.cim_define(options.ip) + if not ret: + raise Exception("Unable to define %s" % default_dom) + + status = cxml.cim_start(options.ip) + if status != PASS: + cxml.undefine(options.ip) + raise Exception("Failed to start the defined domain: %s" \ + % default_dom) + + status = verify_nrasd_mac_value(options.virt, options.ip) + + except Exception, details: + logger.error("Exception details: %s", details) + return FAIL + + cxml.cim_destroy(options.ip) + cxml.undefine(options.ip) + + return status + +if __name__ == "__main__": + sys.exit(main()) + diff -r 910a44242f10 -r 76407aac7701 suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Mon Jul 20 02:09:38 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Tue Jul 21 01:41:43 2009 -0700 @@ -159,10 +159,12 @@ class CIM_NetResourceAllocationSettingData(CIMClassMOF): def __init__(self, type, mac, name, virt_net=None): - self.Address = mac self.NetworkType = type self.ResourceType = RASD_TYPE_NET_ETHER + if mac != None: + self.Address = mac + if virt_net != None : if type == 'network': self.PoolID = "NetworkPool/%s" % virt_net From rmaciel at linux.vnet.ibm.com Tue Jul 21 17:54:48 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Tue, 21 Jul 2009 14:54:48 -0300 Subject: [Libvirt-cim] [PATCH 2 of 4] Add code to be able to parse an existing storage pool's XML In-Reply-To: <67c4f2ab76c74753438a.1248123653@elm3a148.beaverton.ibm.com> References: <67c4f2ab76c74753438a.1248123653@elm3a148.beaverton.ibm.com> Message-ID: <4A6600E8.2050608@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1248121657 25200 > # Node ID 67c4f2ab76c74753438aa94db0bc4867e869ff97 > # Parent 5eefe23b2be112a925b834931897e61b97d2cd06 > Add code to be able to parse an existing storage pool's XML > > This is needed in order to determine the storage pool type. For the upcoming > image creation support, only directory type pools will be supported initially. > > Signed-off-by: Kaitlin Rupert > > diff -r 5eefe23b2be1 -r 67c4f2ab76c7 libxkutil/pool_parsing.c > --- a/libxkutil/pool_parsing.c Mon Jul 20 13:53:31 2009 -0700 > +++ b/libxkutil/pool_parsing.c Mon Jul 20 13:27:37 2009 -0700 > @@ -31,6 +31,7 @@ > #include > > #include "pool_parsing.h" > +#include "device_parsing.h" > #include "../src/svpc_types.h" > > /* > @@ -86,6 +87,160 @@ > *pool = NULL; > } > > +static int parse_disk_target(xmlNode *node, struct disk_pool *pool) > +{ > + xmlNode *child; > + > + for (child = node->children; child != NULL; child = child->next) { > + if (XSTREQ(child->name, "path")) { > + STRPROP(pool, path, child); > + break; > + } > + } > + > + return 1; > +} > + > +static int parse_disk_source(xmlNode *node, struct disk_pool *pool) > +{ > + xmlNode *child; > + > + for (child = node->children; child != NULL; child = child->next) { > + if (XSTREQ(child->name, "device")) { > + const char *path; > + path = get_attr_value(child, "path"); > + /* Build device path array here */ > + } else if (XSTREQ(child->name, "host")) { > + pool->host = get_attr_value(child, "name"); > + if (pool->host == NULL) > + goto err; > + } else if (XSTREQ(child->name, "dir")) { > + pool->src_dir = get_attr_value(child, "path"); > + if (pool->src_dir == NULL) > + goto err; > + } else if (XSTREQ(child->name, "dir")) { > + pool->src_dir = get_attr_value(child, "path"); > + if (pool->src_dir == NULL) > + goto err; Duplicate code for node "dir". Also, I can't find the "dir" node in the libvirt xml documentation, storage pool section. > + } else if (XSTREQ(child->name, "adapter")) { > + pool->adapter = get_attr_value(child, "name"); > + pool->port_name = get_attr_value(child, "wwpn"); > + pool->node_name = get_attr_value(child, "wwnn"); > + } > + } > + > + err: > + > + return 1; > +} > + > +static const char *parse_disk_pool(xmlNodeSet *nsv, struct disk_pool *pool) > +{ > + xmlNode **nodes = nsv->nodeTab; > + xmlNode *child; > + const char *type_str; > + const char *name; > + int type = 0; > + > + type_str = get_attr_value(nodes[0], "type"); > + > + if (STREQC(type_str, "dir")) > + type = DISK_POOL_DIR; > + else if (STREQC(type_str, "fs")) > + type = DISK_POOL_FS; > + else if (STREQC(type_str, "netfs")) > + type = DISK_POOL_NETFS; > + else if (STREQC(type_str, "disk")) > + type = DISK_POOL_DISK; > + else if (STREQC(type_str, "iscsi")) > + type = DISK_POOL_ISCSI; > + else if (STREQC(type_str, "logical")) > + type = DISK_POOL_LOGICAL; > + else if (STREQC(type_str, "scsi")) > + type = DISK_POOL_SCSI; > + else > + type = DISK_POOL_UNKNOWN; > + > + pool->pool_type = type; > + > + for (child = nodes[0]->children; child != NULL; child = child->next) { > + if (XSTREQ(child->name, "name")) { > + name = get_node_content(child); > + } else if (XSTREQ(child->name, "target")) > + parse_disk_target(child, pool); > + else if (XSTREQ(child->name, "source")) > + parse_disk_source(child, pool); > + } > + > + return name; > +} > + > +int get_pool_from_xml(const char *xml, struct virt_pool *pool, int type) > +{ > + int len; > + int ret = 0; > + xmlDoc *xmldoc; > + xmlXPathContext *xpathctx; > + xmlXPathObject *xpathobj; > + const xmlChar *xpathstr = (xmlChar *)"/pool"; > + const char *name; > + > + len = strlen(xml) + 1; > + > + if ((xmldoc = xmlParseMemory(xml, len)) == NULL) > + goto err1; > + > + if ((xpathctx = xmlXPathNewContext(xmldoc)) == NULL) > + goto err2; > + > + if ((xpathobj = xmlXPathEvalExpression(xpathstr, xpathctx)) == NULL) > + goto err3; > + > + /* FIXME: Add support for parsing network pools */ > + if (type == CIM_RES_TYPE_NET) { > + ret = 0; > + goto err1; > + } > + > + memset(pool, 0, sizeof(*pool)); > + > + pool->type = CIM_RES_TYPE_DISK; > + name = parse_disk_pool(xpathobj->nodesetval, > + &(pool)->pool_info.disk); > + if (name == NULL) > + ret = 0; > + > + pool->id = strdup(name); > + > + xmlXPathFreeObject(xpathobj); > + err3: > + xmlXPathFreeContext(xpathctx); > + err2: > + xmlFreeDoc(xmldoc); > + err1: > + return ret; > +} > + > +int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool) > +{ > + char *xml; > + int ret; > + > + xml = virStoragePoolGetXMLDesc(poolptr, 0); > + if (xml == NULL) > + return 0; > + > + *pool = malloc(sizeof(**pool)); > + if (*pool == NULL) > + return 0; > + > + ret = get_pool_from_xml(xml, *pool, CIM_RES_TYPE_DISK); > + > + free(xml); > + > + return ret; > +} > + > int define_pool(virConnectPtr conn, const char *xml, int res_type) > { > int ret = 1; > diff -r 5eefe23b2be1 -r 67c4f2ab76c7 libxkutil/pool_parsing.h > --- a/libxkutil/pool_parsing.h Mon Jul 20 13:53:31 2009 -0700 > +++ b/libxkutil/pool_parsing.h Mon Jul 20 13:27:37 2009 -0700 > @@ -66,6 +66,9 @@ > > void cleanup_virt_pool(struct virt_pool **pool); > > +int get_pool_from_xml(const char *xml, struct virt_pool *pool, int type); > +int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool); > + > int define_pool(virConnectPtr conn, const char *xml, int res_type); > int destroy_pool(virConnectPtr conn, const char *name, int res_type); > > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 21 23:49:21 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 21 Jul 2009 16:49:21 -0700 Subject: [Libvirt-cim] [PATCH 2 of 4] Add code to be able to parse an existing storage pool's XML In-Reply-To: <4A6600E8.2050608@linux.vnet.ibm.com> References: <67c4f2ab76c74753438a.1248123653@elm3a148.beaverton.ibm.com> <4A6600E8.2050608@linux.vnet.ibm.com> Message-ID: <4A665401.3010801@linux.vnet.ibm.com> >> + for (child = node->children; child != NULL; child = >> child->next) { >> + if (XSTREQ(child->name, "device")) { >> + const char *path; >> + path = get_attr_value(child, "path"); >> + /* Build device path array here */ >> + } else if (XSTREQ(child->name, "host")) { >> + pool->host = get_attr_value(child, "name"); >> + if (pool->host == NULL) >> + goto err; >> + } else if (XSTREQ(child->name, "dir")) { >> + pool->src_dir = get_attr_value(child, "path"); >> + if (pool->src_dir == NULL) >> + goto err; >> + } else if (XSTREQ(child->name, "dir")) { >> + pool->src_dir = get_attr_value(child, "path"); >> + if (pool->src_dir == NULL) >> + goto err; > Duplicate code for node "dir". Also, I can't find the "dir" node in the > libvirt xml documentation, storage pool section. > Good catch - not sure what I was thinking there... Check out netfs type pools - they have a dir node. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 22 00:11:22 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 21 Jul 2009 17:11:22 -0700 Subject: [Libvirt-cim] [PATCH 2 of 4] (#2) Add code to be able to parse an existing storage pool's XML In-Reply-To: References: Message-ID: <20fbdf23ea06819cb2d6.1248221482@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1248121657 25200 # Node ID 20fbdf23ea06819cb2d6193273497bee9b3eb8a2 # Parent 5eefe23b2be112a925b834931897e61b97d2cd06 (#2) Add code to be able to parse an existing storage pool's XML This is needed in order to determine the storage pool type. For the upcoming image creation support, only directory type pools will be supported initially. Updates: -Remove duplicate parsing of "dir" node -Add implementation for building device_paths array Signed-off-by: Kaitlin Rupert diff -r 5eefe23b2be1 -r 20fbdf23ea06 libxkutil/pool_parsing.c --- a/libxkutil/pool_parsing.c Mon Jul 20 13:53:31 2009 -0700 +++ b/libxkutil/pool_parsing.c Mon Jul 20 13:27:37 2009 -0700 @@ -31,6 +31,7 @@ #include #include "pool_parsing.h" +#include "device_parsing.h" #include "../src/svpc_types.h" /* @@ -86,6 +87,169 @@ *pool = NULL; } +static int parse_disk_target(xmlNode *node, struct disk_pool *pool) +{ + xmlNode *child; + + for (child = node->children; child != NULL; child = child->next) { + if (XSTREQ(child->name, "path")) { + STRPROP(pool, path, child); + break; + } + } + + return 1; +} + +static int parse_disk_source(xmlNode *node, struct disk_pool *pool) +{ + xmlNode *child; + char **dev_paths = NULL; + unsigned ct = 0; + + for (child = node->children; child != NULL; child = child->next) { + if (XSTREQ(child->name, "device")) { + char **tmp = NULL; + + tmp = realloc(dev_paths, sizeof(char *) * (ct + 1)); + if (tmp == NULL) { + CU_DEBUG("Could not alloc space for dev path"); + continue; + } + dev_paths = tmp; + + dev_paths[ct] = get_attr_value(child, "path"); + ct++; + } else if (XSTREQ(child->name, "host")) { + pool->host = get_attr_value(child, "name"); + if (pool->host == NULL) + goto err; + } else if (XSTREQ(child->name, "dir")) { + pool->src_dir = get_attr_value(child, "path"); + if (pool->src_dir == NULL) + goto err; + } else if (XSTREQ(child->name, "adapter")) { + pool->adapter = get_attr_value(child, "name"); + pool->port_name = get_attr_value(child, "wwpn"); + pool->node_name = get_attr_value(child, "wwnn"); + } + } + + pool->device_paths_ct = ct; + pool->device_paths = dev_paths; + + err: + + return 1; +} + +static const char *parse_disk_pool(xmlNodeSet *nsv, struct disk_pool *pool) +{ + xmlNode **nodes = nsv->nodeTab; + xmlNode *child; + const char *type_str; + const char *name; + int type = 0; + + type_str = get_attr_value(nodes[0], "type"); + + if (STREQC(type_str, "dir")) + type = DISK_POOL_DIR; + else if (STREQC(type_str, "fs")) + type = DISK_POOL_FS; + else if (STREQC(type_str, "netfs")) + type = DISK_POOL_NETFS; + else if (STREQC(type_str, "disk")) + type = DISK_POOL_DISK; + else if (STREQC(type_str, "iscsi")) + type = DISK_POOL_ISCSI; + else if (STREQC(type_str, "logical")) + type = DISK_POOL_LOGICAL; + else if (STREQC(type_str, "scsi")) + type = DISK_POOL_SCSI; + else + type = DISK_POOL_UNKNOWN; + + pool->pool_type = type; + + for (child = nodes[0]->children; child != NULL; child = child->next) { + if (XSTREQ(child->name, "name")) { + name = get_node_content(child); + } else if (XSTREQ(child->name, "target")) + parse_disk_target(child, pool); + else if (XSTREQ(child->name, "source")) + parse_disk_source(child, pool); + } + + return name; +} + +int get_pool_from_xml(const char *xml, struct virt_pool *pool, int type) +{ + int len; + int ret = 0; + xmlDoc *xmldoc; + xmlXPathContext *xpathctx; + xmlXPathObject *xpathobj; + const xmlChar *xpathstr = (xmlChar *)"/pool"; + const char *name; + + len = strlen(xml) + 1; + + if ((xmldoc = xmlParseMemory(xml, len)) == NULL) + goto err1; + + if ((xpathctx = xmlXPathNewContext(xmldoc)) == NULL) + goto err2; + + if ((xpathobj = xmlXPathEvalExpression(xpathstr, xpathctx)) == NULL) + goto err3; + + /* FIXME: Add support for parsing network pools */ + if (type == CIM_RES_TYPE_NET) { + ret = 0; + goto err1; + } + + memset(pool, 0, sizeof(*pool)); + + pool->type = CIM_RES_TYPE_DISK; + name = parse_disk_pool(xpathobj->nodesetval, + &(pool)->pool_info.disk); + if (name == NULL) + ret = 0; + + pool->id = strdup(name); + + xmlXPathFreeObject(xpathobj); + err3: + xmlXPathFreeContext(xpathctx); + err2: + xmlFreeDoc(xmldoc); + err1: + return ret; +} + +int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool) +{ + char *xml; + int ret; + + xml = virStoragePoolGetXMLDesc(poolptr, 0); + if (xml == NULL) + return 0; + + *pool = malloc(sizeof(**pool)); + if (*pool == NULL) + return 0; + + ret = get_pool_from_xml(xml, *pool, CIM_RES_TYPE_DISK); + + free(xml); + + return ret; +} + int define_pool(virConnectPtr conn, const char *xml, int res_type) { int ret = 1; diff -r 5eefe23b2be1 -r 20fbdf23ea06 libxkutil/pool_parsing.h --- a/libxkutil/pool_parsing.h Mon Jul 20 13:53:31 2009 -0700 +++ b/libxkutil/pool_parsing.h Mon Jul 20 13:27:37 2009 -0700 @@ -66,6 +66,9 @@ void cleanup_virt_pool(struct virt_pool **pool); +int get_pool_from_xml(const char *xml, struct virt_pool *pool, int type); +int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool); + int define_pool(virConnectPtr conn, const char *xml, int res_type); int destroy_pool(virConnectPtr conn, const char *name, int res_type); From kaitlin at linux.vnet.ibm.com Wed Jul 22 00:11:20 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 21 Jul 2009 17:11:20 -0700 Subject: [Libvirt-cim] [PATCH 0 of 4] Add support for new storage volume template RASDS Message-ID: There's not too much that can be done with the template RASD until support for the image creation methods are in place. For now, the new storage volume template RASDs can be viewed by following SDC: wbemcli ai -ac KVM_SettingsDefineCapabilities 'http://localhost/root/virt:KVM_AllocationCapabilities.InstanceID="DiskPool/data"' -nl From kaitlin at linux.vnet.ibm.com Wed Jul 22 00:11:21 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 21 Jul 2009 17:11:21 -0700 Subject: [Libvirt-cim] [PATCH 1 of 4] Make get_node_content(), get_attr_value() non static In-Reply-To: References: Message-ID: <5eefe23b2be112a925b8.1248221481@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1248123211 25200 # Node ID 5eefe23b2be112a925b834931897e61b97d2cd06 # Parent 1f48bb4249af07d7598308b8ac7c1aad5e2e3743 Make get_node_content(), get_attr_value() non static This makes these functions to be available for use in pool_parsing.c Also, move XSTREQ() and STRPROP() to device_parsing.h so it can be used in pool_parsing.c Signed-off-by: Kaitlin Rupert diff -r 1f48bb4249af -r 5eefe23b2be1 libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Tue Jul 14 22:13:01 2009 -0700 +++ b/libxkutil/device_parsing.c Mon Jul 20 13:53:31 2009 -0700 @@ -27,9 +27,6 @@ #include #include #include -#include -#include -#include #include @@ -49,7 +46,6 @@ #define DEFAULT_BRIDGE "xenbr0" #define DEFAULT_NETWORK "default" -#define XSTREQ(x, y) (STREQ((char *)x, y)) #define MAX(a,b) (((a)>(b))?(a):(b)) static void cleanup_disk_device(struct disk_device *dev) @@ -123,7 +119,7 @@ *_devs = NULL; } -static char *get_attr_value(xmlNode *node, char *attrname) +char *get_attr_value(xmlNode *node, char *attrname) { char *buf = NULL; char *ret = NULL; @@ -137,7 +133,7 @@ return ret; } -static char *get_node_content(xmlNode *node) +char *get_node_content(xmlNode *node) { char *buf = NULL; xmlChar *ret = NULL; @@ -809,8 +805,6 @@ return 1; } -#define STRPROP(d, p, n) (d->p = get_node_content(n)) - static int parse_os(struct domain *dominfo, xmlNode *os) { xmlNode *child; diff -r 1f48bb4249af -r 5eefe23b2be1 libxkutil/device_parsing.h --- a/libxkutil/device_parsing.h Tue Jul 14 22:13:01 2009 -0700 +++ b/libxkutil/device_parsing.h Mon Jul 20 13:53:31 2009 -0700 @@ -27,6 +27,9 @@ #include #include #include +#include +#include +#include #include "../src/svpc_types.h" @@ -169,6 +172,9 @@ void cleanup_virt_device(struct virt_device *dev); void cleanup_virt_devices(struct virt_device **devs, int count); +char *get_node_content(xmlNode *node); +char *get_attr_value(xmlNode *node, char *attrname); + char *get_fq_devid(char *host, char *_devid); int parse_fq_devid(const char *devid, char **host, char **device); @@ -176,6 +182,9 @@ int detach_device(virDomainPtr dom, struct virt_device *dev); int change_device(virDomainPtr dom, struct virt_device *dev); +#define XSTREQ(x, y) (STREQ((char *)x, y)) +#define STRPROP(d, p, n) (d->p = get_node_content(n)) + #endif /* From kaitlin at linux.vnet.ibm.com Wed Jul 22 00:11:23 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 21 Jul 2009 17:11:23 -0700 Subject: [Libvirt-cim] [PATCH 3 of 4] Add StorageVolumeResourceAllocationSettingData class, new resource type In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1248121657 25200 # Node ID d55e89f660825c2ad5df60151707ead225d07e85 # Parent 20fbdf23ea06819cb2d6193273497bee9b3eb8a2 Add StorageVolumeResourceAllocationSettingData class, new resource type The new class and resource type will be used to distinguish a template RASD used for defining a new storage volume (image file) from template RASDs that can be used to create a new virtual disk (assign an existing storage volume to a guest). Signed-off-by: Kaitlin Rupert diff -r 20fbdf23ea06 -r d55e89f66082 schema/ResourceAllocationSettingData.mof --- a/schema/ResourceAllocationSettingData.mof Mon Jul 20 13:27:37 2009 -0700 +++ b/schema/ResourceAllocationSettingData.mof Mon Jul 20 13:27:37 2009 -0700 @@ -290,3 +290,22 @@ string NodeName; }; + +[Description ("Xen storage volume settings"), + Provider("cmpi::Virt_SettingsDefineCapabilities") +] +class Xen_StorageVolumeResourceAllocationSettingData : Xen_ResourceAllocationSettingData +{ + string Path; + uint16 Type; +}; + +[Description ("KVM storage volume settings"), + Provider("cmpi::Virt_SettingsDefineCapabilities") +] +class KVM_StorageVolumeResourceAllocationSettingData : KVM_ResourceAllocationSettingData +{ + string Path; + uint16 Type; +}; + diff -r 20fbdf23ea06 -r d55e89f66082 src/svpc_types.h --- a/src/svpc_types.h Mon Jul 20 13:27:37 2009 -0700 +++ b/src/svpc_types.h Mon Jul 20 13:27:37 2009 -0700 @@ -33,6 +33,7 @@ #define CIM_RES_TYPE_GRAPHICS 24 #define CIM_RES_TYPE_INPUT 13 #define CIM_RES_TYPE_UNKNOWN 1000 +#define CIM_RES_TYPE_IMAGE 32768 #define CIM_RES_TYPE_COUNT 6 const static int cim_res_types[CIM_RES_TYPE_COUNT] = From kaitlin at linux.vnet.ibm.com Wed Jul 22 00:11:24 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 21 Jul 2009 17:11:24 -0700 Subject: [Libvirt-cim] [PATCH 4 of 4] Expose template RASDs that can be used for defining new storage volumes In-Reply-To: References: Message-ID: <53e7156f47ea93b6866a.1248221484@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1248121657 25200 # Node ID 53e7156f47ea93b6866a9908a456741086ce0473 # Parent d55e89f660825c2ad5df60151707ead225d07e85 Expose template RASDs that can be used for defining new storage volumes Also: -Change volume_template() to avail_volume_template() to distinguish from template RASDs that represent existing storage volumes in a pool vs the template RASDs that are used for creating a new storage volume within a given pool -Change disk_dev_or_pool_template() to disk_res_template() since it now handles more than existing storage volumes and disk pool templates. Signed-off-by: Kaitlin Rupert diff -r d55e89f66082 -r 53e7156f47ea src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Mon Jul 20 13:27:37 2009 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Mon Jul 20 13:27:37 2009 -0700 @@ -71,6 +71,7 @@ #define DEVICE_RASD 0 #define POOL_RASD 1 +#define NEW_VOL_RASD 2 static bool system_has_vt(virConnectPtr conn) { @@ -280,6 +281,10 @@ ret = rasd_classname_from_type(resource_type, &base); else if (rasd_type == POOL_RASD) ret = pool_rasd_classname_from_type(resource_type, &base); + else if (rasd_type == NEW_VOL_RASD) { + base = "StorageVolumeResourceAllocationSettingData"; + ret = 0; + } if (ret != CMPI_RC_OK) { cu_statusf(_BROKER, s, @@ -1023,10 +1028,76 @@ } #if VIR_USE_LIBVIRT_STORAGE -static CMPIStatus volume_template(const CMPIObjectPath *ref, - int template_type, - virStorageVolPtr volume_ptr, - struct inst_list *list) +static CMPIStatus new_volume_template(const CMPIObjectPath *ref, + int template_type, + virStoragePoolPtr poolptr, + struct inst_list *list) +{ + const char *id; + CMPIStatus s = {CMPI_RC_OK, NULL}; + int ret = 0; + struct virt_pool *pool = NULL; + CMPIInstance *inst = NULL; + int type = 0; + const char *path; + + switch(template_type) { + case SDC_RASD_MIN: + id = "New Storage Volume Minimum"; + break; + case SDC_RASD_MAX: + id = "New Storage Volume Maximum"; + break; + case SDC_RASD_INC: + id = "New Storage Volume Increment"; + break; + case SDC_RASD_DEF: + id = "New Storage Volume Default"; + break; + default: + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unsupported sdc_rasd type"); + goto out; + } + + ret = get_disk_pool(poolptr, &pool); + if (ret == 1) { + virt_set_status(_BROKER, &s, + CMPI_RC_ERR_FAILED, + virStoragePoolGetConnect(poolptr), + "Error getting referenced configuration"); + goto out; + } + + type = pool->pool_info.disk.pool_type; + if (type != DISK_POOL_DIR) { + CU_DEBUG("Image creation for this pool type is not supported"); + goto out; + } + + inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_IMAGE, NEW_VOL_RASD); + if ((inst == NULL) || (s.rc != CMPI_RC_OK)) + goto out; + + CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars); + CMSetProperty(inst, "Type", (CMPIValue *)&type, CMPI_uint16); + + path = "/var/lib/libvirt/images/"; + CMSetProperty(inst, "Path", (CMPIValue *)path, CMPI_chars); + + inst_list_add(list, inst); + + out: + cleanup_virt_pool(&pool); + + return s; +} + +static CMPIStatus avail_volume_template(const CMPIObjectPath *ref, + int template_type, + virStorageVolPtr volume_ptr, + struct inst_list *list) { char *pfx = NULL; const char *id; @@ -1163,6 +1234,10 @@ goto out; } + s = new_volume_template(ref, template_type, poolptr, list); + if (s.rc != CMPI_RC_OK) + goto out; + if ((numvols = virStoragePoolNumOfVolumes(poolptr)) == -1) { virt_set_status(_BROKER, &s, CMPI_RC_ERR_FAILED, @@ -1206,7 +1281,7 @@ goto out; } - s = volume_template(ref, template_type, volptr, list); + s = avail_volume_template(ref, template_type, volptr, list); virStorageVolFree(volptr); @@ -1388,9 +1463,9 @@ return s; } -static CMPIStatus disk_dev_or_pool_template(const CMPIObjectPath *ref, - int template_type, - struct inst_list *list) +static CMPIStatus disk_res_template(const CMPIObjectPath *ref, + int template_type, + struct inst_list *list) { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst; @@ -1421,7 +1496,7 @@ if (val) s = disk_pool_template(ref, template_type, list); - else + else s = disk_template(ref, template_type, list); out: @@ -1648,7 +1723,7 @@ else if (type == CIM_RES_TYPE_NET) s = net_dev_or_pool_template(ref, i, list); else if (type == CIM_RES_TYPE_DISK) - s = disk_dev_or_pool_template(ref, i, list); + s = disk_res_template(ref, i, list); else if (type == CIM_RES_TYPE_GRAPHICS) s = graphics_template(ref, i, list); else if (type == CIM_RES_TYPE_INPUT) From anantyog at linux.vnet.ibm.com Wed Jul 22 11:13:27 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Wed, 22 Jul 2009 04:13:27 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [Test]This testcase verifies definig network interface with conflicting MAC In-Reply-To: References: Message-ID: # HG changeset patch # User anantyog at linux.vnet.ibm.com # Date 1248261117 25200 # Node ID d475296d3dec59c3ed90898e43be2465b846f294 # Parent f50cabfd259e6f31cf01bf6e7a39bd4b8f03d1c8 [Test]This testcase verifies definig network interface with conflicting MAC This testcase tests 2 scenarios 1)First case: Try to create 2 diff domains with 'network' type interface with same mac 2)Second case: Try to add a second 'network' type interface with same mac as first interface to tht same domain. Signed-off-by: Yogananth Subramanian diff -r f50cabfd259e -r d475296d3dec suites/libvirt-cim/cimtest/VirtualSystemManagementService/23_verify_duplicate_mac_err.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/23_verify_duplicate_mac_err.py Wed Jul 22 04:11:57 2009 -0700 @@ -0,0 +1,141 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Yogananth subramanian +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# This testcase verifies definig network interface with conflicting MAC +# + +from sys import exit +from random import randint +from pywbem import CIM_ERR_FAILED +from XenKvmLib.vsms_util import add_net_res +from XenKvmLib.vsms import get_vsms_class, get_nasd_class +from XenKvmLib.vxml import get_class +from CimTest.Globals import logger +from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib.const import default_network_name, do_main +from XenKvmLib.common_util import create_netpool_conf, destroy_netpool +from XenKvmLib.classes import get_typed_class +from XenKvmLib.enumclass import GetInstance, EnumNames + +sup_types = ['Xen', 'KVM', 'XenFV'] +default_dom = 'net_domain1' +test_dom = 'brgtest_domain2' +nmac = '99:aa:bb:cc:ee:ff' +ntype = 'network' +npool_name = default_network_name + str(randint(1, 100)) +exp_rc = CIM_ERR_FAILED +exp_desc = "Conflicting MAC Addresses" + + +def cleanup_env(ip, virt, npool_name, cxml): + cxml.cim_destroy(ip) + cxml.undefine(ip) + destroy_netpool(ip, virt, npool_name) + +def start_dom(cxml,ip,dom): + ret = cxml.cim_define(ip) + if not ret: + status = cxml.verify_error_msg(exp_rc, exp_desc) + if status != PASS: + raise Exception("Got unexpected rc code %s and description %s" + % (cxml.err_rc, cxml.err_desc)) + return FAIL + ret = cxml.cim_start(ip) + if ret: + status = cxml.verify_error_msg(exp_rc, exp_desc) + cxml.undefine(ip) + if status != PASS: + raise Exception("Got unexpected rc code %s and description %s" + % (cxml.err_rc, cxml.err_desc)) + return FAIL + return PASS + + at do_main(sup_types) +def main(): + options = main.options + + status, net_name = create_netpool_conf(options.ip, options.virt, + use_existing=False, + net_name=npool_name) + if status != PASS: + logger.error('Unable to create network pool') + return FAIL + cxml = get_class(options.virt)(default_dom, mac=nmac, + ntype=ntype, net_name=npool_name) + try: + start_dom(cxml, options.ip, default_dom) + + except Exception, details: + logger.error(details) + destroy_netpool(options.ip, options.virt, net_name) + return FAIL + + sxml = get_class(options.virt)(test_dom, mac=nmac, + ntype=ntype, net_name=npool_name) + try: + status = start_dom(sxml, options.ip, test_dom) + + if status == PASS: + sxml.cim_destroy(options.ip) + sxml.undefine(options.ip) + raise Exception("Was able to create two domains with" + "Conflicting MAC Addresses") + else: + status = PASS + + service = get_vsms_class(options.virt)(options.ip) + classname = get_typed_class(options.virt, 'VirtualSystemSettingData') + netpool = EnumNames(options.ip, classname) + inst_id = '%s:%s' % (options.virt, default_dom) + vssd_ref = None + for i in range(0, len(netpool)): + ret_pool = netpool[i].keybindings['InstanceID'] + if ret_pool == inst_id: + vssd_ref = netpool[i] + break + if vssd_ref == None: + raise Exception("Failed to get vssd_ref for '%s'"% default_dom) + + nasd = get_nasd_class(options.virt)(type=ntype, mac=nmac, + name=default_dom, + virt_net=npool_name) + net_attr = { 'ntype' : ntype, + 'net_name' : npool_name, + 'nmac' : nmac + } + + ret = add_net_res(options.ip, service, options.virt, cxml, + vssd_ref, nasd, net_attr) + if ret == PASS: + raise Exception("AddRS should NOT return OK with duplicat MAC") + else: + status = PASS + + except Exception, details: + logger.error(details) + status = FAIL + + cleanup_env(options.ip, options.virt, npool_name, cxml) + return status + +if __name__ == "__main__": + exit(main()) + From anantyog at linux.vnet.ibm.com Wed Jul 22 11:13:25 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Wed, 22 Jul 2009 04:13:25 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [Test] Tests to verify multiple bridge interface and duplicate mac Message-ID: Hello everyone, I like to submit a set of tests to verify adding multiple bridge type interface and defining network interface with duplicate mac. The first patch, creates a test called 22_addmulti_brg_interface.py to VirtualSystemManagementService The second patch, creates a test called 23_verify_duplicate_mac_err.py to VirtualSystemManagementService Thanks and Regards Yogi From anantyog at linux.vnet.ibm.com Wed Jul 22 11:13:26 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Wed, 22 Jul 2009 04:13:26 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [Test] Test adding multiple bridge type interface to domain In-Reply-To: References: Message-ID: # HG changeset patch # User anantyog at linux.vnet.ibm.com # Date 1248260644 25200 # Node ID f50cabfd259e6f31cf01bf6e7a39bd4b8f03d1c8 # Parent 69398bff34dec41bd773fd7d8be550109d41913f [Test] Test adding multiple bridge type interface to domain This testcase verifies adding a bridge type interface using AddRS Signed-off-by: Yogananth Subramanian diff -r 69398bff34de -r f50cabfd259e suites/libvirt-cim/cimtest/VirtualSystemManagementService/22_addmulti_brg_interface.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/22_addmulti_brg_interface.py Wed Jul 22 04:04:04 2009 -0700 @@ -0,0 +1,122 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Yogananth subramanian +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# The testcase verifies adding multiple bridge type interface to domain +# +import sys +from XenKvmLib.enumclass import GetInstance, EnumNames +from XenKvmLib.classes import get_typed_class, inst_to_mof +from XenKvmLib.vxml import XenXML, KVMXML, get_class +from CimTest.Globals import logger +from XenKvmLib.const import do_main, get_provider_version, sles11_changeset +from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from XenKvmLib.common_util import create_netpool_conf,destroy_netpool +from pywbem.cim_obj import CIMInstanceName +from XenKvmLib.vsms import get_vsms_class, get_nasd_class +from XenKvmLib.vsms_util import add_net_res + +sup_types = ['Xen', 'KVM', 'XenFV'] +test_dom = "my_domain1" +default_net = "my_network0" +test_net = "my_network1" +test_mac = '99:aa:bb:cc:ee:ff' +default_mac = "00:11:33:33:44:55" +ntype = 'bridge' +default_brg = 'mybr0' +test_brg = 'mybr1' +bug_libvirt = "00015" + +def cleanup_env(ip, virt, net_name, cxml): + cxml.cim_destroy(ip) + cxml.undefine(ip) + destroy_netpool(ip, virt, net_name) + + at do_main(sup_types) +def main(): + options = main.options + + status, net_name = create_netpool_conf(options.ip, options.virt, + net_name=default_net, + bridge_name=default_brg) + if status != PASS: + logger.error('Unable to create network pool %s', + default_net) + return FAIL + + service = get_vsms_class(options.virt)(options.ip) + classname = get_typed_class(options.virt, 'VirtualSystemSettingData') + + vsxml = get_class(options.virt)(test_dom, mac=default_mac, ntype=ntype, + net_name=default_brg) + try: + ret = vsxml.cim_define(options.ip) + if not ret: + raise Exception("Failed to define the dom: %s" % default_dom) + + ret = vsxml.cim_start(options.ip) + if ret: + raise Exception("Failed to define the dom: %s" % default_dom) + + inst_id = '%s:%s' % (options.virt, test_dom) + netpool = EnumNames(options.ip, classname) + vssd_ref = None + for i in range(0, len(netpool)): + ret_pool = netpool[i].keybindings['InstanceID'] + if ret_pool == inst_id: + vssd_ref = netpool[i] + break + + if vssd_ref == None: + raise Exception("Failed to get vssd_ref for '%s'"% test_dom) + + status, net_name = create_netpool_conf(options.ip, options.virt, + net_name=test_net, + bridge_name=test_brg) + if status != PASS: + raise Exception('Unable to create network pool %s'% + test_net) + + except Exception, details: + logger.error(details) + cleanup_env(options.ip, options.virt, default_net, vsxml) + return FAIL + + nasd = get_nasd_class(options.virt)(type=ntype, mac=test_mac, + name=test_dom, virt_net=test_brg) + + net_attr = { 'ntype' : ntype, + 'net_name' : net_name, + 'nmac' : test_mac, + 'virt_net' : test_brg + } + + status = add_net_res(options.ip, service, options.virt, vsxml, + vssd_ref, nasd, net_attr) + cleanup_env(options.ip, options.virt, default_net, vsxml) + destroy_netpool(options.ip, options.virt, net_name=test_net) + + if status != PASS: + return XFAIL_RC(bug_libvirt) + else: + return status + +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Wed Jul 22 11:16:14 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 22 Jul 2009 04:16:14 -0700 Subject: [Libvirt-cim] [PATCH] [TEST]#3 Fixed the RASD/07_parent_disk_pool.py Message-ID: <28340a978f4e8f829d2d.1248261374@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1248261340 25200 # Node ID 28340a978f4e8f829d2d8998c04e0528436e1932 # Parent 69398bff34dec41bd773fd7d8be550109d41913f [TEST]#3 Fixed the RASD/07_parent_disk_pool.py Patch 3: ------- 1) Defined pool constants in pool.py 2) converted the nested for loop into functions Patch 2: ------- 1) Improved the code Verified with KVM and current sources on F10 and SLES11. Signed-off-by: Deepti B. Kalakeri diff -r 69398bff34de -r 28340a978f4e suites/libvirt-cim/cimtest/RASD/07_parent_disk_pool.py --- a/suites/libvirt-cim/cimtest/RASD/07_parent_disk_pool.py Tue Jul 21 01:41:43 2009 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/07_parent_disk_pool.py Wed Jul 22 04:15:40 2009 -0700 @@ -37,7 +37,7 @@ # -PoolID="DiskPool/0" # -Type=3 [ For Type 1 and 2 as well ] # -Path="/dev/null" -# -DevicePath= +# -DevicePaths= # -Host="host_sys.domain.com" # -SourceDirectory="/var/lib/images" # @@ -45,13 +45,55 @@ import sys from sets import Set +from copy import copy from CimTest.Globals import logger from XenKvmLib.const import do_main from CimTest.ReturnCodes import PASS, FAIL -from XenKvmLib.pool import get_pool_rasds +from XenKvmLib.pool import get_pool_rasds, DIR_POOL, FS_POOL, NETFS_POOL, \ + DISK_POOL, ISCSI_POOL, LOGICAL_POOL, SCSI_POOL + sup_types = ['KVM', 'Xen', 'XenFV'] -DISKPOOL_REC_LEN = 3 +DISKPOOL_REC_LEN = 7 + +def init_list(): + pval = "/dev/null" + dir_pool = { 'ResourceType' : 17, + 'PoolID' : "DiskPool/0", + 'Type' : DIR_POOL, + 'DevicePaths': None, + 'Host' : None, 'SourceDirectory': None, + 'Path' : pval + } + + fs_pool = dir_pool.copy() + fs_pool['Type'] = FS_POOL + fs_pool['DevicePaths'] = [u'/dev/sda100'] + + netfs_pool = dir_pool.copy() + netfs_pool['Type'] = NETFS_POOL + netfs_pool['Host'] = u'host_sys.domain.com' + netfs_pool['SourceDirectory'] = u'/var/lib/images' + + disk_pool = dir_pool.copy() + disk_pool['Type'] = DISK_POOL + disk_pool['DevicePaths'] = [u'/dev/VolGroup00/LogVol100'] + + iscsi_pool = dir_pool.copy() + iscsi_pool['Type'] = ISCSI_POOL + iscsi_pool['DevicePaths'] = [u'iscsi-target'] + iscsi_pool['Host'] = u'host_sys.domain.com' + + logical_pool = dir_pool.copy() + logical_pool['Type'] = LOGICAL_POOL + + scsi_pool = dir_pool.copy() + scsi_pool['Type'] = SCSI_POOL + scsi_pool['Path'] = '/dev/disk/by-id' + + exp_t_dp_h_sdir_path = [ dir_pool, fs_pool, netfs_pool, disk_pool, + iscsi_pool, logical_pool, scsi_pool ] + return exp_t_dp_h_sdir_path def get_rec(diskpool_rasd, inst_id='Default'): recs = [] @@ -60,6 +102,44 @@ recs.append(dp_rasd) return recs +def cmp_recs(item, rec): + try: + for key, val in item.iteritems(): + exp_val = val + res_val = rec[key] + if type(val).__name__ == 'list': + cmp_exp = (len(Set(res_val) - Set(exp_val)) != 0) + elif type(val).__name__ != 'NoneType': + cmp_exp = (exp_val != res_val) + elif type(val).__name__ == 'NoneType': + continue + + if cmp_exp: + raise Exception("Mismatching values, Got %s, "\ + "Expected %s" % (res_val, exp_val)) + except Exception, details: + logger.error("Exception details: %s", details) + return FAIL + + return PASS + +def verify_records(exp_t_dp_h_sdir_path, rec): + try: + found = False + for item in exp_t_dp_h_sdir_path: + if rec['Type'] == item['Type']: + status = cmp_recs(item, rec) + if status != PASS: + raise Exception("Verification failed for '%s'" \ + % rec['Type']) + found = True + except Exception, details: + logger.error("Exception details: %s", details) + return FAIL, found + + return PASS, found + + @do_main(sup_types) def main(): options = main.options @@ -70,16 +150,9 @@ if status != PASS: return status inst_list = [ 'Default', 'Minimum', 'Maximum', 'Increment' ] - n_rec_val = { 'ResourceType' : 17, - 'PoolID' : "DiskPool/0", - 'Path' : "/dev/null", - } - exp_type_path_host_dir = [('1', 'None', 'None', 'None'), - ('2', '/dev/sda100', 'None', 'None'), - ('3', 'None', 'host_sys.domain.com', - '/var/lib/images')] - - + + exp_t_dp_h_sdir_path = init_list() + for inst_type in inst_list: logger.info("Verifying '%s' records", inst_type) @@ -89,23 +162,10 @@ raise Exception("Got %s recs instead of %s" %(len(n_rec), DISKPOOL_REC_LEN)) - res_type_path_host_dir = [] for rec in n_rec: - l = (str(rec['Type']), str(rec['DevicePath']), - str(rec['Host']), str(rec['SourceDirectory'])) - res_type_path_host_dir.append(l) - - if len(Set(exp_type_path_host_dir) & Set(res_type_path_host_dir)) \ - != DISKPOOL_REC_LEN : - raise Exception("Mismatching values, \nGot %s,\nExpected %s"\ - %(exp_type_path_host_dir, - res_type_path_host_dir)) - - for key in n_rec_val.keys(): - for rec in n_rec: - if n_rec_val[key] != rec[key]: - raise Exception("'%s' Mismatch, Got %s, Expected %s" \ - % (key, rec[key], n_rec_val[key])) + status, found = verify_records(exp_t_dp_h_sdir_path, rec) + if status != PASS or found == False: + return FAIL except Exception, details: logger.error("Exception details: %s", details) diff -r 69398bff34de -r 28340a978f4e suites/libvirt-cim/lib/XenKvmLib/pool.py --- a/suites/libvirt-cim/lib/XenKvmLib/pool.py Tue Jul 21 01:41:43 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/pool.py Wed Jul 22 04:15:40 2009 -0700 @@ -40,6 +40,14 @@ input_graphics_pool_rev = 757 libvirt_cim_child_pool_rev = 837 +DIR_POOL = 1L +FS_POOL = 2L +NETFS_POOL = 3L +DISK_POOL = 4L +ISCSI_POOL = 5L +LOGICAL_POOL = 6L +SCSI_POOL = 7L + def pool_cn_to_rasd_cn(pool_cn, virt): if pool_cn.find('ProcessorPool') >= 0: return get_typed_class(virt, "ProcResourceAllocationSettingData") From deeptik at linux.vnet.ibm.com Wed Jul 22 12:55:20 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 22 Jul 2009 18:25:20 +0530 Subject: [Libvirt-cim] [PATCH 1 of 2] [Test] Test adding multiple bridge type interface to domain In-Reply-To: References: Message-ID: <4A670C38.7060704@linux.vnet.ibm.com> Thanks for the patch yogi... except for few comments the patch looks good... Yogananth Subramanian wrote: > # HG changeset patch > # User anantyog at linux.vnet.ibm.com > # Date 1248260644 25200 > # Node ID f50cabfd259e6f31cf01bf6e7a39bd4b8f03d1c8 > # Parent 69398bff34dec41bd773fd7d8be550109d41913f > [Test] Test adding multiple bridge type interface to domain > > This testcase verifies adding a bridge type interface using AddRS > > Signed-off-by: Yogananth Subramanian > > diff -r 69398bff34de -r f50cabfd259e suites/libvirt-cim/cimtest/VirtualSystemManagementService/22_addmulti_brg_interface.py > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/22_addmulti_brg_interface.py Wed Jul 22 04:04:04 2009 -0700 > @@ -0,0 +1,122 @@ > +#!/usr/bin/python > +# > +# Copyright 2009 IBM Corp. > +# > +# Authors: > +# Yogananth subramanian > +# > +# This library is free software; you can redistribute it and/or > +# modify it under the terms of the GNU General Public > +# License as published by the Free Software Foundation; either > +# version 2.1 of the License, or (at your option) any later version. > +# > +# This library is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +# General Public License for more details. > +# > +# You should have received a copy of the GNU General Public > +# License along with this library; if not, write to the Free Software > +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +# > +# The testcase verifies adding multiple bridge type interface to domain > +# > +import sys > +from XenKvmLib.enumclass import GetInstance, EnumNames > +from XenKvmLib.classes import get_typed_class, inst_to_mof > +from XenKvmLib.vxml import XenXML, KVMXML, get_class > +from CimTest.Globals import logger > +from XenKvmLib.const import do_main, get_provider_version, sles11_changeset > +from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC > +from XenKvmLib.common_util import create_netpool_conf,destroy_netpool > +from pywbem.cim_obj import CIMInstanceName > No need to import CIMInstanceName as it not used in the test. > +from XenKvmLib.vsms import get_vsms_class, get_nasd_class > +from XenKvmLib.vsms_util import add_net_res > + > +sup_types = ['Xen', 'KVM', 'XenFV'] > +test_dom = "my_domain1" > +default_net = "my_network0" > +test_net = "my_network1" > +test_mac = '99:aa:bb:cc:ee:ff' > +default_mac = "00:11:33:33:44:55" > +ntype = 'bridge' > +default_brg = 'mybr0' > +test_brg = 'mybr1' > +bug_libvirt = "00015" > + > +def cleanup_env(ip, virt, net_name, cxml): > + cxml.cim_destroy(ip) > + cxml.undefine(ip) > + destroy_netpool(ip, virt, net_name) > + > + at do_main(sup_types) > +def main(): > + options = main.options > + > + status, net_name = create_netpool_conf(options.ip, options.virt, > + net_name=default_net, > + bridge_name=default_brg) > + if status != PASS: > + logger.error('Unable to create network pool %s', > + default_net) > + return FAIL > + > + service = get_vsms_class(options.virt)(options.ip) > + classname = get_typed_class(options.virt, 'VirtualSystemSettingData') > + > + vsxml = get_class(options.virt)(test_dom, mac=default_mac, ntype=ntype, > + net_name=default_brg) > + try: > + ret = vsxml.cim_define(options.ip) > + if not ret: > + raise Exception("Failed to define the dom: %s" % default_dom) > + > + ret = vsxml.cim_start(options.ip) > + if ret: > + raise Exception("Failed to define the dom: %s" % default_dom) > + > + inst_id = '%s:%s' % (options.virt, test_dom) > + netpool = EnumNames(options.ip, classname) > + vssd_ref = None > + for i in range(0, len(netpool)): > + ret_pool = netpool[i].keybindings['InstanceID'] > + if ret_pool == inst_id: > + vssd_ref = netpool[i] > + break > + > + if vssd_ref == None: > + raise Exception("Failed to get vssd_ref for '%s'"% test_dom) > + > + status, net_name = create_netpool_conf(options.ip, options.virt, > + net_name=test_net, > + bridge_name=test_brg) > + if status != PASS: > + raise Exception('Unable to create network pool %s'% > + test_net) > + > + except Exception, details: > + logger.error(details) > + cleanup_env(options.ip, options.virt, default_net, vsxml) > + return FAIL > + > + nasd = get_nasd_class(options.virt)(type=ntype, mac=test_mac, > + name=test_dom, virt_net=test_brg) > + > + net_attr = { 'ntype' : ntype, > + 'net_name' : net_name, > + 'nmac' : test_mac, > + 'virt_net' : test_brg > + } > + > + status = add_net_res(options.ip, service, options.virt, vsxml, > + vssd_ref, nasd, net_attr) > + cleanup_env(options.ip, options.virt, default_net, vsxml) > + destroy_netpool(options.ip, options.virt, net_name=test_net) > + > + if status != PASS: > + return XFAIL_RC(bug_libvirt) > + else: > + return status > Include the add_net_res() and the rest of the statements in the above try..except block.. like below or something better you know of: try: ........ ........ nasd = get_nasd_class(options.virt)(type=ntype, mac=test_mac, name=test_dom, virt_net=test_brg) net_attr = { 'ntype' : ntype, 'net_name' : net_name, 'nmac' : test_mac, 'virt_net' : test_brg } status = add_net_res(options.ip, service, options.virt, vsxml, vssd_ref, nasd, net_attr) if status != PASS: status = XFAIL_RC(bug_libvirt) except Exception, details: logger.error(details) status = FAIL cleanup_env(options.ip, options.virt, default_net, vsxml) destroy_netpool(options.ip, options.virt, net_name=test_net) return status This will avoid redundant call to cleanup_env and return statements. > + > +if __name__ == "__main__": > + sys.exit(main()) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Jul 22 12:55:25 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 22 Jul 2009 18:25:25 +0530 Subject: [Libvirt-cim] [PATCH 2 of 2] [Test]This testcase verifies definig network interface with conflicting MAC In-Reply-To: References: Message-ID: <4A670C3D.5000908@linux.vnet.ibm.com> Yogananth Subramanian wrote: > # HG changeset patch > # User anantyog at linux.vnet.ibm.com > # Date 1248261117 25200 > # Node ID d475296d3dec59c3ed90898e43be2465b846f294 > # Parent f50cabfd259e6f31cf01bf6e7a39bd4b8f03d1c8 > [Test]This testcase verifies definig network interface with conflicting MAC > > This testcase tests 2 scenarios > 1)First case: Try to create 2 diff domains with 'network' type interface > with same mac > 2)Second case: Try to add a second 'network' type interface with same > mac as first interface to tht same domain. > > Signed-off-by: Yogananth Subramanian > > diff -r f50cabfd259e -r d475296d3dec suites/libvirt-cim/cimtest/VirtualSystemManagementService/23_verify_duplicate_mac_err.py > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/23_verify_duplicate_mac_err.py Wed Jul 22 04:11:57 2009 -0700 > @@ -0,0 +1,141 @@ > +#!/usr/bin/python > +# > +# Copyright 2009 IBM Corp. > +# > +# Authors: > +# Yogananth subramanian > +# > +# This library is free software; you can redistribute it and/or > +# modify it under the terms of the GNU General Public > +# License as published by the Free Software Foundation; either > +# version 2.1 of the License, or (at your option) any later version. > +# > +# This library is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +# General Public License for more details. > +# > +# You should have received a copy of the GNU General Public > +# License along with this library; if not, write to the Free Software > +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +# > +# This testcase verifies definig network interface with conflicting MAC > +# > + > +from sys import exit > +from random import randint > +from pywbem import CIM_ERR_FAILED > +from XenKvmLib.vsms_util import add_net_res > +from XenKvmLib.vsms import get_vsms_class, get_nasd_class > +from XenKvmLib.vxml import get_class > +from CimTest.Globals import logger > +from CimTest.ReturnCodes import FAIL, PASS > +from XenKvmLib.const import default_network_name, do_main > +from XenKvmLib.common_util import create_netpool_conf, destroy_netpool > +from XenKvmLib.classes import get_typed_class > +from XenKvmLib.enumclass import GetInstance, EnumNames > + > +sup_types = ['Xen', 'KVM', 'XenFV'] > +default_dom = 'net_domain1' > +test_dom = 'brgtest_domain2' > +nmac = '99:aa:bb:cc:ee:ff' > +ntype = 'network' > +npool_name = default_network_name + str(randint(1, 100)) > +exp_rc = CIM_ERR_FAILED > +exp_desc = "Conflicting MAC Addresses" > + > + > +def cleanup_env(ip, virt, npool_name, cxml): > + cxml.cim_destroy(ip) > + cxml.undefine(ip) > + destroy_netpool(ip, virt, npool_name) > + > +def start_dom(cxml,ip,dom): > + ret = cxml.cim_define(ip) > + if not ret: > + status = cxml.verify_error_msg(exp_rc, exp_desc) > + if status != PASS: > + raise Exception("Got unexpected rc code %s and description %s" > + % (cxml.err_rc, cxml.err_desc)) > + return FAIL > + ret = cxml.cim_start(ip) > + if ret: > + status = cxml.verify_error_msg(exp_rc, exp_desc) > + cxml.undefine(ip) > + if status != PASS: > + raise Exception("Got unexpected rc code %s and description %s" > + % (cxml.err_rc, cxml.err_desc)) > + return FAIL > Since you are raising an exception please include the above statements in the try.. except block.. Like that you can one return statement from the when the desired exception is received ... For ex something like below: def start_dom(cxml,ip,dom): try: ret = cxml.cim_define(ip) if not ret: status = cxml.verify_error_msg(exp_rc, exp_desc) if status != PASS: raise Exception("Got unexpected rc code %s and description %s" % (cxml.err_rc, cxml.err_desc)) return PASS ret = cxml.cim_start(ip) if ret: status = cxml.verify_error_msg(exp_rc, exp_desc) cxml.undefine(ip) if status != PASS: raise Exception("Got unexpected rc code %s and description %s" % (cxml.err_rc, cxml.err_desc)) return PASS except Exception, details: logger.error("Exception details: %s", details) return FAIL > + return PASS > + > + at do_main(sup_types) > +def main(): > + options = main.options > + > + status, net_name = create_netpool_conf(options.ip, options.virt, > + use_existing=False, > + net_name=npool_name) > + if status != PASS: > + logger.error('Unable to create network pool') > + return FAIL > + cxml = get_class(options.virt)(default_dom, mac=nmac, > + ntype=ntype, net_name=npool_name) > + try: > + start_dom(cxml, options.ip, default_dom) > Its better you capture the return value of start_dom() and return from the tc if status == FAIL.. > + > + except Exception, details: > + logger.error(details) > + destroy_netpool(options.ip, options.virt, net_name) > + return FAIL > + > + sxml = get_class(options.virt)(test_dom, mac=nmac, > + ntype=ntype, net_name=npool_name) > + try: > + status = start_dom(sxml, options.ip, test_dom) > + > + if status == PASS: > + sxml.cim_destroy(options.ip) > + sxml.undefine(options.ip) > + raise Exception("Was able to create two domains with" > + "Conflicting MAC Addresses") > + else: > + status = PASS > Its better to leave the status to FAIL .. so that we can assign the status = PASS only when the desired condition is met down in the test case. > + > + service = get_vsms_class(options.virt)(options.ip) > + classname = get_typed_class(options.virt, 'VirtualSystemSettingData') > + netpool = EnumNames(options.ip, classname) > + inst_id = '%s:%s' % (options.virt, default_dom) > + vssd_ref = None > + for i in range(0, len(netpool)): > + ret_pool = netpool[i].keybindings['InstanceID'] > + if ret_pool == inst_id: > + vssd_ref = netpool[i] > + break > + if vssd_ref == None: > + raise Exception("Failed to get vssd_ref for '%s'"% default_dom) > + > + nasd = get_nasd_class(options.virt)(type=ntype, mac=nmac, > + name=default_dom, > + virt_net=npool_name) > + net_attr = { 'ntype' : ntype, > + 'net_name' : npool_name, > + 'nmac' : nmac > + } > + > + ret = add_net_res(options.ip, service, options.virt, cxml, > + vssd_ref, nasd, net_attr) > + if ret == PASS: > + raise Exception("AddRS should NOT return OK with duplicat MAC") > + else: > + status = PASS > + > + except Exception, details: > + logger.error(details) > + status = FAIL > + > + cleanup_env(options.ip, options.virt, npool_name, cxml) > + return status > + > +if __name__ == "__main__": > + exit(main()) > + > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Jul 23 12:40:48 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 23 Jul 2009 05:40:48 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add new tc to verify block backed VM creation Message-ID: <341282e8f94f7dd9fc75.1248352848@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1248352829 25200 # Node ID 341282e8f94f7dd9fc758f0298b198ef2576e7b4 # Parent 28340a978f4e8f829d2d8998c04e0528436e1932 [TEST] Add new tc to verify block backed VM creation. Tested with current sources on F10 and KVM. Signed-off-by: Deepti B. Kalakeri diff -r 28340a978f4e -r 341282e8f94f suites/libvirt-cim/misc_cimtests/defineStart_blockbacked_VS.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/misc_cimtests/defineStart_blockbacked_VS.py Thu Jul 23 05:40:29 2009 -0700 @@ -0,0 +1,215 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Deepti B. kalakeri +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# This test case verifies that libvirt-cim providers is able to define and +# start a block backed VM. +# +# Usage: +# python defineStart_blockbacked_VS.py -i localhost +# -b /dev/sda6 -v KVM -N root/virt -u root -p -l -c +# +# Date: 23-07-2009 +# + +import sys +import os +from optparse import OptionParser +from commands import getstatusoutput +sys.path.append('../../../lib') +from CimTest import Globals +from CimTest.Globals import logger, log_param +from CimTest.ReturnCodes import PASS, FAIL +sys.path.append('../lib') +from XenKvmLib.vxml import get_class +from XenKvmLib.classes import get_typed_class +from XenKvmLib.xm_virt_util import active_domain_list +from XenKvmLib.const import default_network_name +from XenKvmLib.common_util import pre_check +from XenKvmLib.common_util import create_netpool_conf, destroy_netpool +from XenKvmLib.enumclass import EnumInstances + +TEST_LOG="cimtest.log" +test_dom = "disk_backed_dom" + +def env_setup(sysname, virt, clean, debug): + env_ready = pre_check(sysname, virt) + if env_ready != None: + print "\n%s. Please check your environment.\n" % env_ready + return FAIL + + if clean: + cmd = "rm -f %s" % (os.path.join(os.getcwd(), TEST_LOG)) + status, output = getstatusoutput(cmd) + + if debug: + dbg = "-d" + else: + dbg = "" + + return PASS + +def verify_inputs(options, parser): + try: + if options.ns == None: + raise Exception("Please specify the NameSpace") + + if options.username == None: + raise Exception("Please specify the Username") + + if options.password == None: + raise Exception("Please specify the Password") + + if options.vm_disk_image == None: + raise Exception("Please specify the diskimage for the VM") + + except Exception, details: + logger.error("Input Verification failed ...") + logger.error("\"%s\"\n", details) + print parser.print_help() + return FAIL + + return PASS + +def print_msg(msg1, field1, msg2, field2): + logger.info("%s '%s' %s '%s' ", msg1, field1, msg2, field2) + print msg1, "'", field1, "'", msg2, "'", field2, "'" + + +def verify_guest_address_value(virt, sysname, vm_disk_image): + rasd_list = [] + classname = get_typed_class(virt, "DiskResourceAllocationSettingData") + try: + rasd_list = EnumInstances(sysname, classname, ret_cim_inst=True) + if len(rasd_list) < 1: + raise Exception("%s returned %i instances, excepted at least 1."\ + % (classname, len(rasd_list))) + + for rasd in rasd_list: + # Verify the Address for the domain is set to vm_disk_image + if test_dom in rasd['InstanceID']: + if rasd['Address'] != "" and rasd['Address'] == vm_disk_image: + print_msg("Address field of", test_dom, + "is set to ", rasd['Address']) + return PASS + + except Exception, detail: + logger.error("Exception: %s", detail) + return FAIL + + print_msg("Address field of", test_dom, "is not set to", vm_disk_image) + return FAIL + +def main(): + usage = "usage: %prog [options] \nex: %prog -i localhost" + parser = OptionParser(usage) + + parser.add_option("-i", "--host-url", dest="h_url", default="localhost:5988", + help="URL of CIMOM to connect to (host:port)") + parser.add_option("-N", "--ns", dest="ns", default="root/virt", + help="Namespace (default is root/virt)") + parser.add_option("-u", "--user", dest="username", default=None, + help="Auth username for CIMOM on source system") + parser.add_option("-p", "--pass", dest="password", default=None, + help="Auth password for CIMOM on source system") + parser.add_option("-v", "--virt-type", dest="virt", default=None, + help="Virtualization type [ Xen | KVM ]") + parser.add_option("-c", "--clean-log", action="store_true", dest="clean", + help="Will remove existing log files before test run") + parser.add_option("-l", "--debug-output", action="store_true", + dest="debug", help="Duplicate the output to stderr") + parser.add_option("-b", "--vm-image", dest="vm_disk_image", default=None, + help="Specify the partition on which the vm" \ + " image is instantiated, Ex: /dev/sda6") + + print "\nPlease check cimtest.log in the curr dir for debug log msgs...\n" + + (options, args) = parser.parse_args() + + virt = options.virt + + if ":" in options.h_url: + (sysname, port) = options.h_url.split(":") + else: + sysname = options.h_url + + log_param(file_name=TEST_LOG) + + # Verify if the CIMOM is running, clean cimtest.log and + # Set Debug option if requested + status = env_setup(sysname, virt, options.clean, options.debug) + if status != PASS: + return status + + status = verify_inputs(options, parser) + if status != PASS: + return status + + os.environ['CIM_NS'] = Globals.CIM_NS = options.ns + os.environ['CIM_USER'] = Globals.CIM_USER = options.username + os.environ['CIM_PASS'] = Globals.CIM_PASS = options.password + + vm_disk_image = options.vm_disk_image + cxml = get_class(virt)(test_dom, disk_file_path=vm_disk_image) + status = FAIL + + try: + status, netpool = create_netpool_conf(sysname, virt, + net_name=default_network_name) + if status != PASS: + logger.error("\nUnable to create network pool %s", + default_network_name) + return status + + ret = cxml.cim_define(sysname) + if not ret: + raise Exception("Unable to define %s" % test_dom) + + status = cxml.cim_start(sysname) + if status != PASS: + cxml.undefine(sysname) + logger.error("Failed to Start the dom: %s", test_dom) + raise Exception("Property values for '%s' not properly set" \ + % test_dom) + + active_doms = active_domain_list(sysname, virt) + if test_dom in active_doms: + status = verify_guest_address_value(virt, sysname, vm_disk_image) + if status == PASS: + print_msg("Domain", test_dom, "successfully created on", + sysname) + else: + logger.error("'%s' not found on the '%s'", test_dom, sysname) + status = FAIL + + except Exception, detail: + logger.error("Exception: %s", detail) + destroy_netpool(sysname, virt, default_network_name) + return FAIL + + cxml.cim_destroy(sysname) + cxml.undefine(sysname) + destroy_netpool(sysname, virt, default_network_name) + + return status + +if __name__ == "__main__": + sys.exit(main()) + From deeptik at linux.vnet.ibm.com Thu Jul 23 12:44:32 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 23 Jul 2009 05:44:32 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add new tc to verify block backed VM creation Message-ID: <341282e8f94f7dd9fc75.1248353072@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1248352829 25200 # Node ID 341282e8f94f7dd9fc758f0298b198ef2576e7b4 # Parent 28340a978f4e8f829d2d8998c04e0528436e1932 [TEST] Add new tc to verify block backed VM creation. Tested with current sources on F10 and KVM. Signed-off-by: Deepti B. Kalakeri diff -r 28340a978f4e -r 341282e8f94f suites/libvirt-cim/misc_cimtests/defineStart_blockbacked_VS.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/misc_cimtests/defineStart_blockbacked_VS.py Thu Jul 23 05:40:29 2009 -0700 @@ -0,0 +1,215 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Deepti B. kalakeri +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# This test case verifies that libvirt-cim providers is able to define and +# start a block backed VM. +# +# Usage: +# python defineStart_blockbacked_VS.py -i localhost +# -b /dev/sda6 -v KVM -N root/virt -u root -p -l -c +# +# Date: 23-07-2009 +# + +import sys +import os +from optparse import OptionParser +from commands import getstatusoutput +sys.path.append('../../../lib') +from CimTest import Globals +from CimTest.Globals import logger, log_param +from CimTest.ReturnCodes import PASS, FAIL +sys.path.append('../lib') +from XenKvmLib.vxml import get_class +from XenKvmLib.classes import get_typed_class +from XenKvmLib.xm_virt_util import active_domain_list +from XenKvmLib.const import default_network_name +from XenKvmLib.common_util import pre_check +from XenKvmLib.common_util import create_netpool_conf, destroy_netpool +from XenKvmLib.enumclass import EnumInstances + +TEST_LOG="cimtest.log" +test_dom = "disk_backed_dom" + +def env_setup(sysname, virt, clean, debug): + env_ready = pre_check(sysname, virt) + if env_ready != None: + print "\n%s. Please check your environment.\n" % env_ready + return FAIL + + if clean: + cmd = "rm -f %s" % (os.path.join(os.getcwd(), TEST_LOG)) + status, output = getstatusoutput(cmd) + + if debug: + dbg = "-d" + else: + dbg = "" + + return PASS + +def verify_inputs(options, parser): + try: + if options.ns == None: + raise Exception("Please specify the NameSpace") + + if options.username == None: + raise Exception("Please specify the Username") + + if options.password == None: + raise Exception("Please specify the Password") + + if options.vm_disk_image == None: + raise Exception("Please specify the diskimage for the VM") + + except Exception, details: + logger.error("Input Verification failed ...") + logger.error("\"%s\"\n", details) + print parser.print_help() + return FAIL + + return PASS + +def print_msg(msg1, field1, msg2, field2): + logger.info("%s '%s' %s '%s' ", msg1, field1, msg2, field2) + print msg1, "'", field1, "'", msg2, "'", field2, "'" + + +def verify_guest_address_value(virt, sysname, vm_disk_image): + rasd_list = [] + classname = get_typed_class(virt, "DiskResourceAllocationSettingData") + try: + rasd_list = EnumInstances(sysname, classname, ret_cim_inst=True) + if len(rasd_list) < 1: + raise Exception("%s returned %i instances, excepted at least 1."\ + % (classname, len(rasd_list))) + + for rasd in rasd_list: + # Verify the Address for the domain is set to vm_disk_image + if test_dom in rasd['InstanceID']: + if rasd['Address'] != "" and rasd['Address'] == vm_disk_image: + print_msg("Address field of", test_dom, + "is set to ", rasd['Address']) + return PASS + + except Exception, detail: + logger.error("Exception: %s", detail) + return FAIL + + print_msg("Address field of", test_dom, "is not set to", vm_disk_image) + return FAIL + +def main(): + usage = "usage: %prog [options] \nex: %prog -i localhost" + parser = OptionParser(usage) + + parser.add_option("-i", "--host-url", dest="h_url", default="localhost:5988", + help="URL of CIMOM to connect to (host:port)") + parser.add_option("-N", "--ns", dest="ns", default="root/virt", + help="Namespace (default is root/virt)") + parser.add_option("-u", "--user", dest="username", default=None, + help="Auth username for CIMOM on source system") + parser.add_option("-p", "--pass", dest="password", default=None, + help="Auth password for CIMOM on source system") + parser.add_option("-v", "--virt-type", dest="virt", default=None, + help="Virtualization type [ Xen | KVM ]") + parser.add_option("-c", "--clean-log", action="store_true", dest="clean", + help="Will remove existing log files before test run") + parser.add_option("-l", "--debug-output", action="store_true", + dest="debug", help="Duplicate the output to stderr") + parser.add_option("-b", "--vm-image", dest="vm_disk_image", default=None, + help="Specify the partition on which the vm" \ + " image is instantiated, Ex: /dev/sda6") + + print "\nPlease check cimtest.log in the curr dir for debug log msgs...\n" + + (options, args) = parser.parse_args() + + virt = options.virt + + if ":" in options.h_url: + (sysname, port) = options.h_url.split(":") + else: + sysname = options.h_url + + log_param(file_name=TEST_LOG) + + # Verify if the CIMOM is running, clean cimtest.log and + # Set Debug option if requested + status = env_setup(sysname, virt, options.clean, options.debug) + if status != PASS: + return status + + status = verify_inputs(options, parser) + if status != PASS: + return status + + os.environ['CIM_NS'] = Globals.CIM_NS = options.ns + os.environ['CIM_USER'] = Globals.CIM_USER = options.username + os.environ['CIM_PASS'] = Globals.CIM_PASS = options.password + + vm_disk_image = options.vm_disk_image + cxml = get_class(virt)(test_dom, disk_file_path=vm_disk_image) + status = FAIL + + try: + status, netpool = create_netpool_conf(sysname, virt, + net_name=default_network_name) + if status != PASS: + logger.error("\nUnable to create network pool %s", + default_network_name) + return status + + ret = cxml.cim_define(sysname) + if not ret: + raise Exception("Unable to define %s" % test_dom) + + status = cxml.cim_start(sysname) + if status != PASS: + cxml.undefine(sysname) + logger.error("Failed to Start the dom: %s", test_dom) + raise Exception("Property values for '%s' not properly set" \ + % test_dom) + + active_doms = active_domain_list(sysname, virt) + if test_dom in active_doms: + status = verify_guest_address_value(virt, sysname, vm_disk_image) + if status == PASS: + print_msg("Domain", test_dom, "successfully created on", + sysname) + else: + logger.error("'%s' not found on the '%s'", test_dom, sysname) + status = FAIL + + except Exception, detail: + logger.error("Exception: %s", detail) + destroy_netpool(sysname, virt, default_network_name) + return FAIL + + cxml.cim_destroy(sysname) + cxml.undefine(sysname) + destroy_netpool(sysname, virt, default_network_name) + + return status + +if __name__ == "__main__": + sys.exit(main()) + From deeptik at linux.vnet.ibm.com Thu Jul 23 12:52:56 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 23 Jul 2009 18:22:56 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Add new tc to verify block backed VM creation In-Reply-To: <341282e8f94f7dd9fc75.1248353072@elm3a148.beaverton.ibm.com> References: <341282e8f94f7dd9fc75.1248353072@elm3a148.beaverton.ibm.com> Message-ID: <4A685D28.8050003@linux.vnet.ibm.com> Please ignore this as this is the duplicate of the previous patch.. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From anantyog at linux.vnet.ibm.com Thu Jul 23 13:33:17 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Thu, 23 Jul 2009 06:33:17 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [Test](#2)Test adding multiple bridge type interface to domain In-Reply-To: References: Message-ID: <7e6a9842914dd6787e1e.1248355997@elm3b151.beaverton.ibm.com> # HG changeset patch # User anantyog at linux.vnet.ibm.com # Date 1248355154 25200 # Node ID 7e6a9842914dd6787e1eaf2376487276eaccb62a # Parent 28340a978f4e8f829d2d8998c04e0528436e1932 [Test](#2)Test adding multiple bridge type interface to domain Made the following changes, based on comments from Deepti Kalakeri, Moved add_net_res() into try-except block() and removed the redundant calls to cleanup_env Signed-off-by: Yogananth Subramanian diff -r 28340a978f4e -r 7e6a9842914d suites/libvirt-cim/cimtest/VirtualSystemManagementService/22_addmulti_brg_interface.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/22_addmulti_brg_interface.py Thu Jul 23 06:19:14 2009 -0700 @@ -0,0 +1,122 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Yogananth subramanian +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# The testcase verifies adding multiple bridge type interface to domain +# +import sys +from XenKvmLib.enumclass import GetInstance, EnumNames +from XenKvmLib.classes import get_typed_class, inst_to_mof +from XenKvmLib.vxml import XenXML, KVMXML, get_class +from CimTest.Globals import logger +from XenKvmLib.const import do_main, get_provider_version, sles11_changeset +from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from XenKvmLib.common_util import create_netpool_conf,destroy_netpool +from XenKvmLib.vsms import get_vsms_class, get_nasd_class +from XenKvmLib.vsms_util import add_net_res + +sup_types = ['Xen', 'KVM', 'XenFV'] +test_dom = "my_domain1" +default_net = "my_network0" +test_net = "my_network1" +test_mac = '99:aa:bb:cc:ee:ff' +default_mac = "00:11:33:33:44:55" +ntype = 'bridge' +default_brg = 'mybr0' +test_brg = 'mybr1' +bug_libvirt = "00015" + +def cleanup_env(ip, virt, net_name, cxml): + cxml.cim_destroy(ip) + cxml.undefine(ip) + destroy_netpool(ip, virt, net_name) + + at do_main(sup_types) +def main(): + options = main.options + + status, net_name = create_netpool_conf(options.ip, options.virt, + net_name=default_net, + bridge_name=default_brg) + if status != PASS: + logger.error('Unable to create network pool %s', + default_net) + return FAIL + + service = get_vsms_class(options.virt)(options.ip) + classname = get_typed_class(options.virt, 'VirtualSystemSettingData') + + vsxml = get_class(options.virt)(test_dom, mac=default_mac, ntype=ntype, + net_name=default_brg) + try: + ret = vsxml.cim_define(options.ip) + if not ret: + raise Exception("Failed to define the dom: %s" % default_dom) + + ret = vsxml.cim_start(options.ip) + if ret: + raise Exception("Failed to define the dom: %s" % default_dom) + + inst_id = '%s:%s' % (options.virt, test_dom) + netpool = EnumNames(options.ip, classname) + vssd_ref = None + for i in range(0, len(netpool)): + ret_pool = netpool[i].keybindings['InstanceID'] + if ret_pool == inst_id: + vssd_ref = netpool[i] + break + + if vssd_ref == None: + raise Exception("Failed to get vssd_ref for '%s'"% test_dom) + + status, net_name = create_netpool_conf(options.ip, options.virt, + net_name=test_net, + bridge_name=test_brg) + if status != PASS: + raise Exception('Unable to create network pool %s'% + test_net) + + nasd = get_nasd_class(options.virt)(type=ntype, mac=test_mac, + name=test_dom, virt_net=test_brg) + + net_attr = { 'ntype' : ntype, + 'net_name' : net_name, + 'nmac' : test_mac, + 'virt_net' : test_brg + } + + status = add_net_res(options.ip, service, options.virt, vsxml, + vssd_ref, nasd, net_attr) + destroy_netpool(options.ip, options.virt, net_name=test_net) + + if status != PASS: + status = XFAIL_RC(bug_libvirt) + + destroy_netpool(options.ip, options.virt, net_name=test_net) + + except Exception, details: + logger.error(details) + status = FAIL + + cleanup_env(options.ip, options.virt, default_net, vsxml) + return status + +if __name__ == "__main__": + sys.exit(main()) From anantyog at linux.vnet.ibm.com Thu Jul 23 13:33:18 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Thu, 23 Jul 2009 06:33:18 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [Test](#2)This testcase verifies definig network interface with conflicting MAC In-Reply-To: References: Message-ID: <29dde4edcc7649096a97.1248355998@elm3b151.beaverton.ibm.com> # HG changeset patch # User anantyog at linux.vnet.ibm.com # Date 1248355754 25200 # Node ID 29dde4edcc7649096a97cd9472d04209abc6334d # Parent 7e6a9842914dd6787e1eaf2376487276eaccb62a [Test](#2)This testcase verifies definig network interface with conflicting MAC Made some minor changes based on comments from Deepti Kalakeri. Since stat_dom funtion is called from within a try-except block, have not made any changes to it. Signed-off-by: Yogananth Subramanian diff -r 7e6a9842914d -r 29dde4edcc76 suites/libvirt-cim/cimtest/VirtualSystemManagementService/23_verify_duplicate_mac_err.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/23_verify_duplicate_mac_err.py Thu Jul 23 06:29:14 2009 -0700 @@ -0,0 +1,143 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Yogananth subramanian +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# This testcase verifies definig network interface with conflicting MAC +# + +from sys import exit +from random import randint +from pywbem import CIM_ERR_FAILED +from XenKvmLib.vsms_util import add_net_res +from XenKvmLib.vsms import get_vsms_class, get_nasd_class +from XenKvmLib.vxml import get_class +from CimTest.Globals import logger +from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib.const import default_network_name, do_main +from XenKvmLib.common_util import create_netpool_conf, destroy_netpool +from XenKvmLib.classes import get_typed_class +from XenKvmLib.enumclass import GetInstance, EnumNames + +sup_types = ['Xen', 'KVM', 'XenFV'] +default_dom = 'net_domain1' +test_dom = 'brgtest_domain2' +nmac = '99:aa:bb:cc:ee:ff' +ntype = 'network' +npool_name = default_network_name + str(randint(1, 100)) +exp_rc = CIM_ERR_FAILED +exp_desc = "Conflicting MAC Addresses" + + +def cleanup_env(ip, virt, npool_name, cxml): + cxml.cim_destroy(ip) + cxml.undefine(ip) + destroy_netpool(ip, virt, npool_name) + +def start_dom(cxml,ip,dom): + ret = cxml.cim_define(ip) + if not ret: + status = cxml.verify_error_msg(exp_rc, exp_desc) + if status != PASS: + raise Exception("Got unexpected rc code %s and description %s" + % (cxml.err_rc, cxml.err_desc)) + return FAIL + ret = cxml.cim_start(ip) + if ret: + status = cxml.verify_error_msg(exp_rc, exp_desc) + cxml.undefine(ip) + if status != PASS: + raise Exception("Got unexpected rc code %s and description %s" + % (cxml.err_rc, cxml.err_desc)) + return FAIL + return PASS + + at do_main(sup_types) +def main(): + options = main.options + + status, net_name = create_netpool_conf(options.ip, options.virt, + use_existing=False, + net_name=npool_name) + if status != PASS: + logger.error('Unable to create network pool') + return FAIL + cxml = get_class(options.virt)(default_dom, mac=nmac, + ntype=ntype, net_name=npool_name) + try: + status = start_dom(cxml, options.ip, default_dom) + if status == FAIL: + raise Exception("Starting %s domain failed, got unexpeceted rc" + "code %s and description %s" % (default_dom, + cxml.err_rc, cxml.err_desc)) + + except Exception, details: + logger.error(details) + destroy_netpool(options.ip, options.virt, net_name) + return FAIL + + sxml = get_class(options.virt)(test_dom, mac=nmac, + ntype=ntype, net_name=npool_name) + try: + status = start_dom(sxml, options.ip, test_dom) + + if status == PASS: + sxml.cim_destroy(options.ip) + sxml.undefine(options.ip) + raise Exception("Was able to create two domains with" + "Conflicting MAC Addresses") + + service = get_vsms_class(options.virt)(options.ip) + classname = get_typed_class(options.virt, 'VirtualSystemSettingData') + netpool = EnumNames(options.ip, classname) + inst_id = '%s:%s' % (options.virt, default_dom) + vssd_ref = None + for i in range(0, len(netpool)): + ret_pool = netpool[i].keybindings['InstanceID'] + if ret_pool == inst_id: + vssd_ref = netpool[i] + break + if vssd_ref == None: + raise Exception("Failed to get vssd_ref for '%s'"% default_dom) + + nasd = get_nasd_class(options.virt)(type=ntype, mac=nmac, + name=default_dom, + virt_net=npool_name) + net_attr = { 'ntype' : ntype, + 'net_name' : npool_name, + 'nmac' : nmac + } + + ret = add_net_res(options.ip, service, options.virt, cxml, + vssd_ref, nasd, net_attr) + if ret == PASS: + raise Exception("AddRS should NOT return OK with duplicat MAC") + else: + status = PASS + + except Exception, details: + logger.error(details) + status = FAIL + + cleanup_env(options.ip, options.virt, npool_name, cxml) + return status + +if __name__ == "__main__": + exit(main()) + From anantyog at linux.vnet.ibm.com Thu Jul 23 13:33:16 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Thu, 23 Jul 2009 06:33:16 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [Test](#2)Tests to verify multiple bridge interface and duplicate mac Message-ID: Hello everyone, I like to resubmit the patches based on the reviews of the previous submission Thx yogi From rmaciel at linux.vnet.ibm.com Thu Jul 23 19:38:51 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 23 Jul 2009 16:38:51 -0300 Subject: [Libvirt-cim] [PATCH 0 of 4] Add support for new storage volume template RASDS In-Reply-To: References: Message-ID: <4A68BC4B.1050303@linux.vnet.ibm.com> +1 Kaitlin Rupert wrote: > There's not too much that can be done with the template RASD until support > for the image creation methods are in place. > > For now, the new storage volume template RASDs can be viewed by following SDC: > > wbemcli ai -ac KVM_SettingsDefineCapabilities 'http://localhost/root/virt:KVM_AllocationCapabilities.InstanceID="DiskPool/data"' -nl > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Mon Jul 27 13:55:12 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 27 Jul 2009 06:55:12 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Added scsi pool support Message-ID: <78496dff7dce6045c687.1248702912@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1248702884 25200 # Node ID 78496dff7dce6045c687d66bd60a066dcf78aca7 # Parent ad67e5d20ee2a268c8f2016004c35bbb890ae94c [TEST] Added scsi pool support Tested with current sources on F10 and KVM. Signed-off-by: Deepti B. Kalakeri diff -r ad67e5d20ee2 -r 78496dff7dce suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py --- a/suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py Thu Jul 23 06:29:14 2009 -0700 +++ b/suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py Mon Jul 27 06:54:44 2009 -0700 @@ -36,9 +36,15 @@ # python create_verify_storagepool.py -t logical -d /dev/VolGroup01 # -n VolGroup01 -v Xen -u -p # +# For scsi pool type with HBA's: +# ------------------------------ +# python create_verify_storagepool.py -t scsi -v KVM -u -p +# -n myscsi_pool -a host2 +# # Where t can be : # 2 - FileSystem -# 4 - Logical etc +# 6 - Logical +# 7 - scsi # # # Date : 27.06.2009 @@ -63,16 +69,15 @@ TEST_LOG="cimtest.log" libvirt_cim_fs_changes = 857 libvirt_cim_logical_changes = 906 +libvirt_cim_scsi_changes = 921 supp_types = [ 'Xen', 'KVM' , 'LXC' ] -pool_types = { 'DISK_POOL_FS' : 2 , 'DISK_POOL_LOGICAL' : 6 } +pool_types = { 'DISK_POOL_FS' : 2 , 'DISK_POOL_LOGICAL' : 6 , + 'DISK_POOL_SCSI' : 7 } def verify_cmd_options(options, parser): try: - if options.part_dev == None: - raise Exception("Free Partition to be mounted not specified") - if options.pool_name == None: raise Exception("Must specify the Pool Name to be created") @@ -82,9 +87,15 @@ if options.pool_type == None: raise Exception("Must specify pool type to be tested") - if options.mnt_pt == None and options.pool_type != 'logical': + if options.part_dev == None and options.pool_type != 'scsi': + raise Exception("Free Partition to be mounted not specified") + + if options.mnt_pt == None and options.pool_type == 'fs': raise Exception("Mount points to be used not specified") + if options.adap_name == None and options.pool_type == 'scsi': + raise Exception("Adapter name used not specified") + except Exception, details: print "\nFATAL: ", details , "\n" print parser.print_help() @@ -114,15 +125,24 @@ pool_type = pool_types['DISK_POOL_FS'] elif pooltype == "logical": pool_type = pool_types['DISK_POOL_LOGICAL'] + elif pooltype == "scsi": + pool_type = pool_types['DISK_POOL_SCSI'] else: logger.error("Invalid pool type ....") return None, None return PASS, pool_type -def verify_inputs(part_dev, mount_pt, pool_type, pool_name): +def verify_inputs(part_dev, mount_pt, pool_type, pool_name, adap_name): del_dir = False + if pool_type == pool_types['DISK_POOL_SCSI']: + hba_path = "/sys/class/scsi_host/" + adap_path = "%s%s" % (hba_path, adap_name) + if not os.path.exists(adap_path): + logger.error("HBA '%s' does not exist on the machine, specify "\ + "one present in '%s' path", adap_path, hba_path) + return FAIL, del_dir - if pool_type == pool_types['DISK_POOL_LOGICAL']: + elif pool_type == pool_types['DISK_POOL_LOGICAL']: if not os.path.exists("/sbin/lvm"): logger.error("LVM support does not exist on the machine") return FAIL, del_dir @@ -142,47 +162,48 @@ return FAIL, del_dir return PASS, del_dir + elif pool_type == pool_types['DISK_POOL_FS']: + cmd = "mount" + status, mount_info = getstatusoutput(cmd) + if status != PASS: + logger.error("Failed to get mount info.. ") + return FAIL, del_dir + + for line in mount_info.split('\n'): + try: + # Check if the specified partition is mounted before using it + part_name = line.split()[0] + if part_dev == part_name: + logger.error("[%s] already mounted", part_dev) + raise Exception("Please specify free partition other than "\ + "[%s]" % part_dev) - cmd = "mount" - status, mount_info = getstatusoutput(cmd) - if status != PASS: - logger.error("Failed to get mount info.. ") - return FAIL, del_dir - - for line in mount_info.split('\n'): - try: - # Check if the specified partition is mounted before using it - part_name = line.split()[0] - if part_dev == part_name: - logger.error("[%s] already mounted", part_dev) - raise Exception("Please specify free partition other than " \ - "[%s]" % part_dev) + # Check if mount point is already used for mounting + mount_name = line.split()[2] + if mount_pt == mount_name: + logger.error("[%s] already mounted", mount_pt) + raise Exception("Please specify dir other than [%s]" \ + % mount_pt) - # Check if mount point is already used for mounting - mount_name = line.split()[2] - if mount_pt == mount_name: - logger.error("[%s] already mounted", mount_pt) - raise Exception("Please specify dir other than [%s]" %mount_pt) + except Exception, details: + logger.error("%s", details) + return FAIL, del_dir - except Exception, details: - logger.error("%s", details) - return FAIL, del_dir + # Check if the mount point specified already exist, if not then create it.. + if not os.path.exists(mount_pt): + os.mkdir(mount_pt) - # Check if the mount point specified already exist, if not then create it.. - if not os.path.exists(mount_pt): - os.mkdir(mount_pt) + # set del_dir to True so that we remove it before exiting from the tc. + del_dir = True + else: + # Check if the mount point specified is a dir + if not os.path.isdir(mount_pt): + logger.error("The mount point [%s] should be a dir", mount_pt) + return FAIL, del_dir - # set del_dir to True so that we remove it before exiting from the tc. - del_dir = True - else: - # Check if the mount point specified is a dir - if not os.path.isdir(mount_pt): - logger.error("The mount point [%s] should be a dir", mount_pt) - return FAIL, del_dir - - files = os.listdir(mount_pt) - if len(files) != 0: - logger.info("The mount point [%s] given is not empty", mount_pt) + files = os.listdir(mount_pt) + if len(files) != 0: + logger.info("The mount point [%s] given is not empty", mount_pt) return PASS, del_dir @@ -195,7 +216,8 @@ vuri = 'lxc:///system' return vuri -def get_pool_settings(dp_rasds, pooltype, part_dev, mount_pt, pool_name): +def get_pool_settings(dp_rasds, pooltype, part_dev, mount_pt, + pool_name, adap_name): pool_settings = None for dpool_rasd in dp_rasds: if dpool_rasd['Type'] == pooltype and \ @@ -207,6 +229,9 @@ dpool_rasd['DevicePaths'] = [part_dev] elif pooltype == pool_types['DISK_POOL_LOGICAL']: dpool_rasd['Path'] = part_dev + if pooltype == pool_types['DISK_POOL_SCSI']: + dpool_rasd['AdapterName'] = adap_name + dpool_rasd['Path'] = "/dev/disk/by-id" break if not pool_name in dpool_rasd['InstanceID']: @@ -270,7 +295,7 @@ parser.add_option("-v", "--virt-type", dest="virt", default=None, help="Virtualization type [ Xen | KVM ]") parser.add_option("-t", "--pool-type", dest="pool_type", default=None, - help="Pool type:[ fs | logical ]") + help="Pool type:[ fs | logical | scsi ]") parser.add_option("-d", "--part-dev", dest="part_dev", default=None, help="specify the free partition to be used for " \ "fs pool type or the predefined Vol Group" \ @@ -279,6 +304,9 @@ help="Mount point to be used") parser.add_option("-n", "--pool-name", dest="pool_name", default=None, help="Pool to be created") + parser.add_option("-a", "--adap_name", dest="adap_name", default=None, + help="Adap name to be used Ex: specify one of the host" \ + "in /sys/class/scsi_host/ like host0") parser.add_option("-c", "--clean-log", action="store_true", dest="clean", help="Will remove existing log files before test run") parser.add_option("-l", "--debug-output", action="store_true", dest="debug", @@ -294,6 +322,7 @@ part_dev = options.part_dev mount_pt = options.mnt_pt pool_name = options.pool_name + adap_name = options.adap_name virt = options.virt if ":" in options.h_url: @@ -301,7 +330,7 @@ else: sysname = options.h_url - # Verify if the CIMOM is running, clean cimtest.log if requested + # Verify if the CIMOM is running, if requested clean cimtest.log. # Set Debug option if requested status = env_setup(sysname, virt, options.clean, options.debug) if status != PASS: @@ -322,20 +351,27 @@ curr_cim_rev, changeset = get_provider_version(virt, sysname) if curr_cim_rev < libvirt_cim_fs_changes and \ pooltype == pool_types['DISK_POOL_FS']: - logger.info("Test Skipped for %s pool type, Support for File System "\ - "Pool is available in revision %s", options.pool_type, + logger.info("Test Skipped for '%s' pool type, Support for File System " + "Pool is available in revision '%s'", options.pool_type, libvirt_cim_fs_changes) return SKIP elif curr_cim_rev < libvirt_cim_logical_changes and \ pooltype == pool_types['DISK_POOL_LOGICAL']: - logger.info("Test Skipped for %s pool type, Support for Logical Pool" \ - " is available in revision %s", options.pool_type, \ + logger.info("Test Skipped for '%s' pool type, Support for Logical Pool" + " is available in revision '%s'", options.pool_type, libvirt_cim_logical_changes) return SKIP + elif curr_cim_rev < libvirt_cim_scsi_changes and \ + pooltype == pool_types['DISK_POOL_SCSI']: + logger.info("Test Skipped for '%s' pool type, Support for scsi Pool" + " is available in revision '%s'", options.pool_type, + libvirt_cim_scsi_changes) + return SKIP pooltype = cim_types.Uint16(pooltype) - status, del_dir = verify_inputs(part_dev, mount_pt, pooltype, pool_name) + status, del_dir = verify_inputs(part_dev, mount_pt, pooltype, pool_name, + adap_name) if status != PASS: if del_dir == True: cmd ="rm -rf %s" % mount_pt @@ -370,7 +406,7 @@ # Get the DiskPoolRASD mof with appropriate values of diskpool # to be created.... pool_settings = get_pool_settings(dp_rasds, pooltype, part_dev, - mount_pt, pool_name) + mount_pt, pool_name, adap_name) if pool_settings == None: raise Exception("Did not get the required pool settings ...") From kaitlin at linux.vnet.ibm.com Mon Jul 27 22:59:56 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 27 Jul 2009 15:59:56 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Added scsi pool support In-Reply-To: <78496dff7dce6045c687.1248702912@elm3a148.beaverton.ibm.com> References: <78496dff7dce6045c687.1248702912@elm3a148.beaverton.ibm.com> Message-ID: <4A6E316C.2070009@linux.vnet.ibm.com> > + # Check if the mount point specified already exist, if not then create it.. This comment is longer than 80 characters. > + if not os.path.exists(mount_pt): > + os.mkdir(mount_pt) > > - # Check if the mount point specified already exist, if not then create it.. Same here. The verification of the fs pool params is rather long. If you want to save on indention, you could use a helper function here. > - if not os.path.exists(mount_pt): > - os.mkdir(mount_pt) > + # set del_dir to True so that we remove it before exiting from the tc. > + del_dir = True > + else: > + # Check if the mount point specified is a dir > + if not os.path.isdir(mount_pt): > + logger.error("The mount point [%s] should be a dir", mount_pt) > + return FAIL, del_dir > > - # set del_dir to True so that we remove it before exiting from the tc. > - del_dir = True > - else: > - # Check if the mount point specified is a dir > - if not os.path.isdir(mount_pt): > - logger.error("The mount point [%s] should be a dir", mount_pt) > - return FAIL, del_dir > - > - files = os.listdir(mount_pt) > - if len(files) != 0: > - logger.info("The mount point [%s] given is not empty", mount_pt) > + files = os.listdir(mount_pt) > + if len(files) != 0: > + logger.info("The mount point [%s] given is not empty", mount_pt) > > return PASS, del_dir > > @@ -195,7 +216,8 @@ > vuri = 'lxc:///system' > return vuri > > -def get_pool_settings(dp_rasds, pooltype, part_dev, mount_pt, pool_name): > +def get_pool_settings(dp_rasds, pooltype, part_dev, mount_pt, > + pool_name, adap_name): > pool_settings = None > for dpool_rasd in dp_rasds: > if dpool_rasd['Type'] == pooltype and \ > @@ -207,6 +229,9 @@ > dpool_rasd['DevicePaths'] = [part_dev] > elif pooltype == pool_types['DISK_POOL_LOGICAL']: > dpool_rasd['Path'] = part_dev > + if pooltype == pool_types['DISK_POOL_SCSI']: > + dpool_rasd['AdapterName'] = adap_name > + dpool_rasd['Path'] = "/dev/disk/by-id" > break I've got a selfish request here.. Can you add some spacing in the for loop part of this function? For some reason, it's hard for me to read. Just add a blank line before some of the if / elif statements. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Jul 28 20:20:31 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 28 Jul 2009 13:20:31 -0700 Subject: [Libvirt-cim] [PATCH] If the useer specifies a ReferencedConfiguration, be sure to generate a new Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1248812402 25200 # Node ID cd7e42dad453bf6b0269274dd43e354b89c1734d # Parent ba165481b932c372b13e0cf458e99f86bd843282 If the useer specifies a ReferencedConfiguration, be sure to generate a new... MAC address since MACs cannot collide. Signed-off-by: Kaitlin Rupert diff -r ba165481b932 -r cd7e42dad453 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Jul 20 13:27:37 2009 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Tue Jul 28 13:20:02 2009 -0700 @@ -1276,6 +1276,7 @@ virDomainPtr dom = NULL; char *name = NULL; const char *iid; + const char *mac; CMPIStatus s; int ret; @@ -1336,6 +1337,18 @@ (*domain)->name = NULL; free((*domain)->uuid); (*domain)->uuid = NULL; + free((*domain)->dev_net->dev.net.mac); + (*domain)->dev_net->dev.net.mac = NULL; + + mac = _net_rand_mac(); + if (mac == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_INVALID_PARAMETER, + "Unable to generate a MAC address for guest %s", + name); + goto out; + } + (*domain)->dev_net->dev.net.mac = strdup(mac); out: virDomainFree(dom); From deeptik at linux.vnet.ibm.com Wed Jul 29 07:03:04 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 29 Jul 2009 00:03:04 -0700 Subject: [Libvirt-cim] [PATCH] [TEST]#2 Added scsi pool support Message-ID: # HG changeset patch # User Deepti B.Kalakeri # Date 1248850965 25200 # Node ID f7cbecb195e3800513372d4466393538809923e3 # Parent ad67e5d20ee2a268c8f2016004c35bbb890ae94c [TEST]#2 Added scsi pool support Patch 2: -------- Indented few lines to be follow 80 column length Interchanged the if-elif order in verify_inputs() Tested with current sources on F10 and KVM. Signed-off-by: Deepti B. Kalakeri diff -r ad67e5d20ee2 -r f7cbecb195e3 suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py --- a/suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py Thu Jul 23 06:29:14 2009 -0700 +++ b/suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py Wed Jul 29 00:02:45 2009 -0700 @@ -36,9 +36,15 @@ # python create_verify_storagepool.py -t logical -d /dev/VolGroup01 # -n VolGroup01 -v Xen -u -p # +# For scsi pool type with HBA's: +# ------------------------------ +# python create_verify_storagepool.py -t scsi -v KVM -u -p +# -n myscsi_pool -a host2 +# # Where t can be : # 2 - FileSystem -# 4 - Logical etc +# 6 - Logical +# 7 - scsi # # # Date : 27.06.2009 @@ -63,16 +69,15 @@ TEST_LOG="cimtest.log" libvirt_cim_fs_changes = 857 libvirt_cim_logical_changes = 906 +libvirt_cim_scsi_changes = 921 supp_types = [ 'Xen', 'KVM' , 'LXC' ] -pool_types = { 'DISK_POOL_FS' : 2 , 'DISK_POOL_LOGICAL' : 6 } +pool_types = { 'DISK_POOL_FS' : 2 , 'DISK_POOL_LOGICAL' : 6 , + 'DISK_POOL_SCSI' : 7 } def verify_cmd_options(options, parser): try: - if options.part_dev == None: - raise Exception("Free Partition to be mounted not specified") - if options.pool_name == None: raise Exception("Must specify the Pool Name to be created") @@ -82,9 +87,15 @@ if options.pool_type == None: raise Exception("Must specify pool type to be tested") - if options.mnt_pt == None and options.pool_type != 'logical': + if options.part_dev == None and options.pool_type != 'scsi': + raise Exception("Free Partition to be mounted not specified") + + if options.mnt_pt == None and options.pool_type == 'fs': raise Exception("Mount points to be used not specified") + if options.adap_name == None and options.pool_type == 'scsi': + raise Exception("Adapter name used not specified") + except Exception, details: print "\nFATAL: ", details , "\n" print parser.print_help() @@ -110,19 +121,68 @@ return PASS def get_pooltype(pooltype, virt): + if pooltype == "fs": pool_type = pool_types['DISK_POOL_FS'] elif pooltype == "logical": pool_type = pool_types['DISK_POOL_LOGICAL'] + elif pooltype == "scsi": + pool_type = pool_types['DISK_POOL_SCSI'] else: logger.error("Invalid pool type ....") return None, None + return PASS, pool_type -def verify_inputs(part_dev, mount_pt, pool_type, pool_name): +def verify_inputs(part_dev, mount_pt, pool_type, pool_name, adap_name): + del_dir = False - if pool_type == pool_types['DISK_POOL_LOGICAL']: + if pool_type == pool_types['DISK_POOL_FS']: + cmd = "mount" + status, mount_info = getstatusoutput(cmd) + if status != PASS: + logger.error("Failed to get mount info.. ") + return FAIL, del_dir + + for line in mount_info.split('\n'): + try: + # Check if the specified partition is mounted before using it + part_name = line.split()[0] + if part_dev == part_name: + logger.error("[%s] already mounted", part_dev) + raise Exception("Please specify free partition other than "\ + "[%s]" % part_dev) + + # Check if mount point is already used for mounting + mount_name = line.split()[2] + if mount_pt == mount_name: + logger.error("[%s] already mounted", mount_pt) + raise Exception("Please specify dir other than [%s]" \ + % mount_pt) + + except Exception, details: + logger.error("%s", details) + return FAIL, del_dir + + # Check if the mount point specified already exist, if not create it.. + if not os.path.exists(mount_pt): + os.mkdir(mount_pt) + + # set del_dir=True so that we remove it before exiting from the tc. + del_dir = True + else: + # Check if the mount point specified is a dir + if not os.path.isdir(mount_pt): + logger.error("The mount point [%s] should be a dir", mount_pt) + return FAIL, del_dir + + files = os.listdir(mount_pt) + if len(files) != 0: + logger.info("The mount point [%s] given is not empty", + mount_pt) + + elif pool_type == pool_types['DISK_POOL_LOGICAL']: if not os.path.exists("/sbin/lvm"): logger.error("LVM support does not exist on the machine") return FAIL, del_dir @@ -143,46 +203,13 @@ return PASS, del_dir - cmd = "mount" - status, mount_info = getstatusoutput(cmd) - if status != PASS: - logger.error("Failed to get mount info.. ") - return FAIL, del_dir - - for line in mount_info.split('\n'): - try: - # Check if the specified partition is mounted before using it - part_name = line.split()[0] - if part_dev == part_name: - logger.error("[%s] already mounted", part_dev) - raise Exception("Please specify free partition other than " \ - "[%s]" % part_dev) - - # Check if mount point is already used for mounting - mount_name = line.split()[2] - if mount_pt == mount_name: - logger.error("[%s] already mounted", mount_pt) - raise Exception("Please specify dir other than [%s]" %mount_pt) - - except Exception, details: - logger.error("%s", details) - return FAIL, del_dir - - # Check if the mount point specified already exist, if not then create it.. - if not os.path.exists(mount_pt): - os.mkdir(mount_pt) - - # set del_dir to True so that we remove it before exiting from the tc. - del_dir = True - else: - # Check if the mount point specified is a dir - if not os.path.isdir(mount_pt): - logger.error("The mount point [%s] should be a dir", mount_pt) - return FAIL, del_dir - - files = os.listdir(mount_pt) - if len(files) != 0: - logger.info("The mount point [%s] given is not empty", mount_pt) + elif pool_type == pool_types['DISK_POOL_SCSI']: + hba_path = "/sys/class/scsi_host/" + adap_path = "%s%s" % (hba_path, adap_name) + if not os.path.exists(adap_path): + logger.error("HBA '%s' does not exist on the machine, specify "\ + "one present in '%s' path", adap_path, hba_path) + return FAIL, del_dir return PASS, del_dir @@ -195,18 +222,28 @@ vuri = 'lxc:///system' return vuri -def get_pool_settings(dp_rasds, pooltype, part_dev, mount_pt, pool_name): +def get_pool_settings(dp_rasds, pooltype, part_dev, mount_pt, + pool_name, adap_name): pool_settings = None + for dpool_rasd in dp_rasds: + if dpool_rasd['Type'] == pooltype and \ dpool_rasd['InstanceID'] == 'Default': + dp_pid = "%s/%s" % ("DiskPool", pool_name) dpool_rasd['PoolID'] = dpool_rasd['InstanceID'] = dp_pid + if pooltype == pool_types['DISK_POOL_FS']: dpool_rasd['Path'] = mount_pt dpool_rasd['DevicePaths'] = [part_dev] + elif pooltype == pool_types['DISK_POOL_LOGICAL']: dpool_rasd['Path'] = part_dev + + elif pooltype == pool_types['DISK_POOL_SCSI']: + dpool_rasd['AdapterName'] = adap_name + dpool_rasd['Path'] = "/dev/disk/by-id" break if not pool_name in dpool_rasd['InstanceID']: @@ -270,7 +307,7 @@ parser.add_option("-v", "--virt-type", dest="virt", default=None, help="Virtualization type [ Xen | KVM ]") parser.add_option("-t", "--pool-type", dest="pool_type", default=None, - help="Pool type:[ fs | logical ]") + help="Pool type:[ fs | logical | scsi ]") parser.add_option("-d", "--part-dev", dest="part_dev", default=None, help="specify the free partition to be used for " \ "fs pool type or the predefined Vol Group" \ @@ -279,6 +316,9 @@ help="Mount point to be used") parser.add_option("-n", "--pool-name", dest="pool_name", default=None, help="Pool to be created") + parser.add_option("-a", "--adap_name", dest="adap_name", default=None, + help="Adap name to be used Ex: specify one of the host" \ + "in /sys/class/scsi_host/ like host0") parser.add_option("-c", "--clean-log", action="store_true", dest="clean", help="Will remove existing log files before test run") parser.add_option("-l", "--debug-output", action="store_true", dest="debug", @@ -294,6 +334,7 @@ part_dev = options.part_dev mount_pt = options.mnt_pt pool_name = options.pool_name + adap_name = options.adap_name virt = options.virt if ":" in options.h_url: @@ -301,7 +342,7 @@ else: sysname = options.h_url - # Verify if the CIMOM is running, clean cimtest.log if requested + # Verify if the CIMOM is running, if requested clean cimtest.log. # Set Debug option if requested status = env_setup(sysname, virt, options.clean, options.debug) if status != PASS: @@ -322,20 +363,29 @@ curr_cim_rev, changeset = get_provider_version(virt, sysname) if curr_cim_rev < libvirt_cim_fs_changes and \ pooltype == pool_types['DISK_POOL_FS']: - logger.info("Test Skipped for %s pool type, Support for File System "\ - "Pool is available in revision %s", options.pool_type, + logger.info("Test Skipped for '%s' pool type, Support for File System " + "Pool is available in revision '%s'", options.pool_type, libvirt_cim_fs_changes) return SKIP + elif curr_cim_rev < libvirt_cim_logical_changes and \ pooltype == pool_types['DISK_POOL_LOGICAL']: - logger.info("Test Skipped for %s pool type, Support for Logical Pool" \ - " is available in revision %s", options.pool_type, \ + logger.info("Test Skipped for '%s' pool type, Support for Logical Pool" + " is available in revision '%s'", options.pool_type, libvirt_cim_logical_changes) return SKIP + + elif curr_cim_rev < libvirt_cim_scsi_changes and \ + pooltype == pool_types['DISK_POOL_SCSI']: + logger.info("Test Skipped for '%s' pool type, Support for scsi Pool" + " is available in revision '%s'", options.pool_type, + libvirt_cim_scsi_changes) + return SKIP pooltype = cim_types.Uint16(pooltype) - status, del_dir = verify_inputs(part_dev, mount_pt, pooltype, pool_name) + status, del_dir = verify_inputs(part_dev, mount_pt, pooltype, pool_name, + adap_name) if status != PASS: if del_dir == True: cmd ="rm -rf %s" % mount_pt @@ -370,7 +420,7 @@ # Get the DiskPoolRASD mof with appropriate values of diskpool # to be created.... pool_settings = get_pool_settings(dp_rasds, pooltype, part_dev, - mount_pt, pool_name) + mount_pt, pool_name, adap_name) if pool_settings == None: raise Exception("Did not get the required pool settings ...") From deeptik at linux.vnet.ibm.com Wed Jul 29 08:34:50 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 29 Jul 2009 01:34:50 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Added disk backked pool support Message-ID: <72508ebffdece413437b.1248856490@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1248856464 25200 # Node ID 72508ebffdece413437b820de84e0c69bc577405 # Parent f7cbecb195e3800513372d4466393538809923e3 [TEST] Added disk backked pool support Signed-off-by: Deepti B. Kalakeri diff -r f7cbecb195e3 -r 72508ebffdec suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py --- a/suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py Wed Jul 29 00:02:45 2009 -0700 +++ b/suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py Wed Jul 29 01:34:24 2009 -0700 @@ -28,7 +28,12 @@ # the following command: # For Fs pool type: # ---------------- -# python create_verify_storagepool.py -t fs -d /dev/sda4 -m /tmp/mnt -n diskfs +# python create_verify_storagepool.py -t fs -d /dev/sda4 -m /tmp/mnt -n fs_pool +# -v Xen -u -p +# +# For disk pool type: +# ------------------- +# python create_verify_storagepool.py -t fs -d /dev/sda -m /tmp/ -n disk_pool # -v Xen -u -p # # For logical pool type: @@ -39,11 +44,12 @@ # For scsi pool type with HBA's: # ------------------------------ # python create_verify_storagepool.py -t scsi -v KVM -u -p -# -n myscsi_pool -a host2 +# -n scsi_pool -a host2 # # Where t can be : -# 2 - FileSystem -# 6 - Logical +# 2 - fs [ FileSystem ] +# 4 - disk [ Disk ] +# 6 - logical [ Logical ] # 7 - scsi # # @@ -68,13 +74,14 @@ TEST_LOG="cimtest.log" libvirt_cim_fs_changes = 857 +libvirt_cim_disk_changes = 872 libvirt_cim_logical_changes = 906 libvirt_cim_scsi_changes = 921 supp_types = [ 'Xen', 'KVM' , 'LXC' ] -pool_types = { 'DISK_POOL_FS' : 2 , 'DISK_POOL_LOGICAL' : 6 , - 'DISK_POOL_SCSI' : 7 } +pool_types = { 'DISK_POOL_FS' : 2 , 'DISK_POOL_DISK' : 4, + 'DISK_POOL_LOGICAL' : 6 , 'DISK_POOL_SCSI' : 7 } def verify_cmd_options(options, parser): try: @@ -88,9 +95,10 @@ raise Exception("Must specify pool type to be tested") if options.part_dev == None and options.pool_type != 'scsi': - raise Exception("Free Partition to be mounted not specified") + raise Exception("Free Partition/disk to be mounted not specified") - if options.mnt_pt == None and options.pool_type == 'fs': + if options.mnt_pt == None and (options.pool_type == 'fs' or \ + options.pool_type == 'disk'): raise Exception("Mount points to be used not specified") if options.adap_name == None and options.pool_type == 'scsi': @@ -124,6 +132,8 @@ if pooltype == "fs": pool_type = pool_types['DISK_POOL_FS'] + elif pooltype == "disk": + pool_type = pool_types['DISK_POOL_DISK'] elif pooltype == "logical": pool_type = pool_types['DISK_POOL_LOGICAL'] elif pooltype == "scsi": @@ -151,8 +161,8 @@ part_name = line.split()[0] if part_dev == part_name: logger.error("[%s] already mounted", part_dev) - raise Exception("Please specify free partition other than "\ - "[%s]" % part_dev) + raise Exception("Please specify free partition/disk other " + "than [%s]" % part_dev) # Check if mount point is already used for mounting mount_name = line.split()[2] @@ -234,9 +244,10 @@ dp_pid = "%s/%s" % ("DiskPool", pool_name) dpool_rasd['PoolID'] = dpool_rasd['InstanceID'] = dp_pid - if pooltype == pool_types['DISK_POOL_FS']: + if pooltype == pool_types['DISK_POOL_FS'] or \ + pooltype == pool_types['DISK_POOL_DISK']: + dpool_rasd['DevicePaths'] = [part_dev] dpool_rasd['Path'] = mount_pt - dpool_rasd['DevicePaths'] = [part_dev] elif pooltype == pool_types['DISK_POOL_LOGICAL']: dpool_rasd['Path'] = part_dev @@ -307,11 +318,12 @@ parser.add_option("-v", "--virt-type", dest="virt", default=None, help="Virtualization type [ Xen | KVM ]") parser.add_option("-t", "--pool-type", dest="pool_type", default=None, - help="Pool type:[ fs | logical | scsi ]") + help="Pool type:[ fs | logical | scsi | disk ]") parser.add_option("-d", "--part-dev", dest="part_dev", default=None, help="specify the free partition to be used for " \ "fs pool type or the predefined Vol Group" \ - " for logical pool type") + " for logical pool type or empty disk like" \ + " /dev/sda for disk type pools") parser.add_option("-m", "--mnt_pt", dest="mnt_pt", default=None, help="Mount point to be used") parser.add_option("-n", "--pool-name", dest="pool_name", default=None, @@ -368,6 +380,13 @@ libvirt_cim_fs_changes) return SKIP + elif curr_cim_rev < libvirt_cim_disk_changes and \ + pooltype == pool_types['DISK_POOL_DISK']: + logger.info("Test Skipped for '%s' pool type, Support for disk Pool" + " is available in revision '%s'", options.pool_type, + libvirt_cim_disk_changes) + return SKIP + elif curr_cim_rev < libvirt_cim_logical_changes and \ pooltype == pool_types['DISK_POOL_LOGICAL']: logger.info("Test Skipped for '%s' pool type, Support for Logical Pool" From deeptik at linux.vnet.ibm.com Wed Jul 29 09:46:09 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 29 Jul 2009 15:16:09 +0530 Subject: [Libvirt-cim] Test Run Summary (Jul 27 2009): KVM on SUSE Linux Enterprise Server 11 (i586) with sfcb Message-ID: <4A701A61.8010407@linux.vnet.ibm.com> ================================================= Test Run Summary (Jul 27 2009): KVM on SUSE Linux Enterprise Server 11 (i586) with sfcb ================================================= Distro: SUSE Linux Enterprise Server 11 (i586) Kernel: 2.6.27.19-5-pae libvirt: 0.4.6 Hypervisor: QEMU 0.9.1 CIMOM: sfcb sfcbd 1.3.2 Libvirt-cim revision: 934 Libvirt-cim changeset: ba165481b932+ Cimtest revision: 739 Cimtest changeset: ad67e5d20ee2 ================================================= FAIL : 4 XFAIL : 5 SKIP : 10 PASS : 146 ----------------- Total : 165 ================================================= FAIL Test Summary: ComputerSystemIndication - 01_created_indication.py: FAIL HostSystem - 03_hs_to_settdefcap.py: FAIL SettingsDefineCapabilities - 01_forward.py: FAIL VirtualSystemManagementService - 13_refconfig_additional_devs.py: FAIL ================================================= XFAIL Test Summary: ComputerSystem - 32_start_reboot.py: XFAIL ComputerSystem - 33_suspend_reboot.py: XFAIL VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL VirtualSystemManagementService - 16_removeresource.py: XFAIL VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ================================================= SKIP Test Summary: ComputerSystem - 02_nosystems.py: SKIP ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP LogicalDisk - 02_nodevs.py: SKIP VSSD - 02_bootldr.py: SKIP VirtualSystemMigrationService - 01_migratable_host.py: SKIP VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP ================================================= 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: PASS -------------------------------------------------------------------- ComputerSystem - 05_activate_defined_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 06_paused_active_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 22_define_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 23_pause_pause.py: PASS -------------------------------------------------------------------- ComputerSystem - 27_define_pause_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 32_start_reboot.py: XFAIL ERROR - Got CIM error Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot with return code 1 ERROR - Exception: Unable reboot dom 'cs_test_domain' InvokeMethod(RequestStateChange): Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot Bug:<00005> -------------------------------------------------------------------- ComputerSystem - 33_suspend_reboot.py: XFAIL ERROR - Got CIM error State not supported with return code 7 ERROR - Exception: Unable Suspend dom 'test_domain' InvokeMethod(RequestStateChange): State not supported Bug:<00012> -------------------------------------------------------------------- ComputerSystem - 35_start_reset.py: PASS -------------------------------------------------------------------- ComputerSystem - 40_RSC_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 41_cs_to_settingdefinestate.py: PASS -------------------------------------------------------------------- ComputerSystem - 42_cs_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for define indication ERROR - Waited too long for start indication ERROR - Waited too long for destroy indication -------------------------------------------------------------------- ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP -------------------------------------------------------------------- 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: FAIL ERROR - KVM_SettingsDefineCapabilities returned 52 RASD objects instead of 48 for DiskPool/cimtest-diskpool Class not found -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: PASS -------------------------------------------------------------------- HostSystem - 05_hs_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 06_hs_to_vsms.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 01_forward.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 02_reverse.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 -------------------------------------------------------------------- KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS -------------------------------------------------------------------- LogicalDisk - 01_disk.py: PASS -------------------------------------------------------------------- LogicalDisk - 02_nodevs.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- 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: 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 -------------------------------------------------------------------- RASD - 04_disk_rasd_size.py: PASS -------------------------------------------------------------------- RASD - 05_disk_rasd_emu_type.py: PASS -------------------------------------------------------------------- RASD - 06_parent_net_pool.py: PASS -------------------------------------------------------------------- RASD - 07_parent_disk_pool.py: PASS -------------------------------------------------------------------- RedirectionService - 01_enum_crs.py: PASS -------------------------------------------------------------------- RedirectionService - 02_enum_crscap.py: PASS -------------------------------------------------------------------- RedirectionService - 03_RedirectionSAP_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 -------------------------------------------------------------------- ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 09_DeleteDiskPool.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 02_reverse.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefine - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 03_sds_fwd_errs.py: PASS -------------------------------------------------------------------- SettingsDefine - 04_sds_rev_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 01_forward.py: FAIL ERROR - KVM_SettingsDefineCapabilities returned 48 ResourcePool objects instead of 44 -------------------------------------------------------------------- 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: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL -------------------------------------------------------------------- VirtualSystemManagementService - 10_hv_version.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 12_referenced_config.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 13_refconfig_additional_devs.py: FAIL ERROR - Got CIM error ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Unable define domain rstest_domain2 ERROR - Unable to define rstest_domain2 InvokeMethod(DefineSystem): ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemManagementService - 14_define_sys_disk.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 15_mod_system_settings.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 16_removeresource.py: XFAIL ERROR - 0 RASD insts for domain/mouse:ps2 No such instance (no device domain/mouse:ps2) Bug:<00014> -------------------------------------------------------------------- VirtualSystemManagementService - 17_removeresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 18_define_sys_bridge.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 19_definenetwork_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 20_verify_vnc_password.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 21_createVS_verifyMAC.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ERROR - Error invoking AddRS: add_net_res ERROR - (1, u'Unable to change (0) device: Error 0') ERROR - Failed to destroy Virtual Network 'my_network1' InvokeMethod(AddResourceSettings): Unable to change (0) device: Error 0 Bug:<00015> -------------------------------------------------------------------- VirtualSystemManagementService - 23_verify_duplicate_mac_err.py: PASS -------------------------------------------------------------------- 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 -------------------------------------------------------------------- VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP -------------------------------------------------------------------- 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 -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS -------------------------------------------------------------------- -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Jul 29 11:07:15 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 29 Jul 2009 04:07:15 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing VSMS/13_refconfig_additional_devs.py tc Message-ID: <6574dbb104ed097c8750.1248865635@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1248865627 25200 # Node ID 6574dbb104ed097c8750a1826bb7c287965aaf16 # Parent 78496dff7dce6045c687d66bd60a066dcf78aca7 [TEST] Fixing VSMS/13_refconfig_additional_devs.py tc Tested with KVM on F10 and sles11. Signed-off-by: Deepti B. Kalakeri diff -r 78496dff7dce -r 6574dbb104ed suites/libvirt-cim/cimtest/VirtualSystemManagementService/13_refconfig_additional_devs.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/13_refconfig_additional_devs.py Mon Jul 27 06:54:44 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/13_refconfig_additional_devs.py Wed Jul 29 04:07:07 2009 -0700 @@ -37,6 +37,8 @@ sup_types = ['Xen', 'XenFV', 'KVM'] test_dom = 'rstest_domain' test_dom2 = 'rstest_domain2' +mac1 = '99:aa:bb:cc:ee:ff' +mac2 = '99:aa:bb:cc:ee:aa' REQUESTED_STATE = 2 TIME = "00000000000000.000000:000" @@ -117,8 +119,8 @@ options = main.options virt_xml = get_class(options.virt) - cxml = virt_xml(test_dom) - cxml2 = virt_xml(test_dom2) + cxml = virt_xml(test_dom, mac=mac1) + cxml2 = virt_xml(test_dom2, mac=mac2) try: rc = cxml.cim_define(options.ip) From deeptik at linux.vnet.ibm.com Wed Jul 29 11:50:24 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 29 Jul 2009 17:20:24 +0530 Subject: [Libvirt-cim] Re: Test Run Summary (Jul 27 2009): KVM on SUSE Linux Enterprise Server 11 (i586) with sfcb In-Reply-To: <4A701A61.8010407@linux.vnet.ibm.com> References: <4A701A61.8010407@linux.vnet.ibm.com> Message-ID: <4A703780.4060005@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > ================================================= > Test Run Summary (Jul 27 2009): KVM on SUSE Linux Enterprise Server > 11 (i586) with sfcb > ================================================= > Distro: SUSE Linux Enterprise Server 11 (i586) Kernel: 2.6.27.19-5-pae > libvirt: 0.4.6 > Hypervisor: QEMU 0.9.1 > CIMOM: sfcb sfcbd 1.3.2 > Libvirt-cim revision: 934 > Libvirt-cim changeset: ba165481b932+ > Cimtest revision: 739 > Cimtest changeset: ad67e5d20ee2 > ================================================= > FAIL : 4 > XFAIL : 5 > SKIP : 10 > PASS : 146 > ----------------- > Total : 165 > ================================================= > FAIL Test Summary: > ComputerSystemIndication - 01_created_indication.py: FAIL DestroySystem() does not generate an indication hence the test fails. Have reported this problem. > HostSystem - 03_hs_to_settdefcap.py: FAIL Needs tc update. > SettingsDefineCapabilities - 01_forward.py: FAIL Needs tc update. > VirtualSystemManagementService - 13_refconfig_additional_devs.py: FAIL Test case problem, Patch for this is sent for review. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Jul 29 22:05:39 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 29 Jul 2009 15:05:39 -0700 Subject: [Libvirt-cim] [PATCH] Fix possible seg fault in resource_add() and resource_mod() Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1248905120 25200 # Node ID d7f583a37de4224d6c74bab3c36caee1c0dc6216 # Parent b9c58e6a654f29fcc49a12457ed12fc57ec15953 Fix possible seg fault in resource_add() and resource_mod() If a user attempts to add a virtual NIC with a MAC that is already in use, the provider doesn't current check the return from rasd_to_vdev(). This means the net device struct isn't properly filled out and will result in a seg fault. To fix this, be sure to check the return of rast_to_vdev() and return an error accordingly. Signed-off-by: Kaitlin Rupert diff -r b9c58e6a654f -r d7f583a37de4 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Jul 29 11:26:26 2009 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Wed Jul 29 15:05:20 2009 -0700 @@ -1869,6 +1869,7 @@ struct virt_device *list; struct virt_device *dev; int *count = NULL; + const char *msg = NULL; op = CMGetObjectPath(rasd, &s); if ((op == NULL) || (s.rc != CMPI_RC_OK)) @@ -1915,7 +1916,14 @@ dev = &list[*count]; dev->type = type; - rasd_to_vdev(rasd, dominfo, dev, ns); + msg = rasd_to_vdev(rasd, dominfo, dev, ns); + if (msg != NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Add resource failed: %s", + msg); + goto out; + } if ((type == CIM_RES_TYPE_GRAPHICS) || (type == CIM_RES_TYPE_INPUT)) { (*count)++; @@ -1948,6 +1956,7 @@ struct virt_device *list; int *count; int i; + const char *msg = NULL; if (devid == NULL) { cu_statusf(_BROKER, &s, @@ -1978,7 +1987,14 @@ struct virt_device *dev = &list[i]; if (STREQ(dev->id, devid)) { - rasd_to_vdev(rasd, dominfo, dev, ns); + msg = rasd_to_vdev(rasd, dominfo, dev, ns); + if (msg != NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Modify resource failed: %s", + msg); + goto out; + } if ((type == CIM_RES_TYPE_GRAPHICS) || (type == CIM_RES_TYPE_INPUT)) From kaitlin at linux.vnet.ibm.com Thu Jul 30 05:54:09 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 29 Jul 2009 22:54:09 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Added disk backked pool support In-Reply-To: <72508ebffdece413437b.1248856490@elm3a148.beaverton.ibm.com> References: <72508ebffdece413437b.1248856490@elm3a148.beaverton.ibm.com> Message-ID: <4A713581.1080107@linux.vnet.ibm.com> Deepti B. Kalakeri wrote: > # HG changeset patch > # User Deepti B.Kalakeri > # Date 1248856464 25200 > # Node ID 72508ebffdece413437b820de84e0c69bc577405 > # Parent f7cbecb195e3800513372d4466393538809923e3 > [TEST] Added disk backked pool support > > Signed-off-by: Deepti B. Kalakeri > > diff -r f7cbecb195e3 -r 72508ebffdec suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py Looks good, although you'll want to be sure you verify the parameters passed in for disk pools. verify_inputs() only verifies the inputs for fs, logical, and scsi pools. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Jul 30 06:03:04 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 30 Jul 2009 11:33:04 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Added disk backked pool support In-Reply-To: <4A713581.1080107@linux.vnet.ibm.com> References: <72508ebffdece413437b.1248856490@elm3a148.beaverton.ibm.com> <4A713581.1080107@linux.vnet.ibm.com> Message-ID: <4A713798.6080601@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Deepti B. Kalakeri wrote: >> # HG changeset patch >> # User Deepti B.Kalakeri >> # Date 1248856464 25200 >> # Node ID 72508ebffdece413437b820de84e0c69bc577405 >> # Parent f7cbecb195e3800513372d4466393538809923e3 >> [TEST] Added disk backked pool support >> >> Signed-off-by: Deepti B. Kalakeri >> >> diff -r f7cbecb195e3 -r 72508ebffdec >> suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py > > Looks good, although you'll want to be sure you verify the parameters > passed in for disk pools. verify_inputs() only verifies the inputs for > fs, logical, and scsi pools. > > Oops! the checks for disk and fs pools are same I forgot to include > pooltype = disk in the if loop .. I will do that and submit the patch.. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Jul 30 11:41:13 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 30 Jul 2009 04:41:13 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Added disk backed pool support Message-ID: # HG changeset patch # User Deepti B.Kalakeri # Date 1248954058 25200 # Node ID e4d3d6799e9c73a7a68393782a4292187b777b01 # Parent 0abff40a58a5d1d9ee4963355aec56bed87e5400 [TEST] #2 Added disk backed pool support Tested with KVM on SLES11 and current sources. Signed-off-by: Deepti B. Kalakeri diff -r 0abff40a58a5 -r e4d3d6799e9c suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py --- a/suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py Wed Jul 29 04:07:07 2009 -0700 +++ b/suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py Thu Jul 30 04:40:58 2009 -0700 @@ -28,7 +28,12 @@ # the following command: # For Fs pool type: # ---------------- -# python create_verify_storagepool.py -t fs -d /dev/sda4 -m /tmp/mnt -n diskfs +# python create_verify_storagepool.py -t fs -d /dev/sda4 -m /tmp/mnt -n fs_pool +# -v Xen -u -p +# +# For disk pool type: +# ------------------- +# python create_verify_storagepool.py -t fs -d /dev/sda -m /tmp/ -n disk_pool # -v Xen -u -p # # For logical pool type: @@ -39,11 +44,12 @@ # For scsi pool type with HBA's: # ------------------------------ # python create_verify_storagepool.py -t scsi -v KVM -u -p -# -n myscsi_pool -a host2 +# -n scsi_pool -a host2 # # Where t can be : -# 2 - FileSystem -# 6 - Logical +# 2 - fs [ FileSystem ] +# 4 - disk [ Disk ] +# 6 - logical [ Logical ] # 7 - scsi # # @@ -68,13 +74,14 @@ TEST_LOG="cimtest.log" libvirt_cim_fs_changes = 857 +libvirt_cim_disk_changes = 872 libvirt_cim_logical_changes = 906 libvirt_cim_scsi_changes = 921 supp_types = [ 'Xen', 'KVM' , 'LXC' ] -pool_types = { 'DISK_POOL_FS' : 2 , 'DISK_POOL_LOGICAL' : 6 , - 'DISK_POOL_SCSI' : 7 } +pool_types = { 'DISK_POOL_FS' : 2 , 'DISK_POOL_DISK' : 4, + 'DISK_POOL_LOGICAL' : 6 , 'DISK_POOL_SCSI' : 7 } def verify_cmd_options(options, parser): try: @@ -88,9 +95,10 @@ raise Exception("Must specify pool type to be tested") if options.part_dev == None and options.pool_type != 'scsi': - raise Exception("Free Partition to be mounted not specified") + raise Exception("Free Partition/disk to be mounted not specified") - if options.mnt_pt == None and options.pool_type == 'fs': + if options.mnt_pt == None and (options.pool_type == 'fs' or \ + options.pool_type == 'disk'): raise Exception("Mount points to be used not specified") if options.adap_name == None and options.pool_type == 'scsi': @@ -124,6 +132,8 @@ if pooltype == "fs": pool_type = pool_types['DISK_POOL_FS'] + elif pooltype == "disk": + pool_type = pool_types['DISK_POOL_DISK'] elif pooltype == "logical": pool_type = pool_types['DISK_POOL_LOGICAL'] elif pooltype == "scsi": @@ -138,7 +148,17 @@ del_dir = False - if pool_type == pool_types['DISK_POOL_FS']: + if pool_type == pool_types['DISK_POOL_FS'] or \ + pool_type == pool_types['DISK_POOL_DISK']: + + if pool_type == pool_types['DISK_POOL_DISK']: + # Make sure part_dev is a disk and not a partition + cmd = "fdisk -l | grep -w '%s'" % part_dev + status, disk_info = getstatusoutput(cmd) + if status != PASS: + logger.error("'%s' does not seem like a disk", part_dev) + return FAIL, del_dir + cmd = "mount" status, mount_info = getstatusoutput(cmd) if status != PASS: @@ -151,8 +171,8 @@ part_name = line.split()[0] if part_dev == part_name: logger.error("[%s] already mounted", part_dev) - raise Exception("Please specify free partition other than "\ - "[%s]" % part_dev) + raise Exception("Please specify free partition/disk other " + "than [%s]" % part_dev) # Check if mount point is already used for mounting mount_name = line.split()[2] @@ -234,9 +254,10 @@ dp_pid = "%s/%s" % ("DiskPool", pool_name) dpool_rasd['PoolID'] = dpool_rasd['InstanceID'] = dp_pid - if pooltype == pool_types['DISK_POOL_FS']: + if pooltype == pool_types['DISK_POOL_FS'] or \ + pooltype == pool_types['DISK_POOL_DISK']: + dpool_rasd['DevicePaths'] = [part_dev] dpool_rasd['Path'] = mount_pt - dpool_rasd['DevicePaths'] = [part_dev] elif pooltype == pool_types['DISK_POOL_LOGICAL']: dpool_rasd['Path'] = part_dev @@ -307,11 +328,12 @@ parser.add_option("-v", "--virt-type", dest="virt", default=None, help="Virtualization type [ Xen | KVM ]") parser.add_option("-t", "--pool-type", dest="pool_type", default=None, - help="Pool type:[ fs | logical | scsi ]") + help="Pool type:[ fs | logical | scsi | disk ]") parser.add_option("-d", "--part-dev", dest="part_dev", default=None, help="specify the free partition to be used for " \ "fs pool type or the predefined Vol Group" \ - " for logical pool type") + " for logical pool type or empty disk like" \ + " /dev/sda for disk type pools") parser.add_option("-m", "--mnt_pt", dest="mnt_pt", default=None, help="Mount point to be used") parser.add_option("-n", "--pool-name", dest="pool_name", default=None, @@ -368,6 +390,13 @@ libvirt_cim_fs_changes) return SKIP + elif curr_cim_rev < libvirt_cim_disk_changes and \ + pooltype == pool_types['DISK_POOL_DISK']: + logger.info("Test Skipped for '%s' pool type, Support for disk Pool" + " is available in revision '%s'", options.pool_type, + libvirt_cim_disk_changes) + return SKIP + elif curr_cim_rev < libvirt_cim_logical_changes and \ pooltype == pool_types['DISK_POOL_LOGICAL']: logger.info("Test Skipped for '%s' pool type, Support for Logical Pool" From deeptik at linux.vnet.ibm.com Thu Jul 30 11:51:17 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 30 Jul 2009 04:51:17 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixed indications.py to import sleep() Message-ID: # HG changeset patch # User Deepti B.Kalakeri # Date 1248954666 25200 # Node ID b01abd8b9002071cb796b0a5023ac6ce13696262 # Parent e4d3d6799e9c73a7a68393782a4292187b777b01 [TEST] Fixed indications.py to import sleep() Signed-off-by: Deepti B. Kalakeri diff -r e4d3d6799e9c -r b01abd8b9002 suites/libvirt-cim/lib/XenKvmLib/indications.py --- a/suites/libvirt-cim/lib/XenKvmLib/indications.py Thu Jul 30 04:40:58 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/indications.py Thu Jul 30 04:51:06 2009 -0700 @@ -22,6 +22,7 @@ # from signal import SIGKILL +from time import slepp from CimTest.Globals import logger from XenKvmLib.indication_tester import CIMIndicationSubscription from XenKvmLib.vxml import set_default From rmaciel at linux.vnet.ibm.com Thu Jul 30 20:04:03 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 30 Jul 2009 17:04:03 -0300 Subject: [Libvirt-cim] [PATCH] If the useer specifies a ReferencedConfiguration, be sure to generate a new In-Reply-To: References: Message-ID: <4A71FCB3.9020309@linux.vnet.ibm.com> +1 On 07/28/2009 05:20 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1248812402 25200 > # Node ID cd7e42dad453bf6b0269274dd43e354b89c1734d > # Parent ba165481b932c372b13e0cf458e99f86bd843282 > If the useer specifies a ReferencedConfiguration, be sure to generate a new... > > MAC address since MACs cannot collide. > > Signed-off-by: Kaitlin Rupert > > diff -r ba165481b932 -r cd7e42dad453 src/Virt_VirtualSystemManagementService.c > --- a/src/Virt_VirtualSystemManagementService.c Mon Jul 20 13:27:37 2009 -0700 > +++ b/src/Virt_VirtualSystemManagementService.c Tue Jul 28 13:20:02 2009 -0700 > @@ -1276,6 +1276,7 @@ > virDomainPtr dom = NULL; > char *name = NULL; > const char *iid; > + const char *mac; > CMPIStatus s; > int ret; > > @@ -1336,6 +1337,18 @@ > (*domain)->name = NULL; > free((*domain)->uuid); > (*domain)->uuid = NULL; > + free((*domain)->dev_net->dev.net.mac); > + (*domain)->dev_net->dev.net.mac = NULL; > + > + mac = _net_rand_mac(); > + if (mac == NULL) { > + cu_statusf(_BROKER,&s, > + CMPI_RC_ERR_INVALID_PARAMETER, > + "Unable to generate a MAC address for guest %s", > + name); > + goto out; > + } > + (*domain)->dev_net->dev.net.mac = strdup(mac); > > out: > virDomainFree(dom); > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Thu Jul 30 21:04:55 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 30 Jul 2009 18:04:55 -0300 Subject: [Libvirt-cim] [PATCH] Fix possible seg fault in resource_add() and resource_mod() In-Reply-To: References: Message-ID: <4A720AF7.6080906@linux.vnet.ibm.com> +1 On 07/29/2009 07:05 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1248905120 25200 > # Node ID d7f583a37de4224d6c74bab3c36caee1c0dc6216 > # Parent b9c58e6a654f29fcc49a12457ed12fc57ec15953 > Fix possible seg fault in resource_add() and resource_mod() > > If a user attempts to add a virtual NIC with a MAC that is already in use, the > provider doesn't current check the return from rasd_to_vdev(). This means > the net device struct isn't properly filled out and will result in a seg fault. > > To fix this, be sure to check the return of rast_to_vdev() and return an error > accordingly. > > Signed-off-by: Kaitlin Rupert > > diff -r b9c58e6a654f -r d7f583a37de4 src/Virt_VirtualSystemManagementService.c > --- a/src/Virt_VirtualSystemManagementService.c Wed Jul 29 11:26:26 2009 -0700 > +++ b/src/Virt_VirtualSystemManagementService.c Wed Jul 29 15:05:20 2009 -0700 > @@ -1869,6 +1869,7 @@ > struct virt_device *list; > struct virt_device *dev; > int *count = NULL; > + const char *msg = NULL; > > op = CMGetObjectPath(rasd,&s); > if ((op == NULL) || (s.rc != CMPI_RC_OK)) > @@ -1915,7 +1916,14 @@ > dev =&list[*count]; > > dev->type = type; > - rasd_to_vdev(rasd, dominfo, dev, ns); > + msg = rasd_to_vdev(rasd, dominfo, dev, ns); > + if (msg != NULL) { > + cu_statusf(_BROKER,&s, > + CMPI_RC_ERR_FAILED, > + "Add resource failed: %s", > + msg); > + goto out; > + } > > if ((type == CIM_RES_TYPE_GRAPHICS) || (type == CIM_RES_TYPE_INPUT)) { > (*count)++; > @@ -1948,6 +1956,7 @@ > struct virt_device *list; > int *count; > int i; > + const char *msg = NULL; > > if (devid == NULL) { > cu_statusf(_BROKER,&s, > @@ -1978,7 +1987,14 @@ > struct virt_device *dev =&list[i]; > > if (STREQ(dev->id, devid)) { > - rasd_to_vdev(rasd, dominfo, dev, ns); > + msg = rasd_to_vdev(rasd, dominfo, dev, ns); > + if (msg != NULL) { > + cu_statusf(_BROKER,&s, > + CMPI_RC_ERR_FAILED, > + "Modify resource failed: %s", > + msg); > + goto out; > + } > > if ((type == CIM_RES_TYPE_GRAPHICS) || > (type == CIM_RES_TYPE_INPUT)) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Jul 30 21:38:59 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 30 Jul 2009 14:38:59 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixed indications.py to import sleep() In-Reply-To: References: Message-ID: <4A7212F3.9080300@linux.vnet.ibm.com> Deepti B. Kalakeri wrote: > # HG changeset patch > # User Deepti B.Kalakeri > # Date 1248954666 25200 > # Node ID b01abd8b9002071cb796b0a5023ac6ce13696262 > # Parent e4d3d6799e9c73a7a68393782a4292187b777b01 > [TEST] Fixed indications.py to import sleep() > > Signed-off-by: Deepti B. Kalakeri > > diff -r e4d3d6799e9c -r b01abd8b9002 suites/libvirt-cim/lib/XenKvmLib/indications.py > --- a/suites/libvirt-cim/lib/XenKvmLib/indications.py Thu Jul 30 04:40:58 2009 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/indications.py Thu Jul 30 04:51:06 2009 -0700 > @@ -22,6 +22,7 @@ > # > > from signal import SIGKILL > +from time import slepp This should be sleep. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Jul 30 22:59:39 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 30 Jul 2009 15:59:39 -0700 Subject: [Libvirt-cim] [PATCH] Initialize const char * in parse_disk_pool() Message-ID: <02bb726b1ed329000ea3.1248994779@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1248994766 25200 # Node ID 02bb726b1ed329000ea329aac36e954f8f81f432 # Parent 88cccd3d8ef6d1e8e7c797c30ca027bce4db053f Initialize const char * in parse_disk_pool() Otherwise newer versions of gcc will throw a compile warning. Signed-off-by: Kaitlin Rupert diff -r 88cccd3d8ef6 -r 02bb726b1ed3 libxkutil/pool_parsing.c --- a/libxkutil/pool_parsing.c Wed Jul 29 15:05:20 2009 -0700 +++ b/libxkutil/pool_parsing.c Thu Jul 30 15:59:26 2009 -0700 @@ -147,8 +147,8 @@ { xmlNode **nodes = nsv->nodeTab; xmlNode *child; - const char *type_str; - const char *name; + const char *type_str = NULL; + const char *name = NULL; int type = 0; type_str = get_attr_value(nodes[0], "type"); From deeptik at linux.vnet.ibm.com Fri Jul 31 05:41:02 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 30 Jul 2009 22:41:02 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fixed indications.py to import sleep() Message-ID: # HG changeset patch # User Deepti B.Kalakeri # Date 1249018839 25200 # Node ID c1d8168e6ff0a7883fac582d19af5e68ad979bbc # Parent e4d3d6799e9c73a7a68393782a4292187b777b01 [TEST] #2 Fixed indications.py to import sleep() Patch 2: -------- corrected the typo Signed-off-by: Deepti B. Kalakeri diff -r e4d3d6799e9c -r c1d8168e6ff0 suites/libvirt-cim/lib/XenKvmLib/indications.py --- a/suites/libvirt-cim/lib/XenKvmLib/indications.py Thu Jul 30 04:40:58 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/indications.py Thu Jul 30 22:40:39 2009 -0700 @@ -22,6 +22,7 @@ # from signal import SIGKILL +from time import sleep from CimTest.Globals import logger from XenKvmLib.indication_tester import CIMIndicationSubscription from XenKvmLib.vxml import set_default From rmaciel at linux.vnet.ibm.com Fri Jul 31 13:10:06 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Fri, 31 Jul 2009 10:10:06 -0300 Subject: [Libvirt-cim] [PATCH] Initialize const char * in parse_disk_pool() In-Reply-To: <02bb726b1ed329000ea3.1248994779@elm3a148.beaverton.ibm.com> References: <02bb726b1ed329000ea3.1248994779@elm3a148.beaverton.ibm.com> Message-ID: <4A72ED2E.60907@linux.vnet.ibm.com> +1 On 07/30/2009 07:59 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1248994766 25200 > # Node ID 02bb726b1ed329000ea329aac36e954f8f81f432 > # Parent 88cccd3d8ef6d1e8e7c797c30ca027bce4db053f > Initialize const char * in parse_disk_pool() > > Otherwise newer versions of gcc will throw a compile warning. > > Signed-off-by: Kaitlin Rupert > > diff -r 88cccd3d8ef6 -r 02bb726b1ed3 libxkutil/pool_parsing.c > --- a/libxkutil/pool_parsing.c Wed Jul 29 15:05:20 2009 -0700 > +++ b/libxkutil/pool_parsing.c Thu Jul 30 15:59:26 2009 -0700 > @@ -147,8 +147,8 @@ > { > xmlNode **nodes = nsv->nodeTab; > xmlNode *child; > - const char *type_str; > - const char *name; > + const char *type_str = NULL; > + const char *name = NULL; > int type = 0; > > type_str = get_attr_value(nodes[0], "type"); > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Tue Jul 28 11:39:54 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Tue, 28 Jul 2009 08:39:54 -0300 Subject: [Libvirt-cim] [PATCH] VirtualDevice default value for a cdrom template rasd changed from hda to hdc Message-ID: # HG changeset patch # User Richard Maciel # Date 1248772238 10800 # Node ID b4da93f35181591b2a225c9e8377a426312270b7 # Parent bdf6eda6765f09c27f7306cd8c074ca5acda38a6 VirtualDevice default value for a cdrom template rasd changed from hda to hdc Signed-off-by: Richard Maciel diff -r bdf6eda6765f -r b4da93f35181 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Thu Jul 30 15:59:26 2009 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Tue Jul 28 06:10:38 2009 -0300 @@ -782,13 +782,6 @@ CMPIInstance *inst; CMPIStatus s = {CMPI_RC_OK, NULL}; - if (type == DOMAIN_LXC) { - dev = "/lxc_mnt/tmp"; - } - else { - dev = "hda"; - } - inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_DISK, DEVICE_RASD); if ((inst == NULL) || (s.rc != CMPI_RC_OK)) goto out; @@ -798,12 +791,11 @@ (CMPIValue *)"MegaBytes", CMPI_chars); CMSetProperty(inst, "Address", (CMPIValue *)disk_path, CMPI_chars); - if (type == DOMAIN_LXC) + if (type == DOMAIN_LXC) { + dev = "/lxc_mnt/tmp"; CMSetProperty(inst, "MountPoint", (CMPIValue *)dev, CMPI_chars); - else { - if (emu_type == 0) - CMSetProperty(inst, "VirtualQuantity", - (CMPIValue *)&disk_size, CMPI_uint64); + } else { + dev = "hda"; if (type == DOMAIN_XENPV) { dev = "xvda"; @@ -813,6 +805,13 @@ CMSetProperty(inst, "Caption", (CMPIValue *)"FV disk", CMPI_chars); } + + if (emu_type == 0) { + CMSetProperty(inst, "VirtualQuantity", + (CMPIValue *)&disk_size, CMPI_uint64); + } else if (emu_type == 1) { + dev = "hdc"; + } CMSetProperty(inst, "VirtualDevice", (CMPIValue *)dev, CMPI_chars); From rmaciel at linux.vnet.ibm.com Tue Jul 28 17:05:16 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Tue, 28 Jul 2009 14:05:16 -0300 Subject: [Libvirt-cim] [PATCH] Add check to catch duplicated VirtualDevice parameter in DiskRASDs Message-ID: <4ff0f15857f88d54dac5.1248800716@localhost.localdomain> # HG changeset patch # User Richard Maciel # Date 1248800674 10800 # Node ID 4ff0f15857f88d54dac54c149da08f0d0b1052f1 # Parent b4da93f35181591b2a225c9e8377a426312270b7 Add check to catch duplicated VirtualDevice parameter in DiskRASDs At the moment of creation of a guest, it is necessary to check if its DiskRASDs all have unique (among themselves) VirtualDevice parameters Signed-off-by: Richard Maciel diff -r b4da93f35181 -r 4ff0f15857f8 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Tue Jul 28 06:10:38 2009 -0300 +++ b/src/Virt_VirtualSystemManagementService.c Tue Jul 28 14:04:34 2009 -0300 @@ -1011,6 +1011,11 @@ for (i = 0; i < *index; i++) { struct virt_device *ptr = &list[i]; + + if (STREQC(ptr->dev.disk.virtual_dev, dev->dev.disk.virtual_dev)) + return "VirtualDevice property must be unique for each " + "DiskResourceAllocationSettingData in a single " + "guest"; if (STREQC(ptr->id, dev->id)) { CU_DEBUG("Overriding device %s from refconf", ptr->id);