def verify_image_snapshot_biil(project): glance_dao = GlanceDAO("mysql+pymysql://root:^[email protected]/glance") snapshots = glance_dao.get_snapshots(project.id) for snapshot in snapshots: LOG.info("++++++++++++++++++++++++++++++++++++++++++++++++++") LOG.info("snapshot") # LOG.info("\tname: %s" % router.name) LOG.info("\tid: " + snapshot.id) LOG.info("\tstatus: %s" % snapshot.status) verify_billing(snapshot.id, "snapshot") LOG.info("++++++++++++++++++++++++++++++++++++++++++++++++++")
def test_get_snapshots(self): """ Test retrieving images which are the snapshots of vms of a project """ glance_dao = GlanceDAO("mysql+pymysql://root:^[email protected]/glance") images = glance_dao.get_snapshots("18fb285bfa4f4ddaaebb7512683b6a52") self.assertGreater(images.count(), 0) for image in images: self.assertGreater(len(image.properties), 1) is_snapshot = False for image_property in image.properties: if image_property.value == "snapshot": is_snapshot = True break self.assertTrue(is_snapshot, "The image %s is not a snapshot!" % image.id)