예제 #1
0
 def test_delete_image_volume(self):
     volume_params = {
         'status': 'creating',
         'host': 'some_host',
         'cluster_name': 'some_cluster',
         'size': 1
     }
     volume_api = cinder.volume.api.API()
     volume = tests_utils.create_volume(self.context, **volume_params)
     volume.status = 'available'
     volume.save()
     image_id = '70a599e0-31e7-49b7-b260-868f441e862b'
     db.image_volume_cache_create(self.context, volume['host'],
                                  volume_params['cluster_name'], image_id,
                                  datetime.datetime.utcnow(), volume['id'],
                                  volume['size'])
     volume_api.delete(self.context, volume)
     entry = db.image_volume_cache_get_by_volume_id(self.context,
                                                    volume['id'])
     self.assertIsNone(entry)
예제 #2
0
 def test_delete_image_volume(self):
     volume_params = {
         'status': 'creating',
         'host': 'some_host',
         'cluster_name': 'some_cluster',
         'size': 1
     }
     volume_api = cinder.volume.api.API()
     volume = tests_utils.create_volume(self.context, **volume_params)
     volume.status = 'available'
     volume.save()
     image_id = '70a599e0-31e7-49b7-b260-868f441e862b'
     db.image_volume_cache_create(self.context,
                                  volume['host'],
                                  volume_params['cluster_name'],
                                  image_id,
                                  datetime.datetime.utcnow(),
                                  volume['id'],
                                  volume['size'])
     volume_api.delete(self.context, volume)
     entry = db.image_volume_cache_get_by_volume_id(self.context,
                                                    volume['id'])
     self.assertIsNone(entry)