]> review.fuel-infra Code Review - openstack-build/neutron-build.git/log
openstack-build/neutron-build.git
9 years agoMerge "Remove duplicated l3 router scheduler test cases"
Jenkins [Tue, 28 Apr 2015 08:54:15 +0000 (08:54 +0000)]
Merge "Remove duplicated l3 router scheduler test cases"

9 years agoMerge "Not creating HA router when not enough l3 agents"
Jenkins [Tue, 28 Apr 2015 07:30:22 +0000 (07:30 +0000)]
Merge "Not creating HA router when not enough l3 agents"

9 years agoMerge "OOP naming cleanup in l3_dvr_db"
Jenkins [Tue, 28 Apr 2015 07:18:23 +0000 (07:18 +0000)]
Merge "OOP naming cleanup in l3_dvr_db"

9 years agoMerge "Replace BaseLinuxTestCase by BaseSudoTestCase"
Jenkins [Tue, 28 Apr 2015 06:22:46 +0000 (06:22 +0000)]
Merge "Replace BaseLinuxTestCase by BaseSudoTestCase"

9 years agoMerge "Add weak reference test for callback manager"
Jenkins [Tue, 28 Apr 2015 06:22:23 +0000 (06:22 +0000)]
Merge "Add weak reference test for callback manager"

9 years agoMerge "Remove backward compatibility for check_is_admin"
Jenkins [Tue, 28 Apr 2015 06:05:46 +0000 (06:05 +0000)]
Merge "Remove backward compatibility for check_is_admin"

9 years agoMerge "Add missing interface to populate subnets method"
Jenkins [Tue, 28 Apr 2015 02:19:01 +0000 (02:19 +0000)]
Merge "Add missing interface to populate subnets method"

9 years agoRun radvd as root
Henry Gessau [Mon, 27 Apr 2015 13:59:21 +0000 (09:59 -0400)]
Run radvd as root

During the refactoring of external process management radvd lost
its root privileges.

Closes-bug: 1448813

Change-Id: I84883fe81684afafac9b024282a03f447c8f825a

9 years agoNot creating HA router when not enough l3 agents
Xu Han Peng [Thu, 9 Apr 2015 05:46:36 +0000 (01:46 -0400)]
Not creating HA router when not enough l3 agents

Currently a HA router can be successfully created even when
there is not enough active l3 agent. Current code only checks
existing l3 agents but does not check if the agent is already
down.

This patch fixes this problem by checking only active l3 agents
when getting the number of agents for scheduling HA router.

Closes-Bug: 1420117

Change-Id: I6c1d108db1a7c93b61c0dd0b1ffee319a411b17a

9 years agoMerge "Spawn RADVD only in the master HA router"
Jenkins [Fri, 24 Apr 2015 21:24:04 +0000 (21:24 +0000)]
Merge "Spawn RADVD only in the master HA router"

9 years agoMerge "Imported Translations from Transifex"
Jenkins [Fri, 24 Apr 2015 21:12:43 +0000 (21:12 +0000)]
Merge "Imported Translations from Transifex"

9 years agoReplace BaseLinuxTestCase by BaseSudoTestCase
Cedric Brandily [Thu, 5 Mar 2015 21:43:09 +0000 (21:43 +0000)]
Replace BaseLinuxTestCase by BaseSudoTestCase

BaseLinuxTestCase provides 2 methods which are used once/three time(s),
this change inlines these methods and removes BaseLinuxTestCase and
replaces it by BaseSudoTestCase.

Change-Id: I2b60abf55193f535fc7d7637bcb2f15c6a372a87

9 years agoMerge "Fix MismatchError to nondeterministic order for list of controllers"
Jenkins [Fri, 24 Apr 2015 19:34:11 +0000 (19:34 +0000)]
Merge "Fix MismatchError to nondeterministic order for list of controllers"

9 years agoMerge "Don't resync on DHCP agent setup failure"
Jenkins [Fri, 24 Apr 2015 19:03:13 +0000 (19:03 +0000)]
Merge "Don't resync on DHCP agent setup failure"

9 years agoMerge "Replace BaseIPVethTestCase by FakeMachine"
Jenkins [Fri, 24 Apr 2015 17:25:49 +0000 (17:25 +0000)]
Merge "Replace BaseIPVethTestCase by FakeMachine"

9 years agoFix MismatchError to nondeterministic order for list of controllers
armando-migliaccio [Fri, 24 Apr 2015 16:27:40 +0000 (09:27 -0700)]
Fix MismatchError to nondeterministic order for list of controllers

The list of controllers returned by the ovsdb server can be in any order,
therefore we can't assert likes for likes. Assert the sorted lists instead.

Change-Id: Ice3bb8cc0b3da70f8c9aae50d8cdae2b474ff49b
Closes-bug: #1448202

9 years agoMerge "Neutron to Drop Router Advts from VM ports"
Jenkins [Fri, 24 Apr 2015 16:05:44 +0000 (16:05 +0000)]
Merge "Neutron to Drop Router Advts from VM ports"

