[PATCH] [TEST] Update RASD.01&03 for LXC support

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1212567414 -28800 # Node ID 7ca197434dfef26fd9cca7b3551c85a2178a2071 # Parent 9b2e8889d7937c66e73968e53ec31bf93f535224 [TEST] Update RASD.01&03 for LXC support Signed-off-by: Guolian Yun <yunguol@cn.ibm.com> diff -r 9b2e8889d793 -r 7ca197434dfe suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py --- a/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Tue Jun 03 13:13:39 2008 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Wed Jun 04 16:16:54 2008 +0800 @@ -58,7 +58,7 @@ from CimTest.Globals import logger from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen', 'KVM', 'XenFV'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "VSSDC_dom" test_vcpus = 1 @@ -102,9 +102,14 @@ def assoc_values(assoc_info, xml, disk, virt="Xen"): procrasd, netrasd, diskrasd, memrasd = init_list(xml, disk, virt) - proc_status = 1 + if virt == 'LXC': + proc_status = 0 + disk_status = 0 + else: + proc_status = 1 + disk_status = 1 + net_status = 0 - disk_status = 1 mem_status = 1 status = 0 try: @@ -140,8 +145,11 @@ test_disk = 'hda' 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('Unable to create domain %s' % test_dom) diff -r 9b2e8889d793 -r 7ca197434dfe suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py --- a/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py Tue Jun 03 13:13:39 2008 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py Wed Jun 04 16:16:54 2008 +0800 @@ -63,7 +63,7 @@ from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS, CIM_ERROR_GETINSTANCE from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen', 'KVM', 'XenFV'] +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "VSSDC_dom" test_vcpus = 1 @@ -81,7 +81,7 @@ } } -def init_list(): +def init_list(virt="Xen"): disk = { 'cn' : get_typed_class(virt, "DiskResourceAllocationSettingData"), \ 'instid' : '%s/%s' %(test_dom, test_disk) @@ -99,8 +99,11 @@ 'cn' : get_typed_class(virt, "NetResourceAllocationSettingData"), \ 'instid' : '%s/%s' %(test_dom,test_mac) } - - rasd_values_list =[ disk, mem, proc, net ] + + if virt == 'LXC': + rasd_values_list =[ mem ] + else: + rasd_values_list =[ disk, mem, proc, net ] return rasd_values_list def verify_rasd_err(field, keys, rasd_type): @@ -130,14 +133,16 @@ test_disk = "xvda" else: test_disk = "hda" - - vsxml = get_class(virt)(test_dom, \ - mem=test_mem, \ - vcpus = test_vcpus, \ - mac = test_mac, \ - disk = test_disk) + if options.virt == 'LXC': + vsxml = get_class(virt)(test_dom) + else: + vsxml = get_class(virt)(test_dom, \ + mem=test_mem, \ + vcpus = test_vcpus, \ + mac = test_mac, \ + disk = test_disk) + bridge = vsxml.set_vbridge(server) try: - bridge = vsxml.set_vbridge(server) ret = vsxml.define(options.ip) if not ret: logger.error("Failed to Define the domain: %s", test_dom)
participants (1)
-
yunguol@cn.ibm.com