# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1213339312 -28800
# Node ID bad1f84147e979809c1da8f165b3181f354e9d53
# Parent b9100cec9aedb9f9243d753111a9a856e9480335
[TEST] Update ResourceAllocationFromPool.02 for LXC support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r b9100cec9aed -r bad1f84147e9
suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py
--- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Wed Jun 11
03:38:49 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Fri Jun 13
14:41:52 2008 +0800
@@ -38,7 +38,7 @@
create_netpool_conf
-sup_types = ['Xen', 'XenFV', 'KVM']
+sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
test_dom = "RAFP_dom"
test_vcpus = 1
test_mem = 128
@@ -54,8 +54,11 @@
test_disk = "hda"
virtxml = get_class(virt)
- vsxml = virtxml(test_dom, mem=test_mem, vcpus = test_vcpus,
- mac = test_mac, disk = test_disk)
+ if virt == 'LXC':
+ vsxml = virtxml(test_dom)
+ else:
+ vsxml = virtxml(test_dom, mem=test_mem, vcpus = test_vcpus,
+ mac = test_mac, disk = test_disk)
try:
ret = vsxml.define(server)
if not ret:
@@ -68,7 +71,7 @@
return PASS, vsxml, test_disk
-def init_list(test_disk, diskid, test_network):
+def init_list(test_disk, diskid, test_network, virt='Xen'):
if CIM_REV < proc_instid_rev:
procid = '%s/%s' % (test_dom, 0)
@@ -92,12 +95,17 @@
'pool_id' : diskid
}
- cn_id_list = {
- 'MemResourceAllocationSettingData' : mem,
- 'ProcResourceAllocationSettingData' : proc,
- 'NetResourceAllocationSettingData' : net,
- 'DiskResourceAllocationSettingData' : disk
- }
+ if virt == 'LXC':
+ cn_id_list = {
+ 'MemResourceAllocationSettingData' : mem,
+ }
+ else:
+ cn_id_list = {
+ 'MemResourceAllocationSettingData' : mem,
+ 'ProcResourceAllocationSettingData' : proc,
+ 'NetResourceAllocationSettingData' : net,
+ 'DiskResourceAllocationSettingData' : disk
+ }
return cn_id_list
@@ -174,7 +182,7 @@
if status != PASS:
return status
- cn_id_list = init_list(test_disk, diskid, test_network)
+ cn_id_list = init_list(test_disk, diskid, test_network, options.virt)
for rasd_cn, id_info in cn_id_list.iteritems():
status = get_rasdinst_verify_pool_from_RAFP(server, virt, vsxml,