9 years agoMerge "Block subnet create with mismatched IP versions"
Jenkins [Fri, 24 Apr 2015 16:00:37 +0000 (16:00 +0000)]
Merge "Block subnet create with mismatched IP versions"

9 years agoMerge "OVS_LIB API addition - change bridge controller connection-mode"
Jenkins [Fri, 24 Apr 2015 15:06:49 +0000 (15:06 +0000)]
Merge "OVS_LIB API addition - change bridge controller connection-mode"

9 years agoAdd missing interface to populate subnets method
Kevin Benton [Fri, 24 Apr 2015 13:52:21 +0000 (06:52 -0700)]
Add missing interface to populate subnets method

Change Ib46f685d72eb61ecbaa2869e28fb173cd6d49552 introduced
and optimization to defer the lookup of interface subnet info
until all of the router interfaces were collected. However,
it didn't add the DVR SNAT interface to the list of interfaces
to populate subnet info so it broke DVR.

This patch corrects the behavior by adding the DVR SNAT interface
to the list of ports that need subnet info populated.

Change-Id: I32054ff00bf6992c5dedd21735b6d2afd15c5fb3

9 years agoMerge "Refactor socket ssl wrapping"
Jenkins [Fri, 24 Apr 2015 12:59:34 +0000 (12:59 +0000)]
Merge "Refactor socket ssl wrapping"

9 years agoRefactor socket ssl wrapping
Elena Ezhova [Tue, 7 Apr 2015 11:54:45 +0000 (14:54 +0300)]
Refactor socket ssl wrapping

Move socket wrapping into a separate method in order to separate
its logic from other action done in _get_socket. Now, ssl wrapping
is applied to the socket returned by _get_socket method.
Additionally checks for ssl config options are now performed during
init and not each time wrap_socket is called.

Added unit tests.

Related-Bug: #1276694
Change-Id: I706517ae351a7a681623ec91c9657a2f61cd2679

9 years agoDon't resync on DHCP agent setup failure
Kevin Benton [Fri, 24 Apr 2015 07:35:31 +0000 (00:35 -0700)]
Don't resync on DHCP agent setup failure

There are various cases where the DHCP agent will try to
create a DHCP port for a network and there will be a failure.
This has primarily been caused by a lack of available IP addresses
in the allocation pool. Trying to fix all availability corner cases
on the server side will be very difficult due to race conditions between
multiple ports being created, the dhcp_agents_per_network parameter, etc.

This patch just stops the resync attempt on the agent side if a failure
is caused by an IP address generation problem. Future updates to the subnet
will cause another attempt so if the tenant does fix the issue they will
get DHCP service.

Change-Id: I0896730126d6dca13fe9284b4d812cfb081b6218
Closes-Bug: #1447883

9 years agoReplace BaseIPVethTestCase by FakeMachine
Cedric Brandily [Sun, 1 Mar 2015 23:05:36 +0000 (23:05 +0000)]
Replace BaseIPVethTestCase by FakeMachine

This change removes BaseIPVethTestCase class and moves Pinger class to
allow its use from a fake machine.

Change-Id: I0636f11a327e9535828e7b52e60195e52831a0b2

9 years agoMerge "ovs_lib: Fix a race between get_port_tag_dict and port removal"
Jenkins [Fri, 24 Apr 2015 08:27:44 +0000 (08:27 +0000)]
Merge "ovs_lib: Fix a race between get_port_tag_dict and port removal"

9 years agoImported Translations from Transifex
OpenStack Proposal Bot [Fri, 24 Apr 2015 06:13:56 +0000 (06:13 +0000)]
Imported Translations from Transifex

For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: Ib7e961af3fe219179b3c6847f8fec785ad040351

9 years agoMerge "ARP spoofing patch: Low level ebtables integration"
Jenkins [Fri, 24 Apr 2015 04:58:33 +0000 (04:58 +0000)]
Merge "ARP spoofing patch: Low level ebtables integration"

9 years agoMerge "Block allowed address pairs on other tenants' net"
Jenkins [Fri, 24 Apr 2015 04:58:19 +0000 (04:58 +0000)]
Merge "Block allowed address pairs on other tenants' net"

9 years agoMerge "Fix incorrect query for user ip allocations"
Jenkins [Fri, 24 Apr 2015 04:38:08 +0000 (04:38 +0000)]
Merge "Fix incorrect query for user ip allocations"

9 years agoNeutron to Drop Router Advts from VM ports
sridhargaddam [Mon, 8 Dec 2014 16:11:38 +0000 (16:11 +0000)]
Neutron to Drop Router Advts from VM ports

