
# HG changeset patch # User Deepti B. Kalakeri<deeptik@linux.vnet.ibm.com> # Date 1224748128 25200 # Node ID 2c77be4e041a0a8669d234d6219e1f207b6d4ed5 # Parent 73be202634a52607d5ab54ca62a2706ec7aca23b [TEST] Adding new tc 02_enum_crscap.py to verify ConsoleRedirectionServiceCapabilities fields. Tested on KVM with current sources. Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> diff -r 73be202634a5 -r 2c77be4e041a suites/libvirt-cim/cimtest/RedirectionService/02_enum_crscap.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/RedirectionService/02_enum_crscap.py Thu Oct 23 00:48:48 2008 -0700 @@ -0,0 +1,73 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri <dkalaker@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 +# +# This test case is used to verify the ConsoleRedirectionServiceCapabilities +# properties in detail. +# +# Date : 22-10-2008 +# + +import sys +from VirtLib.live import domain_list +from XenKvmLib.enumclass import EnumInstances +from CimTest.Globals import logger, CIM_ERROR_ENUMERATE +from XenKvmLib.classes import get_typed_class +from XenKvmLib.const import do_main +from CimTest.ReturnCodes import PASS, FAIL + +sup_types = ['Xen', 'KVM', 'XenFV'] +@do_main(sup_types) +def main(): + virt = main.options.virt + server = main.options.ip + cname = 'ConsoleRedirectionServiceCapabilities' + cap_name = 'ConsoleRedirectionCapabilities' + classname = get_typed_class(virt, cname) + try: + crs = EnumInstances(server, classname) + crs_val = crs[0] + if crs_val.InstanceID != cap_name: + logger.error("InstanceID Mismatch") + logger.error("Got '%s', Expected '%s'", crs_val.InstanceID, + cap_name) + return FAIL + + if crs_val.ElementName != cap_name: + logger.error("ElementName Mismatch") + logger.error("Got '%s', Expected '%s'", crs_val.ElementName, + cap_name) + return FAIL + + mode_supp = crs_val.SharingModeSupported[0] + if mode_supp != 3: + logger.error("SharingModeSupported Mismatch") + logger.error("Got '%s', Expected '%s'", mode_supp, 3) + return FAIL + + except Exception, detail: + logger.error(CIM_ERROR_ENUMERATE, classname) + logger.error("Exception: %s", detail) + return FAIL + + return PASS + +if __name__ == "__main__": + sys.exit(main())