[Libvirt-cim] [PATCH] [TEST] Fix ComputerSystem/41_cs_to_settingdefinestate.py to work with Input and Graphics devices

yunguol at cn.ibm.com yunguol at cn.ibm.com
Tue Dec 30 05:54:54 UTC 2008


# HG changeset patch
# User Guolian Yun <yunguol at cn.ibm.com>
# Date 1230616480 28800
# Node ID 50352cad18df68a6beb36a0c16c7e4b2591b8290
# Parent  5849e413cc6e3d3330d11fbda9e9b954af774ac0
[TEST] Fix ComputerSystem/41_cs_to_settingdefinestate.py to work with Input and Graphics devices

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

diff -r 5849e413cc6e -r 50352cad18df suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py	Tue Dec 23 13:51:22 2008 -0800
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py	Mon Dec 29 21:54:40 2008 -0800
@@ -62,17 +62,21 @@
 from XenKvmLib.classes import get_typed_class
 from XenKvmLib.test_doms import destroy_and_undefine_all
 from XenKvmLib.assoc import Associators, AssociatorNames
+from XenKvmLib.const import get_provider_version
 from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES, \
 CIM_ERROR_ASSOCIATORS
 from XenKvmLib.const import do_main
 from CimTest.ReturnCodes import PASS, FAIL
 from XenKvmLib import rasd
 from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \
-verify_diskrasd_values, verify_memrasd_values, rasd_init_list
+verify_diskrasd_values, verify_memrasd_values, verify_inputrasd_values, \
+verify_displayrasd_values, rasd_init_list
 from XenKvmLib.common_util import poll_for_state_change
 from XenKvmLib.classes import get_typed_class
 
 sup_types = ['Xen', 'XenFV', 'KVM']
+graphics_dev_rev = 725
+input_dev_rev = 745
 
 test_dom    = "CrossClass_GuestDom"
 test_vcpus  = 1
@@ -200,7 +204,9 @@
     prasd = get_typed_class(virt, 'ProcResourceAllocationSettingData')
     mrasd = get_typed_class(virt, 'MemResourceAllocationSettingData')
     nrasd = get_typed_class(virt, 'NetResourceAllocationSettingData')
-    drasd = get_typed_class(virt, 'DiskResourceAllocationSettingData') 
+    drasd = get_typed_class(virt, 'DiskResourceAllocationSettingData')
+    grasd = get_typed_class(virt, 'GraphicsResourceAllocationSettingData')
+    irasd = get_typed_class(virt, 'InputResourceAllocationSettingData') 
 
     try:
 
@@ -216,7 +222,13 @@
         # and hence expect the in_setting_define_state to contain just 4 entries.
         an  = get_typed_class(virt, "SystemDevice")
         qcn = "Logical Devices"
-        exp_len = 4
+        curr_cim_rev, changeset = get_provider_version(virt, server)
+        if curr_cim_rev >= graphics_dev_rev and curr_cim_rev <= input_dev_rev:
+            exp_len = 5
+        elif curr_cim_rev >= input_dev_rev:
+            exp_len = 6
+        else:
+            exp_len = 4
         if check_len(an, in_setting_define_state, qcn, exp_len) != PASS:
             return FAIL, in_setting_define_state
 
@@ -256,6 +268,10 @@
                 status = verify_diskrasd_values(assoc_info[index], rasd)
             elif CCName == mrasd:
                 status  = verify_memrasd_values(assoc_info[index], rasd)
+            elif CCName == grasd:
+                status = verify_displayrasd_values(assoc_info[index], rasd)
+            elif CCName == irasd:
+                status = verify_inputrasd_values(assoc_info[index], rasd)
             else:
                 status = FAIL
             if status != PASS:
@@ -362,7 +378,13 @@
 
     # Verifying that the in_vssdc_list contains 4 entries one each for mem rasd,
     # network rasd, processor rasd and disk rasd.
-    exp_len = 4
+    curr_cim_rev, changeset = get_provider_version(virt, server)
+    if curr_cim_rev >= graphics_dev_rev and curr_cim_rev <= input_dev_rev:
+        exp_len = 5
+    elif curr_cim_rev >= input_dev_rev:
+       exp_len = 6
+    else:
+       exp_len = 4
     if check_len(an, in_vssdc_list, qcn, exp_len) != PASS:
         vsxml.destroy(server)
         return FAIL 




More information about the Libvirt-cim mailing list