'Test volume can be created from a volume replica.'

@mock.patch('cinder.volume.driver.VolumeDriver.create_replica_test_volume')
def test_create_volume_from_sourcereplica(self, _create_replica_test):

    _create_replica_test.return_value = None
    volume_src = tests_utils.create_volume(self.context, **self.volume_params)
    self.volume.create_volume(self.context, volume_src)
    volume_dst = tests_utils.create_volume(self.context, **self.volume_params)
    self.volume.create_volume(self.context, volume_dst, {'source_replicaid': volume_src.id})
    self.assertEqual('available', db.volume_get(context.get_admin_context(), volume_dst['id']).status)
    self.assertTrue(_create_replica_test.called)
    self.volume.delete_volume(self.context, volume_dst)
    self.volume.delete_volume(self.context, volume_src)
