[Libvirt-cim] [PATCH] [TEST] Fixing testcase to account for different libvirt error string

Sharad Mishra snmishra at us.ibm.com
Thu Mar 31 20:42:35 UTC 2011


# HG changeset patch
# User Sharad Mishra <snmishra at us.ibm.com>
# Date 1301604051 25200
# Node ID 6d7dab79f4e8806aea65cb413c4f193cdbfc4f40
# Parent  f0a7eee4cbe06cc4f618770ac149218a1bddb171
[TEST] Fixing testcase to account for different libvirt error string.

Noticed that this  test was failing on some  libvirt versions between
0.7.0 and 0.8.7 because libvirt was returning new error message. Latest
libvirt (0.8.7-5) is back to using error string from libvirt versions
prior to 0.7.0.

Signed-off-by: Sharad Mishra <snmishra at us.ibm.com>

diff -r f0a7eee4cbe0 -r 6d7dab79f4e8 suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py	Thu Mar 31 12:32:11 2011 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py	Thu Mar 31 13:40:51 2011 -0700
@@ -125,10 +125,17 @@
                 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))
+                        # There are few libvirt version between 0.7.0
+                        # and 0.8.7 which give following error.
+                        status = verify_error(exp_rc, 
+                                            'No Network bridge name specified', 
+                                            cxml)
+                        if status != PASS:
+                            raise Exception('Defining 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:




More information about the Libvirt-cim mailing list