Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tests/iaas/openstack_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def make_container(cloud):
c.add_function('scs_0123_service_placement', lambda c: compute_scs_0123_service_presence(c.services_lookup, 'placement'))
c.add_function('scs_0123_service_object_store', lambda c: compute_scs_0123_service_presence(c.services_lookup, 'object-store'))
c.add_function('scs_0123_storage_apis', lambda c: compute_scs_0123_service_presence(c.services_lookup, 'volume', 'volumev3', 'block-storage'))
c.add_function('scs_0123_swift_s3', lambda c: compute_scs_0123_swift_s3(c.conn))
c.add_function('scs_0123_swift_s3', lambda c: compute_scs_0123_swift_s3(c.services_lookup, c.conn))
return c


Expand Down
16 changes: 10 additions & 6 deletions Tests/iaas/scs_0117_volume_backup/volume_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def cleanup(conn: openstack.connection.Connection, prefix=DEFAULT_PREFIX) -> boo
logging.info(f"↳ deleting volume backup '{backup.id}' ...")
conn.block_storage.delete_backup(backup.id, ignore_missing=False)
except Exception as e:
if isinstance(e, openstack.exceptions.ResourceNotFound):
if isinstance(e, (openstack.exceptions.ResourceNotFound, openstack.exceptions.NotFoundException)):
# if the resource has vanished on its own in the meantime ignore it
# however, ResourceNotFound will also be thrown if the service 'cinder-backup' is missing
if 'cinder-backup' in str(e):
Expand Down Expand Up @@ -209,15 +209,19 @@ def compute_scs_0117_test_backup(conn, prefix=DEFAULT_PREFIX):
the restored volume is correct (for the sake of simplicity, it only uses empty volumes
and does not look at data).
"""
if not cleanup(conn, prefix=prefix):
raise RuntimeError("Initial cleanup failed")
try:
test_backup(conn, prefix=prefix)
if not cleanup(conn, prefix=prefix):
# what we're usually seeing here is either a problem with cinder-backup or with volumes
# -- either way, consider this a FAIL, not an ABORT (these things have to work!)
logging.error("Initial cleanup failed")
return False
try:
test_backup(conn, prefix=prefix)
finally:
cleanup(conn, prefix=prefix)
except BaseException:
logging.error('Backup test failed.')
logging.debug('exception details', exc_info=True)
return False
else:
return True
finally:
cleanup(conn, prefix=prefix)
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@ def s3_from_ostack(usable_credentials, conn, rgx=re.compile(r"^(https*://[^/]*)/
return s3_creds


def compute_scs_0123_swift_s3(conn: openstack.connection.Connection):
def compute_scs_0123_swift_s3(services_lookup, conn: openstack.connection.Connection):
"""
This test ensures that S3 can be used to access object storage using EC2 credentials from the identity API.
It will abort with an exception if no service of type object-storage is present. As of now, we deem
this behavior adequate.
"""
if 'object-store' not in services_lookup:
Comment thread
depressiveRobot marked this conversation as resolved.
logger.info('skipping scs-0123-swift-s3 because object-store not present')
return True
# we assume s3 is accessible via the service catalog, and Swift might exist too
usable_credentials = []
s3_buckets = []
Expand Down