[openstack-dev] [qa] Use test scenarios for interface type and auth version

Robert Collins robertc at robertcollins.net
Sat Jan 4 01:29:59 UTC 2014


On 4 January 2014 04:14, Frittoli, Andrea (Cloud Services)
<frittoli at hp.com> wrote:
> Hi,
>
>
>
> I’m working on multi-keystone-api-version-tests which aims to provide the
> ability to run tests using a configurable list of keystone API versions for
> authentication.
>
>
>
> If two versions of the API are configured, each test would be run using the
> two versions.
>
> In the gate, where we’re short of time, we could test only the latest stable
> version, but in other tests will have the ability to use more than one
> version.
>
>
>
> The approach I’m considering is based on testscenarios.
>
> Thinking about how to implement this I recognized that a solution that works
> for auth version could be used also to run json / xml, removing the need to
> have two classes for API test.

+1.

> The idea I have is to change Base[Service]Test classes and move the client
> selection logic to BaseTestCase.  Something like this:
>
>
>
>                 def __getattr__(self, attr):
>
>                                 if attr in
> manager.list_of_available_clients:
>
>                                     manager.get_client(attr,
> self.auth_version, self.interface)
>
>                           else:
>
>                                  raise AttributeError


Ugh, don't override __getattr__ (or __getattribute__) for something
like this. ETOOMUCHMAGIC.

def self.get_client(self, attr):
     ....

Will be much more obvious.

Cheers,
Rob
-- 
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Converged Cloud



More information about the OpenStack-dev mailing list