Commit cb906c6a authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis
Browse files

burnin: Cleanup stale snapshots

parent 12ca4e92
......@@ -113,7 +113,8 @@ class ImagesTestSuite(BurninTests):
"""Test every system image has specific metadata defined"""
keys = frozenset(["osfamily", "root_partition"])
for i in self.system_images:
self.assertTrue(keys.issubset(i['properties'].keys()))
self.assertTrue(keys.issubset(i['properties'].keys()),
"Failed in image with id '%s'" % i['id'])
def test_007_download_image(self):
"""Download image from Pithos"""
......
......@@ -71,7 +71,7 @@ class SnapshotsTestSuite(CycladesTests):
self._insist_on_server_transition(server, ["BUILD"], "ACTIVE")
volume_id = server['volumes'][0]
snapshot_name = 'snapshot_%s' % volume_id
snapshot_name = 'snf-burnin-snapshot_%s' % volume_id
self.info("Creating snapshot with name '%s', for volume %s",
snapshot_name, volume_id)
self.snapshot = self.clients.block_storage.create_snapshot(
......@@ -216,9 +216,11 @@ class SnapshotsTestSuite(CycladesTests):
def tearDownClass(cls): # noqa
"""Clean up"""
# Delete snapshot
if cls.snapshot is not None:
snapshots = [s for s in cls.clients.block_storage.list_snapshots()
if s['display_name'].startswith("snf-burnin-")]
for snapshot in snapshots:
try:
cls.clients.block_storage.delete_snapshot(cls.snapshot['id'])
cls.clients.block_storage.delete_snapshot(snapshot['id'])
except ClientError:
pass
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment