Assaf Muller [Mon, 29 Jun 2015 15:38:51 +0000 (11:38 -0400)]
Remove failing SafeFixture tests
The fixtures 1.3 release attempted to fix the fixtures resource
leak issue, but failed to do so completely. Our own SafeFixture
is still needed: The 1.3 release broke our SafeFixture tests,
but not the usage of SafeFixture itself. This patch removes
those failing tests for now to unbreak the gate. Jakub reported
a bug on fixtures 1.3:
https://bugs.launchpad.net/python-fixtures/+bug/1469759
We will continue to use SafeFixture until that bug is fixed
in fixtures, at which point we will be able to require
fixtures > 1.3.
We pulled all of the plugins out of the tree, many of which still inherit
from neutron test classes. This change then stated that we no longer
support testing other plugins. I think this is a bit premature and should
have been discussed under the subject
"Neutron plugins can't use neutron plugin unit tests" or something
similar.
Jakub Libosvar [Fri, 5 Jun 2015 14:32:51 +0000 (14:32 +0000)]
Refactor NetcatTester class
Following capabilities were added:
- used transport protocol is passed as a constant instead of bool
- src port for testing was added
- connection can be established explicitly
- change constructor parameters of NetcatTester
As a part of removing bool for protocol definition
get_free_namespace_port() was also modified to match the behavior.
Kevin Benton [Fri, 26 Jun 2015 01:34:38 +0000 (18:34 -0700)]
Add a double-mock guard to the base test case
Use mock to patch mock with a check to prevent multiple active
patches to the same target. Multiple patches to the same target
result in non-deterministic behavior when stopall() tries to
undo the patches.[1]
Kevin Benton [Fri, 26 Jun 2015 05:08:41 +0000 (22:08 -0700)]
Remove duplicated mock patch of ip_lib
The functional tests for agents were patching ip_lib in the
function to configure an agent, so any tests that relied on
multiple agents would patch ip_lib multiple times.
Kyle Mestery [Thu, 25 Jun 2015 20:36:47 +0000 (20:36 +0000)]
Consolidate sriov agent and driver code
In preparation for decomposing the built-in reference implementation,
this commits consolidates the sriov agent and driver code into a
coherent place for it's life in the new repository. I've also given
the unit tests a new home.
Kyle Mestery [Wed, 24 Jun 2015 19:12:06 +0000 (19:12 +0000)]
Restructure agent code in preparation for decomp
This commit moves the L2 agents (Linuxbridge and OVS) into the
ML2 directory, while at the same time also moving the ML2 server
bits into toplevel directories. It also moves the configuration
files and unit tests. We also move the l2pop RPC mixin while
here as well.
sridhargaddam [Mon, 22 Jun 2015 14:13:56 +0000 (14:13 +0000)]
Fix ip_lib get_gateway for default gateway on an iface
Currently get_gateway() of IpRouteCommand class always assumes
the presence of gateway_ip when default_route is seen.
Since we can also have interface routes without the gw_ip,
this patch fixes the issue by parsing the output accordingly.
IPv6 does not have a subnet broadcast address so the last IP
address can be used as a regular address. This patch tweaks the
automatic allocation pool generation to include that last address
on v6 networks.
This was found because
NetworksTestDHCPv6.test_dhcp_stateful_fixedips_outrange makes the
assumption that the default generated pools cover the entire usable
address space.
Pavel Bondar [Thu, 25 Jun 2015 13:52:08 +0000 (16:52 +0300)]
Extend SubnetRequestFactory to access subnet dict
SubnetRequestFactory incorporates logic for preparing arguments and
building right request.
Subnet dict, context and subnetpool are used to make decision on
what kind of reqest should be created.
SubnetRequestFactory can be overriden on ipam driver level,
it allows to easily extend existent Request model.
Kevin Benton [Fri, 26 Jun 2015 01:31:38 +0000 (18:31 -0700)]
Remove duplicated call to setup_coreplugin
The test case for vlan_transparent was calling setup_coreplugin
before calling the super setUp method which already calls
setup_coreplugin. This was causing duplicate core plugin fixtures
which resulted in patching the dhcp periodic check twice.
Kevin Benton [Fri, 26 Jun 2015 01:29:37 +0000 (18:29 -0700)]
Remove double mock of dhcp agent periodic check
The test case for the periodic check was patching a target
that the core plugin fixture already patched out. This removes
that and exposes the mock from the fixture so the test case
can reference it.
Kevin Benton [Fri, 26 Jun 2015 00:55:16 +0000 (17:55 -0700)]
Remove double callback manager mocks
setup_test_registry_instance() in the base test case class gives
each test its own registry by mocking out the get_callback_manager.
The L3 agent test cases were duplicating this.
Kevin Benton [Thu, 25 Jun 2015 23:57:30 +0000 (16:57 -0700)]
Remove ensure_dirs double-patch
test_spawn_radvd called mock.patch on ensure_dirs after the
setup method already patched it out. This causes issues when
mock.patch.stopall() is called because the mocks are stored
as a set and are unwound in a non-deterministic fashion.[1]
So some of the time they will be undone correctly, but others
will leave a monkey-patched in mock, causing the ensure_dir
test to fail.
Sukhdev Kapur [Thu, 25 Jun 2015 22:11:28 +0000 (15:11 -0700)]
Fix tenant-id in Arista ML2 driver to support HA router
When HA router is created, the framework creates a network and does
not specify the tenant-id. This casuse Arista ML2 driver to fail.
This patch sets the tenant-id when it is not passed explicitly by
by the network_create() call from the HA router framework.
Even though original issue was discovered for network_create()
it turns out the same issue applies for port_create() as well
so all the methods are fixed in this patch
Cedric Brandily [Wed, 24 Jun 2015 19:31:33 +0000 (21:31 +0200)]
Avoid env variable duplication in tox.ini
Some environment variables are defined multiple times in tox.ini. This
change defines "fake" tox jobs and refactors existing jobs to reduce
duplicated environment variables.
Kevin Benton [Wed, 3 Jun 2015 22:20:27 +0000 (15:20 -0700)]
Skip ARP protection if 0.0.0.0/0 in addr pairs
Don't setup ARP protection on ports with allowed address pairs
that allow them to use any IP address. This is necessary because
OVS doesn't support the /0 prefix in rules that match on ARP headers.
Russell Bryant [Wed, 24 Jun 2015 18:59:26 +0000 (14:59 -0400)]
Updated from global requirements
This patch takes the latest global requirements update from change
Ibcb49412a012f79be2f7fd697349ddbf43bd7b9b except takes out the update
to setup.py which reverts the windows specific requirements. We are
still working on getting the custom changes out of setup.py in change
I3c07c279d33f6aed46c3a97dd9ba81251e51429a.
Cedric Brandily [Thu, 11 Jun 2015 20:12:01 +0000 (22:12 +0200)]
Define SafeFixture base fixture
Currenty useFixture(myfixture)[1] ensures to call myfixture.cleanUp only
if myfixture.setUp succeed.
This change defines a workaround to ensure cleanUp call even if setUp
fails until testtools/fixtures support it: SafeFixture[2] which ensures
cleanUp call if setUp fails and replaces fixtures.Fixture use by
SafeFixture. This workaround will be removed when the bug will fixed in
testtools and fixtures[3].
[1] testtools.TestCase.useFixture, fixtures.Fixture.useFixture
[2] neutron.tests.tools
[3] see related bugs
Ihar Hrachyshka [Tue, 23 Jun 2015 15:33:38 +0000 (17:33 +0200)]
ovsdb: attempt to enable connection_uri for native impl on startup
The port is in most cases disabled, so to use it, we should first enable
it, and it means that we should still rely on ovs-vsctl for that initial
call.
Aaron Rosen [Wed, 3 Jun 2015 23:19:39 +0000 (16:19 -0700)]
Provide work around for 0.0.0.0/0 ::/0 for ipset
Previously, the ipset_manager would pass in 0.0.0.0/0 or ::/0 if
these addresses were inputted as allowed address pairs. This causes
ipset to raise an error as it does not work with zero prefix sizes.
To solve this problem we use two ipset rules to represent this:
Ipv4: 0.0.0.0/1 and 128.0.0.1/1
IPv6: ::/1' and '8000::/1
All of this logic is handled via _sanitize_addresses() in the ipset_manager
which is called to convert the input.
Kevin Benton [Wed, 24 Jun 2015 10:27:16 +0000 (03:27 -0700)]
Make DHCPv6 out of bounds API test deterministic
The test_dhcp_stateful_fixedips_outrange API test was randomly
picking an IP from last + 1 up to last + 10 in the allocation
range. This made it fail randomly when there was an issue related
to the subnet allocation having an off-by-one issue.
This adjusts the test to just always test last +1 and +2.
Kevin Benton [Wed, 24 Jun 2015 09:15:29 +0000 (02:15 -0700)]
Don't process network_delete events on OVS agent
There is no reason to reclaim the local VLAN on a network_delete
event since it will be reclaimed when the last port is deleted anyway.
This method was racey with recent port creation events and lead to
occasional traces when it would yank the local VLAN out from underneath
an ongoing port wiring process.
Cedric Brandily [Tue, 23 Jun 2015 22:08:22 +0000 (00:08 +0200)]
Support oslo_db 1.12
oslo_db 1.12[1] decorates oslo_context.context.RequestContext with
session management[2][3] and add a read-only attribute 'session'. Such
feature breaks Brocade plugin and its unittests because they define
on RequestContext the 'session' attribute which now is a read-only
property. This change uses neutron.context instead of
oslo_context.context in order to delegate session management to the
neutron.context and remove read-only attribute set.
A follow-up change will refactor neutron.context in order to use oslo_db
1.12 session management instead of homemade one.
Jeremy Stanley [Thu, 18 Jun 2015 19:09:05 +0000 (19:09 +0000)]
Override opportunistic database tests to PyMySQL
Set the OS_TEST_DBAPI_ADMIN_CONNECTION override variable so that
oslo.db opportunistic detection will know to use PyMySQL until
I12b32dc097a121bd43991bc38dd4d289b65e86c1 makes it the default
behavior.
This change removes previous code[1] enabling PyMySQL use.
[1] Ic5c1d12ab75443e1cc290a7447eeb4b452b4a9dd
Change-Id: Ic39feee0248f2ffabdba26f3779ab40a8f3838e6 Co-Authored-By: Victor Sergeyev <vsergeyev@mirantis.com> Co-Authored-By: Cedric Brandily <zzelle@gmail.com>
Cedric Brandily [Tue, 23 Jun 2015 18:00:30 +0000 (20:00 +0200)]
Extend default setenv instead of replacing it in tox.ini
Some tox jobs[1] define their own setenv without extending/referencing
default setenv, it disallows to define environment variables shared by
all jobs. This change updates previous jobs[1] in order to extend
instead of replacing default setenv and enable global environement
variables (used in daughter change).
One remark, this change sets VIRTUAL_ENV environment variable in updated
jobs[1] but it has no effect on them.
[1] (dsvm-)functional, (dsvm-)fullstack and api jobs