As part of Spoofing filter chain Neutron drops all the outbound
traffic where MAC/IP does not match the IP address assigned
to the VM ports (inc' allowed_address_pairs). Along with this,
we also drop traffic associated to dhcp[v6] server (i.e., do
not allow a VM to run dhcp[v6] server). Currently we do not
have any rules to drop Router Advts from VM ports. This can create
issues in the network as other devices in the network may not have
any protection for this kind of stuff.

Even if we allow RAs from the VM ports, because of the Anti-Spoofing
rules that are applied, a VM cannot act as a IPv6 router (i.e., it
cannot forward IPv6 traffic). So there is no point in allowing Router
Advts from VMs assuming that it would be useful in Service VM use-cases.
In order to properly implement IPv6 router as a Service VM, one needs
to use the port_security_extension [1] which allows us to disable
security group rules/anti-spoofing filters on the VM ports.

[1]https://review.openstack.org/#/c/99873/22/specs/kilo/ml2-ovs-portsecurity.rst

This patch disables Router Advts from VM ports.

Closes-Bug: #1372882
Change-Id: I8db5d6dbe60bf04f4e3754a886c6aa8a97a16bab

9 years agoMerge "Fix L3 agent functional tests random failures"
Jenkins [Fri, 24 Apr 2015 01:16:40 +0000 (01:16 +0000)]
Merge "Fix L3 agent functional tests random failures"

9 years agoMerge "Add block name to switch config options for MLX plug-ins."
Jenkins [Fri, 24 Apr 2015 01:09:06 +0000 (01:09 +0000)]
Merge "Add block name to switch config options for MLX plug-ins."

9 years agoFix L3 agent functional tests random failures
Assaf Muller [Thu, 23 Apr 2015 17:43:29 +0000 (13:43 -0400)]
Fix L3 agent functional tests random failures

The test_ha_router_failover tests were not being unmocked. This
is because the same object was being mocked twice, but unmocked
once. The mock.patch.stopall call in the tests base class was rewinding
the value of the object from the second mock to the first mock.

Follow up tests in the same worker were using namespace
names defined via the first mock in the failover test.

Closes-Bug: #1446261
Change-Id: I8f24b8bb3a6a501dbe210c2cc67c47fa4b76257c

9 years agoMerge "Refactor RESOURCE_ATTRIBUTE_MAP cleanup"
Jenkins [Thu, 23 Apr 2015 18:00:13 +0000 (18:00 +0000)]
Merge "Refactor RESOURCE_ATTRIBUTE_MAP cleanup"

9 years agoMerge "Log RPC initialization in L3 service plugin and ML2"
Jenkins [Thu, 23 Apr 2015 17:47:39 +0000 (17:47 +0000)]
Merge "Log RPC initialization in L3 service plugin and ML2"

9 years agoMerge "Change callbacks logging from INFO to DEBUG"
Jenkins [Thu, 23 Apr 2015 17:45:35 +0000 (17:45 +0000)]
Merge "Change callbacks logging from INFO to DEBUG"

9 years agoMerge "Fix DVR functional tests resources leak"
Jenkins [Thu, 23 Apr 2015 17:42:56 +0000 (17:42 +0000)]
Merge "Fix DVR functional tests resources leak"

9 years agoMerge "Simplify keepalived.virtual_routes"
Jenkins [Thu, 23 Apr 2015 17:39:27 +0000 (17:39 +0000)]
Merge "Simplify keepalived.virtual_routes"

9 years agoRemove backward compatibility for check_is_admin
Salvatore Orlando [Fri, 17 Apr 2015 23:59:42 +0000 (16:59 -0700)]
Remove backward compatibility for check_is_admin

This routine in policy.py used to have a backward compatibility
check to ensure proper behaviour even when the policy.json file
did not have a specific 'context_is_admin' policy.
However, this backward compatibility check does not work. It
appears indeed that it has been broken for several release cycles;
it is also possible that actually it never worked.
When the 'context_is_admin' policy is not in the policy.json file
the enforcer simply ends up evaluating whatever is the default
policy configured there.

Therefore this patch:
- Removes the backward compatibility check, since it does not work
- Fails, for safety, check_is_admin if 'context_is_admin' policy is
  not specified
- Fixeds check_is_advsvc in the same way (the backward compatibility
  check never made any sense for this function)
- Fixes unit tests adding appropriate tests for check_is_admin and
  check_is_advsvc

Change-Id: Ia47e5781d86a3f21b9d837c9ac70a62ac435d20b
Closes-Bug: #1445690

9 years agoMerge "Add security groups events"
Jenkins [Thu, 23 Apr 2015 14:08:25 +0000 (14:08 +0000)]
Merge "Add security groups events"

9 years agoAdd weak reference test for callback manager
Kevin Benton [Tue, 21 Apr 2015 11:28:27 +0000 (04:28 -0700)]
Add weak reference test for callback manager

Adds a unit test to make sure the callback manager can
have weakly referenced functions as callbacks.

Change-Id: Ic811e8fe63bcde2d89cdb39f9a641cde1ebd9ddb

9 years agoSpawn RADVD only in the master HA router
sridhargaddam [Wed, 8 Apr 2015 10:57:19 +0000 (10:57 +0000)]
Spawn RADVD only in the master HA router

Currently radvd is spawned in all the HA routers irrespective of the
state of the router. This approach has the following issues.

1. While processing the internal router ports (i.e., qr-xxx), ha_router
   removes the LLA of the interface and adds it as a VIP to Keepalived conf.
   Radvd daemon is spawned after this operation in the router namespace
   (if the port is associated with any IPv6 subnets). Radvd notices that
   qr-xxx interface does not have the LLA, so does not transmit any Router
   Advts. In this state, VMs fail to acquire IPv6 addresses because of the
   missing RAs. Radvd does not recover even after keepalived configures the
   LLA of the interface. The only solution is to restart/reload radvd daemon.
   Currently keepalived-state-change monitor does not do any radvd related
   operations when a state transition happens. So we endup in this state
   forever.
2. For all the routers in Backup state, qr-xxx interface does not have LLA
   as it is managed by keepalived and configured only on the Master HA router.
   In such agents syslog is flooded with the messages [1] and this can cause
   loss of other useful info.
   [1] - resetting ipv6-allrouters membership on qr-2e373555-97

This patch implements the following.
1. If the router is already in the Master state, we configure the LLA as a VIP
   in keepalived conf but do not delete the LLA of the internal interface.
2. We spawn radvd only if the router is in the Master State.
3. Keepalived-state-change monitor takes care of enabling/disabling radvd upon
   state transitions.

Closes-Bug: #1440699
Change-Id: I351c71d058170265bbb8b56e1f7a3430bd8828d5

9 years agoMerge "L3 DB: Defer port DB subnet lookups"
Jenkins [Thu, 23 Apr 2015 09:52:30 +0000 (09:52 +0000)]
Merge "L3 DB: Defer port DB subnet lookups"

9 years agoMerge "Remove dependency on weak reference for registry callbacks"
Jenkins [Thu, 23 Apr 2015 08:01:44 +0000 (08:01 +0000)]
Merge "Remove dependency on weak reference for registry callbacks"

9 years agoMerge "Ensure metadata network works with DVR"
Jenkins [Thu, 23 Apr 2015 07:43:44 +0000 (07:43 +0000)]
Merge "Ensure metadata network works with DVR"

9 years agoMerge "Restrict subnet create/update to avoid DHCP resync"
Jenkins [Thu, 23 Apr 2015 05:18:19 +0000 (05:18 +0000)]
Merge "Restrict subnet create/update to avoid DHCP resync"

9 years agoMerge "Only update MTU in update code for MTU"
Jenkins [Thu, 23 Apr 2015 04:11:52 +0000 (04:11 +0000)]
Merge "Only update MTU in update code for MTU"

9 years agoMerge "tests: confirm that _output_hosts_file does not log too often"
Jenkins [Thu, 23 Apr 2015 03:52:05 +0000 (03:52 +0000)]
Merge "tests: confirm that _output_hosts_file does not log too often"

9 years agoRestrict subnet create/update to avoid DHCP resync
watanabe.isao [Wed, 15 Apr 2015 06:48:08 +0000 (15:48 +0900)]
Restrict subnet create/update to avoid DHCP resync

As we know, IPs in subnet CIDR are used for
1) Broadcast port
2) Gateway port
3) DHCP port if enable_dhcp is True, or update to True
4) Others go into allocation_pools
Above 1) to 3) are created by default, which means if CIDR doesn't
have that much of IPs, subnet create/update will cause a DHCP resync.

This fix is to add some restricts to the issue:
A) When subnet create, if enable_dhcp is True, /31 and /32
   cidrs are forbidden for IPv4 subnets while /127 and /128 cidrs are
   forbidden for IPv6 subnets.
B) When subnet update, if enable_dhcp is changing to True and there are no
   more IPs in allocation_pools, the request should be denied.

Change-Id: I2e4a4d5841b9ad908f02b7d0795cba07596c023d
Co-authored-by: Andrew Boik <dboik@cisco.com>
Closes-Bug: #1443798

9 years agoRemove dependency on weak reference for registry callbacks
armando-migliaccio [Tue, 21 Apr 2015 23:47:09 +0000 (16:47 -0700)]
Remove dependency on weak reference for registry callbacks

The use of weakref was introduced as a preventive measure to avoid
potential OOM kills, however that limited our ability to employ
certain functions as callbacks, such as object methods (see [1] for
an example).

Since the adoption of the callback registry, it has been observed that
callbacks are generally long lived (for the entire duration of the
process they belong to), therefore this limitation appears to be too
restrictive at this point in time.

Some might argue that it's better safe than sorry, but until we
have some evidence of actual OOM kills, it's probably best to take
the bolder action of removing the adoption of weak references and
deal with the potential fallout, should it happen.

[1] https://review.openstack.org/#/c/175179/

Change-Id: Idcd0286fc4235af82901c8a17ea45bc758b62b37

9 years agoEnsure metadata network works with DVR
Salvatore Orlando [Wed, 22 Apr 2015 20:27:53 +0000 (13:27 -0700)]
Ensure metadata network works with DVR

As DVR routers use a different type of interface, this patch
amends the DHCP agent code ensuring that a metadata proxy is
spawned when the metadata network feature is enabled on the
DHCP agent.

Change-Id: Id7f2e891c0753620a604cf6160c6b592db1aa284
Closes-Bug: #1447344

9 years agoMerge "ovs_neutron_agent: Remove a redundant assignment of ovs_status"
Jenkins [Wed, 22 Apr 2015 20:37:51 +0000 (20:37 +0000)]
Merge "ovs_neutron_agent: Remove a redundant assignment of ovs_status"

9 years agoMerge "Added note about removing bridge from mappings"
Jenkins [Wed, 22 Apr 2015 20:35:53 +0000 (20:35 +0000)]
Merge "Added note about removing bridge from mappings"

9 years agoMerge "Defer creation of router JSON in get_routers RPC"
Jenkins [Wed, 22 Apr 2015 19:29:09 +0000 (19:29 +0000)]
Merge "Defer creation of router JSON in get_routers RPC"

9 years agoMerge "Handle no ofport in get_vif_port_to_ofport_map"
Jenkins [Wed, 22 Apr 2015 19:28:56 +0000 (19:28 +0000)]
Merge "Handle no ofport in get_vif_port_to_ofport_map"

9 years agoChange callbacks logging from INFO to DEBUG
Assaf Muller [Wed, 22 Apr 2015 16:12:47 +0000 (12:12 -0400)]
Change callbacks logging from INFO to DEBUG

This is an internal implementation detail, would admins care
if internal events are being fired off successfully? What actionable
information does this present?

Change-Id: I81418c1ff529b5a8ffe60513d91f51d134a45f26

9 years agoFix DVR functional tests resources leak
Assaf Muller [Mon, 20 Apr 2015 15:53:41 +0000 (11:53 -0400)]
Fix DVR functional tests resources leak

Change-Id: I882bd9127a61de7e016abfca53d22b01cbf57835
Closes-Bug: #1446288

9 years agoRefactor RESOURCE_ATTRIBUTE_MAP cleanup
Brent Eagles [Tue, 17 Feb 2015 17:15:25 +0000 (13:45 -0330)]
Refactor RESOURCE_ATTRIBUTE_MAP cleanup

This patch adds a AttributeMapMemento class that can be used for
restoring the RESOURCE_ATTRIBUTE_MAP on test tear down. Tests containing
their own cleanup code have been modified to use it instead.

Change-Id: I7ce5182bdfb8f541741a327feada63a29ddac2ae

9 years agoFix incorrect query for user ip allocations
Eugene Nikanorov [Sat, 18 Apr 2015 11:31:44 +0000 (15:31 +0400)]
Fix incorrect query for user ip allocations

Previously the query was fetching an IPAllocation object incorrectly
relying on the fact that it has port attribute that should be
join-loaded when it really is not.

Incorrect query produced by previous code:
SELECT ipallocations.port_id AS ipallocations_port_id,
       ipallocations.ip_address AS ipallocations_ip_address,
       ipallocations.subnet_id AS ipallocations_subnet_id,
       ipallocations.network_id AS ipallocations_network_id
FROM ipallocations, ports
WHERE ipallocations.subnet_id = :subnet_id_1
      AND ports.device_owner NOT IN (:device_owner_1)

The query then may have produced results that don't satisfy
the condition intended by the code.

Query produced by the fixed code:
SELECT ipallocations.port_id AS ipallocations_port_id,
       ipallocations.ip_address AS ipallocations_ip_address,
       ipallocations.subnet_id AS ipallocations_subnet_id,
       ipallocations.network_id AS ipallocations_network_id
FROM ipallocations JOIN ports ON ports.id = ipallocations.port_id
WHERE ipallocations.subnet_id = :subnet_id_1
      AND ports.device_owner NOT IN (:device_owner_1)

Change-Id: I34682df784e30e3ce49ee48c690f8b799ad58149
Closes-Bug: #1357055

9 years agoMerge "Remove neutron.tests.common.agents package"
Jenkins [Wed, 22 Apr 2015 09:38:17 +0000 (09:38 +0000)]
Merge "Remove neutron.tests.common.agents package"

9 years agoMerge "Fix test discovery for api and functional paths"
Jenkins [Wed, 22 Apr 2015 04:24:20 +0000 (04:24 +0000)]
Merge "Fix test discovery for api and functional paths"

9 years agoOOP naming cleanup in l3_dvr_db
Eugene Nikanorov [Wed, 22 Apr 2015 00:14:42 +0000 (04:14 +0400)]
OOP naming cleanup in l3_dvr_db

Start protected method names with underscore.

Closes-Bug: #1446911
Change-Id: Iddf4f467118e40eb5b4bfe18bde00aa9d34b2ec4

9 years agoARP spoofing patch: Low level ebtables integration
Édouard Thuleau [Tue, 10 Feb 2015 00:43:34 +0000 (13:43 +1300)]
ARP spoofing patch: Low level ebtables integration

ARP cache poisoning is not actually prevented by the firewall
driver 'iptables_firewall'. We are adding the use of the ebtables
command - with a corresponding ebtables-driver - in order to create
Ethernet frame filtering rules, which prevent the sending of ARP
cache poisoning frames.

The complete patch is broken into a set of smaller patches for easier review.

This patch here is th first of the series and includes the low-level ebtables
integration, unit and functional tests.

