Image API tests all error after recent Devstack change

Bug #992096 reported by Jay Pipes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Critical
Jay Pipes
tempest
Fix Released
Undecided
Jay Pipes

Bug Description

After a recent devstack change that removed the v1/ from the image endpoint, all Tempest image API tests are failing:

https://jenkins.openstack.org/job/dev-gate-tempest-devstack-vm/391/consoleFull

Look like this:

16:55:40 ======================================================================
16:55:40 ERROR: Negative tests for invalid data supplied to POST /images
16:55:40 ----------------------------------------------------------------------
16:55:40 Traceback (most recent call last):
16:55:40 File "/opt/stack/tempest/tempest/tests/image/test_images.py", line 73, in test_register_with_invalid_data
16:55:40 results = self.client.add_image(meta)
16:55:40 File "/opt/stack/glance/glance/client.py", line 161, in add_image
16:55:40 res = self.do_request("POST", "/images", body, headers)
16:55:40 File "/opt/stack/glance/glance/common/client.py", line 58, in wrapped
16:55:40 return func(self, *args, **kwargs)
16:55:40 File "/opt/stack/glance/glance/common/client.py", line 420, in do_request
16:55:40 headers=headers)
16:55:40 File "/opt/stack/glance/glance/common/client.py", line 75, in wrapped
16:55:40 return func(self, method, url, body, headers)
16:55:40 File "/opt/stack/glance/glance/common/client.py", line 549, in _do_request
16:55:40 raise exception.MultipleChoices(body=res.read())
16:55:40 MultipleChoices: The request returned a 302 Multiple Choices. This generally means that you have not included a version indicator in a request URI.
16:55:40
16:55:40 The body of response returned:
16:55:40 {"versions": [{"status": "EXPERIMENTAL", "id": "v2", "links": [{"href": "http://127.0.0.1:9292/v2/", "rel": "self"}]}, {"status": "CURRENT", "id": "v1.1", "links": [{"href": "http://127.0.0.1:9292/v1/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v1.0", "links": [{"href": "http://127.0.0.1:9292/v1/", "rel": "self"}]}]}

Apparently, we now need to update the tempest.services.image.service.Service to append the v1.

Tags: images
Revision history for this message
Jay Pipes (jaypipes) wrote :

The root cause of this issue is that glance.common.client overwrites the management_url with the auth plugin's returned URL, and then calls glance.common.client.Client.configure_url() with that management URL, *even if a URL was already supplied*.

affects: tempest → glance
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/6938

Changed in glance:
status: Triaged → In Progress
Revision history for this message
Jay Pipes (jaypipes) wrote :

For Tempest, what is needed is adding the configure_via_auth=False parameter to the client constructed in the tempest image service constructor...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.openstack.org/6939

Changed in tempest:
assignee: nobody → Jay Pipes (jaypipes)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/6939
Committed: http://github.com/openstack/tempest/commit/ad6feca97e7584075bc663b8e771b4f699fe274c
Submitter: Jenkins
Branch: master

commit ad6feca97e7584075bc663b8e771b4f699fe274c
Author: Jay Pipes <email address hidden>
Date: Mon Apr 30 15:10:18 2012 -0400

    Fixes LP #992096 - Add configure_via_auth=False

    We now need to pass configure_via_auth=False to the glance
    client constructor to signal that we don't want to have the
    endpoint returned by the Keystone service catalog to override
    the URL we are already passing in (the [image][host] configuration
    option...)

    Change-Id: Ie2ef15bfe03efe4b83e687d19283dfa66c25289e

Changed in tempest:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/6938
Committed: http://github.com/openstack/glance/commit/60ab521b01b4f653655eecd8ba2e561a7bbdf0c9
Submitter: Jenkins
Branch: master

commit 60ab521b01b4f653655eecd8ba2e561a7bbdf0c9
Author: Jay Pipes <email address hidden>
Date: Mon Apr 30 14:38:51 2012 -0400

    Fixes LP #992096 - Ensure version in URL

    * Documents the configure_via_auth parameter
    * Ensures that if configure_via_auth is used (the default), that
      if the management_url that is returned does not contain a version
      identifier, the client class' DEFAULT_DOC_ROOT is appended
      appropriately.
    * Adds some log debugging statements into the base client class so
      that the URL being configured/constructed is more easily identifiable

    Change-Id: I307a24231b59f7a183ed669f679976cc3f8ec21c

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → folsom-1
status: Fix Committed → Fix Released
Jay Pipes (jaypipes)
Changed in tempest:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: folsom-1 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.