Fix compute tests init
Compute tests skip and feature enable mechanism based on global variables
set by the generic_setup_package. When the tesresources is introduced
for handling initialization, the skip logic frequently sees the default disabled
values.
Code execute on module load is not advised, because the hacking.py (used
on pep8 checking) inspects the modules in way which causes global module
code execution.
Every compute test cases depends on base class, which static (class)
attribute initialization done, before any setUpClass checking the global
variables.
This initialization is happens only once, and visible by all subclasses.
A possible next step (after this change), to have the
generic_setup_package to return, with a dict contains the conclusion
about the testing and configured variables, it will be visible for all
subclasses.
Change-Id: I405dc1a441b2da3fa95d7fbec62e5871eae8c905
diff --git a/tempest/tests/compute/__init__.py b/tempest/tests/compute/__init__.py
index a3c6380..36893e3 100644
--- a/tempest/tests/compute/__init__.py
+++ b/tempest/tests/compute/__init__.py
@@ -21,7 +21,6 @@
from tempest import clients
from tempest import config
from tempest.exceptions import InvalidConfiguration
-from testresources import TestResourceManager
LOG = logging.getLogger(__name__)
@@ -79,8 +78,3 @@
"tenant or password: alt_tenant_name=%s alt_password=%s"
% (user2_tenant_name, user2_password))
raise InvalidConfiguration(msg)
-
-
-class ComputeResource(TestResourceManager):
- def make(self, dependency_resources=None):
- return generic_setup_package()
diff --git a/tempest/tests/compute/base.py b/tempest/tests/compute/base.py
index 2aae89c..2c6b861 100644
--- a/tempest/tests/compute/base.py
+++ b/tempest/tests/compute/base.py
@@ -38,7 +38,7 @@
testresources.ResourcedTestCase):
"""Base test case class for all Compute API tests."""
- resources = [('compute_init', compute.ComputeResource())]
+ conclusion = compute.generic_setup_package()
@classmethod
def setUpClass(cls):