[PATCH 0/3] Address 'cimtest' issues

These patches resolve some issues with test logging and there's one test fix that I've had just hanging around that I figure I'd put out there since there was some activity. John Ferlan (3): Allow adding bridged network for running domain Remove extranous or unnecessary parameter from error messages Ensure get_provider_version() returns strings as expected .../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/const.py | 2 +- suites/libvirt-cim/lib/XenKvmLib/vsms_util.py | 23 +++++++++++++++++----- 6 files changed, 29 insertions(+), 11 deletions(-) -- 1.8.3.1

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.3.1

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.3.1

The reporting.py had a failure: Traceback (most recent call last): File "main.py", line 326, in <module> ret = main(options, args) File "main.py", line 312, in main msg_body, heading = gen_report(options.virt, options.ip, testsuite.log_file) File "./lib/XenKvmLib/reporting.py", line 168, in gen_report sys_env, distro = get_env_data(ip, virt) File "./lib/XenKvmLib/reporting.py", line 109, in get_env_data return env + lc_ver + cimtest_ver, distro UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 31: ordinal not in range(128) --- suites/libvirt-cim/lib/XenKvmLib/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suites/libvirt-cim/lib/XenKvmLib/const.py b/suites/libvirt-cim/lib/XenKvmLib/const.py index 6701d36..d17fef3 100755 --- a/suites/libvirt-cim/lib/XenKvmLib/const.py +++ b/suites/libvirt-cim/lib/XenKvmLib/const.py @@ -180,6 +180,6 @@ def get_provider_version(virt, ip): if revision.isdigit(): revision = int(revision) - return revision, changeset + return str(revision), str(changeset) -- 1.8.3.1

On 08/08/2013 06:16 PM, John Ferlan wrote:
These patches resolve some issues with test logging and there's one test fix that I've had just hanging around that I figure I'd put out there since there was some activity.
John Ferlan (3): Allow adding bridged network for running domain Remove extranous or unnecessary parameter from error messages Ensure get_provider_version() returns strings as expected
.../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/const.py | 2 +- suites/libvirt-cim/lib/XenKvmLib/vsms_util.py | 23 +++++++++++++++++----- 6 files changed, 29 insertions(+), 11 deletions(-)
ping?

On 08/09/2013 12:16 AM, John Ferlan wrote:
These patches resolve some issues with test logging and there's one test fix that I've had just hanging around that I figure I'd put out there since there was some activity.
John Ferlan (3): Allow adding bridged network for running domain Remove extranous or unnecessary parameter from error messages Ensure get_provider_version() returns strings as expected
.../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/const.py | 2 +- suites/libvirt-cim/lib/XenKvmLib/vsms_util.py | 23 +++++++++++++++++----- 6 files changed, 29 insertions(+), 11 deletions(-)
I gave the patches a try. The first patch works for me, and turns an XFAIL into a PASS. I didn't see the other errors occur for me, but your changes look reasonable. If there are no objections from others: go ahead and commit. Tested-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> -- Mit freundlichen Grüßen/Kind Regards Viktor Mihajlovski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martina Köderitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On 08/08/2013 06:16 PM, John Ferlan wrote:
These patches resolve some issues with test logging and there's one test fix that I've had just hanging around that I figure I'd put out there since there was some activity.
John Ferlan (3): Allow adding bridged network for running domain Remove extranous or unnecessary parameter from error messages Ensure get_provider_version() returns strings as expected
.../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/const.py | 2 +- suites/libvirt-cim/lib/XenKvmLib/vsms_util.py | 23 +++++++++++++++++----- 6 files changed, 29 insertions(+), 11 deletions(-)
These are now pushed. John
participants (2)
-
John Ferlan
-
Viktor Mihajlovski