[Libvirt-cim] [PATCH] [TEST] Update Processor -t 02_definesys_get_procs.py to use cim_define()
Deepti B Kalakeri
deeptik at linux.vnet.ibm.com
Tue Jan 6 10:14:51 UTC 2009
Kaitlin Rupert wrote:
> # HG changeset patch
> # User Kaitlin Rupert <karupert at us.ibm.com>
> # Date 1231196579 28800
> # Node ID 87b41555ea6e8a363cc966b599e0cf28af4fd318
> # Parent 5650fd38e40aca51f20037f9df695930ddff7cdf
> [TEST] Update Processor -t 02_definesys_get_procs.py to use cim_define()
>
> Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>
>
> diff -r 5650fd38e40a -r 87b41555ea6e suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py
> --- a/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Mon Jan 05 14:45:41 2009 -0800
> +++ b/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Mon Jan 05 15:02:59 2009 -0800
> @@ -32,11 +32,7 @@
> #
>
> import sys
> -import pywbem
> -from XenKvmLib.classes import get_typed_class
> -from XenKvmLib.vxml import XenXML, KVMXML, get_class
> -from XenKvmLib.test_doms import undefine_test_domain
> -from XenKvmLib.common_util import create_using_definesystem
> +from XenKvmLib.vxml import get_class
> from XenKvmLib.devices import get_dom_proc_insts
> from CimTest.Globals import logger
> from XenKvmLib.const import do_main
> @@ -71,33 +67,29 @@
> @do_main(sup_types)
> def main():
> options = main.options
> - status = PASS
> -
> - undefine_test_domain(default_dom, options.ip)
> + status = FAIL
>
> try:
> - rc = create_using_definesystem(default_dom, options.ip, params=None,
> - ref_config=' ', exp_err=None,
> - virt=options.virt)
> - if rc != 0:
> - raise Exception("Unable create domain %s using DefineSystem()" \
> - % default_dom)
> + cxml = get_class(options.virt)(default_dom)
> + ret = cxml.cim_define(options.ip)
> + if not ret:
> + raise Exception("Failed to define the guest: %s" % default_dom)
>
> proc_list = get_dom_proc_insts(options.virt, options.ip, default_dom)
> if len(proc_list) == 0:
> raise Exception("Failied to retrieve vcpu instances for %s" \
> % default_dom)
>
Very Minor spell error, can you change Failied to Failed instead ?
> - rc = check_processors(proc_list)
> - if rc != 0:
> + status = check_processors(proc_list)
> + if status != PASS:
> raise Exception("Processor instances for %s are not as expected." \
> % default_dom)
>
In the check_processors() can you change the spelling of guesst to guest:
logger.error("Inst returned is for guesst %s, expected guest %s.",
procs['SystemName'], default_dom)
> -
> +
> except Exception, detail:
> logger.error("Exception: %s" % detail)
> status = FAIL
>
> - undefine_test_domain(default_dom, options.ip)
> + cxml.undefine(options.ip)
>
> return status
>
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
>
More information about the Libvirt-cim
mailing list