Re: [openstack-dev] [tempest] tearDownClass usage in scenario tests

2014-12-02 Thread Richard Winters (riwinter)
I see - looks like the repro I¹m based off of hasn¹t keep up with the
latest.  

I¹ll have to look at the ScenarioTest.

Thanks
Rich


On 12/2/14, 9:54 AM, "Andrea Frittoli"  wrote:

>Hello Rich,
>
>in the latest tempest we made two significant changes compared to the
>version you're using.
>
>We dropped the use of official clients from scenario tests (and
>OfficialClientTest has been replaced by ScenarioTest).
>And we introduced resource_setup and resource_cleanup in the test base
>class, which should be used instead of setUpClass and teadDownClass
>(there's an hacking rule for that).
>
>While tearDownClass is not always invoked, resource_cleanup is always
>invoked, and it has been implemented to avoid resource leaks.
>
>If you are using an older version of tempest you should be able to
>override tearDownClass instead.
>
>andrea
>
>
>On 2 December 2014 at 13:51, Richard Winters (riwinter)
> wrote:
>> I¹ve noticed that in scenario tests only the OfficialClientTest in
>> manager.py has a tearDownClass and was wondering if there is a reason
>>for
>> that?
>>
>> In my scenario tests I need to ensure a particular connection gets
>>closed
>> after the test runs.  This connection is setup in setUpClass so it makes
>> sense to me that it should also be closed in the tearDownClass.
>>
>> This is how I¹m cleaning up now ­ but didn¹t know if there is better
>>way to
>> do it.
>> @classmethod
>> def tearDownClass(cls):
>> super(TestCSROneNet, cls).tearDownClass()
>> if cls.nx_onep is not None:
>> cls.nx_onep.disconnect()
>>
>> Thanks
>> Rich
>>
>> ___
>> OpenStack-dev mailing list
>> OpenStack-dev@lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>
>
>___
>OpenStack-dev mailing list
>OpenStack-dev@lists.openstack.org
>http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [tempest] tearDownClass usage in scenario tests

2014-12-02 Thread Andrea Frittoli
Hello Rich,

in the latest tempest we made two significant changes compared to the
version you're using.

We dropped the use of official clients from scenario tests (and
OfficialClientTest has been replaced by ScenarioTest).
And we introduced resource_setup and resource_cleanup in the test base
class, which should be used instead of setUpClass and teadDownClass
(there's an hacking rule for that).

While tearDownClass is not always invoked, resource_cleanup is always
invoked, and it has been implemented to avoid resource leaks.

If you are using an older version of tempest you should be able to
override tearDownClass instead.

andrea


On 2 December 2014 at 13:51, Richard Winters (riwinter)
 wrote:
> I’ve noticed that in scenario tests only the OfficialClientTest in
> manager.py has a tearDownClass and was wondering if there is a reason for
> that?
>
> In my scenario tests I need to ensure a particular connection gets closed
> after the test runs.  This connection is setup in setUpClass so it makes
> sense to me that it should also be closed in the tearDownClass.
>
> This is how I’m cleaning up now – but didn’t know if there is better way to
> do it.
> @classmethod
> def tearDownClass(cls):
> super(TestCSROneNet, cls).tearDownClass()
> if cls.nx_onep is not None:
> cls.nx_onep.disconnect()
>
> Thanks
> Rich
>
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [tempest] tearDownClass usage in scenario tests

2014-12-02 Thread Richard Winters (riwinter)
I’ve noticed that in scenario tests only the OfficialClientTest in manager.py 
has a tearDownClass and was wondering if there is a reason for that?

In my scenario tests I need to ensure a particular connection gets closed after 
the test runs.  This connection is setup in setUpClass so it makes sense to me 
that it should also be closed in the tearDownClass.

This is how I’m cleaning up now – but didn’t know if there is better way to do 
it.
@classmethod
def tearDownClass(cls):
super(TestCSROneNet, cls).tearDownClass()
if cls.nx_onep is not None:
cls.nx_onep.disconnect()

Thanks
Rich
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev