<br><tt><font size=2>libvirt-cim-bounces@redhat.com wrote on 2008-10-07
19:49:24:<br>
<br>
> +1 for the changes in this patch.<br>
> Daisy, I have some more comments on the tc which is not part of the
<br>
> changes you have made.<br>
> At the end of the tc we have a for loop to verify the resourcepool
details.<br>
> With the existing changes we might get a false positive because before
<br>
> entering the loop the status is already assigned to PASS by <br>
> get_host_info() call if it succeeds.<br>
> After entering the for loop even when none of the if conditions match
we <br>
> will still have the status set to PASS and there are possibilities
of <br>
> the tc returning false positives because of the<br>
> status already being set to PASS.<br>
> Can you change the below in the tc :<br>
> <br>
> for items in pool:<br>
> cname = items.classname<br>
> if cname.find("MemoryPool") >=0 and items['InstanceID']
== "MemoryPool/0":<br>
> status = PASS<br>
> if cname.find("ProcessorPool") >=0 and items['InstanceID']
== <br>
> "ProcessorPool/0":<br>
> status = PASS<br>
> if cname.find("NetworkPool") >=0 and \<br>
> items['InstanceID'] == "NetworkPool/%s" %default_network_name:<br>
> status = PASS<br>
> if cname.find("DiskPool") >=0 and \<br>
> items['InstanceID'] == "DiskPool/%s" % default_pool_name:<br>
> status = PASS<br>
> To<br>
> <br>
> <br>
> <br>
> status = FAIL<br>
> for items in pool:<br>
> cname = items.classname<br>
> if cname.find("MemoryPool") >=0 and items['InstanceID']
== "MemoryPool/0":<br>
> status = PASS<br>
> if cname.find("ProcessorPool") >=0 and items['InstanceID']
== <br>
> "ProcessorPool/0":<br>
> status = PASS<br>
> if cname.find("NetworkPool") >=0 and \<br>
> items['InstanceID'] == "NetworkPool/%s" %default_network_name:<br>
> status = PASS<br>
> if cname.find("DiskPool") >=0 and \<br>
> items['InstanceID'] == "DiskPool/%s" % default_pool_name:<br>
> status = PASS<br>
> if status != PASS:<br>
> logger.error("HostedResourcePool information error")<br>
> return status<br>
> <br>
> If you have anyother better ideas, you are welcome to do the changes
<br>
> accordingly.</font></tt>
<br>
<br><tt><font size=2>  Your idea sounds good to me. I cook up a patch
for it.</font></tt>
<br><tt><font size=2>  Thanks!<br>
> <br>
> Thanks and Regards,<br>
> Deepti.<br>
> <br>
> yunguol@cn.ibm.com wrote:<br>
> > # HG changeset patch<br>
> > # User Guolian Yun <yunguol@cn.ibm.com><br>
> > # Date 1223359324 25200<br>
> > # Node ID d81c2122fff796c7a08eb45cfe679f2e690e27bf<br>
> > # Parent  311bf6eda3786eb8e47ede06c4da6dc1570aff61<br>
> > [TEST] Fix HostedResourcePool/01_forward.py to work with sblim
<br>
> base provider installed<br>
> ><br>
> > Signed-off-by: Guolian Yun <yunguol@cn.ibm.com><br>
> ><br>
> > diff -r 311bf6eda378 -r d81c2122fff7 suites/libvirt-<br>
> cim/cimtest/HostedResourcePool/01_forward.py<br>
> > --- a/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py
<br>
> Sun Oct 05 23:56:40 2008 -0700<br>
> > +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py
<br>
> Mon Oct 06 23:02:04 2008 -0700<br>
> > @@ -26,13 +26,15 @@ import sys<br>
> >  import sys<br>
> >  from XenKvmLib import assoc<br>
> >  from XenKvmLib import enumclass<br>
> > +from XenKvmLib.common_util import get_host_info<br>
> >  from XenKvmLib.const import default_network_name<br>
> >  from CimTest import Globals<br>
> >  from CimTest.Globals import logger<br>
> > -from CimTest.ReturnCodes import PASS, FAIL<br>
> > +from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC<br>
> >  from XenKvmLib.const import do_main, default_pool_name<br>
> >  from XenKvmLib.classes import get_typed_class<br>
> ><br>
> > +bug = '00007'<br>
> >  sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']<br>
> >  @do_main(sup_types)<br>
> >  def main():<br>
> > @@ -40,19 +42,17 @@ def main():<br>
> >      status = FAIL<br>
> ><br>
> >      keys = ['Name', 'CreationClassName']<br>
> > -    try:<br>
> > -        host_sys = enumclass.enumerate(options.ip,
'HostSystem', <br>
> keys, options.virt)[0]<br>
> > -    except Exception:<br>
> > -        host_cn = get_typed_class(options.virt,
"HostSystem")<br>
> > -        logger.error(Globals.CIM_ERROR_ENUMERATE
% host_cn)<br>
> > +    status, host_sys, host_cn = 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>
> >      try:<br>
> >          assoc_cn = get_typed_class(options.virt,
"HostedResourcePool")<br>
> >          pool = assoc.AssociatorNames(options.ip,<br>
> >                  
                    assoc_cn,<br>
> > -                  
                  host_sys.CreationClassName,<br>
> > -                  
                  Name = host_sys.Name,<br>
> > -                  
                  CreationClassName
= <br>
> host_sys.CreationClassName)<br>
> > +                  
                  host_cn,<br>
> > +                  
                  Name = host_sys,<br>
> > +                  
                  CreationClassName
= host_cn)<br>
> >      except Exception, details:<br>
> >          logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES
% assoc_cn)<br>
> >          logger.error("Exception:",
 details)<br>
> > @@ -62,8 +62,11 @@ def main():<br>
> >          logger.error("System association
failed")<br>
> >          return FAIL<br>
> >      elif len(pool) == 0:<br>
> > -        logger.error("No pool returned")<br>
> > -        return FAIL<br>
> > +        if host_cn == 'Linux_ComputerSystem':<br>
> > +            return XFAIL_RC(bug)<br>
> > +        else:<br>
> > +            logger.error("No
pool returned")<br>
> > +            return FAIL<br>
> >      <br>
> >      for items in pool:<br>
> >          cname = items.classname<br>
> ><br>
> > _______________________________________________<br>
> > Libvirt-cim mailing list<br>
> > Libvirt-cim@redhat.com<br>
> > https://www.redhat.com/mailman/listinfo/libvirt-cim<br>
> >   <br>
> <br>
> _______________________________________________<br>
> Libvirt-cim mailing list<br>
> Libvirt-cim@redhat.com<br>
> https://www.redhat.com/mailman/listinfo/libvirt-cim<br>
</font></tt>