[Libvirt-cim] [PATCH] [TEST] #2 Add check to verify StorageVolume InstanceID

Deepti B Kalakeri deeptik at linux.vnet.ibm.com
Thu Mar 18 05:41:32 UTC 2010



Sharad Mishra wrote:
> # HG changeset patch
> # User Sharad Mishra <snmishra at us.ibm.com>
> # Date 1268864289 25200
> # Node ID 2a7a2ab9e729227b40a40d67f6dec9e2555e7bb7
> # Parent  3655b03ada11d9e99a1d10b97aaa7cdb737fc493
> [TEST] #2 Add check to verify StorageVolume InstanceID.
>
> Updates:
> 	Moved InstanceID check immediately after call to CreateResourceInPool.
>
> This test verifies that the InstanceID of StorageVolume is not dependent on the pool path in RASD. Rather it is set by virStorageVolGetPath.
>
> Signed-off-by: Sharad Mishra <snmishra at us.ibm.com>
>
> diff -r 3655b03ada11 -r 2a7a2ab9e729 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/10_create_storagevolume.py
> --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/10_create_storagevolume.py	Thu Jan 28 14:00:59 2010 -0800
> +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/10_create_storagevolume.py	Wed Mar 17 15:18:09 2010 -0700
> @@ -231,6 +231,11 @@
>              if res[0] != PASS:
>                  raise Exception("Failed to create the Vol %s" % vol_name)
>
> +            if res[1]['Resource']['InstanceID'] != exp_vol_path:
> +                status = FAIL
>   
You can raise an exception with some meaningful information here and 
come out of the test if the InstanceID does not contain the expected 
exp_vol_path.
Like this we can avoid waiting till the end of the test case to 
determine if it failed some verification.
> +            else:
> +                status = PASS
> +
>              found = verify_vol(server, virt, pool_name, exp_vol_path, found)
>              stovol_status = verify_template_rasd_exists(virt, server, 
>                                                          dp_inst_id, 
> @@ -239,7 +244,8 @@
>              ret = cleanup_pool_vol(server, virt, pool_name, 
>                                     clean_pool, exp_vol_path)
>              if res[0] == PASS and found == 1 and \
> -               ret == PASS and stovol_status == PASS:
> +               ret == PASS and stovol_status == PASS and \
> +               status == PASS:
>                  status = PASS
>              else:
>                  return FAIL
>
> _______________________________________________
> 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