libvirt-cim-bounces@redhat.com wrote on 2008-10-17 00:28:33:

> yunguol@cn.ibm.com wrote:
> > # HG changeset patch
> > # User Guolian Yun <yunguol@cn.ibm.com>
> > # Date 1224140552 25200
> > # Node ID 0167493d2ce4cad2c09d572964844f199555fcb4
> > # Parent  96d45b1dcc0801ade819413abe1af43b3957dde4
> > [TEST] Update Profile/02_profile_to_elec.py to call new EnumNames
> >
> > This tc updates fails for me, I look into this but I can't work it out.
> >
> >
> > Signed-off-by: Guolian Yun <yunguol@cn.ibm.com>
> >
> > diff -r 96d45b1dcc08 -r 0167493d2ce4 suites/libvirt-
> cim/cimtest/Profile/02_profile_to_elec.py
> > --- a/suites/libvirt-cim/cimtest/Profile/02_profile_to_elec.py  
> Wed Oct 15 06:07:28 2008 -0700
> > +++ b/suites/libvirt-cim/cimtest/Profile/02_profile_to_elec.py  
> Thu Oct 16 00:02:32 2008 -0700
> > @@ -95,7 +95,7 @@ def get_profile(server, virt):
> >      profile = None
> >
> >      try:
> > -        proflist = enumclass.enumerate_inst(server,
> 'RegisteredProfile', virt)
> > +        proflist = enumclass.EnumNames(server, cn)
> >          status, profile = get_expected_inst(cn, proflist, 'RegisteredName',
> >                                              registeredname)
> >      except Exception, detail:
>
> This is because EnumNames() only returns a reference, not and instance.
>   The test case is attempting to verify the attributes of the instance,
> but that's not possible with just a reference.
>
> What you'll need to do is change enumclass.EnumNames() to
> enumclass.EnumInstances().  In addition, you'll need to modify
> EnumInstances() so that it can return either CIM_CimtestClass objects or
> a CIMInstance objects.
>

  I updated EnumInstances so it returns both CIMInstance and CIM_CimtestClass objects.
  And #2 patch for tc on the way.

  Thanks!

> I did something similar with GetInstance() in this patch:
>     "Update inst_to_mof() to convert CIM_CimtestClass instances to inst"
>
> --
> Kaitlin Rupert
> IBM Linux Technology Center
> kaitlin@linux.vnet.ibm.com
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim@redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim