Merge "Sorting services list before asserting in test_get_service_list test"
diff --git a/openstack-common.conf b/openstack-common.conf
index 8568f22..ff84404 100644
--- a/openstack-common.conf
+++ b/openstack-common.conf
@@ -4,6 +4,7 @@
module=install_venv_common
module=lockutils
module=log
+module=importlib
# The base module to hold the copy of openstack.common
base=tempest
diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py
index d170eb8..c4c2041 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import importlib
import logging
import multiprocessing
import time
@@ -21,6 +20,7 @@
from tempest.common import ssh
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
+from tempest.openstack.common import importutils
from tempest.stress import cleanup
admin_manager = clients.AdminManager()
@@ -93,11 +93,6 @@
return None
-def get_action_object(path):
- (module_part, _, obj_name) = path.rpartition('.')
- return getattr(importlib.import_module(module_part), obj_name)
-
-
def stress_openstack(tests, duration, max_runs=None):
"""
Workload driver. Executes an action function against a nova-cluster.
@@ -131,7 +126,7 @@
password="pass",
tenant_name=tenant_name)
- test_obj = get_action_object(test['action'])
+ test_obj = importutils.import_class(test['action'])
test_run = test_obj(manager, logger, max_runs)
kwargs = test.get('kwargs', {})
diff --git a/tempest/thirdparty/boto/test_s3_ec2_images.py b/tempest/thirdparty/boto/test_s3_ec2_images.py
index 5e1e2cb..e2ca15f 100644
--- a/tempest/thirdparty/boto/test_s3_ec2_images.py
+++ b/tempest/thirdparty/boto/test_s3_ec2_images.py
@@ -22,7 +22,6 @@
from tempest.test import attr
from tempest.thirdparty.boto.test import BotoTestCase
from tempest.thirdparty.boto.utils.s3 import s3_upload_dir
-from tempest.thirdparty.boto.utils.wait import state_wait
class S3ImagesTest(BotoTestCase):
@@ -51,8 +50,6 @@
cls.bucket_name)
s3_upload_dir(bucket, cls.materials_path)
- #Note(afazekas): Without the normal status change test!
- # otherwise I would skip it too
@attr(type='smoke')
def test_register_get_deregister_ami_image(self):
# Register and deregister ami image
@@ -70,13 +67,8 @@
retrieved_image = self.images_client.get_image(image["image_id"])
self.assertTrue(retrieved_image.name == image["name"])
self.assertTrue(retrieved_image.id == image["image_id"])
- state = retrieved_image.state
- if state != "available":
- def _state():
- retr = self.images_client.get_image(image["image_id"])
- return retr.state
- state = state_wait(_state, "available")
- self.assertEqual("available", state)
+ if retrieved_image.state != "available":
+ self.assertImageStateWait(retrieved_image, "available")
self.images_client.deregister_image(image["image_id"])
self.assertNotIn(image["image_id"], str(
self.images_client.get_all_images()))