Merge "Migrate thirdparty tests to resource_* fixtures"
This commit is contained in:
Vendored
+4
-4
@@ -195,8 +195,8 @@ class BotoTestCase(tempest.test.BaseTestCase):
|
||||
"""Recommended to use as base class for boto related test."""
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(BotoTestCase, cls).setUpClass()
|
||||
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
|
||||
@@ -245,7 +245,7 @@ class BotoTestCase(tempest.test.BaseTestCase):
|
||||
raise self.failureException, "BotoServerError not raised"
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
def resource_cleanup(cls):
|
||||
"""Calls the callables added by addResourceCleanUp,
|
||||
when you overwrite this function don't forget to call this too.
|
||||
"""
|
||||
@@ -264,7 +264,7 @@ class BotoTestCase(tempest.test.BaseTestCase):
|
||||
finally:
|
||||
del cls._resource_trash_bin[key]
|
||||
cls.clear_isolated_creds()
|
||||
super(BotoTestCase, cls).tearDownClass()
|
||||
super(BotoTestCase, cls).resource_cleanup()
|
||||
# NOTE(afazekas): let the super called even on exceptions
|
||||
# The real exceptions already logged, if the super throws another,
|
||||
# does not causes hidden issues
|
||||
|
||||
+2
-2
@@ -30,8 +30,8 @@ LOG = logging.getLogger(__name__)
|
||||
class InstanceRunTest(boto_test.BotoTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(InstanceRunTest, cls).setUpClass()
|
||||
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")))
|
||||
|
||||
+2
-2
@@ -26,8 +26,8 @@ def compare_key_pairs(a, b):
|
||||
class EC2KeysTest(boto_test.BotoTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(EC2KeysTest, cls).setUpClass()
|
||||
def resource_setup(cls):
|
||||
super(EC2KeysTest, cls).resource_setup()
|
||||
cls.client = cls.os.ec2api_client
|
||||
cls.ec = cls.ec2_error_code
|
||||
|
||||
|
||||
+2
-2
@@ -20,8 +20,8 @@ from tempest.thirdparty.boto import test as boto_test
|
||||
class EC2NetworkTest(boto_test.BotoTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(EC2NetworkTest, cls).setUpClass()
|
||||
def resource_setup(cls):
|
||||
super(EC2NetworkTest, cls).resource_setup()
|
||||
cls.client = cls.os.ec2api_client
|
||||
|
||||
# Note(afazekas): these tests for things duable without an instance
|
||||
|
||||
+2
-2
@@ -20,8 +20,8 @@ from tempest.thirdparty.boto import test as boto_test
|
||||
class EC2SecurityGroupTest(boto_test.BotoTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(EC2SecurityGroupTest, cls).setUpClass()
|
||||
def resource_setup(cls):
|
||||
super(EC2SecurityGroupTest, cls).resource_setup()
|
||||
cls.client = cls.os.ec2api_client
|
||||
|
||||
def test_create_authorize_security_group(self):
|
||||
|
||||
+2
-2
@@ -29,8 +29,8 @@ def compare_volumes(a, b):
|
||||
class EC2VolumesTest(boto_test.BotoTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(EC2VolumesTest, cls).setUpClass()
|
||||
def resource_setup(cls):
|
||||
super(EC2VolumesTest, cls).resource_setup()
|
||||
|
||||
if not CONF.service_available.cinder:
|
||||
skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
|
||||
|
||||
+2
-2
@@ -20,8 +20,8 @@ from tempest.thirdparty.boto import test as boto_test
|
||||
class S3BucketsTest(boto_test.BotoTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(S3BucketsTest, cls).setUpClass()
|
||||
def resource_setup(cls):
|
||||
super(S3BucketsTest, cls).resource_setup()
|
||||
cls.client = cls.os.s3_client
|
||||
|
||||
def test_create_and_get_delete_bucket(self):
|
||||
|
||||
+2
-2
@@ -26,8 +26,8 @@ CONF = config.CONF
|
||||
class S3ImagesTest(boto_test.BotoTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(S3ImagesTest, cls).setUpClass()
|
||||
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")))
|
||||
|
||||
+2
-2
@@ -24,8 +24,8 @@ from tempest.thirdparty.boto import test as boto_test
|
||||
class S3BucketsTest(boto_test.BotoTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(S3BucketsTest, cls).setUpClass()
|
||||
def resource_setup(cls):
|
||||
super(S3BucketsTest, cls).resource_setup()
|
||||
cls.client = cls.os.s3_client
|
||||
|
||||
def test_create_get_delete_object(self):
|
||||
|
||||
Reference in New Issue
Block a user