# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1215776529 25200
# Node ID 25cd5c474b0797d36d67e200b4f8ed4ffa9cfedc
# Parent 0f8b7f041b91761da40aee3f6574338de6c178fd
[TEST] Adding functions to verify the EAFP fields .
Added functions verify_common_pool_values(), verify_specific_fields() and
verify_disk_mem_proc_pool_values()
to be helpful to verify the EAFP fields returned when queried with Logicaldevices.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 0f8b7f041b91 -r 25cd5c474b07 suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py
--- a/suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py Thu Jul 10 06:07:36 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/logicaldevices.py Fri Jul 11 04:42:09 2008 -0700
@@ -123,3 +123,34 @@
return FAIL
return PASS
+def verify_common_pool_values(assoc_info, list_values):
+ if assoc_info['InstanceID'] != list_values['InstanceID']:
+ field_err(assoc_info, list_values, fieldname = 'InstanceID')
+ return FAIL
+ if assoc_info['PoolID'] != list_values['PoolID']:
+ field_err(assoc_info, list_values, fieldname = 'PoolID')
+ return FAIL
+ if assoc_info['ResourceType'] != list_values['ResourceType']:
+ field_err(assoc_info, list_values, fieldname = 'ResourceType')
+ return FAIL
+ return PASS
+
+def verify_specific_fields(assoc_info, list_values):
+ if assoc_info['Capacity'] != list_values['Capacity']:
+ field_err(assoc_info, list_values, fieldname = 'Capacity')
+ return FAIL
+ if assoc_info['Reserved'] != list_values['Reserved']:
+ field_err(assoc_info, list_values, fieldname = 'Reserved')
+ return FAIL
+ if assoc_info['AllocationUnits'] != list_values['AllocationUnits']:
+ field_err(assoc_info, list_values, fieldname = 'AllocationUnits')
+ return FAIL
+ return PASS
+
+def verify_disk_mem_proc_pool_values(assoc_info, list_values):
+ status = verify_common_pool_values(assoc_info, list_values)
+ if status != PASS:
+ return status
+ status = verify_specific_fields(assoc_info, list_values)
+ return status
+