glance functional test test_copy_from_swift failing

Bug #1158404 reported by John Lenihan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
John Lenihan

Bug Description

I have found that this test is failing if I create a config file which points at at a real swift system and specify the config file in the GLANCE_TEST_SWIFT_CONF:

GLANCE_TEST_SWIFT_CONF=./glance-api.conf ./run_tests.sh

There are several problems; the first is that the creds in the uri are not properly quoted so the test finds an incorrect number of colons in the uri. Also, the get_swift_uri() function only fixes up uris of the form '@http://' and does not handle uris of the form '@https://'. Finally, when the test attempts to GET the image it just created this fails because the image is not yet in the 'active' state but in the 'queued' state.

glance.tests.functional.v1.test_copy_to_file.TestCopyToFile.test_copy_from_swift ... FAIL

======================================================================
FAIL: glance.tests.functional.v1.test_copy_to_file.TestCopyToFile.test_copy_from_swift
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "/home/jenkins/QA_Automated_Tests_DEVQA2_master/workspace/DevQA_Glance_RnDA_Functional_Tests/glance/tests/utils.py", line 87, in _runner
    func(*args, **kw)
  File "/home/jenkins/QA_Automated_Tests_DEVQA2_master/workspace/DevQA_Glance_RnDA_Functional_Tests/glance/tests/utils.py", line 123, in wrapped
    func(*a, **kwargs)
  File "/home/jenkins/QA_Automated_Tests_DEVQA2_master/workspace/DevQA_Glance_RnDA_Functional_Tests/glance/tests/functional/v1/test_copy_to_file.py", line 167, in test_copy_from_swift
    self._do_test_copy_from('swift', get_swift_uri)
  File "/home/jenkins/QA_Automated_Tests_DEVQA2_master/workspace/DevQA_Glance_RnDA_Functional_Tests/glance/tests/functional/v1/test_copy_to_file.py", line 110, in _do_test_copy_from
    self.assertEqual(response.status, 201, content)
MismatchError: 500 != 201: Traceback (most recent call last):
  File "/home/jenkins/QA_Automated_Tests_DEVQA2_master/workspace/DevQA_Glance_RnDA_Functional_Tests/.venv/local/lib/python2.7/site-packages/eventlet/wsgi.py", line 383, in handle_one_response
    result = self.application(self.environ, start_response)
.
.
.
  File "/home/jenkins/QA_Automated_Tests_DEVQA2_master/workspace/DevQA_Glance_RnDA_Functional_Tests/glance/store/__init__.py", line 250, in get_store_from_location
    loc = location.get_location_from_uri(uri)
  File "/home/jenkins/QA_Automated_Tests_DEVQA2_master/workspace/DevQA_Glance_RnDA_Functional_Tests/glance/store/location.py", line 75, in get_location_from_uri
    store_location_class=scheme_info['location_class'])
  File "/home/jenkins/QA_Automated_Tests_DEVQA2_master/workspace/DevQA_Glance_RnDA_Functional_Tests/glance/store/location.py", line 115, in __init__
    self.store_location.parse_uri(uri)
  File "/home/jenkins/QA_Automated_Tests_DEVQA2_master/workspace/DevQA_Glance_RnDA_Functional_Tests/glance/store/swift.py", line 141, in parse_uri
    raise exception.BadStoreUri(message=reason)
BadStoreUri: URI cannot contain more than one occurrence of a scheme. If you have specified a URI like swift://user:pass@http://authurl.com/v1/container/obj, you need to change it to use the swift+http:// scheme, like so: swift+http://user:<email address hidden>/v1/container/obj

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/25126

Changed in glance:
assignee: nobody → John Lenihan (john-lenihan-k)
status: New → In Progress
Changed in glance:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/25126
Committed: http://github.com/openstack/glance/commit/ff75ad4dfb352a5362e53ce91125419998d861aa
Submitter: Jenkins
Branch: master

commit ff75ad4dfb352a5362e53ce91125419998d861aa
Author: John Lenihan <email address hidden>
Date: Fri Mar 22 11:28:10 2013 +0000

    Fix functional test 'test_copy_from_swift'

    This test fails if a real swift system is specified in a config file
    and passed to the tests via the GLANCE_TEST_SWIFT_CONF environment
    variable. The fix is to quote the creds in the uri and also to
    fix get_swift_uri() to handle uris of the form '@https://'.

    Fixes bug 1158404

    Change-Id: Ic091f77a83696e6413aea047e805ac11487aba39

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → havana-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: havana-1 → 2013.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.