Kevin Benton [Fri, 7 Mar 2014 04:51:11 +0000 (20:51 -0800)]
BigSwitch: Improves server manager UT coverage
Improves the unit test coverage for the Big Switch
server manager module (100%). Also reorganizes the
capabilities test to avoid duplicating a lot of
router tests that are already covered.
Kevin Benton [Thu, 3 Apr 2014 10:00:37 +0000 (10:00 +0000)]
BigSwitch: Don't import portbindings_db until use
The Big Switch ML2 driver re-uses large parts of
code from the Big Switch plugin. However, the plugin
uses the old portbindings_db in its port tracking
code. This db is not created/used by ML2, so it does
not exist when the Big Switch ML2 driver is being used.
This caused a problem when the portbindings_db module
would be imported even though it wasn't being used
since the SQLAlchemy models would create the
relationships during the import.
This patch moves the portbindings_db import down to
the methods that leverage it so it won't be imported
during use by the ML2 driver.
This is a temporary solution which can be back-ported
if disabling auto schema generation is back-ported
to icehouse. An appropriate fix will require some
refactoring to avoid the port tracking code from
being imported for ML2.
This patch changes the policy engine behaviour and the API base
controller in order to ensure policy.init is invoked only once
for each API request.
This will avoid issues arising from policy file updates during
API processing and speed up response generation for list operations,
by about 5%.
Jakub Libosvar [Mon, 17 Mar 2014 15:36:01 +0000 (16:36 +0100)]
Sync service and systemd modules from oslo-incubator
This patch make systemd know when neutron-service was started. This is
needed in HA environment, previously systemd returned success even
before neutron-server was able to handle requests.
Robert Kukura [Thu, 3 Apr 2014 21:01:00 +0000 (17:01 -0400)]
ML2: ODL driver sets port status
The OpenDaylight mechanism driver does not depend on an L2 agent to
plug the port. Now that nova waits for notification that the port
status is ACTIVE, the ML2 driver API is extended so that the mechanism
driver that binds a port can optionally set the port status, and the
OpenDaylight mechanism driver uses this to set the port status to
ACTIVE.
Andreas Jaeger [Mon, 31 Mar 2014 20:17:18 +0000 (22:17 +0200)]
Fix Jenkins translation jobs
The job neutron-propose-translation-update
does not update from
transifex since our po files contain duplicate entries where
obsolete entries duplicate normal entries.
Remove all obsolete entries to fix the job.
Add test to pep8 that checks that no new breakages get
introduced.
Joe Gordon [Wed, 2 Apr 2014 18:25:27 +0000 (11:25 -0700)]
Explicitly import state_path opt in tests.base
This wasn't explicitly needed in the unit tests because
neutron.common.config was already loaded, but this broke for the
functional tests (which are non-voting) so add a CONF.import_opt line so
functional tests know where to find the definition for state_path.
Miguel Angel Ajo [Mon, 31 Mar 2014 13:50:55 +0000 (15:50 +0200)]
fixes tests using called_once_ without assert
A few tests were using mock's called_once, or called_once_with_args
instead of assert_called_once or assert_called_once_with_args. Those
methods return a bool that needs to be actively checked.
The tests are fixed to avoid them from passing if the call condition
is not met.
This reverts changes from this review [1] which incorrectly removed
the return of the OVSBridge object when calling BaseOVS.add_bridge.
This broke all functional tests relying on this return.
Miguel Angel Ajo [Tue, 18 Mar 2014 12:33:19 +0000 (13:33 +0100)]
fixes broken neutron-netns-cleanup
Some configuration parameters used in neutron.agent.linux.utils
were missing. The namespace attribute in the FakeNetwork object
was missing, and used in neutron.agent.linux.dhcp. Also, the
plugin object was missing for release_dhcp_port operation.
We provide a fake plugin object to accept current and any future
plugin calls as this is meant to be an standalone tool that
should work without any RPC connectivity.
FakeNetwork was switched for neutron.agent.linux.dhcp.NetModel
to follow any future changes in NetModel.
Two wrong called_once_with_args calls without assert were fixed.
Xuhan Peng [Mon, 10 Feb 2014 03:02:33 +0000 (22:02 -0500)]
Permit ICMPv6 RAs only from known routers
Currently ingress ICMPv6 RAs are permitted from any IPs by
default to allow VMs to accept ICMPv6 RA from provider network.
In this way, VM can accept RAs from attacker VM and configure
a network prefix specified by the attacher VM.
Remove permitting ICMPv6 RAs from any IPs and add security rule
to only permit ICMPv6 RA from:
1. If the port's subnet is configured with ipv6_ra_mode value
(i.e.value is slaac, dhcpv6-stateful, or dhcpv6-stateless), RA
is sending from dnsmasq controlled by OpenStack. In this case,
allow RA from the link local address of gateway port (if the
gateway port is created).
2. If the subnet's gateway port is not managed by OpenStack, allow
the ICMPv6 RA sent from the subnet gateway IP if it's a link local
address. The administrator needs to configure the gateway IP as
link local address in this case to make the RA rule work.
Second firewall creation returns 500, but it is an expected behavior
of firewall reference implementation and an internal server error
should not be returned.
A minor change is made to the Arista API between ML2 Driver and the
back-end. This fix addresses this change to align Icehouse release with
Arista EOS releases.
Joe Gordon [Tue, 1 Apr 2014 22:06:36 +0000 (15:06 -0700)]
Use a temp dir for CONF.state_path
external_pids will defaults to $state_path(/var/lib/neutron)/external/pids
which isn't accessible when running unit tests so use a tempdir for
CONF.state_path. This bug arose when oslo.config 1.3.0 came out which
fixed bug #1282250 (I4324bda6f3de3cdf05f8eb3cf16052c04018dec8) and
caused this issue.
Kevin Benton [Tue, 1 Apr 2014 08:05:29 +0000 (01:05 -0700)]
Stop using portbindings_db in BSN ML2 driver
Avoids using the portbindings_db in the Big Switch
ML2 driver since ML2 has deprecated that database for
its own version that tracks the same information.
Also eliminates unnecessary 'binding_host' field since
it is now always the same as as the 'portbinding:host_id'
field.
Simply removes the vim header line and the empty line
following it (when present) for files in the api, db, and
extenssions base directories. In one single _init_ file in
this patchset, all comment lines are removed.
AKamyshnikova [Thu, 6 Mar 2014 12:09:08 +0000 (16:09 +0400)]
Restore NOT NULL constraint lost by earlier migrations
Bring back nullable=False for columns in tables poolstatisticss
and ipsec_site_connections that disapeared because of
migrations abc88c33f74f and 338d7508968c correspondingly.
Kevin Benton [Tue, 1 Apr 2014 06:32:41 +0000 (23:32 -0700)]
BigSwitch: Semaphore on port status update
Adds a semaphore to the _set_port_status
function used by the Big Switch ML2 driver and
plugin. Without it, the async threads are
susceptible to deadlocking and causing the
known eventlet/mysql timeout exception.
Aaron Rosen [Mon, 31 Mar 2014 18:03:48 +0000 (11:03 -0700)]
Only send notifications on uuid device_id's
Neutron assumes that all ports with the device_owner that start with
'compute:' are ports created by nova compute. Thus, when the debug agent
creates a port with device_owner = compute:probe the nova notifier
feature tells nova when this port is wired even though nova does not know
about it (doesn't really matter we just log an error). This patch adds a check
to make sure the device_id is a uuid as nova only uses uuids and the debug
agent uses the hostname for device_id.