[PATCH 0/2] Couple of fixes for cimtest

I've been using the changes in this patchset for a while, just hadn't posted them. The changes resolve issues seen in the 22_multi_brg_interface test. While testing I also found a latent issue elsewhere - I cannot remember where I ran the test, only that it failed for the reasons indicated in the commit. With these patches installed, I get the following test results as shown in the 'suites/libvirt-cim/run_report.txt' output: ================================================= Test Run Summary (Jul 08 2013): KVM on Fedora release 18 (Spherical Cow) with Pe gasus ================================================= Distro: Fedora release 18 (Spherical Cow) Kernel: 3.9.6-200.fc18.x86_64 libvirt: 1.1.0 Hypervisor: QEMU 1.5.50 CIMOM: Pegasus 2.12.0 Libvirt-cim revision: 1225 Libvirt-cim changeset: 07adabc Cimtest revision: 907 Cimtest changeset: 442a7b1 Total test execution: Unknown ================================================= FAIL : 3 XFAIL : 3 SKIP : 11 PASS : 175 ----------------- Total : 192 ================================================= FAIL Test Summary: ComputerSystemIndication - 01_created_indication.py: FAIL RASDIndications - 01_guest_states_rasd_ind.py: FAIL RASDIndications - 02_guest_add_mod_rem_rasd_ind.py: FAIL ================================================= XFAIL Test Summary: SwitchService - 01_enum.py: XFAIL VirtualSystemManagementService - 28_definesystem_with_vsi_profile.py: XFAIL VirtualSystemManagementService - 30_dynamic_disk_mod.py: XFAIL ================================================= SKIP Test Summary: ComputerSystem - 02_nosystems.py: SKIP ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP LogicalDisk - 02_nodevs.py: SKIP Profile - 04_verify_libvirt_cim_slp_profiles.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 VSSD - 02_bootldr.py: SKIP NOTE: The *Indications tests have not worked in my environment ever. I chased the issue down to network configuration within whatever segment of the Red Hat domain I'm in. John Ferlan (2): Allow adding bridged network for running domain Remove extranous or unnecessary parameter from error messages .../cimtest/Profile/03_rprofile_gi_errs.py | 2 +- suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py | 2 +- .../cimtest/ResourcePool/02_rp_gi_errors.py | 2 +- .../22_addmulti_brg_interface.py | 9 +++++++-- suites/libvirt-cim/lib/XenKvmLib/vsms_util.py | 23 +++++++++++++++++----- 5 files changed, 28 insertions(+), 10 deletions(-) -- 1.8.1.4

