[openstack-dev] Tempest testing for optional middlewares
Sean Dague
sean at dague.net
Fri Jul 12 18:26:29 UTC 2013
On 07/12/2013 02:15 PM, Joe Hakim Rahme wrote:
> Hello everyone,
>
> I'm addressing this email to the dev list because I couldn't find a way
> to get in touch with the testing team. Hopefully someone here will have
> the answer to my question or can point me to the correct people to ask.
>
> I am writing Tempest tests that cover the behavior of some optional
> Swift middlewares (precisely account_quota and container_quota).
> It occurs to me that these middlewares are optional and may not be
> present in every Swift installation. In this case, I'd like Tempest to skip
> this test rather than fail it.
>
> What's the correct way of detecting the presence of the middleware
> before launching the test?
In the tempest.conf you should create a variable for "foo_available",
defaulting to false. Then if someone wants to test it we set it to true.
Then you can decorate your tests (or class) to skip if that variable is
false.
This is an example of it in the code -
https://github.com/openstack/tempest/blob/master/tempest/api/compute/servers/test_server_actions.py#L150
-Sean
--
Sean Dague
http://dague.net
More information about the OpenStack-dev
mailing list