← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1308413] Re: Missing x-tenant-id header to registry will return list of all images while using v2 api with registry

 

Closing due no interest.

** Changed in: glance
       Status: Incomplete => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1308413

Title:
  Missing x-tenant-id header to registry will return list of all images
  while using v2 api with registry

Status in OpenStack Image Registry and Delivery Service (Glance):
  Invalid
Status in OpenStack Security Advisories:
  Won't Fix

Bug description:
  $ ./run_tests.sh --subunit glance.tests.functional.v2.test_images.TestImages.test_permissions
  Running `tools/with_venv.sh python -m glance.openstack.common.lockutils python setup.py testr --testr-args='--subunit --concurrency 1  --subunit glance.tests.functional.v2.test_images.TestImages.test_permissions'`
  glance.tests.functional.v2.test_images.TestImages
      test_permissions                                                  FAIL

  Slowest 1 tests took 12.91 secs:
  glance.tests.functional.v2.test_images.TestImages
      test_permissions                                                      12.91

  ======================================================================
  FAIL: glance.tests.functional.v2.test_images.TestImages.test_permissions
  ----------------------------------------------------------------------
  Traceback (most recent call last):
  _StringException: Traceback (most recent call last):
    File "/home/ubuntu/glance/glance/tests/functional/v2/test_images.py", line 488, in test_permissions
      self.assertEqual(0, len(images))
    File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 321, in assertEqual
      self.assertThat(observed, matcher, message)
    File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 406, in assertThat
      raise mismatch_error
  MismatchError: 0 != 1

  Ran 2 tests in 26.407s

  FAILED (failures=1)

    482         # TENANT2 should not see the image in their list
    483         path = self._url('/v2/images')
    484         headers = self._headers({'X-Tenant-Id': TENANT2})
    485         response = requests.get(path, headers=headers)
    486         self.assertEqual(200, response.status_code)
    487         images = jsonutils.loads(response.text)['images']
    488         self.assertEqual(0, len(images))

  The reason only one image seen by wrong tenant is purely because this
  test has populated glance only with one image. Missing x-tenant-id
  header in the GET request made to registry server listing images will
  return all images.

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1308413/+subscriptions