Note:
    This commit is based greatly on an original, now abandoned patch,
    presented for review here:

        https://review.openstack.org/#/c/70067/

    Full spec can be found here:

        https://review.openstack.org/#/c/129090/

SecurityImpact

Change-Id: I9ef57a86b1a1c1fa4ba1a034c920f23cb40072c0
Implements: blueprint arp-spoof-patch-ebtables
Related-Bug: 1274034
Co-Authored-By: jbrendel <jbrendel@cisco.com>
9 years agoFix test discovery for api and functional paths
Maru Newby [Fri, 17 Apr 2015 23:49:09 +0000 (23:49 +0000)]
Fix test discovery for api and functional paths

The use of the builtin unittest test loader was silently dropping tests
that couldn't be imported.

This change also drops the retargetable path from discovery in the api
path due to a previously-masked configuration problem, and fixes an
invalid import in a functional testing fixture module.

Fullstack tests are also disabled temporarily pending a fix for #1446261.

Change-Id: Ie44e45c117bd864538e7919dfcf499091fde7752
Related-Bug: #1440834
Related-Bug: #1443480
Closes-Bug: #1446405

9 years agoBlock allowed address pairs on other tenants' net
Kevin Benton [Tue, 21 Apr 2015 09:01:39 +0000 (02:01 -0700)]
Block allowed address pairs on other tenants' net

Don't allow tenants to use the allowed address pairs extension
when they are attaching a port to a network that does not belong
to them.

This is done because allowed address pairs can allow things like
ARP spoofing and all tenants attached to a shared network might not
implicitly trust each other.

Change-Id: Ie6c3e8ad04103804e40f2b043202387385e62ca5
Closes-Bug: #1447242

9 years agotests: confirm that _output_hosts_file does not log too often
Ihar Hrachyshka [Mon, 20 Apr 2015 15:06:38 +0000 (17:06 +0200)]
tests: confirm that _output_hosts_file does not log too often

I3ad7864eeb2f959549ed356a1e34fa18804395cc didn't include any regression unit
tests to validate that the method won't ever log too often again,
reintroducing performance drop in later patches. It didn't play well
with stable backports of the fix, where context was lost when doing the
backport, that left the bug unfixed in stable/juno even though the patch
was merged there [1].

The patch adds an explicit note in the code that suggests not to add new
log messages inside the loop to avoid regression, and a unit test was
added to capture it.

Once the test is merged in master, it will be proposed for stable/juno
inclusion, with additional changes that would fix the regression again.

Related-Bug: #1414218
Change-Id: I5d43021932d6a994638c348eda277dd8337cf041

9 years agoMerge "Fix super cleanUp for fullstack ProcessFixture"
Jenkins [Tue, 21 Apr 2015 16:44:07 +0000 (16:44 +0000)]
Merge "Fix super cleanUp for fullstack ProcessFixture"

9 years agoMerge "Only call get_engine().pool.dispose if _FACADE"
Jenkins [Tue, 21 Apr 2015 16:43:54 +0000 (16:43 +0000)]
Merge "Only call get_engine().pool.dispose if _FACADE"

9 years agoFix super cleanUp for fullstack ProcessFixture
Henry Gessau [Tue, 21 Apr 2015 15:35:10 +0000 (11:35 -0400)]
Fix super cleanUp for fullstack ProcessFixture

This fixes a problem where the fullstack neutro-server process
would sometimes not be stopped after tests completed.

Change-Id: Iadf9f47fc22b39144cfc6163330ca60fefc8b464

9 years agoAdd security groups events
armando-migliaccio [Thu, 16 Apr 2015 19:45:32 +0000 (12:45 -0700)]
Add security groups events

ML2 mech drivers have no direct exposure to security groups,
and they can only infer them from the associated network/ports.
This is problematic as agentless ML2 mech drivers have no way of
intercepting securitygroups events and propagate the information
to their backend, or more generally, react to them.

This patch leverages the callback registry to dispatch such events
so that interested ML2 mech drivers (or any interested party like
service plugins) can be notified and react accordingly.

This patch addresses create/update/delete of security groups and
create/delete of security groups rules. Other events may be added
over time, if need be.

This patch is only about emitting the events. The actual subscription
and implementation of the event handlers will have to take place where
deemed appropriate.

Closes-bug: #1444112

Change-Id: Ifa1d7ee9c967576f824f1129dd68e6e3abd48f5c

9 years agoMerge "Revive BaseLinuxTestCase._create_namespace"
Jenkins [Tue, 21 Apr 2015 15:03:15 +0000 (15:03 +0000)]
Merge "Revive BaseLinuxTestCase._create_namespace"

9 years agoBlock subnet create with mismatched IP versions
Ryan Tidwell [Tue, 14 Apr 2015 22:53:02 +0000 (15:53 -0700)]
Block subnet create with mismatched IP versions

Change-Id: Ic0a3baf0e956505999d2473ae85ebac90e0970cd
Closes-Bug: 1444146

9 years agoRemove neutron.tests.common.agents package
Jakub Libosvar [Tue, 21 Apr 2015 14:44:58 +0000 (16:44 +0200)]
Remove neutron.tests.common.agents package

