← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1553254] [NEW] neutron.tests.unit.objects.qos.test_policy.QosPolicyObjectTestCase fails if executed separately

 

Public bug reported:

The test will fail if you execute just it as in:

$ tox -e py27
neutron.tests.unit.objects.qos.test_policy.QosPolicyObjectTestCase

...

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
        return func(*args, **keywargs)
      File "neutron/tests/unit/objects/test_base.py", line 238, in test_update_no_changes
        obj.update()
      File "neutron/objects/rbac_db.py", line 280, in func
        return new_method(self, orig_method)
      File "neutron/objects/rbac_db.py", line 212, in _update_hook
        _update_post(self)
      File "neutron/objects/rbac_db.py", line 206, in _update_post
        self.update_shared(self.shared, self.id)
      File "neutron/objects/rbac_db.py", line 189, in update_shared
        action=models.ACCESS_SHARED)
      File "neutron/db/api.py", line 95, in get_object
        .filter_by(**kwargs)
      File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2634, in first
        ret = list(self[0:1])
      File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2457, in __getitem__
        return list(res)
      File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2736, in __iter__
        return self._execute_and_instances(context)
      File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2751, in _execute_and_instances
        result = conn.execute(querycontext.statement, self._params)
      File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
        return meth(self, multiparams, params)
      File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
        return connection._execute_clauseelement(self, multiparams, params)
      File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
        compiled_sql, distilled_params
      File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
        context)
      File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
        util.raise_from_cause(newraise, exc_info)
      File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
        reraise(type(exception), exception, tb=exc_tb, cause=cause)
      File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
        context)
      File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
        cursor.execute(statement, parameters)
    sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: qospolicyrbacs [SQL: u'SELECT qospolicyrbacs.tenant_id AS qospolicyrbacs_tenant_id, qospolicyrbacs.id AS qospolicyrbacs_id, qospolicyrbacs.target_tenant AS qospolicyrbacs_target_tenant, qospolicyrbacs.action AS qospolicyrbacs_action, qospolicyrbacs.object_id AS qospolicyrbacs_object_id \nFROM qospolicyrbacs \nWHERE qospolicyrbacs.object_id = ? AND qospolicyrbacs.action = ? AND qospolicyrbacs.target_tenant = ?\n LIMIT ? OFFSET ?'] [parameters: ('7777', 'access_as_shared', '*', 1, 0)]

That's because RBAC mixin now triggers some fetches when updating
policy.

** Affects: neutron
     Importance: Undecided
     Assignee: Ihar Hrachyshka (ihar-hrachyshka)
         Status: New

** Changed in: neutron
    Milestone: None => mitaka-rc1

** Changed in: neutron
     Assignee: (unassigned) => Ihar Hrachyshka (ihar-hrachyshka)

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

Title:
  neutron.tests.unit.objects.qos.test_policy.QosPolicyObjectTestCase
  fails if executed separately

Status in neutron:
  New

Bug description:
  The test will fail if you execute just it as in:

  $ tox -e py27
  neutron.tests.unit.objects.qos.test_policy.QosPolicyObjectTestCase

  ...

  Captured traceback:
  ~~~~~~~~~~~~~~~~~~~
      Traceback (most recent call last):
        File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
          return func(*args, **keywargs)
        File "neutron/tests/unit/objects/test_base.py", line 238, in test_update_no_changes
          obj.update()
        File "neutron/objects/rbac_db.py", line 280, in func
          return new_method(self, orig_method)
        File "neutron/objects/rbac_db.py", line 212, in _update_hook
          _update_post(self)
        File "neutron/objects/rbac_db.py", line 206, in _update_post
          self.update_shared(self.shared, self.id)
        File "neutron/objects/rbac_db.py", line 189, in update_shared
          action=models.ACCESS_SHARED)
        File "neutron/db/api.py", line 95, in get_object
          .filter_by(**kwargs)
        File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2634, in first
          ret = list(self[0:1])
        File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2457, in __getitem__
          return list(res)
        File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2736, in __iter__
          return self._execute_and_instances(context)
        File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2751, in _execute_and_instances
          result = conn.execute(querycontext.statement, self._params)
        File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
          return meth(self, multiparams, params)
        File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
          return connection._execute_clauseelement(self, multiparams, params)
        File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
          compiled_sql, distilled_params
        File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
          context)
        File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
          util.raise_from_cause(newraise, exc_info)
        File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
          reraise(type(exception), exception, tb=exc_tb, cause=cause)
        File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
          context)
        File "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
          cursor.execute(statement, parameters)
      sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: qospolicyrbacs [SQL: u'SELECT qospolicyrbacs.tenant_id AS qospolicyrbacs_tenant_id, qospolicyrbacs.id AS qospolicyrbacs_id, qospolicyrbacs.target_tenant AS qospolicyrbacs_target_tenant, qospolicyrbacs.action AS qospolicyrbacs_action, qospolicyrbacs.object_id AS qospolicyrbacs_object_id \nFROM qospolicyrbacs \nWHERE qospolicyrbacs.object_id = ? AND qospolicyrbacs.action = ? AND qospolicyrbacs.target_tenant = ?\n LIMIT ? OFFSET ?'] [parameters: ('7777', 'access_as_shared', '*', 1, 0)]

  That's because RBAC mixin now triggers some fetches when updating
  policy.

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


Follow ups