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
15 changes: 10 additions & 5 deletions tests/integration_tests/clouds.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,16 @@ def snapshot(self, instance):

def delete_snapshot(self):
if self.snapshot_id:
log.info(
'Deleting snapshot image created for this testrun: %s',
self.snapshot_id
)
self.cloud_instance.delete_image(self.snapshot_id)
if self.settings.KEEP_IMAGE:
log.info(
'NOT deleting snapshot image created for this testrun '
'because KEEP_IMAGE is True: %s', self.snapshot_id)
else:
log.info(
'Deleting snapshot image created for this testrun: %s',
self.snapshot_id
)
self.cloud_instance.delete_image(self.snapshot_id)


class Ec2Cloud(IntegrationCloud):
Expand Down
2 changes: 2 additions & 0 deletions tests/integration_tests/integration_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

# Keep instance (mostly for debugging) when test is finished
KEEP_INSTANCE = False
# Keep snapshot image (mostly for debugging) when test is finished
KEEP_IMAGE = False

# One of:
# lxd_container
Expand Down