Convert scenario test tearDown to addCleanup
This commit removes the resource management code used in the scenario
tests and replaces it with addCleanup. The tearDownClass code created
a LIFO queue for deleting resources created during tests which is
exactly what addCleanup is used for. Additionally, the previous
tearDownClass code only worked for objects created, and couldn't
undo actions such as volume attach which changed the resource state.
addCleanup doesn't have that limitation.
To handle async delete actions a list of waits is added which will be iterated
over as the last step of clearing the addCleanup queue. That way all the
delete calls are made up front and the tests won't succeed unless the deletes
are eventually successful. This is the same basic approach used in the api
tests to limit cleanup execution time except here it is multi-resource, because
of the nature of the scenario tests.
Change-Id: I315c9c67a70ab6a209d4996e2926a8a2d06c9bc1
14 files changed