It seems like agents' package content was removed by commit
01a7ba19cf6661b1aef7d08fb748bb2470caf28f but package itself was left in
the tree.

Change-Id: I651f8010aa7c4af59ce403b099db7bc064364133

9 years agoL3 DB: Defer port DB subnet lookups
Kevin Benton [Fri, 17 Apr 2015 11:46:11 +0000 (04:46 -0700)]
L3 DB: Defer port DB subnet lookups

_populate_subnets_for_ports was being called multiple
times for different interface types during the get_routers
process.

This patch eliminates those extra queries by deferring the
subnet information population until after all of the interfaces
have been looked up. Includes a function rename as well to
indicate that a function is only used internally.

Change-Id: Ib46f685d72eb61ecbaa2869e28fb173cd6d49552
Partial-bug: #1445412

9 years agoOnly update MTU in update code for MTU
Kevin Benton [Tue, 21 Apr 2015 05:26:22 +0000 (22:26 -0700)]
Only update MTU in update code for MTU

The ML2 create_network_db was re-passing in the entire network
with extensions like vlan_transparency present that was causing
issues in the base update function it was calling.

This corrects the behavior by having it only update the MTU, which
is the only thing it was intending to update in the first place.

Change-Id: I723c5c138e0830de98f6024c7635ec65065e9346
Closes-Bug: #1446784

9 years agoRevive BaseLinuxTestCase._create_namespace
YAMAMOTO Takashi [Tue, 21 Apr 2015 05:07:08 +0000 (14:07 +0900)]
Revive BaseLinuxTestCase._create_namespace

It was removed by commit 7f7343b1afc0b1b953e5c36a753397a6d37316cb
but still have a few users.

Closes-Bug: #1446465
Change-Id: I2914700f17ae38a775735906931f0f616c13c602

9 years agoMerge "_create_subnet_from_implicit_pool assumes external network extension"
Jenkins [Tue, 21 Apr 2015 04:19:47 +0000 (04:19 +0000)]
Merge "_create_subnet_from_implicit_pool assumes external network extension"

9 years agoMerge "Log caught exceptions while deleting a router"
Jenkins [Tue, 21 Apr 2015 04:10:55 +0000 (04:10 +0000)]
Merge "Log caught exceptions while deleting a router"

9 years agoMerge "Strip unnecessary overrides in extraroute_db mixin"
Jenkins [Tue, 21 Apr 2015 03:55:12 +0000 (03:55 +0000)]
Merge "Strip unnecessary overrides in extraroute_db mixin"

9 years agoMerge "Define FakeMachine helper for functional/fullstack tests"
Jenkins [Tue, 21 Apr 2015 03:52:17 +0000 (03:52 +0000)]
Merge "Define FakeMachine helper for functional/fullstack tests"

9 years agoDefer creation of router JSON in get_routers RPC
Kevin Benton [Fri, 17 Apr 2015 10:53:45 +0000 (03:53 -0700)]
Defer creation of router JSON in get_routers RPC

The get_routers method in the l3 RPC code has a log.debug
statement that formats all of the router data as indented
JSON. This method can be expensive if there are hundreds
of routers being synced and it happens even if debugging
is disabled since the function call result is the parameter
to the debug statement.

This patch adds and leverages a small helper class that takes a
callable and its args and defers calling it until the __str__ method
is called on it when it's actually trying to be rendered to a string.

Change-Id: I2bfceb286ce30f2a3595381b62bdc6dd71ed8483
Partial-Bug: #1445412

9 years agoovs_lib: Fix a race between get_port_tag_dict and port removal
YAMAMOTO Takashi [Thu, 16 Apr 2015 04:39:55 +0000 (13:39 +0900)]
ovs_lib: Fix a race between get_port_tag_dict and port removal

get_port_tag_dict() gets a list of ports using get_port_name_list()
and then queries the db again for ports in the list.
It fails if some of ports disappeared in between.
This change fixes it by ignoring "not exist" errors in the later query.

Closes-Bug: #1444797
Change-Id: Ic54b644bb1d72a4664b70f124863d17805c26fff

9 years agoMerge "Replace custom method call logger with oslo.log helper"
Jenkins [Mon, 20 Apr 2015 20:21:22 +0000 (20:21 +0000)]
Merge "Replace custom method call logger with oslo.log helper"

9 years ago_create_subnet_from_implicit_pool assumes external network extension
Aaron Rosen [Mon, 20 Apr 2015 19:45:12 +0000 (12:45 -0700)]
_create_subnet_from_implicit_pool assumes external network extension

network.external is only present if one is using the external_net_db
mixin. This patch just adds a check to see network has the attribute
external to avoid an Attribute error.

Closes-bug: 1441793
Change-Id: Ic003879b557a8c7ab52268a95d08d6d710618438

9 years agoLog caught exceptions while deleting a router
Assaf Muller [Mon, 20 Apr 2015 19:15:34 +0000 (15:15 -0400)]
Log caught exceptions while deleting a router

