Smoke attribute implies gate attribute

The smoke attribute now implies that the gate attribute
be applied as well. This should simplify the attribute
marking and reduce the probability of tests accidentally
not being included in the gate.

Partially implements blueprint set-gate-attribute

Change-Id: Ic273b216d8702c670bfbff60616bf4d07185c3c8
This commit is contained in:
Chris Yeoh 2013-05-19 15:59:00 +09:30
parent f4b10421b2
commit cf3fb7cbbb
8 changed files with 17 additions and 13 deletions

View File

@ -39,9 +39,13 @@ def attr(*args, **kwargs):
def decorator(f):
if 'type' in kwargs and isinstance(kwargs['type'], str):
f = testtools.testcase.attr(kwargs['type'])(f)
if kwargs['type'] == 'smoke':
f = testtools.testcase.attr('gate')(f)
elif 'type' in kwargs and isinstance(kwargs['type'], list):
for attr in kwargs['type']:
f = testtools.testcase.attr(attr)(f)
if attr == 'smoke':
f = testtools.testcase.attr('gate')(f)
return nose.plugins.attrib.attr(*args, **kwargs)(f)
return decorator

View File

@ -109,7 +109,7 @@ class VolumeMultiBackendTest(base.BaseVolumeAdminTest):
super(VolumeMultiBackendTest, cls).tearDownClass()
@attr(type=['smoke', 'gate'])
@attr(type=['smoke'])
def test_multi_backend_enabled(self):
# this test checks that multi backend is enabled for at least the
# computes where the volumes created in setUp were made

View File

@ -38,7 +38,7 @@ class VolumeTypesTest(BaseVolumeTest):
auth_url,
adm_tenant)
@attr(type=['smoke', 'gate'])
@attr(type=['smoke'])
def test_volume_type_list(self):
# List Volume types.
try:
@ -48,7 +48,7 @@ class VolumeTypesTest(BaseVolumeTest):
except Exception:
self.fail("Could not list volume types")
@attr(type=['smoke', 'gate'])
@attr(type=['smoke'])
def test_create_get_delete_volume_with_volume_type_and_extra_specs(self):
# Create/get/delete volume with volume_type and extra spec.
try:
@ -100,7 +100,7 @@ class VolumeTypesTest(BaseVolumeTest):
resp, _ = self.client.delete_volume_type(body['id'])
self.assertEqual(202, resp.status)
@attr(type=['smoke', 'gate'])
@attr(type=['smoke'])
def test_volume_type_create_delete(self):
# Create/Delete volume type.
try:
@ -123,7 +123,7 @@ class VolumeTypesTest(BaseVolumeTest):
except Exception:
self.fail("Could not create a volume_type")
@attr(type=['smoke', 'gate'])
@attr(type=['smoke'])
def test_volume_type_create_get(self):
# Create/get volume type.
try:

View File

@ -34,7 +34,7 @@ class VolumeTypesExtraSpecsTest(base.BaseVolumeAdminTest):
cls.client.delete_volume_type(cls.volume_type['id'])
super(VolumeTypesExtraSpecsTest, cls).tearDownClass()
@attr(type=['smoke', 'gate'])
@attr(type=['smoke'])
def test_volume_type_extra_specs_list(self):
# List Volume types extra specs.
try:
@ -77,7 +77,7 @@ class VolumeTypesExtraSpecsTest(base.BaseVolumeAdminTest):
except Exception:
self.fail("Couldnt update volume type extra spec")
@attr(type=['smoke', 'gate'])
@attr(type=['smoke'])
def test_volume_type_extra_spec_create_get_delete(self):
# Create/Get/Delete volume type extra spec.
try:

View File

@ -52,7 +52,7 @@ class VolumesActionsTest(BaseVolumeTest):
super(VolumesActionsTest, cls).tearDownClass()
@attr(type=['smoke', 'gate'])
@attr(type=['smoke'])
def test_attach_detach_volume_to_instance(self):
# Volume is attached and detached successfully from an instance
try:

View File

@ -105,11 +105,11 @@ class VolumesGetTest(base.BaseVolumeTest):
self.assertEqual(202, resp.status)
self.client.wait_for_resource_deletion(volume['id'])
@attr(type=['smoke', 'gate'])
@attr(type=['smoke'])
def test_volume_create_get_delete(self):
self._volume_create_get_delete(image_ref=None)
@attr(type=['smoke', 'gate'])
@attr(type=['smoke'])
def test_volume_from_image(self):
self._volume_create_get_delete(image_ref=self.config.compute.image_ref)

View File

@ -76,7 +76,7 @@ class VolumesListTest(base.BaseVolumeTest):
cls.client.wait_for_resource_deletion(volid)
super(VolumesListTest, cls).tearDownClass()
@attr(type=['smoke', 'gate'])
@attr(type=['smoke'])
def test_volume_list(self):
# Get a list of Volumes
# Fetch all volumes

View File

@ -37,7 +37,7 @@ class VolumesSnapshotTest(base.BaseVolumeTest):
def tearDownClass(cls):
super(VolumesSnapshotTest, cls).tearDownClass()
@attr(type=['smoke', 'gate'])
@attr(type=['smoke'])
def test_snapshot_create_get_delete(self):
# Create a snapshot, get some of the details and then deletes it
resp, snapshot = self.snapshots_client.create_snapshot(
@ -52,7 +52,7 @@ class VolumesSnapshotTest(base.BaseVolumeTest):
self.snapshots_client.delete_snapshot(snapshot['id'])
self.snapshots_client.wait_for_resource_deletion(snapshot['id'])
@attr(type=['smoke', 'gate'])
@attr(type=['smoke'])
def test_volume_from_snapshot(self):
# Create a temporary snap using wrapper method from base, then
# create a snap based volume, check resp code and deletes it