[PATCH] [TEST] Remove log info to the right place
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1228719139 28800
# Node ID 53c3639c9f6db35026fa06cfda94171ecef9d3ed
# Parent 701f3228bdfe740f4a504dce1dfab844c812b9d5
[TEST] Remove log info to the right place
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 701f3228bdfe -r 53c3639c9f6d suites/libvirt-cim/cimtest/ElementConforms/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Wed Dec 03 21:31:09 2008 -0800
+++ b/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Sun Dec 07 22:52:19 2008 -0800
@@ -93,13 +93,14 @@
if assoc_val.items() == ele.items():
managed_ele_values[cn].remove(ele)
return PASS, managed_ele_values
+ else:
+ logger.error("%s not in expected list %s", assoc_val, elements)
+ return FAIL, managed_ele_values
except Exception, details:
logger.error("verify_fields() exception: %s", details)
return FAIL, managed_ele_values
- logger.error("%s not in expected list %s", assoc_val, elements)
- return FAIL, managed_ele_values
def get_proflist(server, reg_classname, virt):
profiles_instid_list = []
16 years
[PATCH] Adding a testcase to test the invalid inputs to the KVMRedirectionSAP class
by veeren@linux.vnet.ibm.com
# HG changeset patch
# User Veerendra C <vechandr(a)in.ibm.com>
# Date 1228732224 28800
# Node ID 3f098b127064b5cc08b6a5ae1c197b0457a69048
# Parent 701f3228bdfe740f4a504dce1dfab844c812b9d5
Adding a testcase to test the invalid inputs to the KVMRedirectionSAP class
diff -r 701f3228bdfe -r 3f098b127064 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 Mon Dec 08 02:30:24 2008 -0800
@@ -0,0 +1,124 @@
+#!/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 XenKvmLib.test_doms import destroy_and_undefine_all
+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
+ server = main.options.ip
+ 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")
+ status = PASS
+
+ # 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
+ ret_value = try_getinstance(conn, classname, newkey_vals,
+ field_name=test_val,
+ expr_values = expr_values[field],
+ bug_no = "")
+ if ret_value != PASS:
+ logger.error(" -------------- FAILED %s ----------- : " % field)
+ break
+
+ cxml.destroy(options.ip)
+ cxml.undefine(options.ip)
+ return status
+
+if __name__ == "__main__":
+ sys.exit(main())
+
16 years
[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 1228805116 28800
# Node ID 60a3dfddf48799d74ff6025ee2709f72c7f90aa2
# Parent b12c6c2772b7b5540f06d32cdaa9c99a8bf4fb9d
Submitting testcase to test the invalid inputs for the KVMRedirecionSAP class.
diff -r b12c6c2772b7 -r 60a3dfddf487 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 Mon Dec 08 22:45:16 2008 -0800
@@ -0,0 +1,122 @@
+#!/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 = PASS
+
+ # 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
+ ret_value = try_getinstance(conn, classname, newkey_vals,
+ field_name=test_val,
+ expr_values = expr_values[field],
+ bug_no = "")
+ if ret_value != PASS:
+ logger.error(" -------------- FAILED %s ----------- : " % field)
+ status = ret_value
+ break
+
+ cxml.cim_destroy(options.ip)
+ cxml.undefine(options.ip)
+ return status
+
+if __name__ == "__main__":
+ sys.exit(main())
+
16 years
[PATCH] Fix up console caption generation to properly test the count field before
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1228848669 28800
# Node ID da7aba7f560d7a3622f1ff3325d634a6470bad29
# Parent afb78ca3d292b1661ab69cafe5886a8de08ff693
Fix up console caption generation to properly test the count field before
attempting to examine the device.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r afb78ca3d292 -r da7aba7f560d src/Virt_ComputerSystem.c
--- a/src/Virt_ComputerSystem.c Tue Dec 09 10:17:27 2008 -0800
+++ b/src/Virt_ComputerSystem.c Tue Dec 09 10:51:09 2008 -0800
@@ -111,12 +111,12 @@
strcpy(host, "localhost");
}
- if (domain->dev_graphics != NULL)
+ if (domain->dev_graphics_ct > 0)
ret = asprintf(&cap,
"Virtual System (Console on %s://%s:%s)",
- domain->dev_graphics->dev.graphics.type,
+ domain->dev_graphics[0].dev.graphics.type,
host,
- domain->dev_graphics->dev.graphics.port);
+ domain->dev_graphics[0].dev.graphics.port);
else
ret = asprintf(&cap,
"Virtual System (No console)");
16 years
[PATCH] [TEST]Update ElementSettingData/01_forward.py to support GraphicsRASD/InputRASD
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1228809698 28800
# Node ID 3396c68f9288d76d82442098260d1f02c2eab433
# Parent b12c6c2772b7b5540f06d32cdaa9c99a8bf4fb9d
[TEST]Update ElementSettingData/01_forward.py to support GraphicsRASD/InputRASD
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r b12c6c2772b7 -r 3396c68f9288 suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Sun Dec 07 23:50:29 2008 -0800
+++ b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Tue Dec 09 00:01:38 2008 -0800
@@ -55,9 +55,10 @@
from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORS
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.vxml import get_class
-from XenKvmLib.const import do_main
+from XenKvmLib.const import do_main, get_provider_version
sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
+input_graphics_pool_rev = 757
test_dom = "esd_dom"
vmac = "00:11:22:33:44:aa"
@@ -125,6 +126,14 @@
vdisk = "xvda"
else:
vdisk = "hda"
+
+ if options.virt == 'LXC' or options.virt == 'XenFV':
+ input_device = "%s/%s" %(test_dom, "mouse:usb")
+ elif options.virt == 'Xen':
+ input_device = "%s/%s" %(test_dom, "mouse:xen")
+ else:
+ input_device = "%s/%s" %(test_dom, "mouse:ps2")
+
virt_class = get_class(options.virt)
if options.virt == 'LXC':
@@ -134,6 +143,11 @@
keys['ProcResourceAllocationSettingData'] = "%s/proc" % test_dom
keys['DiskResourceAllocationSettingData'] = "%s/%s" % (test_dom, vdisk)
keys['NetResourceAllocationSettingData'] = "%s/%s" % (test_dom, vmac)
+
+ curr_cim_rev, changeset = get_provider_version(options.virt, options.ip)
+ if curr_cim_rev >= input_graphics_pool_rev:
+ keys['InputResourceAllocationSettingData'] = input_device
+ keys['GraphicsResourceAllocationSettingData'] = "%s/graphics" % test_dom
ret = cxml.cim_define(options.ip)
if not ret:
16 years
[PATCH] [TEST] Update vxml.py to support input/graphics, also update SystemDevice[01_forward.py]
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1228800691 28800
# Node ID 7db927b03b2fc035b89092d40342d4117e4f28fa
# Parent b12c6c2772b7b5540f06d32cdaa9c99a8bf4fb9d
[TEST] Update vxml.py to support input/graphics, also update SystemDevice[01_forward.py]
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r b12c6c2772b7 -r 7db927b03b2f suites/libvirt-cim/cimtest/SystemDevice/01_forward.py
--- a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Sun Dec 07 23:50:29 2008 -0800
+++ b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Mon Dec 08 21:31:31 2008 -0800
@@ -32,10 +32,11 @@
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 PASS, FAIL
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
+input_graphics_pool_rev = 757
test_dom = "test_domain"
test_mac = "00:11:22:33:44:55"
@@ -93,6 +94,14 @@
exp_pllist[net_cn] = ['%s/%s' % (test_dom, test_mac)]
exp_pllist[disk_cn] = [ '%s/%s' % (test_dom, test_disk)]
+ curr_cim_rev, changeset = get_provider_version(virt, server)
+ if curr_cim_rev >= input_graphics_pool_rev:
+ input_cn = get_typed_class(virt, "PointingDevice")
+ graphics_cn = get_typed_class(virt, "DisplayController")
+ exp_pllist[input_cn] = ['%s/mouse:ps2' % test_dom]
+ exp_pllist[graphics_cn] = ['%s/graphics' % test_dom]
+
+
try:
res_pllist = {}
for items in devs:
diff -r b12c6c2772b7 -r 7db927b03b2f suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Sun Dec 07 23:50:29 2008 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Dec 08 21:31:31 2008 -0800
@@ -663,6 +663,10 @@
self.add_sub_node(disk, 'source', file=disk_img)
self.add_sub_node(disk, 'target', dev=disk_dev)
self.set_interface_details(devices, net_mac, net_type, net_name, 'Xen')
+ self.add_sub_node(devices, 'input', type='mouse', bus='xen')
+ self.add_sub_node(devices, 'graphics', type='vnc', port='5900',
+ keymap='en-us')
+
def set_bootloader(self, ip, gtype=0):
bldr = bootloader(ip, gtype)
@@ -713,6 +717,9 @@
disk = self.add_sub_node(devices, 'disk', type='file', device='disk')
self.add_sub_node(disk, 'source', file=disk_img)
self.add_sub_node(disk, 'target', dev=disk_dev)
+ self.add_sub_node(devices, 'input', type='mouse', bus='ps2')
+ self.add_sub_node(devices, 'graphics', type='vnc', port='5900',
+ keymap='en-us')
self.set_interface_details(devices, net_mac, net_type, net_name, 'KVM')
16 years
[PATCH] [TEST] Update SystemDevice[01_forward.py] to verify the DisplayController and PointingDevice with SystemDevice
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1228723896 28800
# Node ID f346e561aa615d79c547fb3d8bce3e49256493f4
# Parent 701f3228bdfe740f4a504dce1dfab844c812b9d5
[TEST] Update SystemDevice[01_forward.py] to verify the DisplayController and PointingDevice with SystemDevice.
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 701f3228bdfe -r f346e561aa61 suites/libvirt-cim/cimtest/SystemDevice/01_forward.py
--- a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Wed Dec 03 21:31:09 2008 -0800
+++ b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Mon Dec 08 00:11:36 2008 -0800
@@ -90,8 +90,12 @@
if virt != 'LXC':
net_cn = get_typed_class(virt, "NetworkPort")
disk_cn = get_typed_class(virt, "LogicalDisk")
+ input_cn = get_typed_class(virt, "PointingDevice")
+ graphics_cn = get_typed_class(virt, "DisplayController")
exp_pllist[net_cn] = ['%s/%s' % (test_dom, test_mac)]
exp_pllist[disk_cn] = [ '%s/%s' % (test_dom, test_disk)]
+ exp_pllist[input_cn] = ['%s/mouse:ps2' % test_dom]
+ exp_pllist[graphics_cn] = ['%s/graphics' % test_dom]
try:
res_pllist = {}
16 years
[PATCH 0 of 4] Add clock offset support
by Dan Smith
This patch set adds the ability to control the clock offset of a guest from
the CIM providers, which is important with dealing with Windows guests. It
gives us:
- The ability to specify the offset during DefineSystem
- The ability to inspect the offset in the VSSD object
- The knowledge of the <clock> element in libvirt XML so as not to clobber it
when adjusting the XML as part of another action
16 years