rename tests -> api

Now that all the other tests are moved out of the tests directory
we can rename tests -> api to reflect that these tests are api
testing, and need to use only the internal clients.

Clean up references from other parts of OpenStack to the new api
namespace.

Reorder the imports as required with this naming change.

Added README.rst

Change-Id: I19203957f917b59e7c8a3838c590937752461a2f
changes/06/29606/5
Sean Dague 10 years ago
parent 77800d3620
commit 1937d09fb0

@ -0,0 +1,50 @@
Tempest Guide to API tests
========
What are these tests?
--------
One of Tempest's prime function is to ensure that your OpenStack cloud
works with the OpenStack API as documented. The current largest
portion of Tempest code is devoted to test cases that do exactly this.
It's also important to test not only the expected possitive path on
APIs, but also to provide them with invalid data to ensure they fail
in expected and documented ways. Over the course of the OpenStack
project Tempest has discovered many fundamental bugs by doing just
this.
In order for some APIs to return meaniful results, there must be
enough data in the system. This means these tests might start by
spinning up a server, image, etc, then opperating on it.
Why are these tests in tempest?
--------
This is one of the core missions for the Tempest project, and where it
started. Many people use this bit of function in Tempest to ensure
their clouds haven't broken the OpenStack API.
It could be argued that some of the negative testing could be done
back in the projects themselves, and we might evolve there over time,
but currently in the OpenStack gate this is a fundamentally important
place to keep things.
Scope of these tests
--------
API tests should always use the Tempest implementation of the
OpenStack API, as we want to ensure that bugs aren't hidden by the
official clients.
They should test specific API calls, and can build up complex state if
it's needed for the API call to be meaningful.
They should send not only good data, but bad data at the API and look
for error codes.
They should all be able to be run on their own, not depending on the
state created by a previous test.

