[Libvirt-cim] [PATCH 3 of 3] [TEST] add ElementAllocatedFromPool.02 for KVM & XenFV support

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Wed Apr 16 21:37:38 UTC 2008


> +#    Guolian Yun <yunguol at cn.ibm.com>

Being as most of the test cases will need to be changed from time to 
time, we should leave the author's list as is.

>  test_mem   = 128 
>  test_vcpus = 4 
> -test_disk  = "xvdb"
>  test_dpath = "foo"
>  disk_file = '/tmp/diskpool.conf'

This test should use the diskpool support in the provider. This means a 
diskpool needs to be created if one doesn't exist already.  Otherwise, 
this test fails.

For RHEL 5.2 - we'll need to ignore the diskpool stuff and use a file. 
Since you need to write a function that creates the diskpool, you could 
have the function check the version of libvirt and then either create a 
diskpool or create diskpool file accordingly (thanks to Dan for the help 
with this).

> 
> -def  assoc_values(assoc_list, field , list, index, specific_fields_list=""):
> +def  assoc_values(assoc_list, field , list, index, specific_fields_list="", virt="Xen"):

This line wraps past 80 characters.

>      """
>          Verifying the records retruned by the associations.
>      """
> @@ -203,7 +205,7 @@ def  assoc_values(assoc_list, field , li
>              if status != PASS:
>                  break
>      elif field == "DeviceID":
> -        if assoc_list[0]['CreationClassName'] == 'Xen_Processor':
> +        if assoc_list[0]['CreationClassName'] == get_typed_class(virt, 'Processor'):

This line also wraps.

>  # Verifying  the list of DeviceId returned by the association 
>  # against the list created intially .
>              for i in range(len(list)):
> @@ -218,7 +220,7 @@ def  assoc_values(assoc_list, field , li
>                  status = FAIL
>      else: 
>   # other specific fields verification
> -        if assoc_list[0]['CreationClassName'] != 'Xen_Processor':
> +        if assoc_list[0]['CreationClassName'] != get_typed_class(virt, 'Processor'):

Same here.

> +
> +    diskpool = eval('enumclass.' + get_typed_class(options.virt, "DiskPool"))
> +    mempool = eval('enumclass.' + get_typed_class(options.virt, "MemoryPool"))
> +    netpool = eval('enumclass.' + get_typed_class(options.virt, "NetworkPool"))
> +    procpool = eval('enumclass.' + get_typed_class(options.virt, "ProcessorPool"))

This might be confusing, so it would be better to set the classname to a 
variable.

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




More information about the Libvirt-cim mailing list