[PATCH] Submitting testcase to test the invalid inputs for the KVMRedirecionSAP class
by veeren@linux.vnet.ibm.com
# HG changeset patch
# User Veerendra C <vechandr(a)in.ibm.com>
# Date 1228887700 28800
# Node ID 2d0addd9aa5ab7d5c8dd08f6d2f85897a6eebb96
# Parent 0881bfe3b0ef3b4021c4047962fbe90e2cda2311
Submitting testcase to test the invalid inputs for the KVMRedirecionSAP class.
diff -r 0881bfe3b0ef -r 2d0addd9aa5a suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py Tue Dec 09 21:41:40 2008 -0800
@@ -0,0 +1,121 @@
+#!/usr/bin/python
+################################################################################
+# Copyright 2008 IBM Corp.
+#
+# Authors:
+# Veerendra C <vechandr(a)in.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+################################################################################
+# Example :
+# wbemcli gi 'http://root:passwd@localhost:5988/root/virt:KVM_KVMRedirectionSAP.
+# CreationClassName="KVM_KVMRedirectionSAP",Name="1:1",SystemCreationClassName=
+# "KVM_ComputerSystem",SystemName="demo"' -nl
+#
+# Test Case Info:
+# --------------
+# This testcase is used to verify if appropriate exceptions are
+# returned by KVMRedirectionSAP on giving invalid inputs for keyvalue's.
+#
+################################################################################
+
+import sys
+import pywbem
+from XenKvmLib import assoc
+from XenKvmLib.common_util import try_getinstance
+from XenKvmLib.classes import get_typed_class
+from XenKvmLib import vxml
+from CimTest.ReturnCodes import PASS, FAIL, SKIP
+from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS
+from XenKvmLib.const import do_main, get_provider_version
+
+test_dom = "demo"
+test_vcpus = 1
+sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
+
+@do_main(sup_types)
+def main():
+ options = main.options
+ libvirtcim_hr_crs_changes = 688
+ status = FAIL
+
+ # This check is required for libivirt-cim providers which do not have
+ # CRS changes in it and the CRS provider is available with revision >= 688.
+ curr_cim_rev, changeset = get_provider_version(options.virt, options.ip)
+ if (curr_cim_rev < libvirtcim_hr_crs_changes):
+ logger.info("ConsoleRedirectionService provider not supported, "
+ "hence skipping the test ....")
+ return SKIP
+
+ name = "%s:%s" % ("1", "1")
+
+ # Getting the VS list and deleting the test_dom if it already exists.
+ cxml = vxml.get_class(options.virt)(test_dom, vcpus=test_vcpus)
+ ret = cxml.cim_define(options.ip)
+
+ if not ret :
+ logger.error("ERROR: VS '%s' is not defined", test_dom)
+ return status
+
+ conn = assoc.myWBEMConnection( 'http://%s' % options.ip,
+ (CIM_USER, CIM_PASS), CIM_NS)
+
+ classname = get_typed_class(options.virt, 'KVMRedirectionSAP')
+
+ key_vals = {
+ 'SystemName': test_dom,
+ 'CreationClassName': classname,
+ 'SystemCreationClassName': get_typed_class(options.virt,
+ 'ComputerSystem'),
+ 'Name': name
+ }
+
+ expr_values = {
+ "invalid_ccname" : {'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : "No such instance (CreationClassName)" },
+ "invalid_sccname" : {'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : "No such instance (SystemCreationClassName)" },
+ "invalid_nameport" : {'rc' : pywbem.CIM_ERR_FAILED,
+ 'desc' : " Unable to determine console port for guest" },
+ "invalid_sysval" : {'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : "No such instance" }
+ }
+
+ tc_scen = {
+ 'invalid_ccname' : 'CreationClassName',
+ 'invalid_sccname' : 'SystemCreationClassName',
+ 'invalid_nameport' : 'Name',
+ 'invalid_sysval' : 'SystemName',
+ }
+
+ # Looping by passing invalid key values
+ for field, test_val in tc_scen.items():
+ newkey_vals = key_vals.copy()
+ newkey_vals[test_val] = field
+ status = try_getinstance(conn, classname, newkey_vals,
+ field_name=test_val,
+ expr_values = expr_values[field],
+ bug_no = "")
+ if status != PASS:
+ logger.error(" -------------- FAILED %s ----------- : " % field)
+ break
+
+ cxml.cim_destroy(options.ip)
+ cxml.undefine(options.ip)
+ return status
+
+if __name__ == "__main__":
+ sys.exit(main())
+
16 years
[PATCH] [TEST]Verify enum of DiskRASD to have EmulatedType=0 for Disk
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1228891942 28800
# Node ID 7b947ebadbf4c362f4bc8433d2a7acfbfd89a62e
# Parent 0881bfe3b0ef3b4021c4047962fbe90e2cda2311
[TEST]Verify enum of DiskRASD to have EmulatedType=0 for Disk
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 0881bfe3b0ef -r 7b947ebadbf4 suites/libvirt-cim/lib/XenKvmLib/rasd.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Tue Dec 09 00:01:38 2008 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Tue Dec 09 22:52:22 2008 -0800
@@ -83,6 +83,7 @@
"InstanceID" : '%s/%s' %(t_dom, t_disk),
"ResourceType" : 17,
"Address" : disk_path,
+ "EmulatedType" : 0,
},
net_cn : {
"InstanceID" : '%s/%s' %(t_dom, t_mac),
@@ -176,6 +177,11 @@
if assoc_info['ResourceType'] != diskrasd_list['ResourceType']:
RType_err(assoc_info, diskrasd_list)
status = FAIL
+ if assoc_info['EmulatedType'] != diskrasd_list['EmulatedType']:
+ logger.error("%s Mismatch", 'EmulatedType')
+ logger.error("Returned %s instead of %s ",
+ assoc_info['EmulatedType'], diskrasd_list['EmulatedType'])
+ status = FAIL
if assoc_info['Address'] != diskrasd_list['Address']:
logger.error("%s Mismatch", 'Address')
logger.error("Returned %s instead of %s ",
16 years
[PATCH] [TEST] Update VSSDComponent [02_reverse.py] to verify GRASD and InputRASD
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1228814455 28800
# Node ID af0bb1f10027c41daa9fd8b53f53abaa624df825
# Parent b12c6c2772b7b5540f06d32cdaa9c99a8bf4fb9d
[TEST] Update VSSDComponent [02_reverse.py] to verify GRASD and InputRASD
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r b12c6c2772b7 -r af0bb1f10027 suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Sun Dec 07 23:50:29 2008 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Tue Dec 09 01:20:55 2008 -0800
@@ -83,11 +83,21 @@
verified.
"""
status = PASS
+ if virt == 'LXC' or virt == 'XenFV':
+ input_device = "mouse:usb"
+ elif virt == 'Xen':
+ input_device = "mouse:xen"
+ else:
+ input_device = "mouse:ps2"
+
rasd_list = {
"proc_rasd" : '%s/%s' %(test_dom, "proc"),
"net_rasd" : '%s/%s' %(test_dom,test_mac),
"disk_rasd" : '%s/%s' %(test_dom, test_disk),
- "mem_rasd" : '%s/%s' %(test_dom, "mem")
+ "mem_rasd" : '%s/%s' %(test_dom, "mem"),
+ "input_rasd": '%s/%s' %(test_dom, input_device),
+ "grap_rasd" : '%s/%s' %(test_dom, "graphics")
+
}
try:
@@ -99,6 +109,8 @@
net_cn = get_typed_class(virt, 'NetResourceAllocationSettingData')
disk_cn = get_typed_class(virt, 'DiskResourceAllocationSettingData')
mem_cn = get_typed_class(virt, 'MemResourceAllocationSettingData')
+ input_cn = get_typed_class(virt, 'InputResourceAllocationSettingData')
+ grap_cn = get_typed_class(virt, 'GraphicsResourceAllocationSettingData')
for inst in assoc_info:
if inst.classname == proc_cn:
@@ -113,6 +125,12 @@
elif inst.classname == mem_cn:
status = check_rasd_values(inst['InstanceID'],
rasd_list['mem_rasd'])
+ elif inst.classname == input_cn:
+ status = check_rasd_values(inst['InstanceID'],
+ rasd_list['input_rasd'])
+ elif inst.classname == grap_cn:
+ status = check_rasd_values(inst['InstanceID'],
+ rasd_list['grap_rasd'])
else:
logger.error("Unexpected RASD instance type" )
status = FAIL
16 years
[PATCH] Properly quote the namespace in provider-register.sh
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1228838971 28800
# Node ID 6783a4570e3cbd33d71045a60fd136540d662633
# Parent 9e63b52769bf42a6c025b7baa32a84afff0f3828
Properly quote the namespace in provider-register.sh
This use of the namespace in an error path causes an additional error message
to be raised which adds confusion.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 9e63b52769bf -r 6783a4570e3c provider-register.sh
--- a/provider-register.sh Tue Dec 09 07:29:28 2008 -0800
+++ b/provider-register.sh Tue Dec 09 08:09:31 2008 -0800
@@ -116,7 +116,7 @@
return 1;;
esac
done
- if test $namespace = $NAMESPACE
+ if test "$namespace" = "$NAMESPACE"
then
cat >> $OUTFILE <<EOFC
instance of PG_ProviderCapabilities
16 years
[PATCH 0 of 5] [TEST] Update RAFP 01 and 02.
by Kaitlin Rupert
RAFP 01 and 02 are older tests that needed to be updated. Instead of building
keys lists and calling GetInstance(), EnumerateInstances() is called to get
the list of instances for both sides of the association.
This enables the test to behave more like a real CIM client.
16 years
[PATCH] [TEST] #2 Update SettingDefine/01_forward.py to support Graphics/Input
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1228877098 28800
# Node ID 98a6a8ba06b7a4fb1e6357b71af5bfb2016a0ba9
# Parent 0881bfe3b0ef3b4021c4047962fbe90e2cda2311
[TEST] #2 Update SettingDefine/01_forward.py to support Graphics/Input
Updates from 1 to 2:
Just add new items to the list instead of redefine
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 0881bfe3b0ef -r 98a6a8ba06b7 suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py
--- a/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Tue Dec 09 00:01:38 2008 -0800
+++ b/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Tue Dec 09 18:44:58 2008 -0800
@@ -33,10 +33,11 @@
from XenKvmLib.enumclass import GetInstance
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
-from XenKvmLib.const import do_main
+from XenKvmLib.const import do_main, get_provider_version
from CimTest.ReturnCodes import PASS, FAIL
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
+input_graphics_pool_rev = 757
test_dom = "domu1"
test_mac = "00:11:22:33:44:aa"
@@ -74,13 +75,23 @@
else:
cxml = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac,
disk = test_disk)
+ if options.virt == 'LXC' or options.virt == 'XenFV':
+ input_device = "mouse:usb"
+ elif options.virt == 'Xen':
+ input_device = "mouse:xen"
+ else:
+ input_device = "mouse:ps2"
+
cn_id = {
'LogicalDisk' : test_disk,
'Memory' : 'mem',
'NetworkPort' : test_mac,
'Processor' : test_vcpus -1 }
-
-
+ curr_cim_rev, changeset = get_provider_version(options.virt, options.ip)
+ if curr_cim_rev >= input_graphics_pool_rev:
+ cn_id['PointingDevice'] = input_device
+ cn_id['DisplayController'] = 'graphics'
+
ret = cxml.create(options.ip)
if not ret:
Globals.logger.error("Failed to Create the dom: %s", test_dom)
16 years
[PATCH] [TEST] Remove XFAIL from EC 01 and 02
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1228859898 28800
# Node ID 84313e6c8f504da2416bd3bdcc7195e3c51a5a6d
# Parent f72029b3c3e50bbadeabb9023ae8dd2175f7e89b
[TEST] Remove XFAIL from EC 01 and 02.
Fixed 01:
Update to work with CRS.
Also update the logic so that items aren't removed from the managed_ele list
when a match is properly found. It's possible for multiple profiles to return
the same managed element, so removing the elements from this list would cause
a false failure.
Instead, maintain a found list. If a managed element isn't in the found list,
return an error.
Fixed 02:
Fixed to work with SBLIM host instance as well as libvirt-cim host instance.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r f72029b3c3e5 -r 84313e6c8f50 suites/libvirt-cim/cimtest/ElementConforms/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Mon Dec 08 14:21:00 2008 -0800
+++ b/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Tue Dec 09 13:58:18 2008 -0800
@@ -46,15 +46,16 @@
from XenKvmLib.common_util import print_field_error, get_host_info
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
from XenKvmLib.const import do_main, get_provider_version
-from CimTest.ReturnCodes import PASS, FAIL, XFAIL, XFAIL_RC
+from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.enumclass import EnumInstances
sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
test_dom = "domU"
bug_sblim = '00007'
libvirt_cim_ectp_changes = 686
+libvirt_cim_input_graphics_ectp = 773
-def init_vs_pool_values(server, virt):
+def init_managed_ele_values(server, virt):
verify_ectp_list = {}
cn_names = ["ComputerSystem"]
@@ -64,6 +65,8 @@
cn_names2 = ["VirtualSystemMigrationService", "DiskPool", "NetworkPool",
"ProcessorPool", "MemoryPool"]
cn_names.extend(cn_names2)
+ if curr_cim_rev >= libvirt_cim_input_graphics_ectp:
+ cn_names.append("ConsoleRedirectionService")
status, host_inst = get_host_info(server, virt)
if status != PASS:
@@ -91,15 +94,14 @@
for ele in elements:
if assoc_val.items() == ele.items():
- managed_ele_values[cn].remove(ele)
- return PASS, managed_ele_values
+ return PASS
except Exception, details:
logger.error("verify_fields() exception: %s", details)
- return FAIL, managed_ele_values
+ return FAIL
logger.error("%s not in expected list %s", assoc_val, elements)
- return FAIL, managed_ele_values
+ return FAIL
def get_proflist(server, reg_classname, virt):
profiles_instid_list = []
@@ -162,7 +164,7 @@
verify_ectp_list = {}
try:
- status, verify_ectp_list = init_vs_pool_values(server, virt)
+ status, verify_ectp_list = init_managed_ele_values(server, virt)
if status != PASS:
raise Exception("Failed to get instances needed for verification")
@@ -175,6 +177,7 @@
if status != PASS:
raise Exception("Failed to get profile list")
+ found = []
for prof_id in prof_inst_lst:
logger.info("Verifying '%s' with '%s'", an, prof_id)
assoc_info = assoc.Associators(server,
@@ -187,15 +190,15 @@
(an, len(assoc_info), reg_classname))
for inst in assoc_info:
- status, verify_ectp_list = verify_fields(inst, verify_ectp_list)
+ status = verify_fields(inst, verify_ectp_list)
if status != PASS:
raise Exception("Failed to verify instance")
+ found.append(inst.classname)
- if status == PASS:
- for k, l in verify_ectp_list.iteritems():
- if len(l) != 0:
- status = FAIL
- raise Exception("%s items weren't returned: %s" % (k, l))
+ for key, list in verify_ectp_list.iteritems():
+ if key not in found:
+ status = FAIL
+ raise Exception("%s items weren't returned: %s" % (key, list))
except Exception, detail:
logger.error("Exception: %s" % detail)
@@ -205,9 +208,6 @@
cxml.destroy(server)
cxml.undefine(server)
- if "Linux_ComputerSystem" in verify_ectp_list:
- return XFAIL_RC(bug_sblim)
-
return status
if __name__ == "__main__":
diff -r f72029b3c3e5 -r 84313e6c8f50 suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Mon Dec 08 14:21:00 2008 -0800
+++ b/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Tue Dec 09 13:58:18 2008 -0800
@@ -49,7 +49,7 @@
from XenKvmLib import enumclass
from XenKvmLib.vxml import XenXML, KVMXML, get_class
from XenKvmLib.classes import get_typed_class
-from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
+from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.common_util import libvirt_cached_data_poll, get_cs_instance, \
get_host_info
@@ -58,14 +58,14 @@
test_dom ="domgst"
bug_sblim ='00007'
-def build_exp_prof_list(proflist, virt="Xen"):
+def build_exp_prof_list(proflist, virt, host_inst):
list = {}
for item in proflist:
if item.InstanceID.find('-VirtualSystem-') >= 0:
list[get_typed_class(virt, 'ComputerSystem')] = item
elif item.InstanceID.find('-SystemVirtualization-') >= 0:
- list[get_typed_class(virt, 'HostSystem')] = item
+ list[host_inst.CreationClassName] = item
return list
@@ -115,7 +115,6 @@
cxml.undefine(server)
return status
-
except Exception, details:
logger.error("DEBUG Exception: %s" % details)
cxml.undefine(server)
@@ -137,7 +136,7 @@
Globals.CIM_NS = prev_namespace
- exp_list = build_exp_prof_list(proflist, virt)
+ exp_list = build_exp_prof_list(proflist, virt, host_inst)
# Loop through the assoc results returned on test_dom and hostsystem
try:
@@ -149,7 +148,7 @@
cn,
CreationClassName=cn,
Name=name)
- if len(profs) != 1:
+ if len(profs) < 1:
if cn == 'Linux_ComputerSystem':
status = XFAIL_RC(bug_sblim)
else:
16 years
[PATCH] [TEST] #2 Update VSSDComponent [01_forward.py] to verify GRASD and InputRASD
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1228876519 28800
# Node ID 0ac774fa6363164588180af5bce0332bfe31047e
# Parent 0881bfe3b0ef3b4021c4047962fbe90e2cda2311
[TEST] #2 Update VSSDComponent [01_forward.py] to verify GRASD and InputRASD
Updates from 1 to 2:
Just add new items to the list instead of redefine
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 0881bfe3b0ef -r 0ac774fa6363 suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Tue Dec 09 00:01:38 2008 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Tue Dec 09 18:35:19 2008 -0800
@@ -59,16 +59,17 @@
from XenKvmLib import vxml
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger
-from XenKvmLib.const import do_main
+from XenKvmLib.const import do_main, get_provider_version
from CimTest.ReturnCodes import FAIL, PASS
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
+input_graphics_pool_rev = 757
test_dom = "VSSDC_dom"
test_vcpus = 2
test_mac = "00:11:22:33:44:aa"
-def init_list(test_disk, test_mac, virt='Xen'):
+def init_list(test_disk, test_mac, server, virt='Xen'):
"""
Creating the lists that will be used for comparisons.
"""
@@ -84,6 +85,23 @@
rlist[2] : "%s/%s" % (test_dom, test_mac),
rlist[3] : "%s/%s" % (test_dom, "proc")
}
+
+ if virt == 'LXC' or virt == 'XenFV':
+ input_device = "mouse:usb"
+ elif virt == 'Xen':
+ input_device = "mouse:xen"
+ else:
+ input_device = "mouse:ps2"
+
+ curr_cim_rev, changeset = get_provider_version(virt, server)
+ if curr_cim_rev >= input_graphics_pool_rev:
+ input = get_typed_class(virt,'InputResourceAllocationSettingData')
+ graphics = get_typed_class(virt,'GraphicsResourceAllocationSettingData')
+ rlist.append(input)
+ rlist.append(graphics)
+ prop_list[input] = "%s/%s" % (test_dom, input_device)
+ prop_list[graphics] = "%s/%s" % (test_dom, "graphics")
+
if virt == 'LXC':
prop_list = {rlist[1] : "%s/%s" % (test_dom, "mem")}
@@ -124,7 +142,7 @@
else:
test_disk = "hdb"
- prop_list = init_list(test_disk, test_mac, options.virt)
+ prop_list = init_list(test_disk, test_mac, options.ip, options.virt)
virt_xml = vxml.get_class(options.virt)
if options.virt == 'LXC':
cxml = virt_xml(test_dom)
16 years
[PATCH] [TEST] Update SettingDefine/01_forward.py to support Graphics/Input
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1228812554 28800
# Node ID 2ebfddfd4020e8d5e6b54f0bd56788ebc21d8c1a
# Parent b12c6c2772b7b5540f06d32cdaa9c99a8bf4fb9d
[TEST] Update SettingDefine/01_forward.py to support Graphics/Input
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r b12c6c2772b7 -r 2ebfddfd4020 suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py
--- a/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Sun Dec 07 23:50:29 2008 -0800
+++ b/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Tue Dec 09 00:49:14 2008 -0800
@@ -33,11 +33,11 @@
from XenKvmLib.enumclass import GetInstance
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
-from XenKvmLib.const import do_main
+from XenKvmLib.const import do_main, get_provider_version
from CimTest.ReturnCodes import PASS, FAIL
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
-
+input_graphics_pool_rev = 757
test_dom = "domu1"
test_mac = "00:11:22:33:44:aa"
test_vcpus = 1
@@ -74,11 +74,29 @@
else:
cxml = virt_xml(test_dom, vcpus = test_vcpus, mac = test_mac,
disk = test_disk)
+ if options.virt == 'LXC' or options.virt == 'XenFV':
+ input_device = "mouse:usb"
+ elif options.virt == 'Xen':
+ input_device = "mouse:xen"
+ else:
+ input_device = "mouse:ps2"
+
cn_id = {
'LogicalDisk' : test_disk,
'Memory' : 'mem',
'NetworkPort' : test_mac,
'Processor' : test_vcpus -1 }
+
+ curr_cim_rev, changeset = get_provider_version(options.virt, options.ip)
+ if curr_cim_rev >= input_graphics_pool_rev:
+ cn_id = {
+ 'LogicalDisk' : test_disk,
+ 'Memory' : 'mem',
+ 'NetworkPort' : test_mac,
+ 'Processor' : test_vcpus -1,
+ 'PointingDevice' : input_device,
+ 'DisplayController' : 'graphics'
+ }
ret = cxml.create(options.ip)
16 years
[PATCH] [TEST] Update VSSDComponent [01_forward.py] to verify GRASD and InputRASD
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1228813500 28800
# Node ID 160f9aff58daa3e77b737bb29c3de3a4175f5a3c
# Parent b12c6c2772b7b5540f06d32cdaa9c99a8bf4fb9d
[TEST] Update VSSDComponent [01_forward.py] to verify GRASD and InputRASD
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r b12c6c2772b7 -r 160f9aff58da suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Sun Dec 07 23:50:29 2008 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Tue Dec 09 01:05:00 2008 -0800
@@ -59,16 +59,17 @@
from XenKvmLib import vxml
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger
-from XenKvmLib.const import do_main
+from XenKvmLib.const import do_main, get_provider_version
from CimTest.ReturnCodes import FAIL, PASS
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
+input_graphics_pool_rev = 757
test_dom = "VSSDC_dom"
test_vcpus = 2
test_mac = "00:11:22:33:44:aa"
-def init_list(test_disk, test_mac, virt='Xen'):
+def init_list(test_disk, test_mac, server, virt='Xen'):
"""
Creating the lists that will be used for comparisons.
"""
@@ -84,6 +85,29 @@
rlist[2] : "%s/%s" % (test_dom, test_mac),
rlist[3] : "%s/%s" % (test_dom, "proc")
}
+
+ if virt == 'LXC' or virt == 'XenFV':
+ input_device = "%s/%s" %(test_dom, "mouse:usb")
+ elif virt == 'Xen':
+ input_device = "%s/%s" %(test_dom, "mouse:xen")
+ else:
+ input_device = "%s/%s" %(test_dom, "mouse:ps2")
+
+ curr_cim_rev, changeset = get_provider_version(virt, server)
+ if curr_cim_rev >= input_graphics_pool_rev:
+ input = get_typed_class(virt,'InputResourceAllocationSettingData')
+ graphics = get_typed_class(virt,'GraphicsResourceAllocationSettingData')
+ rlist.append(input)
+ rlist.append(graphics)
+ prop_list = {rlist[0] : "%s/%s" % (test_dom, test_disk),
+ rlist[1] : "%s/%s" % (test_dom, "mem"),
+ rlist[2] : "%s/%s" % (test_dom, test_mac),
+ rlist[3] : "%s/%s" % (test_dom, "proc"),
+ rlist[4] : "%s" % input_device,
+ rlist[5] : "%s/%s" % (test_dom, "graphics")
+ }
+
+
if virt == 'LXC':
prop_list = {rlist[1] : "%s/%s" % (test_dom, "mem")}
@@ -124,7 +148,7 @@
else:
test_disk = "hdb"
- prop_list = init_list(test_disk, test_mac, options.virt)
+ prop_list = init_list(test_disk, test_mac, options.ip, options.virt)
virt_xml = vxml.get_class(options.virt)
if options.virt == 'LXC':
cxml = virt_xml(test_dom)
16 years