Merge "Ensure package-wide test init is done with testr"
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
diff --git a/tempest/tests/boto/__init__.py b/tempest/tests/boto/__init__.py
index ec51b18..6d5149e 100644
--- a/tempest/tests/boto/__init__.py
+++ b/tempest/tests/boto/__init__.py
@@ -32,7 +32,7 @@
EC2_CAN_CONNECT_ERROR = "Unknown Error"
-def setup_package():
+def generic_setup_package():
global A_I_IMAGES_READY
global S3_CAN_CONNECT_ERROR
global EC2_CAN_CONNECT_ERROR
diff --git a/tempest/tests/compute/__init__.py b/tempest/tests/compute/__init__.py
index 190cb5f..a00ec77 100644
--- a/tempest/tests/compute/__init__.py
+++ b/tempest/tests/compute/__init__.py
@@ -37,7 +37,7 @@
# All compute tests -- single setup function
-def setup_package():
+def generic_setup_package():
LOG.debug("Entering tempest.tests.compute.setup_package")
global MULTI_USER, DISK_CONFIG_ENABLED, FLAVOR_EXTRA_DATA_ENABLED
diff --git a/tempest/tests/compute/base.py b/tempest/tests/compute/base.py
index ae7c5ab..3f3b3e8 100644
--- a/tempest/tests/compute/base.py
+++ b/tempest/tests/compute/base.py
@@ -19,12 +19,14 @@
import time
import nose
+import testresources
import unittest2 as unittest
from tempest import clients
from tempest.common.utils.data_utils import rand_name
from tempest import config
from tempest import exceptions
+from tempest.tests import compute
__all__ = ['BaseComputeTest', 'BaseComputeTestJSON', 'BaseComputeTestXML',
'BaseComputeAdminTestJSON', 'BaseComputeAdminTestXML']
@@ -32,10 +34,13 @@
LOG = logging.getLogger(__name__)
-class BaseCompTest(unittest.TestCase):
+class BaseCompTest(unittest.TestCase,
+ testresources.ResourcedTestCase):
"""Base test case class for all Compute API tests."""
+ resources = [('compute_init', compute.generic_setup_package())]
+
@classmethod
def setUpClass(cls):
cls.config = config.TempestConfig()
diff --git a/tools/pip-requires b/tools/pip-requires
index 061eff6..fcf1690 100644
--- a/tools/pip-requires
+++ b/tools/pip-requires
@@ -10,3 +10,4 @@
python-keystoneclient>=0.2.0
python-novaclient>=2.10.0
python-quantumclient>=2.1
+testresources