break out whitebox tests
move whitebox tests to their own directory, with rules around
them. We had only a small number of tests here, and we don't
currently run these in gate, so these aren't added to tox.ini yet.
Part of bp:tempest-repo-restructure
Change-Id: Ic1d2158cd92d13ae25f026289f680396aa0ec3a8
diff --git a/tempest/tests/compute/__init__.py b/tempest/tests/compute/__init__.py
index 36893e3..968f17e 100644
--- a/tempest/tests/compute/__init__.py
+++ b/tempest/tests/compute/__init__.py
@@ -28,7 +28,6 @@
CREATE_IMAGE_ENABLED = CONFIG.compute.create_image_enabled
RESIZE_AVAILABLE = CONFIG.compute.resize_available
CHANGE_PASSWORD_AVAILABLE = CONFIG.compute.change_password_available
-WHITEBOX_ENABLED = CONFIG.whitebox.whitebox_enabled
DISK_CONFIG_ENABLED = True
DISK_CONFIG_ENABLED_OVERRIDE = CONFIG.compute.disk_config_enabled_override
FLAVOR_EXTRA_DATA_ENABLED = True
diff --git a/tempest/whitebox/README.rst b/tempest/whitebox/README.rst
new file mode 100644
index 0000000..dabf758
--- /dev/null
+++ b/tempest/whitebox/README.rst
@@ -0,0 +1,46 @@
+Tempest Guide to Whitebox tests
+========
+
+
+What are these tests?
+--------
+
+When you hit the OpenStack API, this causes internal state changes in
+the system. This might be database transitions, vm modifications,
+other deep state changes which aren't really accessible from the
+OpenStack API. These side effects are sometimes important to
+validate.
+
+White box testing is an approach there. In white box testing you are
+given database access to the environment, and can verify internal
+record changes after an API call.
+
+This is an optional part of testing, and requires extra setup, but can
+be useful for validating Tempest internals.
+
+
+Why are these tests in tempest?
+--------
+
+Especially when it comes to something like VM state changing, which is
+a coordination of numerous running daemons, and a functioning VM, it's
+very difficult to get a realistic test like this in unit tests.
+
+
+Scope of these tests
+--------
+
+White box tests should be limitted to tests where black box testing
+(using the OpenStack API to verify results) isn't sufficient.
+
+As these poke at internals of OpenStack, it should also be realized
+that these tests are very tightly coupled to current implementation of
+OpenStack. They will need to be maintained agressively to keep up with
+internals changes in OpenStack projects.
+
+
+Example of a good test
+--------
+
+Pushing VMs through a series of state transitions, and ensuring along
+the way the database state transitions match what's expected.
diff --git a/tempest/whitebox/__init__.py b/tempest/whitebox/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/whitebox/__init__.py
diff --git a/tempest/whitebox.py b/tempest/whitebox/manager.py
similarity index 98%
rename from tempest/whitebox.py
rename to tempest/whitebox/manager.py
index cf9fff0..a75edb0 100644
--- a/tempest/whitebox.py
+++ b/tempest/whitebox/manager.py
@@ -27,7 +27,6 @@
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest import test
-from tempest.tests import compute
LOG = logging.getLogger(__name__)
@@ -56,12 +55,11 @@
@classmethod
def setUpClass(cls):
- if not compute.WHITEBOX_ENABLED:
+ super(ComputeWhiteboxTest, cls).setUpClass()
+ if not cls.config.whitebox.whitebox_enabled:
msg = "Whitebox testing disabled"
raise cls.skipException(msg)
- super(ComputeWhiteboxTest, cls).setUpClass()
-
# Add some convenience attributes that tests use...
cls.nova_dir = cls.config.whitebox.source_dir
cls.compute_bin_dir = cls.config.whitebox.bin_dir
diff --git a/tempest/tests/compute/images/test_images_whitebox.py b/tempest/whitebox/test_images_whitebox.py
similarity index 98%
rename from tempest/tests/compute/images/test_images_whitebox.py
rename to tempest/whitebox/test_images_whitebox.py
index 9ec05dd..304677f 100644
--- a/tempest/tests/compute/images/test_images_whitebox.py
+++ b/tempest/whitebox/test_images_whitebox.py
@@ -19,11 +19,11 @@
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
-from tempest import whitebox
+from tempest.whitebox import manager
@attr(type='whitebox')
-class ImagesWhiteboxTest(whitebox.ComputeWhiteboxTest, base.BaseComputeTest):
+class ImagesWhiteboxTest(manager.ComputeWhiteboxTest, base.BaseComputeTest):
_interface = 'json'
@classmethod
diff --git a/tempest/tests/compute/servers/test_servers_whitebox.py b/tempest/whitebox/test_servers_whitebox.py
similarity index 98%
rename from tempest/tests/compute/servers/test_servers_whitebox.py
rename to tempest/whitebox/test_servers_whitebox.py
index 6b192dd..2eab393 100644
--- a/tempest/tests/compute/servers/test_servers_whitebox.py
+++ b/tempest/whitebox/test_servers_whitebox.py
@@ -18,11 +18,11 @@
from tempest import exceptions
from tempest.test import attr
from tempest.tests.identity.base import BaseIdentityAdminTest
-from tempest import whitebox
+from tempest.whitebox import manager
@attr(type='whitebox')
-class ServersWhiteboxTest(whitebox.ComputeWhiteboxTest):
+class ServersWhiteboxTest(manager.ComputeWhiteboxTest):
_interface = 'json'
@classmethod