<html><body>
<p>I am seeing the following error -<br>
<br>
[root@elm3a148 cimtest]#  CIM_NS=root/virt CIM_USER=root CIM_PASS=elm3a148 ./runtests libvirt-cim -i localhost -c -d -v KVM -g RASDIndications -t 02_guest_add_mod_rem_rasd_ind.py<br>
Starting test suite: libvirt-cim<br>
<br>
Cleaned log files.<br>
<br>
Testing KVM hypervisor<br>
--------------------------------------------------------------------<br>
RASDIndications - 02_guest_add_mod_rem_rasd_ind.py: FAIL<br>
ERROR   - Did not recieve indication KVM_ResourceAllocationSettingDataModifiedIndication<br>
ERROR   - Received Indication error: '256'<br>
ERROR   - Exception: [Errno 3] No such process<br>
--------------------------------------------------------------------<br>
<br>
Running on Fedora 11 with sfcb.<br>
<br>
Thanks<br>
Sharad Mishra<br>
System x Enablement<br>
Linux Technology Center<br>
IBM<br>
<br>
<tt>libvirt-cim-bounces@redhat.com wrote on 09/22/2009 02:33:16 PM:<br>
<br>
> "Deepti B. Kalakeri" <deeptik@linux.vnet.ibm.com> </tt><br>
<tt>> Sent by: libvirt-cim-bounces@redhat.com<br>
> </tt><br>
<tt>> 09/22/2009 02:33 PM</tt><br>
<tt>> <br>
> Please respond to<br>
> List for discussion and development of libvirt CIM <libvirt-cim@redhat.com></tt><br>
<tt>> <br>
> To</tt><br>
<tt>> <br>
> libvirt-cim@redhat.com</tt><br>
<tt>> <br>
> cc</tt><br>
<tt>> <br>
> Subject</tt><br>
<tt>> <br>
> [Libvirt-cim] [PATCH] [TEST] #2 [TEST] Add new tc RASDIndications/<br>
> 02_guest_add_mod_rem_rasd_ind.py</tt><br>
<tt>> <br>
> # HG changeset patch<br>
> # User Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com><br>
> # Date 1253655145 25200<br>
> # Node ID 215cbc24f8f95f95543a24ecc7e3b1d80594ecdd<br>
> # Parent  faf86189f60a2b7e5321996540c390c0598929c9<br>
> [TEST] #2 [TEST] Add new tc RASDIndications/02_guest_add_mod_rem_rasd_ind.py<br>
> <br>
> Patch 2:<br>
> --------<br>
> 1) Checked for RASDIndication support in libvirt-cim<br>
> 2) Included support for XenFV<br>
> 3) Removed cim_start() fromt the testcase<br>
> 4) Undefined the guest at the end of the test.<br>
> <br>
> To verify the Add|Modify|Deleted RASDIndication for the guest.<br>
> <br>
> Tested with Xen and current sources on RHEL5.3 and with KVM on F10.<br>
> Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com><br>
> <br>
> diff -r faf86189f60a -r 215cbc24f8f9 suites/libvirt-cim/cimtest/<br>
> RASDIndications/02_guest_add_mod_rem_rasd_ind.py<br>
> --- /dev/null   Thu Jan 01 00:00:00 1970 +0000<br>
> +++ b/suites/libvirt-cim/cimtest/RASDIndications/<br>
> 02_guest_add_mod_rem_rasd_ind.py   Tue Sep 22 14:32:25 2009 -0700<br>
> @@ -0,0 +1,225 @@<br>
> +#!/usr/bin/python<br>
> +#<br>
> +# Copyright 2009 IBM Corp.<br>
> +#<br>
> +# Authors:<br>
> +#   Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> <br>
> +#    <br>
> +#<br>
> +# This library is free software; you can redistribute it and/or<br>
> +# modify it under the terms of the GNU General Public<br>
> +# License as published by the Free Software Foundation; either<br>
> +# version 2.1 of the License, or (at your option) any later version.<br>
> +#<br>
> +# This library is distributed in the hope that it will be useful,<br>
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
> +# General Public License for more details.<br>
> +#<br>
> +# You should have received a copy of the GNU General Public<br>
> +# License along with this library; if not, write to the Free Software<br>
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA<br>
> +#<br>
> +#<br>
> +# This testcase is used to verify the Created|Modified|Deleted <br>
> +# RASD Indications for a guest.<br>
> +#<br>
> +#                                                      Date : 21-09-2009<br>
> +#<br>
> +<br>
> +import sys<br>
> +from signal import SIGKILL<br>
> +from XenKvmLib import vsms<br>
> +from XenKvmLib import vsms_util<br>
> +from XenKvmLib.classes import get_typed_class<br>
> +from XenKvmLib.enumclass import EnumNames<br>
> +from socket import gethostname<br>
> +from os import kill, fork, _exit<br>
> +from XenKvmLib.vxml import get_class<br>
> +from CimTest.Globals import logger<br>
> +from XenKvmLib.const import do_main, CIM_DISABLE, get_provider_version<br>
> +from CimTest.ReturnCodes import PASS, FAIL, SKIP<br>
> +from XenKvmLib.common_util import poll_for_state_change <br>
> +from XenKvmLib.indications import sub_ind, handle_request, poll_for_ind<br>
> +<br>
> +sup_types = ['KVM', 'Xen', 'XenFV']<br>
> +libvirt_guest_rasd_indication_rev = 980<br>
> +<br>
> +nmem = 256 <br>
> +nmac = '00:11:22:33:44:55'<br>
> +<br>
> +def create_guest(test_dom, ip, virt, cxml):<br>
> +    try:<br>
> +        ret = cxml.cim_define(ip)<br>
> +        if not ret:<br>
> +            raise Exception("Failed to define domain %s" % test_dom)<br>
> +<br>
> +        status, dom_cs = poll_for_state_change(ip, virt, test_dom,<br>
> +                                               CIM_DISABLE)<br>
> +        if status != PASS:<br>
> +            raise Exception("Dom '%s' not in expected state '%s'" \<br>
> +                            % (test_dom, CIM_DISABLE))<br>
> +<br>
> +    except Exception, details:<br>
> +        logger.error("Exception details: %s", details)<br>
> +        return FAIL, cxml<br>
> +<br>
> +    return PASS, cxml<br>
> +<br>
> +<br>
> +def get_rasd_rec(virt, cn, s_sysname, inst_id):<br>
> +    classname = get_typed_class(virt, cn)<br>
> +    recs = EnumNames(s_sysname, classname)<br>
> +    rasd = None<br>
> +    for rasd_rec in recs: <br>
> +        ret_pool = rasd_rec['InstanceID']<br>
> +        if ret_pool == inst_id:<br>
> +            rasd = rasd_rec <br>
> +            break<br>
> +<br>
> +    return rasd<br>
> +<br>
> +def gen_indication(test_dom, s_sysname, virt, cxml, service, ind_name,<br>
> +                   rasd=None, nmem_disk=None):<br>
> +    status = FAIL<br>
> +    try:<br>
> +<br>
> +        if ind_name == "add":<br>
> +            cn = 'VirtualSystemSettingData'<br>
> +            inst_id = '%s:%s' % (virt, test_dom)<br>
> +            classname = get_typed_class(virt, cn)<br>
> +            vssd_ref = get_rasd_rec(virt, cn, s_sysname, inst_id)<br>
> +<br>
> +            if vssd_ref == None:<br>
> +                raise Exception("Failed to get vssd_ref for '%s'" %test_dom)<br>
> +<br>
> +            status = vsms_util.add_disk_res(s_sysname, service, cxml, <br>
> +                                            vssd_ref, rasd, nmem_disk)<br>
> +<br>
> +        elif ind_name == "modify":<br>
> +            status = vsms_util.mod_mem_res(s_sysname, service, cxml, <br>
> +                                           rasd, nmem_disk)<br>
> +<br>
> +        elif ind_name == 'delete':<br>
> +            cn = 'GraphicsResourceAllocationSettingData'<br>
> +            inst_id = '%s/%s' % (test_dom, "graphics")<br>
> +            classname = get_typed_class(virt, cn)<br>
> +            nrasd = get_rasd_rec(virt, cn, s_sysname, inst_id)<br>
> +<br>
> +            if nrasd == None:<br>
> +                raise Exception("Failed to get nrasd for '%s'" % test_dom)<br>
> +<br>
> +            res = service.RemoveResourceSettings(ResourceSettings=[nrasd])<br>
> +            status = res[0]<br>
> +       <br>
> +    except Exception, details:<br>
> +        logger.error("Exception details :%s", details)<br>
> +        return FAIL<br>
> +<br>
> +    return status<br>
> +<br>
> +@do_main(sup_types)<br>
> +def main():<br>
> +    options = main.options<br>
> +    virt = options.virt<br>
> +    s_sysname = options.ip<br>
> +<br>
> +    cim_rev, changeset = get_provider_version(virt, s_sysname)<br>
> +    if cim_rev < libvirt_guest_rasd_indication_rev:<br>
> +        logger.info("Support for Guest Resource Indications is available in "<br>
> +                    "Libvirt-CIM rev '%s'", <br>
> libvirt_guest_rasd_indication_rev)<br>
> +        return SKIP<br>
> +<br>
> +    status = FAIL<br>
> +    test_dom = 'VM_' + gethostname()<br>
> +    ind_names = {<br>
> +                 'add'    : 'ResourceAllocationSettingDataCreatedIndication',<br>
> +                 'modify' : <br>
> 'ResourceAllocationSettingDataModifiedIndication',<br>
> +                 'delete' : 'ResourceAllocationSettingDataDeletedIndication'<br>
> +                }<br>
> +<br>
> +    sub_list, ind_names, dict = sub_ind(s_sysname, virt, ind_names)<br>
> +    virt_xml = get_class(virt)<br>
> +    cxml = virt_xml(test_dom, mac=nmac)<br>
> +    service = vsms.get_vsms_class(options.virt)(options.ip)<br>
> +    ndpath = cxml.secondary_disk_path<br>
> +<br>
> +    if virt == 'KVM':<br>
> +        nddev = 'hdb'<br>
> +    else:<br>
> +        nddev = 'xvdb'<br>
> +<br>
> +    disk_attr = { 'nddev' : nddev,<br>
> +                  'src_path' : ndpath <br>
> +                }<br>
> +    dasd = vsms.get_dasd_class(options.virt)(dev=nddev,<br>
> +                                             source=cxml.secondary_disk_path,<br>
> +                                             name=test_dom)<br>
> +    masd = vsms.get_masd_class(options.virt)(megabytes=nmem, name=test_dom)<br>
> +    rasd_info = { 'add' : [dasd, disk_attr], <br>
> +                  'modify' : [masd, nmem] <br>
> +                }<br>
> +<br>
> +    status, cxml = create_guest(test_dom, s_sysname, virt, cxml)<br>
> +    if status != PASS:<br>
> +        logger.error("Error setting up the guest '%s'" % test_dom)<br>
> +        return FAIL<br>
> +<br>
> +    for ind in ind_names.keys():<br>
> +        sub = sub_list[ind]<br>
> +        ind_name = ind_names[ind]<br>
> +        logger.info("\n Verifying '%s' indications ....", ind_name)<br>
> +        <br>
> +        try:<br>
> +            pid = fork()<br>
> +            if pid == 0:<br>
> +                status = handle_request(sub, ind_name, dict, <br>
> +                                        len(ind_names.keys()))<br>
> +                if status != PASS:<br>
> +                    _exit(1)<br>
> +<br>
> +                _exit(0)<br>
> +            else:<br>
> +                try:<br>
> +                    if ind != 'delete':<br>
> +                        rasd = rasd_info[ind][0]<br>
> +                        val  = rasd_info[ind][1]<br>
> +                        status = gen_indication(test_dom, s_sysname, <br>
> +                                                      virt, cxml, service,<br>
> +                                                      ind, rasd, val)<br>
> +                    else:<br>
> +                        status = gen_indication(test_dom, s_sysname, <br>
> +                                                      virt, cxml, service,<br>
> +                                                      ind)<br>
> +                    if status != PASS:<br>
> +                        raise Exception("Unable to generate indication") <br>
> +       <br>
> +                    status = poll_for_ind(pid, ind_name)<br>
> +                    if status != PASS:<br>
> +                        raise Exception("Poll for indication Failed")<br>
> +<br>
> +                except Exception, details:<br>
> +                    kill(pid, SIGKILL)<br>
> +                    raise Exception(details)<br>
> +<br>
> +        except Exception, details:<br>
> +            logger.error("Exception: %s", details)<br>
> +            status = FAIL<br>
> +<br>
> +        if status != PASS:<br>
> +            break<br>
> +        <br>
> +       #Make sure all subscriptions are really unsubscribed<br>
> +    for ind, sub in sub_list.iteritems():<br>
> +        sub.unsubscribe(dict['default_auth'])<br>
> +        logger.info("Cancelling subscription for %s", ind_names[ind])<br>
> +<br>
> +    ret = cxml.undefine(s_sysname)<br>
> +    if not ret:<br>
> +        logger.error("Failed to undefine the domain '%s'", test_dom)<br>
> +        return FAIL<br>
> +<br>
> +    return status<br>
> +if __name__ == "__main__":<br>
> +    sys.exit(main())<br>
> +<br>
> <br>
> _______________________________________________<br>
> Libvirt-cim mailing list<br>
> Libvirt-cim@redhat.com<br>
> <a href="https://www.redhat.com/mailman/listinfo/libvirt-cim">https://www.redhat.com/mailman/listinfo/libvirt-cim</a><br>
</tt></body></html>