libvirt-cim-bounces@redhat.com wrote on 2008-09-24
14:50:42:
> # HG changeset patch
> # User Guolian Yun <yunguol@cn.ibm.com>
> # Date 1222239007 25200
> # Node ID f09ea1ef1bf1c4c830985078b53e50a103635ae2
> # Parent d2ae228a60c34b78c3dd1e4f43f6a5413898980d
> [TEST] Fix HostedService.01~04 with sblim base provider installed
>
Sorry. I forgot to sign on this patch.
Signed-off-by: Guolian Yun <yunguol@cn.ibm.com>
> suites/libvirt-cim/cimtest/HostedService/cimtest.log
>
> diff -r d2ae228a60c3 -r f09ea1ef1bf1 suites/libvirt-
> cim/cimtest/HostedService/01_forward.py
> --- a/suites/libvirt-cim/cimtest/HostedService/01_forward.py
Mon
> Sep 22 11:28:02 2008 -0700
> +++ b/suites/libvirt-cim/cimtest/HostedService/01_forward.py
Tue
> Sep 23 23:50:07 2008 -0700
> @@ -24,6 +24,7 @@ import sys
> import sys
> from VirtLib import utils
> from XenKvmLib import assoc
> +from XenKvmLib.common_util import check_sblim
> from XenKvmLib import enumclass
> from XenKvmLib.classes import get_typed_class
> from CimTest import Globals
> @@ -36,12 +37,17 @@ sup_types = ['Xen', 'XenFV', 'KVM', 'LXC
> @do_main(sup_types)
> def main():
> options = main.options
> - keys = ['Name', 'CreationClassName']
> - try:
> - host_sys = enumclass.enumerate(options.ip,
'HostSystem',
> keys, options.virt)[0]
> - except Exception:
> - logger.error(Globals.CIM_ERROR_ENUMERATE
% host_sys.name)
> - return FAIL
> +
> + status, linux_cs = check_sblim(options.ip, options.virt)
> + if status == PASS:
> + host_sys = linux_cs[0]
> + else:
> + keys = ['Name', 'CreationClassName']
> + try:
> + host_sys = enumclass.enumerate(options.ip,
> 'HostSystem', keys, options.virt)[0]
> + except Exception:
> + logger.error(Globals.CIM_ERROR_ENUMERATE
% host_sys.name)
> + return FAIL
> try:
> service = assoc.AssociatorNames(options.ip,
>
"HostedService",
> diff -r d2ae228a60c3 -r f09ea1ef1bf1 suites/libvirt-
> cim/cimtest/HostedService/02_reverse.py
> --- a/suites/libvirt-cim/cimtest/HostedService/02_reverse.py
Mon
> Sep 22 11:28:02 2008 -0700
> +++ b/suites/libvirt-cim/cimtest/HostedService/02_reverse.py
Tue
> Sep 23 23:50:07 2008 -0700
> @@ -25,6 +25,7 @@ from VirtLib import utils
> from VirtLib import utils
> from XenKvmLib import assoc
> from XenKvmLib import enumclass
> +from XenKvmLib.common_util import check_sblim
> from XenKvmLib.classes import get_typed_class
> from CimTest import Globals
> from XenKvmLib.const import do_main
> @@ -36,12 +37,16 @@ sup_types = ['Xen', 'XenFV', 'KVM', 'LXC
> @do_main(sup_types)
> def main():
> options = main.options
> - keys = ['Name', 'CreationClassName']
> - try:
> - host_sys = enumclass.enumerate(options.ip,
'HostSystem',
> keys, options.virt)[0]
> - except Exception:
> - logger.error(Globals.CIM_ERROR_ENUMERATE
% host_sys.
> CreationClassName)
> - return FAIL
> + status, linux_cs = check_sblim(options.ip, options.virt)
> + if status == PASS:
> + host_sys = linux_cs[0]
> + else:
> + keys = ['Name', 'CreationClassName']
> + try:
> + host_sys = enumclass.enumerate(options.ip,
> 'HostSystem', keys, options.virt)[0]
> + except Exception:
> + logger.error(Globals.CIM_ERROR_ENUMERATE
% host_sys.
> CreationClassName)
> + return FAIL
> servicelist = {"ResourcePoolConfigurationService"
: "RPCS",
>
"VirtualSystemManagementService" : "Management Service",
>
"VirtualSystemMigrationService" : "MigrationService"}
> @@ -67,7 +72,7 @@ def main():
> ccn = assoc_host[0].keybindings['CreationClassName']
> name = assoc_host[0].keybindings['Name']
>
> - if ccn != get_typed_class(options.virt,
"HostSystem"):
> + if ccn != get_typed_class(options.virt,
"HostSystem") and
> ccn != 'Linux_ComputerSystem' :
> logger.error("CreationClassName
Error")
> return FAIL
> elif name != host_sys.Name:
> diff -r d2ae228a60c3 -r f09ea1ef1bf1 suites/libvirt-
> cim/cimtest/HostedService/03_forward_errs.py
> --- a/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py
> Mon Sep 22 11:28:02 2008 -0700
> +++ b/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py
> Tue Sep 23 23:50:07 2008 -0700
> @@ -25,6 +25,7 @@ from pywbem.cim_obj import CIMInstanceNa
> from pywbem.cim_obj import CIMInstanceName
> from XenKvmLib import assoc
> from XenKvmLib import enumclass
> +from XenKvmLib.common_util import check_sblim
> from XenKvmLib.classes import get_typed_class
> from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_USER,
\
>
CIM_PASS, CIM_NS
> @@ -41,11 +42,15 @@ def main():
> rc = -1
> status = FAIL
> keys = ['Name', 'CreationClassName']
> - try:
> - host_sys = enumclass.enumerate(options.ip,
'HostSystem',
> keys, options.virt)[0]
> - except Exception:
> - logger.error(CIM_ERROR_ENUMERATE % host_sys.name)
> - return FAIL
> + status, linux_cs = check_sblim(options.ip, options.virt)
> + if status == PASS:
> + host_sys = linux_cs[0]
> + else:
> + try:
> + host_sys = enumclass.enumerate(options.ip,
> 'HostSystem', keys, options.virt)[0]
> + except Exception:
> + logger.error(CIM_ERROR_ENUMERATE
% host_sys.name)
> + return FAIL
>
>
> conn = assoc.myWBEMConnection('http://%s' % options.ip,
> diff -r d2ae228a60c3 -r f09ea1ef1bf1 suites/libvirt-
> cim/cimtest/HostedService/04_reverse_errs.py
> --- a/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py
> Mon Sep 22 11:28:02 2008 -0700
> +++ b/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py
> Tue Sep 23 23:50:07 2008 -0700
> @@ -25,6 +25,7 @@ from pywbem.cim_obj import CIMInstanceNa
> from pywbem.cim_obj import CIMInstanceName
> from XenKvmLib import assoc
> from XenKvmLib import enumclass
> +from XenKvmLib.common_util import check_sblim
> from XenKvmLib.classes import get_typed_class
> from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_USER,
\
>
CIM_PASS, CIM_NS
> @@ -41,11 +42,15 @@ def main():
> rc = -1
> status = FAIL
> keys = ['Name', 'CreationClassName']
> - try:
> - host_sys = enumclass.enumerate(options.ip,
'HostSystem',
> keys, options.virt)[0]
> - except Exception:
> - logger.error(CIM_ERROR_ENUMERATE % host_sys.name)
> - return FAIL
> + status, linux_cs = check_sblim(options.ip, options.virt)
> + if status == PASS:
> + host_sys = linux_cs[0]
> + else:
> + try:
> + host_sys = enumclass.enumerate(options.ip,
> 'HostSystem', keys, options.virt)[0]
> + except Exception:
> + logger.error(CIM_ERROR_ENUMERATE
% host_sys.name)
> + return FAIL
>
>
> servicelist = {get_typed_class(options.virt,
> "ResourcePoolConfigurationService") : "RPCS",
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim@redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim