[Libvirt-cim] [PATCH] [TEST] update processor id in Processor01~03

Guo Lian Yun yunguol at cn.ibm.com
Mon Apr 14 02:29:52 UTC 2008


# HG changeset patch
# User Guolian Yun <yunguol at cn.ibm.com>
# Date 1208140185 25200
# Node ID fa24152bf20383e0ae5104fa3e81687aab8c1c91
# Parent  137e5079c73fcbfc70e6654cee0b3c3eb3c6acd2
[TEST] update processor id in Processor01~03

Signed-off-by: Guolian Yun <yunguol at cn.ibm.com>

diff -r 137e5079c73f -r fa24152bf203 suites/libvirt-cim/cimtest/Processor/01_processor.py
--- a/suites/libvirt-cim/cimtest/Processor/01_processor.py	Fri Apr 11 16:58:23 2008 +0530
+++ b/suites/libvirt-cim/cimtest/Processor/01_processor.py	Sun Apr 13 19:29:45 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,22 +51,26 @@ 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):
-            devid = "%s/%s" % (test_dom, i)
-            key_list = { 'DeviceID' : devid,
-                         'CreationClassName' : get_typed_class(options.virt, "Processor"),
-                         'SystemName' : test_dom,
-                         'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem")
-                       }
-            try:
-                dev = eval(('devices.' + get_typed_class(options.virt, 'Processor')))(options.ip, key_list)
+        devid = "%s/%s" % (test_dom, "proc")
+        key_list = { 'DeviceID' : devid,
+                     'CreationClassName' : get_typed_class(options.virt, "Processor"),
+                     'SystemName' : test_dom,
+                     'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem")
+                   }
+        try:
+            dev = eval(('devices.' + get_typed_class(options.virt, 'Processor')))(options.ip, key_list)
+            if dev.DeviceID == devid:
                 logger.info("Checked device %s" % devid)
-            except Exception, details:
-                logger.error("Error check device %s: %s" % (devid, details))
-                status = 1
+            else:
+ 	        logger.error("Mismatching device, returned %s instead %s" % 
+ 		            (dev.DeviceID, devid))
+	        status = FAIL
+        except Exception, details:
+            logger.error("Error check device %s: %s" % (devid, details))
+            status = FAIL
 
     vsxml.stop(options.ip)
     vsxml.undefine(options.ip)
diff -r 137e5079c73f -r fa24152bf203 suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py
--- a/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py	Fri Apr 11 16:58:23 2008 +0530
+++ b/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py	Sun Apr 13 19:29:45 2008 -0700
@@ -39,6 +39,7 @@ from XenKvmLib.common_util import create
 from XenKvmLib.common_util import create_using_definesystem 
 from XenKvmLib.devices import get_dom_proc_insts
 from CimTest.Globals import log_param, logger, do_main
+from CimTest.ReturnCodes import PASS, FAIL
 
 sup_types = ['Xen', 'KVM', 'XenFV']
 
@@ -49,28 +50,28 @@ def check_processors(procs):
     if len(procs) != test_vcpus:
         logger.error("%d vcpu instances were returned. %d expected", 
                      len(procs), test_vcpus)
-        return 1
+        return FAIL
 
     for proc in procs:
         if proc['SystemName'] != default_dom: 
             logger.error("Inst returned is for guesst %s, expected guest %s.", 
                          procs['SystemName'], default_dom)
-            return 1
+            return FAIL
 
-        devid = "%s/%s" % (default_dom, test_vcpus - 1)
+        devid = "%s/%s" % (default_dom, "proc")
 
         if proc['DeviceID'] != devid: 
             logger.error("DeviceID %s does not match expected %s.", 
                          procs['DeviceID'], devid)
-            return 1
+            return FAIL
 
-    return 0
+    return PASS
         
 @do_main(sup_types)
 def main():
     options = main.options
     log_param()
-    status = 0
+    status = PASS
 
     undefine_test_domain(default_dom, options.ip)
 
@@ -94,7 +95,7 @@ def main():
 
     except Exception, detail:
         logger.error("Exception: %s" % detail)
-        status = 1
+        status = FAIL
 
     finally:
         undefine_test_domain(default_dom, options.ip)
diff -r 137e5079c73f -r fa24152bf203 suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py
--- a/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py	Fri Apr 11 16:58:23 2008 +0530
+++ b/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py	Sun Apr 13 19:29:45 2008 -0700
@@ -174,7 +174,7 @@ def main():
     options = main.options
     log_param()
 
-    devid = "%s/%s" % (test_dom, "0")
+    devid = "%s/%s" % (test_dom, "proc")
     status = PASS
 
     # Getting the VS list and deleting the test_dom if it already exists.




More information about the Libvirt-cim mailing list