# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1212562914 -28800
# Node ID ed86d8901057e45ff9a2173da0232746626bff0c
# Parent 9b2e8889d7937c66e73968e53ec31bf93f535224
[TEST] Update ResourcePool.01&02 for LXC support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 9b2e8889d793 -r ed86d8901057 suites/libvirt-cim/cimtest/ResourcePool/01_enum.py
--- a/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Tue Jun 03 13:13:39 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Wed Jun 04 15:01:54 2008 +0800
@@ -39,7 +39,7 @@
from XenKvmLib.common_util import cleanup_restore, test_dpath, \
create_diskpool_file
-sup_types = ['Xen', 'KVM']
+sup_types = ['Xen', 'KVM', 'LXC']
diskid = "%s/%s" % ("DiskPool", test_dpath)
dp_cn = 'DiskPool'
@@ -127,12 +127,13 @@
return FAIL
status = verify_fields(pool_list, propool, get_typed_class(virt, pp_cn))
- try:
- diskpool = enumerate(ip, dp_cn, key_list, virt)
- except Exception:
- logger.error(Globals.CIM_ERROR_ENUMERATE % dp_cn)
- return FAIL
- status = verify_fields(pool_list, diskpool, get_typed_class(virt, dp_cn))
+ if virt == 'LXC':
+ try:
+ diskpool = enumerate(ip, dp_cn, key_list, virt)
+ except Exception:
+ logger.error(Globals.CIM_ERROR_ENUMERATE % dp_cn)
+ return FAIL
+ status = verify_fields(pool_list, diskpool, get_typed_class(virt, dp_cn))
try:
netpool = enumerate(ip, np_cn, key_list, virt)
diff -r 9b2e8889d793 -r ed86d8901057
suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py
--- a/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py Tue Jun 03 13:13:39 2008
-0700
+++ b/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py Wed Jun 04 15:01:54 2008
+0800
@@ -40,7 +40,7 @@
from XenKvmLib.common_util import cleanup_restore, test_dpath, \
create_diskpool_file
-sup_types = ['Xen', 'KVM']
+sup_types = ['Xen', 'KVM', 'LXC']
expr_values = {
"invalid_keyname" : { 'rc' : pywbem.CIM_ERR_FAILED,
@@ -112,13 +112,19 @@
cleanup_restore(ip, virt)
return SKIP
netid = "%s/%s" % ("NetworkPool", test_network)
-
- cn_instid_list = {
- get_typed_class(virt, "DiskPool") : "DiskPool/foo",
- get_typed_class(virt, "MemoryPool") : "MemoryPool/0",
- get_typed_class(virt, "NetworkPool") : netid,
- get_typed_class(virt, "ProcessorPool") :
"ProcessorPool/0"
- }
+ if virt == 'LXC':
+ cn_instid_list = {
+ get_typed_class(virt, "MemoryPool") :
"MemoryPool/0",
+ get_typed_class(virt, "NetworkPool") : netid,
+ get_typed_class(virt, "ProcessorPool") :
"ProcessorPool/0"
+ }
+ else:
+ cn_instid_list = {
+ get_typed_class(virt, "DiskPool") :
"DiskPool/foo",
+ get_typed_class(virt, "MemoryPool") :
"MemoryPool/0",
+ get_typed_class(virt, "NetworkPool") : netid,
+ get_typed_class(virt, "ProcessorPool") :
"ProcessorPool/0"
+ }
for cn, instid in cn_instid_list.items():
ret_value = err_invalid_instid_keyname(conn, cn, instid)