Maru Newby [Wed, 7 May 2014 22:41:40 +0000 (22:41 +0000)]
Ensure core plugin deallocation after every test
The unit tests were previously consuming an excessive amount of memory
(4GB+) due to plugin instances persisting in memory. Deallocation was
not possible where a combination of circular references and mocking
was involved. This patch ensures that only NeutronManager holds a
plugin reference and that all other references are instances of
weakref.proxy. Residual memory footprint for tox executed on a
12-core machine has been reduced to ~1.3GB. Plugin deallocation is
validated at the end of each test to prevent regressions.
This change also includes fixes to unit tests that depended on plugin
instances persisting across tests.
NSX: ensure that no LSN is created on external networks
Logical Service Nodes (LSN) are those that provide dhcp
and metadata services to networks when the NSX plugin is
used without the openstack dhcp and metadata proxy
agents. External networks do not work with Neutron's
dhcp and metadata services, therefore there is no need
to provision a LSN in this case.
In case IpSecPolicy or IKEPolicy is updated while VPN connection that uses it
is already established, IPsecPolicyInUse or IKEPolicuInUse is raised.
Need to clarify their messages to emphasize that policies can't be updated
because they are used by established connection.
Another patch (commit-id: df96a03e6c74f1fceb4525900bca885307907b79) to
fix the same issue with less intrusive consequences was already merged
into master. There's still benefit to have debug logs if this does not
make gate jobs fail, so revert to previous setting value.
Ihar Hrachyshka [Tue, 6 May 2014 13:52:35 +0000 (15:52 +0200)]
Disable debug messages when running unit tests
Some runs started to fail due to large sub_unit.log files. We should
reduce their size. The easy way to achieve this is to disable INFO
messages that are filling our logs.
Jakub Libosvar [Tue, 6 May 2014 08:56:31 +0000 (10:56 +0200)]
Fix importing module in test_netscaler_driver
During H302 was introduced new bug importing package instead of module.
This patch is reverting back change on this file from
https://review.openstack.org/#/c/89628/5
Attila Fazekas [Sun, 4 May 2014 17:54:37 +0000 (19:54 +0200)]
L3 RPC loop could delete a router on concurrent update
routers_updated does not acquire any lock just updates
a set for future rpc loop processing.
The self.updated_routers can be changed by concurrent update
notification. If this change happens at the time around the
self.plugin_rpc.get_routers call, the additional routers
- by mistake - is considered as admin_state_up=false routers, which
are safe to delete.
Creating a local copy of the updated_routers and preserve
the fresh updated_routers entries for the next _rpc_loop
operations.
Jakub Libosvar [Fri, 18 Apr 2014 13:32:40 +0000 (15:32 +0200)]
Fix H302 violations
H302 violation is reported by flake8 when importing separated objects from
modules instead of importing the whole module.
e.g. from package.module import function
function()
is changed to
from package import module
module.function()
Jakub Libosvar [Fri, 18 Apr 2014 13:29:49 +0000 (15:29 +0200)]
Fix H302 violations in plugins package
H302 violation is reported by flake8 when importing separated objects from
modules instead of importing the whole module.
e.g. from package.module import function
function()
is changed to
from package import module
module.function()
Jakub Libosvar [Fri, 18 Apr 2014 13:30:32 +0000 (15:30 +0200)]
Fix H302 violations in unit tests
H302 violation is reported by flake8 when importing separated objects from
modules instead of importing the whole module.
e.g. from package.module import function
function()
is changed to
from package import module
module.function()
LipingMao [Mon, 31 Mar 2014 05:49:18 +0000 (05:49 +0000)]
lbaas on a network without gateway
Not only check the gateway_ip in subnet, but also
check the host_routes. If there is a default route in host_routes
then the next hop of the default route is also a gateway_ip.
In the check for all security groups on port belong to tenant,
add a filter to get security groups for the tenant which are in
common with the security groups of the port.
Abhishek Raut [Fri, 2 May 2014 01:16:33 +0000 (18:16 -0700)]
Fix network profile subtype validation in N1kv plugin
Network profile of type Trunk expects a subtype field for
creation. If a subtype is missing in the request body, plugin
should raise an exception. This patch fixes the validation logic
to detect missing subtype field.
Kevin Benton [Thu, 1 May 2014 01:58:05 +0000 (18:58 -0700)]
Reference new get_engine() method from wsgi.py
wsgi.py referenced get_engine in neutron.openstack.common.db.sqlalchemy.session.
This method was removed from that file in commit 53609f29f3c8fcadc545afb891189253c07b33c3
change-id I0e1d86878d3eb924b01e04dced0f90b4e57757d8. This patch references the
replacement method added to neutron.db.api.
Henry Gessau [Mon, 28 Apr 2014 17:41:18 +0000 (13:41 -0400)]
Allow test_l3_agent unit test to run individually
When the test_l3_agent.TestL3AgentEventHandler test case is run
after test discovery it passes because discovery imports files
that registers all the config options. For the test case to run
individually we need to explicitly register the config options
used in the test.
Isaku Yamahata [Wed, 26 Feb 2014 02:36:56 +0000 (11:36 +0900)]
tests/unit: refactor reading neutron.conf.test
neutron.conf.test includes rpc_backend whose value is stashed.
Thus it is required to reset when tearing down, otherwise the stale status
will be used by succeeding tests causing random error.
This patch refactors reading neutron.conf.test and resets the status of
rpc_backend properly.
Joe Gordon [Tue, 29 Apr 2014 22:22:20 +0000 (15:22 -0700)]
Don't print duplicate messages on SystemExit
Don't log the error using LOG.error or LOG.exception and then
passing the same string to SystemExit since this will result in the
error being logged twice. Instead log the error and raise SystemExit(1).
Paul Michali [Fri, 4 Apr 2014 19:14:36 +0000 (19:14 +0000)]
Cisco VPN device driver - support IPSec connection updates
Provides support for IPSec connection updates and state changes. To do
this, the configuration of the connection is maintained, when the
connection is created. This is checked against the current settings, at
sync time, to determine whether a configuration change (as opposed to a
state change) has occurred.
If there is a change to the configuration detected, then the simple
approach is taken of deleting and then re-creating the connection, with
the new settings.
In addition, if the admin state of the connection changes, the tunnel
will be taken admin down/up, as needed. Admin down will occur if the
IPSec connection or the associated VPN service is set to admin down.
Admin up will occur, if both the IPSec connection and the VPN service
are in admin up state.
Added REST client method to allow changing the IPSec connection tunnel
to admin up/down (effectively doing a no-shut/shut on the tunnel I/F),
based on the above mentioned state.
Modified UTs for the support of IPSec connection update requests (used to
throw an "unsupported" exception), and to check that the configuration
and state changing are processed correctly.
Updated so that tunnel_ip is set in device driver, rather than hard
coding, and then overriding in REST client. Since device driver has the
same info, this will fit into future plans to obtain the info from
router, vs reading an .ini file. Revised UTs as well.
In case the network is without a subnet, calling the validation
logic during the report phase leads to an error because the LSN
would have been already allocated during the migration phase.
Bypass the issue by calling the plugin directly, which is what
the validation logic does in the first place.
Henry Gessau [Fri, 25 Apr 2014 19:46:58 +0000 (15:46 -0400)]
Allow ML2 plugin test cases to be run independently
Some test cases in neutron.tests.unit.ml2.test_ml2_plugin override the
network_vlan_ranges option in the ml2_type_vlan config group. However,
the test module does not import the ML2 type driver module where this
config group's options are registered. When unit tests are run by
tox/testr the module is imported during test discovery. Running the
tests independently via nose or testtools requires the option to be
explicitly imported.
Li Ma [Fri, 25 Apr 2014 07:37:46 +0000 (00:37 -0700)]
Database exception causes UnboundLocalError in linuxbridge-agent
When database exception raises from update_device_down,
the linuxbridge-agent doesn't deal with them in a proper way
that causes accessing not-existed local variables.
A straightforward workaround is to set it as None by default
and verify its value then.
Henry Gessau [Thu, 13 Feb 2014 16:58:47 +0000 (11:58 -0500)]
Cisco APIC ML2 mechanism driver, part 1
This set of changes introduces a mechanism driver for the
Cisco APIC. Please see the blueprint for more information.
The review is submitted in two parts:
- Part 1 (this one)
o APIC REST Client
o APIC data model and migration script
o APIC configurations
- Part 2 (dependent on part 1)
o APIC mechanism driver
o APIC manager