diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-05-28 03:47:45 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-05-28 03:47:46 +0000 |
commit | 2e70bccfac45bdb9b464ab525c3384c047216ab8 (patch) | |
tree | c0b8b05f593b6ee542b659311033a7e867e73cb6 /neutron/tests | |
parent | d5eac3cfe0f64a792eea0b25aeba342b747bbbd7 (diff) | |
parent | c13d722f3913137945c27fcc74371d3316129f30 (diff) | |
download | neutron-2e70bccfac45bdb9b464ab525c3384c047216ab8.tar.gz |
Merge "ovsdb: Don't let block() wait indefinitely"
Diffstat (limited to 'neutron/tests')
-rw-r--r-- | neutron/tests/functional/agent/test_l2_ovs_agent.py | 8 | ||||
-rw-r--r-- | neutron/tests/unit/agent/ovsdb/test_impl_idl.py | 37 |
2 files changed, 37 insertions, 8 deletions
diff --git a/neutron/tests/functional/agent/test_l2_ovs_agent.py b/neutron/tests/functional/agent/test_l2_ovs_agent.py index 15efcc269d..cbb2cb4762 100644 --- a/neutron/tests/functional/agent/test_l2_ovs_agent.py +++ b/neutron/tests/functional/agent/test_l2_ovs_agent.py @@ -24,14 +24,6 @@ from neutron.tests.functional.agent.l2 import base class TestOVSAgent(base.OVSAgentTestFramework): - def setUp(self): - # NOTE(jlibosva): Tests are getting stuck when running with native - # ovsdb interface in this test suite. We skip until the root cause is - # found to unblock CI jobs. - if self.ovsdb_interface == 'native': - self.skipTest('bug/1567668') - super(TestOVSAgent, self).setUp() - def test_port_creation_and_deletion(self): self.setup_agent_and_ports( port_dicts=self.create_test_ports()) diff --git a/neutron/tests/unit/agent/ovsdb/test_impl_idl.py b/neutron/tests/unit/agent/ovsdb/test_impl_idl.py new file mode 100644 index 0000000000..3e4e927cbe --- /dev/null +++ b/neutron/tests/unit/agent/ovsdb/test_impl_idl.py @@ -0,0 +1,37 @@ +# Copyright (c) 2016 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import mock +from six.moves import queue +import testtools +import unittest2 + +try: + from ovs.db import idl # noqa +except ImportError: + raise unittest2.SkipTest( + "Skip test since ovs requirement for PY3 doesn't support yet.") + +from neutron.agent.ovsdb import api +from neutron.agent.ovsdb import impl_idl +from neutron.tests import base + + +class TransactionTestCase(base.BaseTestCase): + def test_commit_raises_exception_on_timeout(self): + with mock.patch.object(queue, 'Queue') as mock_queue: + transaction = impl_idl.Transaction(mock.sentinel, mock.Mock(), 0) + mock_queue.return_value.get.side_effect = queue.Empty + with testtools.ExpectedException(api.TimeoutException): + transaction.commit() |