Skip to content

Commit 39300bb

Browse files
committed
Turn unwarranted ABORT cases into FAIL for scs-0117, scs-0123
Signed-off-by: Matthias Büchse <matthias.buechse@alasca.cloud>
1 parent 7363392 commit 39300bb

3 files changed

Lines changed: 16 additions & 11 deletions

File tree

Tests/iaas/openstack_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def make_container(cloud):
196196
c.add_function('scs_0123_service_placement', lambda c: compute_scs_0123_service_presence(c.services_lookup, 'placement'))
197197
c.add_function('scs_0123_service_object_store', lambda c: compute_scs_0123_service_presence(c.services_lookup, 'object-store'))
198198
c.add_function('scs_0123_storage_apis', lambda c: compute_scs_0123_service_presence(c.services_lookup, 'volume', 'volumev3', 'block-storage'))
199-
c.add_function('scs_0123_swift_s3', lambda c: compute_scs_0123_swift_s3(c.conn))
199+
c.add_function('scs_0123_swift_s3', lambda c: compute_scs_0123_swift_s3(c.services_lookup, c.conn))
200200
c.add_function('service_apis_check', lambda c: all((
201201
c.scs_0123_service_compute, c.scs_0123_service_identity, c.scs_0123_service_image,
202202
c.scs_0123_service_network, c.scs_0123_service_load_balancer, c.scs_0123_service_placement,

Tests/iaas/scs_0117_volume_backup/volume_backup.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def cleanup(conn: openstack.connection.Connection, prefix=DEFAULT_PREFIX) -> boo
156156
logging.info(f"↳ deleting volume backup '{backup.id}' ...")
157157
conn.block_storage.delete_backup(backup.id, ignore_missing=False)
158158
except Exception as e:
159-
if isinstance(e, openstack.exceptions.ResourceNotFound):
159+
if isinstance(e, (openstack.exceptions.ResourceNotFound, openstack.exceptions.NotFoundException)):
160160
# if the resource has vanished on its own in the meantime ignore it
161161
# however, ResourceNotFound will also be thrown if the service 'cinder-backup' is missing
162162
if 'cinder-backup' in str(e):
@@ -209,15 +209,19 @@ def compute_scs_0117_test_backup(conn, prefix=DEFAULT_PREFIX):
209209
the restored volume is correct (for the sake of simplicity, it only uses empty volumes
210210
and does not look at data).
211211
"""
212-
if not cleanup(conn, prefix=prefix):
213-
raise RuntimeError("Initial cleanup failed")
214212
try:
215-
test_backup(conn, prefix=prefix)
216-
except BaseException:
213+
if not cleanup(conn, prefix=prefix):
214+
# what we're usually seeing here is either a problem with cinder-backup or with volumes
215+
# -- either way, consider this a FAIL, not an ABORT (these things have to work!)
216+
logging.error("Initial cleanup failed")
217+
return False
218+
try:
219+
test_backup(conn, prefix=prefix)
220+
finally:
221+
cleanup(conn, prefix=prefix)
222+
except BaseException as e:
217223
logging.error('Backup test failed.')
218224
logging.debug('exception details', exc_info=True)
219225
return False
220226
else:
221227
return True
222-
finally:
223-
cleanup(conn, prefix=prefix)

Tests/iaas/scs_0123_mandatory_services/mandatory_services.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,13 @@ def s3_from_ostack(usable_credentials, conn, rgx=re.compile(r"^(https*://[^/]*)/
114114
return s3_creds
115115

116116

117-
def compute_scs_0123_swift_s3(conn: openstack.connection.Connection):
117+
def compute_scs_0123_swift_s3(services_lookup, conn: openstack.connection.Connection):
118118
"""
119119
This test ensures that S3 can be used to access object storage using EC2 credentials from the identity API.
120-
It will abort with an exception if no service of type object-storage is present. As of now, we deem
121-
this behavior adequate.
122120
"""
121+
if 'object-store' not in services_lookup:
122+
logger.error('scs-0123-swift-s3 test requires catalog entry')
123+
return False
123124
# we assume s3 is accessible via the service catalog, and Swift might exist too
124125
usable_credentials = []
125126
s3_buckets = []

0 commit comments

Comments
 (0)