'Don\'t permit a snapshot of a volume backed instance if configured
not to based on role'

@mock.patch('nova.compute.utils.is_volume_backed_instance', return_value=True)
@mock.patch.object(objects.BlockDeviceMappingList, 'get_by_instance_uuid')
@mock.patch.object(servers.ServersController, '_get_server')
def test_create_vol_backed_img_snapshotting_policy_blocks_role(self, mock_get_server, mock_get_uuidi, mock_is_vol_back):

    rule_name = 'os_compute_api:servers:create_image:allow_volume_backed'
    rules = {rule_name: 'role:non_fake', 'os_compute_api:servers:create_image': ''}
    body = {'createImage': {'name': 'Snapshot    1'}}
    self._common_policy_check(rules, rule_name, self.controller._action_create_image, self.req, FAKE_UUID, body=body)
