requesting empty task list fails when using v2 api with registry

Bug #1308419 reported by Erno Kuvaja
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Unassigned

Bug Description

$ ./run_tests.sh --subunit glance.tests.functional.v2.test_tasks.TestTasks.test_task_lifecycle
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_tasks.TestTasks.test_task_lifecycle'`
glance.tests.functional.v2.test_tasks.TestTasks
    test_task_lifecycle FAIL

Slowest 1 tests took 12.51 secs:
glance.tests.functional.v2.test_tasks.TestTasks
    test_task_lifecycle 12.51

======================================================================
FAIL: glance.tests.functional.v2.test_tasks.TestTasks.test_task_lifecycle
----------------------------------------------------------------------
Traceback (most recent call last):
_StringException: Traceback (most recent call last):
  File "/home/ubuntu/glance/glance/tests/functional/v2/test_tasks.py", line 70, in test_task_lifecycle
    self.assertEqual(200, response.status_code)
  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: 200 != 500

Ran 2 tests in 26.697s

FAILED (failures=1)

2014-04-16 08:56:22,297 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/eventlet/wsgi.py", line 389, in handle_one_response
2014-04-16 08:56:22,297 INFO result = self.application(self.environ, start_response)
2014-04-16 08:56:22,297 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
2014-04-16 08:56:22,297 INFO resp = self.call_func(req, *args, **self.kwargs)
2014-04-16 08:56:22,297 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
2014-04-16 08:56:22,297 INFO return self.func(req, *args, **kwargs)
2014-04-16 08:56:22,297 INFO File "glance/common/wsgi.py", line 378, in __call__
2014-04-16 08:56:22,297 INFO response = req.get_response(self.application)
2014-04-16 08:56:22,297 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/request.py", line 1320, in send
2014-04-16 08:56:22,297 INFO application, catch_exc_info=False)
2014-04-16 08:56:22,298 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/request.py", line 1284, in call_application
2014-04-16 08:56:22,298 INFO app_iter = application(self.environ, start_response)
2014-04-16 08:56:22,298 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
2014-04-16 08:56:22,298 INFO resp = self.call_func(req, *args, **self.kwargs)
2014-04-16 08:56:22,298 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
2014-04-16 08:56:22,298 INFO return self.func(req, *args, **kwargs)
2014-04-16 08:56:22,298 INFO File "glance/common/wsgi.py", line 378, in __call__
2014-04-16 08:56:22,298 INFO response = req.get_response(self.application)
2014-04-16 08:56:22,298 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/request.py", line 1320, in send
2014-04-16 08:56:22,298 INFO application, catch_exc_info=False)
2014-04-16 08:56:22,298 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/request.py", line 1284, in call_application
2014-04-16 08:56:22,298 INFO app_iter = application(self.environ, start_response)
2014-04-16 08:56:22,298 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
2014-04-16 08:56:22,298 INFO resp = self.call_func(req, *args, **self.kwargs)
2014-04-16 08:56:22,298 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
2014-04-16 08:56:22,299 INFO return self.func(req, *args, **kwargs)
2014-04-16 08:56:22,299 INFO File "glance/common/wsgi.py", line 378, in __call__
2014-04-16 08:56:22,299 INFO response = req.get_response(self.application)
2014-04-16 08:56:22,299 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/request.py", line 1320, in send
2014-04-16 08:56:22,299 INFO application, catch_exc_info=False)
2014-04-16 08:56:22,299 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/request.py", line 1284, in call_application
2014-04-16 08:56:22,299 INFO app_iter = application(self.environ, start_response)
2014-04-16 08:56:22,299 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/paste/urlmap.py", line 203, in __call__
2014-04-16 08:56:22,299 INFO return app(environ, start_response)
2014-04-16 08:56:22,299 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
2014-04-16 08:56:22,299 INFO return resp(environ, start_response)
2014-04-16 08:56:22,299 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/routes/middleware.py", line 131, in __call__
2014-04-16 08:56:22,299 INFO response = self.app(environ, start_response)
2014-04-16 08:56:22,299 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
2014-04-16 08:56:22,299 INFO return resp(environ, start_response)
2014-04-16 08:56:22,299 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
2014-04-16 08:56:22,300 INFO resp = self.call_func(req, *args, **self.kwargs)
2014-04-16 08:56:22,300 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
2014-04-16 08:56:22,300 INFO return self.func(req, *args, **kwargs)
2014-04-16 08:56:22,300 INFO File "glance/common/wsgi.py", line 644, in __call__
2014-04-16 08:56:22,300 INFO request, **action_args)
2014-04-16 08:56:22,300 INFO File "glance/common/wsgi.py", line 668, in dispatch
2014-04-16 08:56:22,300 INFO return method(*args, **kwargs)
2014-04-16 08:56:22,300 INFO File "glance/api/v2/tasks.py", line 91, in index
2014-04-16 08:56:22,300 INFO filters)
2014-04-16 08:56:22,300 INFO File "glance/api/authorization.py", line 439, in list_tasks
2014-04-16 08:56:22,300 INFO tasks = self.task_repo.list_tasks(*args, **kwargs)
2014-04-16 08:56:22,300 INFO File "glance/domain/proxy.py", line 64, in list_tasks
2014-04-16 08:56:22,300 INFO tasks = self.base.list_tasks(*args, **kwargs)
2014-04-16 08:56:22,300 INFO File "glance/api/policy.py", line 389, in list_tasks
2014-04-16 08:56:22,300 INFO return super(TaskRepoProxy, self).list_tasks(*args, **kwargs)
2014-04-16 08:56:22,300 INFO File "glance/domain/proxy.py", line 64, in list_tasks
2014-04-16 08:56:22,301 INFO tasks = self.base.list_tasks(*args, **kwargs)
2014-04-16 08:56:22,301 INFO File "glance/db/__init__.py", line 348, in list_tasks
2014-04-16 08:56:22,301 INFO db_api_tasks = self.db_api.task_get_all(self.context,
2014-04-16 08:56:22,301 INFO AttributeError: 'module' object has no attribute 'task_get_all'

  67 # Task list should be empty
  68 path = self._url('/v2/tasks')
  69 response = requests.get(path, headers=self._headers())
  70 self.assertEqual(200, response.status_code)

Revision history for this message
Erno Kuvaja (jokke) wrote :

This test has been ran with change: https://review.openstack.org/#/c/87726/

Erno Kuvaja (jokke)
Changed in glance:
status: New → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/106012
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=36b502ccdc34a30b4c553d2c398f690b903c469c
Submitter: Jenkins
Branch: master

commit 36b502ccdc34a30b4c553d2c398f690b903c469c
Author: Stuart McLaren <email address hidden>
Date: Thu Jul 10 10:40:56 2014 +0000

    Add task functions to v2 registry

    If local changes are made to run the v2 functional
    tests with the v2 registry enabled, and the tests
    are then run with:

    $ ./run_tests.sh glance.tests.functional.v2

    all tests pass except for 'test_task_lifecycle'.

    This test fails because the v2 registry does not define the
    'task_get_all' or 'task_create' functions.

    With these defined the tests pass when run with the v2 registry enabled.

    This is a prerequisite to running the v2 functional tests with the
    registry enabled.

    Change-Id: I588af10105b19087d06f7f13a6f75523595d4a23
    Closes-Bug: 1308419

Changed in glance:
status: Invalid → Fix Committed
Changed in glance:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: juno-2 → 2014.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.