# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1223517447 25200
# Node ID fb14259f2f490a27cc3b7714ae8ad7968004fa74
# Parent 285bc0174fb36512228e1cfcaba2186a0aa112c5
[TEST] #2 Fix a false positive in HostedResourcePool/01_forward.py
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 285bc0174fb3 -r fb14259f2f49
suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py
--- a/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Wed Oct 08 03:03:37 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Wed Oct 08 18:57:27 2008
-0700
@@ -67,20 +67,22 @@ def main():
else:
logger.error("No pool returned")
return FAIL
-
- for items in pool:
- cname = items.classname
- if cname.find("MemoryPool") >=0 and items['InstanceID'] ==
"MemoryPool/0":
- status = PASS
- if cname.find("ProcessorPool") >=0 and items['InstanceID']
== "ProcessorPool/0":
- status = PASS
- if cname.find("NetworkPool") >=0 and \
- items['InstanceID'] == "NetworkPool/%s"
%default_network_name:
- status = PASS
- if cname.find("DiskPool") >=0 and \
- items['InstanceID'] == "DiskPool/%s" % default_pool_name:
- status = PASS
-
+ try:
+ for items in pool:
+ cname = items.classname
+ if cname.find("MemoryPool") >=0 and items['InstanceID']
== "MemoryPool/0":
+ status = PASS
+ elif cname.find("ProcessorPool") >=0 and
items['InstanceID'] == "ProcessorPool/0":
+ status = PASS
+ elif cname.find("NetworkPool") >=0 and \
+ items['InstanceID'] == "NetworkPool/%s"
%default_network_name:
+ status = PASS
+ elif cname.find("DiskPool") >=0 and \
+ items['InstanceID'] == "DiskPool/%s" %
default_pool_name:
+ status = PASS
+ except Exception, details:
+ logger.error(details)
+ return FAIL
return status
if __name__ == "__main__":