From 0477accd328220c725bdf227b25cbe8ce2862e72 Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Wed, 9 Aug 2017 21:14:53 +0100 Subject: [PATCH] Make validation_resources a stable interface Move the module to tempest.lib, add unit tests, release notes and update imports. Change-Id: I76b3b8e9a83bd83a6b5742b6d2ceb84642f653ad --- doc/source/library.rst | 1 + doc/source/library/validation_resources.rst | 11 +++++++++++ ...-validation-resources-to-lib-dc2600c4324ca4d7.yaml | 7 +++++++ tempest/{ => lib}/common/validation_resources.py | 0 tempest/test.py | 2 +- .../{ => lib}/common/test_validation_resources.py | 2 +- tempest/tests/test_test.py | 4 ++-- 7 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 doc/source/library/validation_resources.rst create mode 100644 releasenotes/notes/add-validation-resources-to-lib-dc2600c4324ca4d7.yaml rename tempest/{ => lib}/common/validation_resources.py (100%) rename tempest/tests/{ => lib}/common/test_validation_resources.py (99%) diff --git a/doc/source/library.rst b/doc/source/library.rst index a461a0fc00..074d642e42 100644 --- a/doc/source/library.rst +++ b/doc/source/library.rst @@ -69,3 +69,4 @@ Current Library APIs library/auth library/clients library/credential_providers + library/validation_resources diff --git a/doc/source/library/validation_resources.rst b/doc/source/library/validation_resources.rst new file mode 100644 index 0000000000..9b36476cbb --- /dev/null +++ b/doc/source/library/validation_resources.rst @@ -0,0 +1,11 @@ +.. _validation_resources: + +Validation Resources +==================== + +------------------------------- +The validation_resources module +------------------------------- + +.. automodule:: tempest.lib.common.validation_resources + :members: diff --git a/releasenotes/notes/add-validation-resources-to-lib-dc2600c4324ca4d7.yaml b/releasenotes/notes/add-validation-resources-to-lib-dc2600c4324ca4d7.yaml new file mode 100644 index 0000000000..7814f4e1c5 --- /dev/null +++ b/releasenotes/notes/add-validation-resources-to-lib-dc2600c4324ca4d7.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Add the `validation_resources` module to tempest.lib. The module provides + a set of helpers that can be used to provision and cleanup all the + resources required to perform ping / ssh tests against a virtual machine: + a keypair, a security group with targeted rules and a floating IP. diff --git a/tempest/common/validation_resources.py b/tempest/lib/common/validation_resources.py similarity index 100% rename from tempest/common/validation_resources.py rename to tempest/lib/common/validation_resources.py diff --git a/tempest/test.py b/tempest/test.py index cfa01e6828..3967515d9b 100644 --- a/tempest/test.py +++ b/tempest/test.py @@ -26,10 +26,10 @@ import testtools from tempest import clients from tempest.common import credentials_factory as credentials from tempest.common import utils -import tempest.common.validation_resources as vr from tempest import config from tempest.lib.common import cred_client from tempest.lib.common import fixed_network +from tempest.lib.common import validation_resources as vr from tempest.lib import decorators from tempest.lib import exceptions as lib_exc diff --git a/tempest/tests/common/test_validation_resources.py b/tempest/tests/lib/common/test_validation_resources.py similarity index 99% rename from tempest/tests/common/test_validation_resources.py rename to tempest/tests/lib/common/test_validation_resources.py index f7edfc0fe6..d5139f4da4 100644 --- a/tempest/tests/common/test_validation_resources.py +++ b/tempest/tests/lib/common/test_validation_resources.py @@ -15,7 +15,7 @@ import fixtures import mock import testtools -from tempest.common import validation_resources as vr +from tempest.lib.common import validation_resources as vr from tempest.lib import exceptions as lib_exc from tempest.lib.services import clients from tempest.tests import base diff --git a/tempest/tests/test_test.py b/tempest/tests/test_test.py index de3dc060e5..72e3ac7bd7 100644 --- a/tempest/tests/test_test.py +++ b/tempest/tests/test_test.py @@ -20,8 +20,8 @@ from oslo_config import cfg import testtools from tempest import clients -from tempest.common import validation_resources as vr from tempest import config +from tempest.lib.common import validation_resources as vr from tempest.lib import exceptions as lib_exc from tempest import test from tempest.tests import base @@ -48,7 +48,7 @@ class LoggingTestResult(testtools.TestResult): class TestValidationResources(base.TestCase): - validation_resources_module = 'tempest.common.validation_resources' + validation_resources_module = 'tempest.lib.common.validation_resources' def setUp(self): super(TestValidationResources, self).setUp()