[Libvirt-cim] [PATCH] [TEST] Fixing 01_forward.py tc of HostedResourcePool

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Mon Oct 13 20:45:02 UTC 2008


> +
> +    mpool =  get_typed_class(virt, 'MemoryPool')
> +    exp_pllist = { mpool   : ['MemoryPool/0'] }
> +    if virt != 'LXC':
> +        npool =  get_typed_class(virt, 'NetworkPool')
> +        dpool =  get_typed_class(virt, 'DiskPool')
> +        ppool =  get_typed_class(virt, 'ProcessorPool')
> +        exp_pllist[dpool] = ['DiskPool/%s' % default_pool_name]
> +        exp_pllist[npool] = ['%s/%s' %('NetworkPool', default_network_name)]

This can be formatted just like the DiskPool line:

exp_pllist[npool] = ['NetworkPool/%s' % default_network_name]

> +
> +        #Verifying we get all the expected pool class info
> +        if len(Set(exp_pllist.keys()) - Set(res_pllist.keys())) != 0:
> +            logger.error("Pool Class mismatch")
> +            raise Exception("Expected Pool class list: %s \n \t  Got: %s"
> +                            % (sorted(exp_pllist.keys()), 
> +                               sorted(res_pllist.keys())))
> +
> +        #Verifying that we get the atleast the expected instanceid 
> +        #for every pool class
> +        for key in exp_pllist.keys():
> +            if len(Set(exp_pllist[key]) - Set(res_pllist[key])) != 0:

This should be:

  Set(exp_pllist[key]) != Set(res_pllist[key])

> +                logger.error("InstanceID mismatch")
> +                raise Exception("Expected InstanceID: %s \n \t  Got: %s"
> +                                 % (sorted(exp_pllist[key]), 
> +                                    sorted(res_pllist[key])))


-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list