Change-Id: I2c270f1eebf4f3c0d2cecdef457efc626e503975
Closes-Bug: #1446349

9 years agoMerge "Avoid double-hopping deletes for security group rules"
Jenkins [Mon, 20 Apr 2015 19:16:45 +0000 (19:16 +0000)]
Merge "Avoid double-hopping deletes for security group rules"

9 years agoMerge "Clarify the init logic for the ML2 plugin"
Jenkins [Mon, 20 Apr 2015 19:13:22 +0000 (19:13 +0000)]
Merge "Clarify the init logic for the ML2 plugin"

9 years agoDefine FakeMachine helper for functional/fullstack tests
Cedric Brandily [Sun, 1 Mar 2015 22:08:58 +0000 (22:08 +0000)]
Define FakeMachine helper for functional/fullstack tests

The change defines the FakeMachine fixture/helper which emulates a
machine through a namespace with:
* a port bound to a bridge,
* an ip on the port,
* a gateway (if requested).

The FakeMachine class can be used to emulate:
* a VM for testing network features (ex: metadata service),
* an external machine for testing "external" network features (ex:
  routing/natting),
* a server for low level tests of network features (ex: iptables).

The change also defines PeerMachines fixture/helper to create some fake
machines bound to a bridge.

Change-Id: I4fde1a03badd9adfd14b9124b5602331b69dda9d

9 years agoReplace custom method call logger with oslo.log helper
Ihar Hrachyshka [Mon, 30 Mar 2015 16:41:28 +0000 (18:41 +0200)]
Replace custom method call logger with oslo.log helper

oslo.log now provides a logging helper that is similar to custom neutron
helper (actually, the helper in oslo.log started from neutron version).

Now switching to library implementation.

Deprecated neutron.common.log.log

Change-Id: I85d5fc570950ff18cfdb8db20ad20b166e195299

9 years agoMerge "Add Kilo release milestone"
Jenkins [Mon, 20 Apr 2015 10:50:21 +0000 (10:50 +0000)]
Merge "Add Kilo release milestone"

9 years agoMerge "Drop the ovs_lib compat layer as per TODO note"
Jenkins [Mon, 20 Apr 2015 10:12:36 +0000 (10:12 +0000)]
Merge "Drop the ovs_lib compat layer as per TODO note"

9 years agoMerge "Correct typo for matching non-dict ovsdb rows"
Jenkins [Mon, 20 Apr 2015 07:34:32 +0000 (07:34 +0000)]
Merge "Correct typo for matching non-dict ovsdb rows"

9 years agoSimplify keepalived.virtual_routes
Assaf Muller [Mon, 2 Mar 2015 16:29:51 +0000 (11:29 -0500)]
Simplify keepalived.virtual_routes

keepalived.virtual_routes previously held one list of virtual
routes of different kinds, and the HA router class manipulated
that list directly. The list held both the default gateway
virtual route, and any extra routes. This means that when adding
extra routes for example, the HA router would first have to
remove all routes that are not default gateway routes, then add
the extra routes received via RPC.

This is messy because:
a) It's needlessly complicated
b) It's fragile
c) There's zero separation of concerns (HA router should not know
   how keepalived maintains its list of virtual routes)
d) It requires changes to the management of the default gateway
   and virtual routes just to add another type of extra routes

This patch solves these issues by separating the persistency of
virtual routes according to their role.

Co-Authored-By: gong yong sheng <gong.yongsheng@99cloud.net>
Related-Bug: 1414640
Change-Id: I1406b1876c3a47b110818686b42e5f2f688154fa

9 years agoMerge "Enhance OVSDB Transaction timeout configuration"
Jenkins [Sun, 19 Apr 2015 05:13:47 +0000 (05:13 +0000)]
Merge "Enhance OVSDB Transaction timeout configuration"

9 years agoMerge "Add full-stack test"
Jenkins [Sat, 18 Apr 2015 13:15:14 +0000 (13:15 +0000)]
Merge "Add full-stack test"

9 years agoMerge "Add some more comments to models/frozen.py"
Jenkins [Sat, 18 Apr 2015 08:25:37 +0000 (08:25 +0000)]
Merge "Add some more comments to models/frozen.py"

9 years agoMerge "Deal with TODO related to Security Groups RPC API's classes"
Jenkins [Sat, 18 Apr 2015 05:13:09 +0000 (05:13 +0000)]
Merge "Deal with TODO related to Security Groups RPC API's classes"

9 years agoMerge "Set loading strategy to joined for Routerport/Port"
Jenkins [Sat, 18 Apr 2015 03:54:18 +0000 (03:54 +0000)]
Merge "Set loading strategy to joined for Routerport/Port"

9 years agoMerge "Revert connection option post full-stack tests"
Jenkins [Sat, 18 Apr 2015 01:51:18 +0000 (01:51 +0000)]
Merge "Revert connection option post full-stack tests"

9 years agoMerge "create_resource should return maximum length str"
Jenkins [Sat, 18 Apr 2015 01:51:02 +0000 (01:51 +0000)]
Merge "create_resource should return maximum length str"