[Libvirt-cim] [PATCH] [TEST] Updating VSMC 01_enum.py to verify the SynchronousMethodsSupported values

Deepti B Kalakeri deeptik at linux.vnet.ibm.com
Wed Sep 3 16:00:32 UTC 2008



Kaitlin Rupert wrote:
>>
>> +    try:
>> +        if len(vsmc) != 1:
>> +            logger.error("'%s' returned '%d' instance, excepted only 
>> 1", cn, len(vsmc))
>
> This line wraps.
Can I get more details here ?
>
>> +            return FAIL
>> + +        if vsmc[0].InstanceID != "ManagementCapabilities":
>> +            print_field_error('InstanceID', vsmc[0].InstanceID, 
>> 'ManagementCapabilities')
>
> This line wraps as well.
>
>> +            return FAIL
>>
>> +        vsmc_sync_val = Set(vsmc[0].SynchronousMethodsSupported)
>> +        if len(vsmc_sync_val - sync_method_val) != 0:
>> +            print_field_error('SynchronousMethodsSupported', 
>> vsmc_sync_val, +                               sync_method_val)
>> +            return FAIL
>
> In addition to also checking the len, you'll want to check to make 
> sure the SynchronousMethodsSupported values match the values we're 
> expecting.

The above check len(vsmc_sync_val - sync_method_val)
1) Verifies the len
2) Also if the values in the list differ then difference will be greater 
than zero which means the list values does not match.
Well, I had initially done 2 check one for verifying the len of the list 
and the other for verifying the values.
But since the operation S1 - S2 did both of them I switched to the above 
option.

Let me know if you still think separating the both is good then I can do so.

Thanks and Regards,
Deepti.




More information about the Libvirt-cim mailing list