[openstack-qa] Refactoring Tempest service clients

Giulio Fidente gfidente at redhat.com
Wed Jul 10 07:38:19 UTC 2013


On 07/09/2013 11:01 PM, Jay Pipes wrote:
> On 07/08/2013 08:49 AM, Giulio Fidente wrote:
>> On 07/02/2013 04:01 PM, David Kranz wrote:
>>>
>>> Resource management
>>> There was a discussion last year about whether resource management
>>> should be in the client or in the test class. I will try to dig it up
>>> from the old launchpad qa list if I can. We ended up managing this in
>>> the test classes. This is a complicated issue. If you have a proposal
>>> for how to do it differently the best thing would be to put up a WIP
>>> patch with the essence of the base class structure and flow you are
>>> proposing for both client and test classes.
>>
>> I wasn't any active at the time but let me add my 2cents to that
>> discussion now.
>>
>> I don't think the choice to manage the resources in the test classes is
>> bad but I find confusing and prone to errors that the resources are
>> actually managed part in the base class and part in the test class; I'm
>> thinking about the resources cleanup facilities for instance or the user
>> credentials.
>>
>> The issue with the credentials in particular has been brought up in the
>> list before.
>>
>> Is there some agreement on "fixing" this or an idea on how these things
>> could be changed?
>
> What would you fix? The reason the credentials fixtures are "managed" in
> the base test classes is to provide absolute isolation for the test
> cases that subclass those base classes. Do you propose the subclasses be
> responsible for creating their own tenant isolation?

No, I'd like to see the credentials managed in the base class only.

Going trough the code I think I found a couple of places where we could 
improve. For instance, what I *think* is problematic are cases like this:

https://github.com/openstack/tempest/blob/master/tempest/api/volume/admin/test_multi_backend.py#L37

where we define credentials from config in the test class but maybe we 
should can improve that in the base class here:

https://github.com/openstack/tempest/blob/master/tempest/api/volume/base.py#L205

by just adding the needed clients as per:

https://github.com/openstack/tempest/blob/master/tempest/api/volume/base.py#L48

or even define os as os_adm in the base admin class, makes sense?

Also, speaking about actual resources and not credentials, would it be 
useful to enforce (trough the reviews) the usage of the utility methods 
provided by the base classes (which also take care of the cleanup) 
rather than create/delete resources in the test class?

-- 
Giulio Fidente
GPG KEY: 08D733BA | IRC: giulivo



More information about the openstack-qa mailing list