<br><tt><font size=2>libvirt-cim-bounces@redhat.com wrote on 2008-12-09
03:03:21:<br>
<br>
> yunguol@cn.ibm.com wrote:<br>
> > # HG changeset patch<br>
> > # User Guolian Yun <yunguol@cn.ibm.com><br>
> > # Date 1228719139 28800<br>
> > # Node ID 53c3639c9f6db35026fa06cfda94171ecef9d3ed<br>
> > # Parent  701f3228bdfe740f4a504dce1dfab844c812b9d5<br>
> > [TEST] Remove log info to the right place<br>
> > <br>
> >  Signed-off-by: Guolian Yun <yunguol@cn.ibm.com><br>
> > <br>
> > diff -r 701f3228bdfe -r 53c3639c9f6d suites/libvirt-<br>
> cim/cimtest/ElementConforms/01_forward.py<br>
> > --- a/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py
  <br>
> Wed Dec 03 21:31:09 2008 -0800<br>
> > +++ b/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py
  <br>
> Sun Dec 07 22:52:19 2008 -0800<br>
> > @@ -93,13 +93,14 @@<br>
> >              if assoc_val.items()
== ele.items():<br>
> >                  managed_ele_values[cn].remove(ele)<br>
> >                  return
PASS, managed_ele_values<br>
> > +            else:<br>
> > +                logger.error("%s
not in expected list %s", <br>
> assoc_val, elements)<br>
> > +                return
FAIL, managed_ele_values<br>
> </font></tt>
<br><tt><font size=2>    This test fails when cn == "KVM_HostSystem",
which report below:</font></tt>
<br><tt><font size=2>   CIMInstance(classname=u'KVM_HostSystem',
...) not in expected list []</font></tt>
<br>
<br><tt><font size=2>    Here is the output of managed_ele_values:</font></tt>
<br><tt><font size=2>    {'KVM_ComputerSystem': [], 'KVM_VirtualSystemMigrationService':
[], 'KVM_MemoryPool': [], 'KVM_DiskPool': [], u'KVM_HostSystem': [], 'KVM_NetworkPool':
[], 'KVM_ProcessorPool': []}</font></tt>
<br><tt><font size=2>  </font></tt>
<br><tt><font size=2>    Do you know why it is?</font></tt>
<br><tt><font size=2>    Thanks!</font></tt>
<br><tt><font size=2><br>
> This isn't a valid change.  If your system has multiple diskpools
<br>
> defined, the first item in elements might not be the pool you were
<br>
> attempting to verify.<br>
> <br>
> So the loop could look like this:<br>
> <br>
> elements = [bootvirtimages, cimtest-diskpool]<br>
> for ele in elements:<br>
>    if assoc_val.items() == ele.items():<br>
> <br>
> The attributes of bootvirtimages won't match the attributes of the
<br>
> cimtest-diskpool (which is the diskpool instance we're looking for).<br>
> <br>
> So if you put an else here, we return a failure incorrectly.<br>
> <br>
> > <br>
> >      except Exception, details:<br>
> >          logger.error("verify_fields()
exception: %s", details)<br>
> >          return FAIL, managed_ele_values<br>
> >        <br>
> > -    logger.error("%s not in expected list %s",
assoc_val, elements)<br>
> > -    return FAIL, managed_ele_values<br>
> <br>
> With the return left here as is, we loop through all the items in
<br>
> elements.  If we don't find a match, we return a failure.<br>
> <br>
> -- <br>
> Kaitlin Rupert<br>
> IBM Linux Technology Center<br>
> kaitlin@linux.vnet.ibm.com<br>
> <br>
> _______________________________________________<br>
> Libvirt-cim mailing list<br>
> Libvirt-cim@redhat.com<br>
> https://www.redhat.com/mailman/listinfo/libvirt-cim<br>
</font></tt>