[PATCH] [TEST] Update SettingsDefine.01~04 for LXC support

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1212556756 -28800 # Node ID 9d471559a53aee2058545de88471c0288c14af46 # Parent 9b2e8889d7937c66e73968e53ec31bf93f535224 [TEST] Update SettingsDefine.01~04 for LXC support Signed-off-by: Guolian Yun <yunguol@cn.ibm.com> diff -r 9b2e8889d793 -r 9d471559a53a suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Tue Jun 03 13:13:39 2008 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Wed Jun 04 13:19:16 2008 +0800 @@ -37,7 +37,7 @@ from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen', 'KVM', 'XenFV'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "domu1" test_mac = "00:11:22:33:44:aa" @@ -71,19 +71,23 @@ else: test_disk = 'hda' virt_xml = vxml.get_class(options.virt) - cxml = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, - disk = test_disk) + if options.virt == 'LXC': + cxml = virt_xml(test_dom) + cn_id = {'Memory' : 'mem'} + else: + cxml = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, + disk = test_disk) + cn_id = { + 'LogicalDisk' : test_disk, + 'Memory' : 'mem', + 'NetworkPort' : test_mac, + 'Processor' : test_vcpus -1 } + ret = cxml.create(options.ip) if not ret: Globals.logger.error("Failed to Create the dom: %s", test_dom) return FAIL - - cn_id = { - 'LogicalDisk' : test_disk, - 'Memory' : 'mem', - 'NetworkPort' : test_mac, - 'Processor' : test_vcpus -1 } devlist = {} diff -r 9b2e8889d793 -r 9d471559a53a suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Tue Jun 03 13:13:39 2008 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Wed Jun 04 13:19:16 2008 +0800 @@ -62,7 +62,7 @@ from XenKvmLib.const import CIM_REV -sup_types = ['Xen', 'KVM', 'XenFV'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "virtgst" test_vcpus = 1 @@ -166,8 +166,11 @@ status = PASS virt_xml = vxml.get_class(options.virt) - cxml = virt_xml(test_dom, mem = test_mem, vcpus = test_vcpus, - mac = test_mac, disk = test_disk) + if options.virt == 'LXC': + cxml = virt_xml(test_dom) + else: + cxml = virt_xml(test_dom, mem = test_mem, vcpus = test_vcpus, + mac = test_mac, disk = test_disk) ret = cxml.create(options.ip) if not ret: logger.error("Failed to create the dom: %s", test_dom) diff -r 9b2e8889d793 -r 9d471559a53a suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Tue Jun 03 13:13:39 2008 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Wed Jun 04 13:19:16 2008 +0800 @@ -154,7 +154,7 @@ from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS from CimTest.Globals import do_main -sup_types = ['Xen', 'KVM', 'XenFV'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "domu1" test_mac = "00:11:22:33:44:aa" @@ -215,8 +215,11 @@ test_disk = 'hda' virt_xml = vxml.get_class(options.virt) - cxml= virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, - disk = test_disk) + if options.virt == 'LXC': + cxml = virt_xml(test_dom) + else: + cxml= virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, + disk = test_disk) ret = cxml.create(options.ip) if not ret: @@ -226,13 +229,15 @@ global conn conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, \ CIM_PASS), CIM_NS) - - class_id = { - get_typed_class(options.virt, 'LogicalDisk') : test_disk, - get_typed_class(options.virt, 'Memory') : 'mem', - get_typed_class(options.virt, 'NetworkPort') : test_mac, - get_typed_class(options.virt, 'Processor') : test_vcpus - 1 - } + if options.virt == 'LXC': + class_id = {get_typed_class(options.virt, 'Memory') : 'mem'} + else: + class_id = { + get_typed_class(options.virt, 'LogicalDisk') : test_disk, + get_typed_class(options.virt, 'Memory') : 'mem', + get_typed_class(options.virt, 'NetworkPort') : test_mac, + get_typed_class(options.virt, 'Processor') : test_vcpus - 1 + } tc_scen = [ 'INVALID_DevID_Keyname', 'INVALID_DevID_Keyval', \ diff -r 9b2e8889d793 -r 9d471559a53a suites/libvirt-cim/cimtest/SettingsDefine/04_sds_rev_errs.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/04_sds_rev_errs.py Tue Jun 03 13:13:39 2008 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/04_sds_rev_errs.py Wed Jun 04 13:19:16 2008 +0800 @@ -63,7 +63,7 @@ from CimTest.Globals import do_main, logger from CimTest.Globals import CIM_USER, CIM_PASS, CIM_NS -sup_types = ['Xen', 'KVM', 'XenFV'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "domu1" test_mac = "00:11:22:33:44:aa" @@ -104,8 +104,11 @@ test_disk = 'hda' virt_xml = vxml.get_class(options.virt) - cxml = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, - disk = test_disk) + if options.virt == 'LXC': + cxml = virt_xml(test_dom) + else: + cxml = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac, + disk = test_disk) ret = cxml.create(options.ip) if not ret: @@ -117,12 +120,19 @@ CIM_PASS), CIM_NS) rasd_base= 'ResourceAllocationSettingData' - class_id = { - get_typed_class(options.virt, 'Disk' + rasd_base) : test_disk, - get_typed_class(options.virt, 'Mem' + rasd_base) : 'mem', - get_typed_class(options.virt, 'Net' + rasd_base) : test_mac, - get_typed_class(options.virt, 'Proc' + rasd_base) : test_vcpus - 1 - } + if options.virt == 'LXC': + class_id = { + get_typed_class(options.virt, 'Disk' + rasd_base) : test_disk, + get_typed_class(options.virt, 'Mem' + rasd_base) : 'mem', + get_typed_class(options.virt, 'Proc' + rasd_base) : test_vcpus - 1 + } + else: + class_id = { + get_typed_class(options.virt, 'Disk' + rasd_base) : test_disk, + get_typed_class(options.virt, 'Mem' + rasd_base) : 'mem', + get_typed_class(options.virt, 'Net' + rasd_base) : test_mac, + get_typed_class(options.virt, 'Proc' + rasd_base) : test_vcpus - 1 + } tc_scen = ['INVALID_InstID_Keyname', 'INVALID_InstID_Keyval']
participants (1)
-
yunguol@cn.ibm.com