[PATCH] [TEST] Fix ResourcePool.01 failure for Xen, verify exp_value in a list not the first item

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1217387789 25200 # Node ID e803555f6857e4e230749f0a8b72c0ddb3c7e8fe # Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb [TEST] Fix ResourcePool.01 failure for Xen, verify exp_value in a list not the first item Signed-off-by: Guolian Yun <yunguol@cn.ibm.com> diff -r 2efc46fd30f3 -r e803555f6857 suites/libvirt-cim/cimtest/ResourcePool/01_enum.py --- a/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Wed Jul 23 17:42:47 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Tue Jul 29 20:16:29 2008 -0700 @@ -89,11 +89,14 @@ def verify_fields(pool_list, poolname, c logger.error("%s return %i instances, expected atleast 1 instance" \ % (cn, len(poolname))) return FAIL - ret_value = poolname[0].InstanceID exp_value = pool_list[cn][0] - if ret_value != exp_value: - print_error('InstanceID', ret_value, exp_value) - status = FAIL + for i in range(0, len(poolname)): + ret_value = poolname[i].InstanceID + if ret_value == exp_value: + break + elif ret_value != exp_value and i == len(poolname)-1: + print_error('InstanceID', ret_value, exp_value) + status = FAIL ret_value = poolname[0].ResourceType exp_value = pool_list[cn][1] if ret_value != exp_value:
participants (1)
-
yunguol@cn.ibm.com