Test failed with following: VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ERROR - (1, u"CIM_ERR_FAILED: Unable to change (0) device: internal error unable to execute QEMU command 'device_add': Bus 'pci.0' does not support hotplugging") ERROR - Error invoking AddRS: add_net_res ERROR - AddResourceSettings call failed ERROR - Failed to destroy Virtual Network 'my_network1' InvokeMethod(AddResourceSettings): CIM_ERR_FAILED: Unable to change (0) device: internal error unable to execute QEMU command 'device_add': Bus 'pci.0' does not support hotplugging Bug:<00015> The fix for this was that the domain needed to be created with the "acpi=True" flag. This allowed the test to get a bit further, but it then failed with the following: VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ERROR - Got 88:aa:bb:cc:ee:ff, exp 88:aa:bb:cc:ee:ff. Got None, exp my_network1. ERROR - Error invoking AddRS: add_net_res ERROR - Error adding rs for net mac ERROR - Failed to destroy Virtual Network 'my_network1' The issue here is that the created network bridge doesn't have an xml resource "source network" as 'my_network1', rather that name is assigned to the pool. A network bridge type object has a resource "source bridge" which correlates to the 'virt_net' attribute while network type object correlates to the 'net_name' attribute. Since I wasn't sure how a Xen domain would look I separated the validation comparisons --- .../22_addmulti_brg_interface.py | 9 +++++++-- suites/libvirt-cim/lib/XenKvmLib/vsms_util.py | 23 +++++++++++++++++----- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/22_addmulti_brg_interface.py b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/22_addmulti_brg_interface.py index 36d1873..0452bf6 100644 --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/22_addmulti_brg_interface.py +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/22_addmulti_brg_interface.py @@ -63,8 +63,13 @@ def main(): 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) + # Seems ACPI needs to be set for KVM in order for hotplug to work right + if options.virt == "KVM": + vsxml = get_class(options.virt)(test_dom, mac=default_mac, ntype=ntype, + net_name=default_brg, acpi=True) + else: + 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: diff --git a/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py b/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py index 075c09f..3c3d0fc 100644 --- a/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py @@ -189,9 +189,22 @@ def add_net_res(server, service, virt, cxml, vssd_ref, nasd, attr): % attr['nmac']) if virt == "KVM": - name = cxml.get_value_xpath( + # For KVM bridge types, compare the source bridge + if attr['ntype'] == 'bridge': + name = cxml.get_value_xpath( + '/domain/devices/interface/source/@bridge[. = "%s"]' + % attr['virt_net']) + attr_name = attr['virt_net'] + # For KVM network types, compare the network name + else: + name = cxml.get_value_xpath( '/domain/devices/interface/source/@network[. = "%s"]' % attr['net_name']) + attr_name = attr['net_name'] + if mac != attr['nmac'] or name != attr_name: + logger.error("MAC: Got %s, exp %s. NAME: Got %s, exp %s.", + mac, attr['nmac'], name, attr['virt_net']) + raise Exception('Error adding rs for net mac') else: # For Xen, network interfaces are converted to bridge interfaces. @@ -202,10 +215,10 @@ def add_net_res(server, service, virt, cxml, vssd_ref, nasd, attr): if name != None: name = attr['net_name'] - if mac != attr['nmac'] or name != attr['net_name']: - logger.error("Got %s, exp %s. Got %s, exp %s.", mac, - attr['nmac'], name, attr['net_name']) - raise Exception('Error adding rs for net mac') + if mac != attr['nmac'] or name != attr['net_name']: + logger.error("MAC: Got %s, exp %s. NAME: Got %s, exp %s. br %s", + mac, attr['nmac'], name, attr['net_name'], br) + raise Exception('Error adding rs for net mac') logger.info('good status for net_mac') except Exception, details: -- 1.8.1.4

Testing on a system failed with: Profile - 03_rprofile_gi_errs.py: FAIL ERROR - Unexpected errno 5, desc Class not found ERROR - Expected No such instance 6 ERROR - NameError : global name 'tc' is not defined Traceback (most recent call last): File "/root/cimtest/suites/libvirt-cim/lib/XenKvmLib/const.py", line 141, in do_try rc = f() File "03_rprofile_gi_errs.py", line 85, in main logger.error("------ FAILED: %s %s ------", cn, tc) NameError: global name 'tc' is not defined ERROR - None Turns out the profile test doesn't define/use tc. Found 2 other such occurrances and fixed them as well. --- suites/libvirt-cim/cimtest/Profile/03_rprofile_gi_errs.py | 2 +- suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py | 2 +- suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/suites/libvirt-cim/cimtest/Profile/03_rprofile_gi_errs.py b/suites/libvirt-cim/cimtest/Profile/03_rprofile_gi_errs.py index 4633cce..fa2a634 100644 --- a/suites/libvirt-cim/cimtest/Profile/03_rprofile_gi_errs.py +++ b/suites/libvirt-cim/cimtest/Profile/03_rprofile_gi_errs.py @@ -82,7 +82,7 @@ def main(): logger.error("Expected %s %s", exp_desc, exp_rc) if status != PASS: - logger.error("------ FAILED: %s %s ------", cn, tc) + logger.error("------ FAILED: InstanceID Key Value. ------") Globals.CIM_NS = prev_namespace return status diff --git a/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py b/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py index 48cc34c..d582ffb 100644 --- a/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py +++ b/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py @@ -133,7 +133,7 @@ def main(): logger.error("Expected %s %s", exp_desc, exp_rc) if status != PASS: - logger.error("------ FAILED: %s %s ------", cn, tc) + logger.error("------ FAILED: %s ------", cn) break vsxml.undefine(server) diff --git a/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py b/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py index d06778e..6215684 100644 --- a/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py +++ b/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py @@ -94,7 +94,7 @@ def main(): logger.error("Expected %s %s", exp_desc, exp_rc) if status != PASS: - logger.error("------ FAILED: %s %s ------", cn, tc) + logger.error("------ FAILED: %s ------", cn) break return status -- 1.8.1.4
participants (1)
-
John Ferlan