'Tests that the registry API returns list of public images.
Use a specific name. This is really a sanity check, filtering is
tested more in-depth using /images/detail'

def test_get_index_filter_name(self):

    extra_fixture = {'id': _gen_uuid(), 'status': 'active', 'visibility': 'public', 'disk_format': 'vhd', 'container_format': 'ovf', 'name': 'new    name!    #123', 'size': 19, 'checksum': None}
    db_api.image_create(self.context, extra_fixture)
    extra_fixture = {'id': _gen_uuid(), 'status': 'active', 'visibility': 'public', 'disk_format': 'vhd', 'container_format': 'ovf', 'name': 'new    name!    #123', 'size': 20, 'checksum': None}
    db_api.image_create(self.context, extra_fixture)
    req = webob.Request.blank('/rpc')
    req.method = 'POST'
    cmd = [{'command': 'image_get_all', 'kwargs': {'filters': {'name': 'new    name!    #123'}}}]
    req.body = jsonutils.dump_as_bytes(cmd)
    res = req.get_response(self.api)
    res_dict = jsonutils.loads(res.body)[0]
    self.assertEqual(http.OK, res.status_int)
    images = res_dict
    self.assertEqual(2, len(images))
    for image in images:
        self.assertEqual('new    name!    #123', image['name'])