@ -36,7 +36,7 @@ MULTI_USER = True
# All compute tests -- single setup function
def generic_setup_package():
LOG.debug("Entering tempest.tests.compute.setup_package")
LOG.debug("Entering tempest.api.compute.setup_package")
global MULTI_USER, DISK_CONFIG_ENABLED, FLAVOR_EXTRA_DATA_ENABLED
os = clients.Manager()

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class AggregatesAdminTestJSON(base.BaseComputeAdminTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class AvailabilityZoneAdminTestJSON(base.BaseComputeAdminTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class FixedIPsBase(base.BaseComputeAdminTest):

@ -15,12 +15,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api import compute
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_int_id
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests import compute
from tempest.tests.compute import base
class FlavorsAdminTestJSON(base.BaseComputeAdminTest):

@ -15,12 +15,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api import compute
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_int_id
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests import compute
from tempest.tests.compute import base
class FlavorsAccessTestJSON(base.BaseComputeAdminTest):

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api import compute
from tempest.api.compute import base
from tempest import exceptions
from tempest.test import attr
from tempest.tests import compute
from tempest.tests.compute import base
class FlavorsExtraSpecsTestJSON(base.BaseComputeAdminTest):

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class QuotasAdminTestJSON(base.BaseComputeAdminTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class ServicesAdminTestJSON(base.BaseComputeAdminTest):

@ -18,11 +18,11 @@
import logging
import time
from tempest.api import compute
from tempest import clients
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
import tempest.test
from tempest.tests import compute
LOG = logging.getLogger(__name__)

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class FlavorsTestJSON(base.BaseComputeTest):

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class FloatingIPsTestJSON(base.BaseComputeTest):

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class FloatingIPDetailsTestJSON(base.BaseComputeTest):

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class ImagesMetadataTestJSON(base.BaseComputeTest):

@ -17,13 +17,13 @@
import testtools
from tempest.api import compute
from tempest.api.compute import base
from tempest import clients
from tempest.common.utils.data_utils import parse_image_id
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests import compute
from tempest.tests.compute import base
class ImagesTestJSON(base.BaseComputeTest):

@ -17,13 +17,13 @@
import testtools
from tempest.api import compute
from tempest.api.compute import base
from tempest import clients
from tempest.common.utils.data_utils import parse_image_id
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests import compute
from tempest.tests.compute import base
class ImagesOneServerTestJSON(base.BaseComputeTest):

@ -15,11 +15,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import parse_image_id
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class ListImageFiltersTestJSON(base.BaseComputeTest):

@ -15,8 +15,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.test import attr
from tempest.tests.compute import base
class ListImagesTestJSON(base.BaseComputeTest):

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class KeyPairsTestJSON(base.BaseComputeTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class AbsoluteLimitsTestJSON(base.BaseComputeTest):

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class SecurityGroupRulesTestJSON(base.BaseComputeTest):

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class SecurityGroupsTestJSON(base.BaseComputeTest):

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.tests.compute import base
from tempest.api.compute import base
import time

@ -20,13 +20,12 @@ import base64
import netaddr
import testtools
from tempest.api import compute
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest.common.utils.linux.remote_client import RemoteClient
import tempest.config
from tempest.test import attr
from tempest.tests import compute
from tempest.tests.compute import base
@attr(type='smoke')

@ -17,9 +17,9 @@
import testtools
from tempest.api import compute
from tempest.api.compute import base
from tempest.test import attr
from tempest.tests import compute
from tempest.tests.compute import base
class ServerDiskConfigTestJSON(base.BaseComputeTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class InstanceActionsTestJSON(base.BaseComputeTest):

@ -15,14 +15,13 @@
# License for the specific language governing permissions and limitations
# under the License.
import testtools
from tempest.api.compute import base
from tempest.api import utils
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
from tempest.tests import utils
import testtools
class ListServerFiltersTestJSON(base.BaseComputeTest):

@ -16,10 +16,10 @@
# under the License.
from tempest.api import compute
from tempest.api.compute import base
from tempest import clients
from tempest import exceptions
from tempest.tests import compute
from tempest.tests.compute import base
class ListServersNegativeTestJSON(base.BaseComputeTest):

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class MultipleCreateTestJSON(base.BaseComputeTest):

@ -20,13 +20,13 @@ import time
import testtools
from tempest.api import compute
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest.common.utils.linux.remote_client import RemoteClient
import tempest.config
from tempest import exceptions
from tempest.test import attr
from tempest.tests import compute
from tempest.tests.compute import base
class ServerActionsTestJSON(base.BaseComputeTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class ServerAddressesTest(base.BaseComputeTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class ServerMetadataTestJSON(base.BaseComputeTest):

@ -17,9 +17,9 @@
import base64
from tempest.api.compute import base
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class ServerPersonalityTestJSON(base.BaseComputeTest):

@ -15,11 +15,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
import tempest.config
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class ServerRescueTestJSON(base.BaseComputeTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest.test import attr
from tempest.tests.compute import base
class ServersTestJSON(base.BaseComputeTest):

@ -17,11 +17,11 @@
import sys
from tempest.api.compute import base
from tempest import clients
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
class ServersNegativeTest(base.BaseComputeTest):

@ -17,10 +17,10 @@
import netaddr
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
@attr(type='smoke')

@ -15,12 +15,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api import compute
from tempest.api.compute import base
from tempest import clients
from tempest.common.utils.data_utils import parse_image_id
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.tests import compute
from tempest.tests.compute import base
class AuthorizationTestJSON(base.BaseComputeTest):

@ -16,8 +16,8 @@
# under the License.
from tempest.api.compute import base
from tempest.test import attr
from tempest.tests.compute import base
class ExtensionsTestJSON(base.BaseComputeTest):

@ -20,10 +20,10 @@ import string
import testtools
from tempest.api.compute import base
from tempest import config
from tempest import exceptions
from tempest.test import attr
from tempest.tests.compute import base
@attr(category='live-migration')

@ -15,8 +15,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.test import attr
from tempest.tests.compute import base
class QuotasTestJSON(base.BaseComputeTest):

@ -17,10 +17,10 @@
import testtools
from tempest.api.compute import base
from tempest.common.utils.linux.remote_client import RemoteClient
import tempest.config
from tempest.test import attr
from tempest.tests.compute import base
class AttachVolumeTestJSON(base.BaseComputeTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest.test import attr
from tempest.tests.compute import base
class VolumesGetTestJSON(base.BaseComputeTest):

@ -15,9 +15,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest.tests.compute import base
class VolumesTestJSON(base.BaseComputeTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.compute import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.tests.compute import base
class VolumesNegativeTest(base.BaseComputeTest):

@ -22,4 +22,4 @@ LOG = logging.getLogger(__name__)
# All identity tests -- single setup function
def setup_package():
LOG.debug("Entering tempest.tests.identity.setup_package")
LOG.debug("Entering tempest.api.identity.setup_package")

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.identity import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.identity import base
class RolesTestJSON(base.BaseIdentityAdminTest):

@ -16,10 +16,10 @@
# under the License.
from tempest.api.identity import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.identity import base
class ServicesTestJSON(base.BaseIdentityAdminTest):

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.identity import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.identity import base
class TenantsTestJSON(base.BaseIdentityAdminTest):

@ -15,12 +15,13 @@
# License for the specific language governing permissions and limitations
# under the License.
import testtools
from testtools.matchers._basic import Contains
from tempest.api.identity import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.identity import base
import testtools
from testtools.matchers._basic import Contains
class UsersTestJSON(base.BaseIdentityAdminTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.identity import base
from tempest.common.utils.data_utils import rand_name
from tempest.test import attr
from tempest.tests.identity import base
class EndPointsTestJSON(base.BaseIdentityAdminTest):

@ -16,9 +16,9 @@
# under the License.
from tempest.api.identity import base
from tempest.common.utils.data_utils import rand_name
from tempest.test import attr
from tempest.tests.identity import base
class ServicesTestJSON(base.BaseIdentityAdminTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.identity import base
from tempest.common.utils.data_utils import rand_name
from tempest.test import attr
from tempest.tests.identity import base
class UsersV3TestJSON(base.BaseIdentityAdminTest):

@ -16,9 +16,9 @@
import cStringIO as StringIO
from tempest.api.image import base
from tempest import clients
from tempest.test import attr
from tempest.tests.image import base
class ImageMembersTests(base.BaseV1ImageTest):

@ -17,9 +17,9 @@
import cStringIO as StringIO
from tempest.api.image import base
from tempest import exceptions
from tempest.test import attr
from tempest.tests.image import base
class CreateRegisterImagesTest(base.BaseV1ImageTest):

@ -19,9 +19,9 @@
import cStringIO as StringIO
import random
from tempest.api.image import base
from tempest import exceptions
from tempest.test import attr
from tempest.tests.image import base
class CreateRegisterImagesTest(base.BaseV2ImageTest):

@ -17,10 +17,10 @@
import netaddr
from tempest.api.network import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.network import base
class NetworksTest(base.BaseNetworkTest):

@ -16,10 +16,10 @@
# under the License.
from tempest.api.identity.base import DataGenerator
from tempest import clients
from tempest import exceptions
import tempest.test
from tempest.tests.identity.base import DataGenerator
class BaseObjectTest(tempest.test.BaseTestCase):

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.object_storage import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.object_storage import base
class AccountTest(base.BaseObjectTest):

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.object_storage import base
from tempest.common.utils.data_utils import arbitrary_string
from tempest.common.utils.data_utils import rand_name
from tempest.test import attr
from tempest.tests.object_storage import base
class ContainerTest(base.BaseObjectTest):

@ -15,11 +15,13 @@
# License for the specific language governing permissions and limitations
# under the License.
import time
import testtools
from tempest.api.object_storage import base
from tempest.common.utils.data_utils import rand_name
from tempest.test import attr
from tempest.tests.object_storage import base
import testtools
import time
class ContainerSyncTest(base.BaseObjectTest):

@ -15,13 +15,15 @@
# License for the specific language governing permissions and limitations
# under the License.
import time
import testtools
from tempest.api.object_storage import base
from tempest.common.utils.data_utils import arbitrary_string
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.object_storage import base
import testtools
import time
class ObjectExpiryTest(base.BaseObjectTest):

@ -15,13 +15,15 @@
# License for the specific language governing permissions and limitations
# under the License.
import time
import testtools
from tempest.api.object_storage import base
from tempest.common.utils.data_utils import arbitrary_string
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.object_storage import base
import testtools
import time
class ObjectTest(base.BaseObjectTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.object_storage import base
from tempest.common.utils.data_utils import rand_name
from tempest.test import attr
from tempest.tests.object_storage import base
class ContainerTest(base.BaseObjectTest):

@ -18,12 +18,12 @@
import logging
import testtools
from tempest.api.volume import base
from tempest.common.utils.data_utils import rand_name
from tempest import config
from tempest.services.volume.json.admin import volume_types_client
from tempest.services.volume.json import volumes_client
from tempest.test import attr
from tempest.tests.volume import base
LOG = logging.getLogger(__name__)

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.volume.base import BaseVolumeTest
from tempest.common.utils.data_utils import rand_name
from tempest.services.volume.json.admin import volume_types_client
from tempest.test import attr
from tempest.tests.volume.base import BaseVolumeTest
class VolumeTypesTest(BaseVolumeTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.volume import base
from tempest.common.utils.data_utils import rand_name
from tempest.test import attr
from tempest.tests.volume import base
class VolumeTypesExtraSpecsTest(base.BaseVolumeAdminTest):

@ -17,10 +17,10 @@
import uuid
from tempest.api.volume import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.volume import base
class ExtraSpecsNegativeTest(base.BaseVolumeAdminTest):

@ -17,9 +17,9 @@
import uuid
from tempest.api.volume import base
from tempest import exceptions
from tempest.test import attr
from tempest.tests.volume import base
class VolumeTypesNegativeTest(base.BaseVolumeAdminTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.volume.base import BaseVolumeTest
from tempest.common.utils.data_utils import rand_name
from tempest.test import attr
from tempest.tests.volume.base import BaseVolumeTest
class VolumesActionsTest(BaseVolumeTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.volume import base
from tempest.common.utils.data_utils import rand_name
from tempest.test import attr
from tempest.tests.volume import base
class VolumesGetTest(base.BaseVolumeTest):

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.volume import base
from tempest.common.utils.data_utils import rand_name
from tempest.test import attr
from tempest.tests.volume import base
class VolumesListTest(base.BaseVolumeTest):

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.volume import base
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
from tempest.tests.volume import base
class VolumesNegativeTest(base.BaseVolumeTest):

@ -14,8 +14,8 @@
import logging
from tempest.api.volume import base
from tempest.test import attr
from tempest.tests.volume import base
LOG = logging.getLogger(__name__)

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save