[PATCH] [TEST] Fixing vsms/19*py

# HG changeset patch # User Deepti B. Kalakeri <deeptik@linux..vnet.ibm.com> # Date 1250160712 25200 # Node ID 8651eccf3771e09bec36329239452d58c8331843 # Parent e8bb9c334a06962f8fbc5e12d649b9f539c077f8 [TEST] Fixing vsms/19*py Tested with KVM on F10 and Xen on RHEL5.3 with current sources. Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> diff -r e8bb9c334a06 -r 8651eccf3771 suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py Thu Aug 13 01:02:25 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py Thu Aug 13 03:51:52 2009 -0700 @@ -68,8 +68,9 @@ 'network' : "Valid param "} } + libvirt_version = virsh_version(options.ip, options.virt) + inv_empty_network = "Network not found" 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" @@ -78,7 +79,6 @@ "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 " + \ @@ -88,6 +88,11 @@ expected_values['empty']['network'] = inv_empty_network expected_values['invalid']['bridge'] = inv_br_str + else: + if libvirt_version >= "0.7.0": + expected_values['empty']['network'] = inv_empty_network + expected_values['invalid']['network'] = inv_empty_network + tc_scen = { 'invalid' : 'invalid', @@ -107,6 +112,7 @@ status = PASS for nettype in nettypes: for tc, field in tc_scen.iteritems(): + logger.error("DEBUG nettype is %s, field is %s, tc is %s", nettype, field, tc) cxml = vxml.get_class(options.virt)(default_dom, mac=nmac, ntype=nettype, net_name=field) diff -r e8bb9c334a06 -r 8651eccf3771 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Thu Aug 13 01:02:25 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Thu Aug 13 03:51:52 2009 -0700 @@ -770,11 +770,12 @@ rc = int(self.err_rc) if rc != exp_rc: - raise Exception("Got rc: %d, exp %d." % (rc, exp_rc)) + raise Exception("Error code Mismatch, Got rc: %d, exp %d." \ + % (rc, exp_rc)) - if self.err_desc.find(exp_desc) < 0: - raise Exception("Got desc: '%s', exp '%s'" % (self.err_desc, - exp_desc)) + if not exp_desc in self.err_desc: + raise Exception("Desc Mismatch, Got desc: '%s', exp '%s'" \ + % (self.err_desc, exp_desc)) except Exception, details: logger.error(details)
participants (1)
-
Deepti B. Kalakeri