diff --git a/tempest/test.py b/tempest/test.py index 438f4d90a2..1e5cd192da 100644 --- a/tempest/test.py +++ b/tempest/test.py @@ -203,6 +203,10 @@ class BaseTestCase(testtools.testcase.WithAttributes, cls._teardowns.append(('resources', cls.resource_cleanup)) cls.resource_setup() except exc as e: + # NOTE(dviroel): the exception may be raised after setting up the + # user credentials, so we must call tearDownClass to release all + # allocated resources. + cls.tearDownClass() raise exc_to_raise(e.args) except Exception: etype, value, trace = sys.exc_info() diff --git a/tempest/tests/test_test.py b/tempest/tests/test_test.py index ad0793c3e5..a2e0efd1d9 100644 --- a/tempest/tests/test_test.py +++ b/tempest/tests/test_test.py @@ -538,7 +538,8 @@ class TestTempestBaseTestClassFixtures(base.TestCase): result = LoggingTestResult(log) suite.run(result) # If we trigger a skip condition, teardown is not invoked at all - self.assertEqual(self.SETUP_FIXTURES[:2], + self.assertEqual((self.SETUP_FIXTURES[:2] + + [self.TEARDOWN_FIXTURES[0]]), self.test.fixtures_invoked) def test_skip_credentials_fails(self):