[Libvirt-cim] [PATCH] [TEST] Fix RPCS 08 to work with older version of libvirt-cim

Deepti B Kalakeri deeptik at linux.vnet.ibm.com
Tue Jul 14 14:17:26 UTC 2009



Kaitlin Rupert wrote:
> # HG changeset patch
> # User Kaitlin Rupert <karupert at us.ibm.com>
> # Date 1247506857 25200
> # Node ID 89d8b84653726ba7508c17a5da75cc695c9da304
> # Parent  3a4e961d8628698392edcc1f0943281f219ff658
> [TEST] Fix RPCS 08 to work with older version of libvirt-cim...
>
> For versions that don't support dir, netfs pool creation, or DiskPoolRASD
> templates.
>
> Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>
>
> diff -r 3a4e961d8628 -r 89d8b8465372 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py
> --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py	Mon Jul 13 10:04:05 2009 -0700
> +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py	Mon Jul 13 10:40:57 2009 -0700
> @@ -61,9 +61,11 @@
>  libvirt_disk_pool_support=837
>  libvirt_netfs_pool_support=869
>      
> -def get_pool_attr(server, pool_type, dp_types):
> +def get_pool_attr(server, pool_type, dp_types, rev):
>      pool_attr = { "Path" : "/tmp" }
> -    if pool_type == dp_types['DISK_POOL_NETFS']:
> +
> +    if rev >= libvirt_netfs_pool_support and \
> +       pool_type == dp_types['DISK_POOL_NETFS']:
>          status , src_mnt_dir, dir_mnt_dir = nfs_netfs_setup(server)
>          if status != PASS:
>              logger.error("Failed to get pool_attr for NETFS diskpool type")
> @@ -107,7 +109,8 @@
>          try:
>              logger.info("Verifying '%s'.....", key)
>              test_pool = key
> -            status, pool_attr = get_pool_attr(server, value, dp_types)
> +            status, pool_attr = get_pool_attr(server, value, dp_types, 
> +                                              curr_cim_rev)
>              if status != PASS:
>                  return FAIL
>
> @@ -144,6 +147,8 @@
>              logger.error("Exception details: %s", details)
>              if key == 'DISK_POOL_NETFS':
>                  netfs_cleanup(server, pool_attr)
> +            if status == SKIP: 
> +                return status
>              return FAIL
>   
Instead of the two return statements you can use return status instead 
above without checking status == SKIP.
>   
>      return status
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
>   

-- 
Thanks and Regards,
Deepti B. Kalakeri
IBM Linux Technology Center
deeptik at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list