Merge "Split resource_setup for thirdparty tests"
diff --git a/tempest/thirdparty/boto/test.py b/tempest/thirdparty/boto/test.py
index edd9de1..5b2ed70 100644
--- a/tempest/thirdparty/boto/test.py
+++ b/tempest/thirdparty/boto/test.py
@@ -201,10 +201,14 @@
raise cls.skipException("The EC2 API is not available")
@classmethod
+ def setup_credentials(cls):
+ super(BotoTestCase, cls).setup_credentials()
+ cls.os = cls.get_client_manager()
+
+ @classmethod
def resource_setup(cls):
super(BotoTestCase, cls).resource_setup()
cls.conclusion = decision_maker()
- cls.os = cls.get_client_manager()
# The trash contains cleanup functions and paramaters in tuples
# (function, *args, **kwargs)
cls._resource_trash_bin = {}
diff --git a/tempest/thirdparty/boto/test_ec2_instance_run.py b/tempest/thirdparty/boto/test_ec2_instance_run.py
index 822bf34..39767a4 100644
--- a/tempest/thirdparty/boto/test_ec2_instance_run.py
+++ b/tempest/thirdparty/boto/test_ec2_instance_run.py
@@ -31,13 +31,17 @@
class InstanceRunTest(boto_test.BotoTestCase):
@classmethod
+ def setup_clients(cls):
+ super(InstanceRunTest, cls).setup_clients()
+ cls.s3_client = cls.os.s3_client
+ cls.ec2_client = cls.os.ec2api_client
+
+ @classmethod
def resource_setup(cls):
super(InstanceRunTest, cls).resource_setup()
if not cls.conclusion['A_I_IMAGES_READY']:
raise cls.skipException("".join(("EC2 ", cls.__name__,
": requires ami/aki/ari manifest")))
- cls.s3_client = cls.os.s3_client
- cls.ec2_client = cls.os.ec2api_client
cls.zone = CONF.boto.aws_zone
cls.materials_path = CONF.boto.s3_materials_path
ami_manifest = CONF.boto.ami_manifest
diff --git a/tempest/thirdparty/boto/test_ec2_keys.py b/tempest/thirdparty/boto/test_ec2_keys.py
index 36c3386..acf797a 100644
--- a/tempest/thirdparty/boto/test_ec2_keys.py
+++ b/tempest/thirdparty/boto/test_ec2_keys.py
@@ -26,9 +26,13 @@
class EC2KeysTest(boto_test.BotoTestCase):
@classmethod
+ def setup_clients(cls):
+ super(EC2KeysTest, cls).setup_clients()
+ cls.client = cls.os.ec2api_client
+
+ @classmethod
def resource_setup(cls):
super(EC2KeysTest, cls).resource_setup()
- cls.client = cls.os.ec2api_client
cls.ec = cls.ec2_error_code
# TODO(afazekas): merge create, delete, get test cases
diff --git a/tempest/thirdparty/boto/test_ec2_network.py b/tempest/thirdparty/boto/test_ec2_network.py
index c7ed00d..ce20156 100644
--- a/tempest/thirdparty/boto/test_ec2_network.py
+++ b/tempest/thirdparty/boto/test_ec2_network.py
@@ -20,8 +20,8 @@
class EC2NetworkTest(boto_test.BotoTestCase):
@classmethod
- def resource_setup(cls):
- super(EC2NetworkTest, cls).resource_setup()
+ def setup_clients(cls):
+ super(EC2NetworkTest, cls).setup_clients()
cls.ec2_client = cls.os.ec2api_client
# Note(afazekas): these tests for things duable without an instance
diff --git a/tempest/thirdparty/boto/test_ec2_security_groups.py b/tempest/thirdparty/boto/test_ec2_security_groups.py
index 92fe59d..7f9568b 100644
--- a/tempest/thirdparty/boto/test_ec2_security_groups.py
+++ b/tempest/thirdparty/boto/test_ec2_security_groups.py
@@ -21,8 +21,8 @@
class EC2SecurityGroupTest(boto_test.BotoTestCase):
@classmethod
- def resource_setup(cls):
- super(EC2SecurityGroupTest, cls).resource_setup()
+ def setup_clients(cls):
+ super(EC2SecurityGroupTest, cls).setup_clients()
cls.client = cls.os.ec2api_client
@test.idempotent_id('519b566e-0c38-4629-905e-7d6b6355f524')
diff --git a/tempest/thirdparty/boto/test_ec2_volumes.py b/tempest/thirdparty/boto/test_ec2_volumes.py
index 4616851..318e8e3 100644
--- a/tempest/thirdparty/boto/test_ec2_volumes.py
+++ b/tempest/thirdparty/boto/test_ec2_volumes.py
@@ -30,14 +30,20 @@
class EC2VolumesTest(boto_test.BotoTestCase):
@classmethod
- def resource_setup(cls):
- super(EC2VolumesTest, cls).resource_setup()
-
+ def skip_checks(cls):
+ super(EC2VolumesTest, cls).skip_checks()
if not CONF.service_available.cinder:
skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
raise cls.skipException(skip_msg)
+ @classmethod
+ def setup_clients(cls):
+ super(EC2VolumesTest, cls).setup_clients()
cls.client = cls.os.ec2api_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(EC2VolumesTest, cls).resource_setup()
cls.zone = CONF.boto.aws_zone
@test.idempotent_id('663f0077-c743-48ad-8ae0-46821cbc0918')
diff --git a/tempest/thirdparty/boto/test_s3_buckets.py b/tempest/thirdparty/boto/test_s3_buckets.py
index e3a265e..bf04803 100644
--- a/tempest/thirdparty/boto/test_s3_buckets.py
+++ b/tempest/thirdparty/boto/test_s3_buckets.py
@@ -21,8 +21,8 @@
class S3BucketsTest(boto_test.BotoTestCase):
@classmethod
- def resource_setup(cls):
- super(S3BucketsTest, cls).resource_setup()
+ def setup_clients(cls):
+ super(S3BucketsTest, cls).setup_clients()
cls.client = cls.os.s3_client
@test.idempotent_id('4678525d-8da0-4518-81c1-f1f67d595b00')
diff --git a/tempest/thirdparty/boto/test_s3_ec2_images.py b/tempest/thirdparty/boto/test_s3_ec2_images.py
index 773a193..21ea984 100644
--- a/tempest/thirdparty/boto/test_s3_ec2_images.py
+++ b/tempest/thirdparty/boto/test_s3_ec2_images.py
@@ -27,13 +27,17 @@
class S3ImagesTest(boto_test.BotoTestCase):
@classmethod
+ def setup_clients(cls):
+ super(S3ImagesTest, cls).setup_clients()
+ cls.s3_client = cls.os.s3_client
+ cls.images_client = cls.os.ec2api_client
+
+ @classmethod
def resource_setup(cls):
super(S3ImagesTest, cls).resource_setup()
if not cls.conclusion['A_I_IMAGES_READY']:
raise cls.skipException("".join(("EC2 ", cls.__name__,
": requires ami/aki/ari manifest")))
- cls.s3_client = cls.os.s3_client
- cls.images_client = cls.os.ec2api_client
cls.materials_path = CONF.boto.s3_materials_path
cls.ami_manifest = CONF.boto.ami_manifest
cls.aki_manifest = CONF.boto.aki_manifest
diff --git a/tempest/thirdparty/boto/test_s3_objects.py b/tempest/thirdparty/boto/test_s3_objects.py
index bc32686..2d8152d 100644
--- a/tempest/thirdparty/boto/test_s3_objects.py
+++ b/tempest/thirdparty/boto/test_s3_objects.py
@@ -25,8 +25,8 @@
class S3BucketsTest(boto_test.BotoTestCase):
@classmethod
- def resource_setup(cls):
- super(S3BucketsTest, cls).resource_setup()
+ def setup_clients(cls):
+ super(S3BucketsTest, cls).setup_clients()
cls.client = cls.os.s3_client
@test.idempotent_id('4eea567a-b46a-405b-a475-6097e1faebde')