<br><tt><font size=2>libvirt-cim-bounces@redhat.com wrote on 2008-09-29
19:36:20:<br>
<br>
> <br>
> <br>
> yunguol@cn.ibm.com wrote:<br>
> >      <br>
> > diff -r 0ecb3a22c361 -r 145cde258442 suites/libvirt-<br>
> cim/cimtest/HostedService/03_forward_errs.py<br>
> > --- a/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py
<br>
> Fri Sep 26 02:44:52 2008 -0700<br>
> > +++ b/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py
<br>
> Fri Sep 26 19:29:43 2008 -0700<br>
> > @@ -25,6 +25,7 @@ from pywbem.cim_obj import CIMInstanceNa<br>
> >  from pywbem.cim_obj import CIMInstanceName<br>
> >  from XenKvmLib import assoc<br>
> >  from XenKvmLib import enumclass<br>
> > +from XenKvmLib.common_util import get_host_info<br>
> >  from XenKvmLib.classes import get_typed_class<br>
> >  from CimTest.Globals import logger, CIM_ERROR_ENUMERATE,
CIM_USER, \<br>
> >                  
           CIM_PASS, CIM_NS<br>
> > @@ -40,24 +41,22 @@ def main():<br>
> >      options = main.options<br>
> >      rc = -1<br>
> >      status = FAIL<br>
> > -    keys = ['Name', 'CreationClassName']<br>
> > -    try:<br>
> > -        host_sys = enumclass.enumerate(options.ip,
'HostSystem', <br>
> keys, options.virt)[0]<br>
> > -    except Exception:<br>
> > -        logger.error(CIM_ERROR_ENUMERATE
% host_sys.name)<br>
> > +    status, host_name, host_ccn = get_host_info(options.ip,
options.virt)<br>
> > +    if status != PASS:<br>
> > +        logger.error("Error in calling
get_host_info function")<br>
> >          return FAIL<br>
> > -<br>
> > -    <br>
> > + <br>
> >      conn = assoc.myWBEMConnection('http://%s'
% options.ip,               <br>
> >                  
                 (CIM_USER,
CIM_PASS),<br>
> >                  
                  CIM_NS)<br>
> >      instanceref = CIMInstanceName(get_typed_class(options.virt,
<br>
> "HostSystem"), <br>
> > -                  
               keybindings = {"Wrong"
: <br>
> "wrong", "CreationClassName" : host_sys.CreationClassName})<br>
> > +                  
               keybindings = {"Wrong"
: "wrong", \<br>
> > +                  
               "CreationClassName"
: host_ccn})<br>
> ><br>
> >      names = []<br>
> > -<br>
> > +    assoc_class = get_typed_class(options.virt, "HostedService")<br>
> >      try:<br>
> > -        names = conn.AssociatorNames(instanceref,
AssocClass = <br>
> get_typed_class(options.virt, "HostedService"))<br>
> > +        names = conn.AssociatorNames(instanceref,
AssocClass = assoc_class)<br>
> >          rc = 0<br>
> >      except pywbem.CIMError, (rc, desc):<br>
> >          if rc == exp_rc and desc.find(exp_desc)
>= 0:<br>
> > @@ -70,7 +69,8 @@ def main():<br>
> >          logger.error(details)<br>
> ><br>
> >      if rc == 0:<br>
> > -        logger.error("HostedService
associator should NOT return <br>
> excepted result with a wrong key name and value of HostSystem input")<br>
> > +        logger.error("HostedService
associator should NOT return <br>
> excepted result\<br>
> > +                  
   with a wrong key name and value of HostSystem input")<br>
> >          status = FAIL<br>
> >      <br>
> >      return status        <br>
> >   <br>
> The above test case passes with false positive.<br>
> The existing test case is intended to verify for exception when a
wrong <br>
> Name is passed as a parameter.<br>
> _<br>
> For ex: without the sblim-base-provider the tc would be checking_<br>
> wbemcli ain -ac Xen_HostedService <br>
> 'http://root:p@localhost:5988/root/virt:Xen_HostSystem.<br>
> CreationClassName="Xen_HostSystem",Wrong="wrong"'<br>
> *<br>
> * wbemcli: Cim: (6) CIM_ERR_NOT_FOUND: No such instance (Name)<br>
> *<br>
> <br>
> _But with the sblim-base-provider installed the tc would be checking_<br>
> <br>
> wbemcli ain -ac Xen_HostedService <br>
> 'http://root:P@localhost:5988/root/virt:Xen_HostSystem.<br>
> CreationClassName="Linux_ComputerSystem",Wrong="wrong"'<br>
> *<br>
> * wbemcli: Cim: (6) CIM_ERR_NOT_FOUND: No such instance (CreationClassName)<br>
> *<br>
> <br>
> though getting the exception for Linux_ComputerSystem in the second
case <br>
> is valid for now, as the query with the Linux_CS does not work yet,<br>
> but this is not the expected behavior of the test case.<br>
> <br>
> The tc just verifies only "No such instance " string which
is present in <br>
> both the exceptions and hence passes.<br>
> 1) This test cannot be supported to work with sblim-base-provider
<br>
> installed yet.<br>
> 2) We need to update the tc to verify the case where we pass Invalid
<br>
> CreationClassName.<br>
> 3) We need to be verifying the complete exception instead of just
<br>
> verifying part of it.<br>
> </font></tt>
<br><tt><font size=2>  Good catch - Deepti.</font></tt>
<br><tt><font size=2>  I have update the tc to verify the complete
exceptions for both HostedService03&04,</font></tt>
<br><tt><font size=2>  also  HostedService-03 to verify the case
when we pass invalid CreationClassName.</font></tt>
<br><tt><font size=2>  On HostedService-04, follow patch will to verify
other invalid properties except invalid</font></tt>
<br><tt><font size=2>  Name.</font></tt>
<br>
<br><tt><font size=2>  Thanks!</font></tt>
<br><tt><font size=2>  </font></tt>
<br><tt><font size=2><br>
> Thanks and Regards,<br>
> Deepti.<br>
> <br>
> _______________________________________________<br>
> Libvirt-cim mailing list<br>
> Libvirt-cim@redhat.com<br>
> https://www.redhat.com/mailman/listinfo/libvirt-cim<br>
</font></tt>