Ensure package-wide test init is done with testr
This patch adds testresources.ResourcedTestCase as another base class
for compute and boto tests. This allows us to perform package-wide
init for tests when running them under testr. The init was not being
performed when the tests were run under testr because setup_package is
a nosetests specific init feature. The setup_package functions in
__init__.py files are renamed to ensure that the initialisation is
only done once.
Implements: blueprint speed-up-tempest
Change-Id: If76f71cb06f2243607db2680504e94dc65e1f585
diff --git a/tempest/testboto.py b/tempest/testboto.py
index 09ac950..29ac3ca 100644
--- a/tempest/testboto.py
+++ b/tempest/testboto.py
@@ -26,6 +26,7 @@
from boto.s3.bucket import Bucket
from boto.s3.key import Key
import nose
+import testresources
import unittest2 as unittest
from tempest.exceptions import TearDownException
@@ -122,8 +123,12 @@
return string + ")"
-class BotoTestCase(unittest.TestCase):
+class BotoTestCase(unittest.TestCase,
+ testresources.ResourcedTestCase):
"""Recommended to use as base class for boto related test."""
+
+ resources = [('boto_init', tempest.tests.boto.generic_setup_package())]
+
@classmethod
def setUpClass(cls):
# The trash contains cleanup functions and paramaters in tuples