yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #70365
[Bug 1742797] Re: Connection to ovsdb not mocked properly
Reviewed: https://review.openstack.org/533154
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=f0ff58e770d97fe0c65bb4b8dbfef5ade4bccee5
Submitter: Zuul
Branch: master
commit f0ff58e770d97fe0c65bb4b8dbfef5ade4bccee5
Author: Sławek Kapłoński <slawek@xxxxxxxxxxxx>
Date: Fri Jan 12 11:59:06 2018 +0100
Fix mocking of ovsdb connection in UT
After support for ovsdbapp 0.4.0 was added in
Id22faa1f6179c2fdf8a136972d65f10749c9fc2e
different connection object should be patched to mock
connection to ovsdb in unit tests.
This patch fixes issue with wrong patched module in tests for
logapi agent extension.
Change-Id: I98ee3be7854f6a89edfedd2a4fa38af0ce7d81e4
Closes-Bug: #1742797
** Changed in: neutron
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1742797
Title:
Connection to ovsdb not mocked properly
Status in neutron:
Fix Released
Bug description:
It looks that connection to ovsdb is not mocked in test:
neutron.tests.unit.services.logapi.agent.test_log_extension.LoggingExtensionTestCase.test_handle_port_vm
and that cause problem with UT when openvswitch is not installed on
host:
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "neutron/tests/unit/services/logapi/agent/test_log_extension.py", line 68, in setUp
super(LoggingExtensionTestCase, self).setUp()
File "neutron/tests/unit/services/logapi/agent/test_log_extension.py", line 58, in setUp
ovs_bridge.OVSAgentBridge('br-int'),
File "neutron/plugins/ml2/drivers/openvswitch/agent/openflow/br_cookie.py", line 27, in __init__
super(OVSBridgeCookieMixin, self).__init__(*args, **kwargs)
File "neutron/agent/common/ovs_lib.py", line 213, in __init__
super(OVSBridge, self).__init__()
File "neutron/agent/common/ovs_lib.py", line 113, in __init__
self.ovsdb = ovsdb_api.from_config(self)
File "neutron/agent/ovsdb/api.py", line 40, in from_config
return iface.api_factory(context)
File "neutron/agent/ovsdb/impl_idl.py", line 47, in api_factory
idl=n_connection.idl_factory(),
File "neutron/agent/ovsdb/native/connection.py", line 43, in idl_factory
helper = do_get_schema_helper()
File "/home/ubuntu/neutron/.tox/py27/local/lib/python2.7/site-packages/tenacity/__init__.py", line 214, in wrapped_f
return self.call(f, *args, **kw)
File "/home/ubuntu/neutron/.tox/py27/local/lib/python2.7/site-packages/tenacity/__init__.py", line 295, in call
start_time=start_time)
File "/home/ubuntu/neutron/.tox/py27/local/lib/python2.7/site-packages/tenacity/__init__.py", line 265, in iter
raise RetryError(fut).reraise()
File "/home/ubuntu/neutron/.tox/py27/local/lib/python2.7/site-packages/tenacity/__init__.py", line 344, in reraise
raise self.last_attempt.result()
File "/home/ubuntu/neutron/.tox/py27/local/lib/python2.7/site-packages/concurrent/futures/_base.py", line 455, in result
return self.__get_result()
File "/home/ubuntu/neutron/.tox/py27/local/lib/python2.7/site-packages/tenacity/__init__.py", line 298, in call
result = fn(*args, **kwargs)
File "neutron/agent/ovsdb/native/connection.py", line 41, in do_get_schema_helper
return idlutils.get_schema_helper(conn, schema_name)
File "/home/ubuntu/neutron/.tox/py27/local/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/idlutils.py", line 128, in get_schema_helper
'err': os.strerror(err)})
Exception: Could not retrieve schema from tcp:127.0.0.1:6640: Connection refused
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1742797/+subscriptions
References