<br><font size=2 face="sans-serif">+1 from me</font>
<br>
<br><font size=2 face="sans-serif">Best,<br>
Regards<br>
<br>
Daisy (Ô˹úÁ«)<br>
VSM Team, China Systems & Technology Labs (CSTL)<br>
E-mail: yunguol@cn.ibm.com<br>
TEL: (86)-21-60922144<br>
Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203<br>
</font>
<br>
<br><tt><font size=2>libvirt-cim-bounces@redhat.com wrote on 2008-07-16
00:10:46:<br>
<br>
> # HG changeset patch<br>
> # User Kaitlin Rupert <karupert@us.ibm.com><br>
> # Date 1215806699 25200<br>
> # Node ID 30509a2ca9f2c68bf925f0d5fa2a3a65c602073f<br>
> # Parent  7ea2f4ed91cd8b69bc0b8c34304cf3ef870a1b05<br>
> [TEST] #2 Add compare_all_prop().<br>
> <br>
> This function takes an instance from the list returned bu the <br>
> Associators() call and an instance from a getInstance() / <br>
> enumerate_instances() call.  It compares all of the property
values <br>
> to ensure the instances are identical.<br>
> <br>
> This function could probably be added to a fair number of tests as
<br>
> an additional verification check.<br>
> <br>
> Updates from 1 to 2:<br>
>   -Added logger import statement<br>
>   -Included FAIL in the ReturnCodes import.<br>
>   -Tested failure path to be sure error message is logged and
FAIL <br>
> is returned properly.<br>
> <br>
> <br>
> Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com><br>
> <br>
> diff -r 7ea2f4ed91cd -r 30509a2ca9f2 suites/libvirt-cim/lib/XenKvmLib/assoc.py<br>
> --- a/suites/libvirt-cim/lib/XenKvmLib/assoc.py   Thu Jun 05
19:28:<br>
> 30 2008 -0700<br>
> +++ b/suites/libvirt-cim/lib/XenKvmLib/assoc.py   Fri Jul 11
13:04:<br>
> 59 2008 -0700<br>
> @@ -27,6 +27,8 @@<br>
>  import pywbem<br>
>  from pywbem.cim_obj import CIMInstanceName<br>
>  from XenKvmLib.classes import get_typed_class<br>
> +from CimTest.ReturnCodes import PASS, FAIL<br>
> +from CimTest.Globals import logger<br>
>  <br>
>  def AssociatorNames(host, basetype, baseobj, virt="Xen",
**keys):<br>
>      '''Resolve the association specified by @type,
given the<br>
> @@ -139,3 +141,17 @@<br>
>  <br>
>      return new_list<br>
>  <br>
> +def compare_all_prop(inst, exp_inst):<br>
> +    prop_vals = inst.items()<br>
> +<br>
> +    for i in range(0, len(prop_vals)):<br>
> +        key = prop_vals[i][0]<br>
> +        val = eval('exp_inst.' + key)<br>
> +<br>
> +        if prop_vals[i][1] != val:<br>
> +            logger.error("%s val
mismatch: got %s, expected %s" % (key,<br>
> +                    
    prop_vals[i][1], val))<br>
> +            return FAIL<br>
> +<br>
> +    return PASS<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>