# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1208310365 25200
# Node ID 16d0609fdfaaff43564203dcdd61295baa52b44c
# Parent b9ce0dcc277e51d5865b611ebd092874e856bbe2
[TEST] update DeviceID verification in Processor.01
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r b9ce0dcc277e -r 16d0609fdfaa suites/libvirt-cim/cimtest/Processor/01_processor.py
--- a/suites/libvirt-cim/cimtest/Processor/01_processor.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/Processor/01_processor.py Tue Apr 15 18:46:05 2008 -0700
@@ -32,6 +32,7 @@ from XenKvmLib.vxml import XenXML, KVMXM
from XenKvmLib.vxml import XenXML, KVMXML, get_class
from CimTest.Globals import log_param, logger
from CimTest.Globals import do_main
+from CimTest.ReturnCodes import PASS, FAIL
SUPPORTED_TYPES = ['Xen', 'KVM', 'XenFV']
@@ -42,7 +43,7 @@ def main():
def main():
options = main.options
log_param()
- status = 0
+ status = PASS
vsxml = get_class(options.virt)(test_dom, vcpus=test_vcpus)
vsxml.define(options.ip)
vsxml.start(options.ip)
@@ -50,7 +51,7 @@ def main():
# Processor instance enumerate need the domain to be active
domlist = live.active_domain_list(options.ip, options.virt)
if test_dom not in domlist:
- status = 1
+ status = FAIL
logger.error("Domain not started, we're not able to check vcpu")
else:
for i in range(0, test_vcpus):
@@ -62,7 +63,11 @@ def main():
}
try:
dev = eval(('devices.' + get_typed_class(options.virt,
'Processor')))(options.ip, key_list)
- logger.info("Checked device %s" % devid)
+ if dev.DeviceID == devid:
+ logger.info("Checked device %s" % devid)
+ else:
+ logger.error("Mismatching device, returned %s instead %s" %
+ (dev.DeviceID, devid))
except Exception, details:
logger.error("Error check device %s: %s" % (devid, details))
status = 1