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

# HG changeset patch # User Guolian Yun <yunguol@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@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

yunguol@cn.ibm.com wrote:
# HG changeset patch # User Guolian Yun <yunguol@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@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
Thanks Daisy for making the changes. I had made changes to fix this tc which were almost similar to yours. But, Kaitlin had some comments for the changes I did to fix this test case. You can have a look at the comments for the same in the reply by kaitlin for patch "Fixing 41_cs_to_settingdefinestate.py tc of CS to work with the latest libvirt-cim changes". Can you take care of that ? Thanks and Regards, Deepti.

libvirt-cim-bounces@redhat.com wrote on 2008-12-30 17:13:31:
yunguol@cn.ibm.com wrote:
# HG changeset patch # User Guolian Yun <yunguol@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@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
Thanks Daisy for making the changes. I had made changes to fix this tc which were almost similar to yours. But, Kaitlin had some comments for the changes I did to fix this test
case.
You can have a look at the comments for the same in the reply by kaitlin
for patch "Fixing 41_cs_to_settingdefinestate.py tc of CS to work with the latest libvirt-cim changes". Can you take care of that ?
Oh, sorry, I didn't check the mail. Since you work on this, would you please continue to fix it with Kaitlin's comments? Thanks!
Thanks and Regards, Deepti.
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
participants (3)
-
Deepti B Kalakeri
-
Guo Lian Yun
-
yunguol@cn.ibm.com