Browse Source

Merge "Remove deprecated 'external_network_bridge' option"

Zuul 1 month ago
parent
commit
7198fb6a0a
39 changed files with 115 additions and 304 deletions
  1. 1
    1
      doc/source/admin/config-az.rst
  2. 0
    6
      doc/source/admin/config-dvr-ha-snat.rst
  3. 4
    5
      doc/source/admin/config-services-agent.rst
  4. 0
    6
      doc/source/admin/deploy-lb-ha-vrrp.rst
  5. 0
    6
      doc/source/admin/deploy-lb-selfservice.rst
  6. 0
    10
      doc/source/admin/deploy-ovs-ha-dvr.rst
  7. 0
    6
      doc/source/admin/deploy-ovs-ha-vrrp.rst
  8. 0
    6
      doc/source/admin/deploy-ovs-selfservice.rst
  9. 3
    3
      doc/source/contributor/internals/services_and_agents.rst
  10. 0
    14
      neutron/agent/l3/agent.py
  11. 0
    2
      neutron/agent/l3/dvr_edge_router.py
  12. 0
    14
      neutron/agent/l3/dvr_fip_ns.py
  13. 0
    1
      neutron/agent/l3/dvr_snat_ns.py
  14. 0
    1
      neutron/agent/l3/ha_router.py
  15. 0
    1
      neutron/agent/l3/namespaces.py
  16. 0
    12
      neutron/agent/l3/router_info.py
  17. 0
    15
      neutron/agent/linux/interface.py
  18. 1
    2
      neutron/cmd/ovs_cleanup.py
  19. 0
    11
      neutron/conf/agent/common.py
  20. 4
    9
      neutron/conf/agent/l3/config.py
  21. 1
    11
      neutron/db/l3_db.py
  22. 1
    11
      neutron/debug/debug_agent.py
  23. 0
    1
      neutron/debug/shell.py
  24. 3
    7
      neutron/tests/common/helpers.py
  25. 13
    0
      neutron/tests/fullstack/base.py
  26. 3
    11
      neutron/tests/fullstack/resources/config.py
  27. 3
    7
      neutron/tests/fullstack/resources/environment.py
  28. 4
    14
      neutron/tests/fullstack/test_l3_agent.py
  29. 6
    13
      neutron/tests/functional/agent/l3/framework.py
  30. 6
    10
      neutron/tests/functional/agent/l3/test_dvr_router.py
  31. 23
    0
      neutron/tests/functional/agent/l3/test_ha_router.py
  32. 6
    33
      neutron/tests/functional/agent/l3/test_legacy_router.py
  33. 17
    21
      neutron/tests/functional/cmd/test_ovs_cleanup.py
  34. 2
    8
      neutron/tests/unit/agent/l3/test_agent.py
  35. 0
    5
      neutron/tests/unit/agent/l3/test_dvr_fip_ns.py
  36. 4
    4
      neutron/tests/unit/agent/l3/test_dvr_local_router.py
  37. 3
    15
      neutron/tests/unit/debug/test_commands.py
  38. 1
    2
      neutron/tests/unit/extensions/test_l3.py
  39. 6
    0
      releasenotes/notes/external_network_bridge-option-removed-bbf50fb803f04f82.yaml

+ 1
- 1
doc/source/admin/config-az.rst View File

@@ -94,7 +94,7 @@ To confirm the agent's availability zone:
94 94
     | availability_zone   | zone-1                                          |
95 95
     | binary              | neutron-l3-agent                                |
96 96
     | configurations      | agent_mode='legacy', ex_gw_ports='2',           |
97
-    |                     | external_network_bridge='', floating_ips='0',   |
97
+    |                     | floating_ips='0',                               |
98 98
     |                     | gateway_external_network_id='',                 |
99 99
     |                     | handle_internal_only_routers='True',            |
100 100
     |                     | interface_driver='openvswitch', interfaces='4', |

+ 0
- 6
doc/source/admin/config-dvr-ha-snat.rst View File

@@ -136,13 +136,8 @@ Network nodes
136 136
       [DEFAULT]
137 137
       ha_vrrp_auth_password = password
138 138
       interface_driver = openvswitch
139
-      external_network_bridge =
140 139
       agent_mode = dvr_snat
141 140
 
142
-   .. note::
143
-
144
-      The ``external_network_bridge`` option intentionally contains
145
-      no value.
146 141
 
147 142
 Compute nodes
148 143
 -------------
@@ -170,7 +165,6 @@ Compute nodes
170 165
 
171 166
       [DEFAULT]
172 167
       interface_driver = openvswitch
173
-      external_network_bridge =
174 168
       agent_mode = dvr
175 169
 
176 170
    Replace ``TUNNEL_INTERFACE_IP_ADDRESS`` with the IP address of the interface

+ 4
- 5
doc/source/admin/config-services-agent.rst View File

@@ -39,8 +39,7 @@ should be instructed to act upon these values through RPC.
39 39
 Each individual agent may have its own configuration file. This file should be
40 40
 loaded after the main ``neutron.conf`` file, so the agent configuration takes
41 41
 precedence. The agent-specific configuration may contain configurations which
42
-vary between hosts in a neutron deployment such as the
43
-``external_network_bridge`` for an L3 agent. If any agent requires access to
44
-additional external services beyond the neutron RPC, those endpoints should be
45
-defined in the agent-specific configuration file (for example, nova metadata
46
-for metadata agent).
42
+vary between hosts in a neutron deployment such as the ``local_ip`` for an L2
43
+agent. If any agent requires access to additional external services beyond the
44
+neutron RPC, those endpoints should be defined in the agent-specific
45
+configuration file (for example, nova metadata for metadata agent).

+ 0
- 6
doc/source/admin/deploy-lb-ha-vrrp.rst View File

@@ -118,12 +118,6 @@ Network node 2
118 118
 
119 119
       [DEFAULT]
120 120
       interface_driver = linuxbridge
121
-      external_network_bridge =
122
-
123
-   .. note::
124
-
125
-      The ``external_network_bridge`` option intentionally contains
126
-      no value.
127 121
 
128 122
 #. Start the following services:
129 123
 

+ 0
- 6
doc/source/admin/deploy-lb-selfservice.rst View File

@@ -146,12 +146,6 @@ Network node
146 146
 
147 147
       [DEFAULT]
148 148
       interface_driver = linuxbridge
149
-      external_network_bridge =
150
-
151
-   .. note::
152
-
153
-      The ``external_network_bridge`` option intentionally contains
154
-      no value.
155 149
 
156 150
 #. Start the following services:
157 151
 

+ 0
- 10
doc/source/admin/deploy-ovs-ha-dvr.rst View File

@@ -97,10 +97,6 @@ Network node
97 97
       [DEFAULT]
98 98
       agent_mode = dvr_snat
99 99
 
100
-   .. note::
101
-
102
-      The ``external_network_bridge`` option intentionally contains
103
-      no value.
104 100
 
105 101
 #. Restart the following services:
106 102
 
@@ -125,14 +121,8 @@ Compute nodes
125 121
 
126 122
       [DEFAULT]
127 123
       interface_driver = openvswitch
128
-      external_network_bridge =
129 124
       agent_mode = dvr
130 125
 
131
-   .. note::
132
-
133
-      The ``external_network_bridge`` option intentionally contains
134
-      no value.
135
-
136 126
 #. Restart the following services:
137 127
 
138 128
    * Open vSwitch agent

+ 0
- 6
doc/source/admin/deploy-ovs-ha-vrrp.rst View File

@@ -119,12 +119,6 @@ Network node 2
119 119
 
120 120
       [DEFAULT]
121 121
       interface_driver = openvswitch
122
-      external_network_bridge =
123
-
124
-   .. note::
125
-
126
-      The ``external_network_bridge`` option intentionally contains
127
-      no value.
128 122
 
129 123
 #. Start the following services:
130 124
 

+ 0
- 6
doc/source/admin/deploy-ovs-selfservice.rst View File

@@ -150,12 +150,6 @@ Network node
150 150
 
151 151
       [DEFAULT]
152 152
       interface_driver = openvswitch
153
-      external_network_bridge =
154
-
155
-   .. note::
156
-
157
-      The ``external_network_bridge`` option intentionally contains
158
-      no value.
159 153
 
160 154
 #. Start the following services:
161 155
 

+ 3
- 3
doc/source/contributor/internals/services_and_agents.rst View File

@@ -103,7 +103,7 @@ should be instructed to act upon these values via RPC.
103 103
 Each individual agent may have its own configuration file. This file should be
104 104
 loaded after the main ```neutron.conf``` file, so the agent configuration takes
105 105
 precedence. The agent specific configuration may contain configurations which
106
-vary between hosts in a Neutron deployment such as the external_network_bridge
107
-for a L3 agent. If any agent requires access to additional external services
108
-beyond the Neutron RPC, those endpoints should be defined in the agent specific
106
+vary between hosts in a Neutron deployment such as the ``local_ip`` for an L2
107
+agent. If any agent requires access to additional external services beyond the
108
+neutron RPC, those endpoints should be defined in the agent-specific
109 109
 configuration file (e.g. nova metadata for metadata agent).

+ 0
- 14
neutron/agent/l3/agent.py View File

@@ -50,7 +50,6 @@ from neutron.agent.l3 import l3_agent_extensions_manager as l3_ext_manager
50 50
 from neutron.agent.l3 import legacy_router
51 51
 from neutron.agent.l3 import namespace_manager
52 52
 from neutron.agent.linux import external_process
53
-from neutron.agent.linux import ip_lib
54 53
 from neutron.agent.linux import pd
55 54
 from neutron.agent.linux import utils as linux_utils
56 55
 from neutron.agent.metadata import driver as metadata_driver
@@ -359,12 +358,6 @@ class L3NATAgent(ha.AgentMixin,
359 358
         if self.conf.gateway_external_network_id:
360 359
             return self.conf.gateway_external_network_id
361 360
 
362
-        # L3 agent doesn't use external_network_bridge to handle external
363
-        # networks, so bridge_mappings with provider networks will be used
364
-        # and the L3 agent is able to handle any external networks.
365
-        if not self.conf.external_network_bridge:
366
-            return
367
-
368 361
         if not force and self.target_ex_net_id:
369 362
             return self.target_ex_net_id
370 363
 
@@ -546,12 +539,6 @@ class L3NATAgent(ha.AgentMixin,
546 539
                 self._resync_router(update)
547 540
 
548 541
     def _process_router_if_compatible(self, router):
549
-        if (self.conf.external_network_bridge and
550
-                not ip_lib.device_exists(self.conf.external_network_bridge)):
551
-            LOG.error("The external network bridge '%s' does not exist",
552
-                      self.conf.external_network_bridge)
553
-            return
554
-
555 542
         # Either ex_net_id or handle_internal_only_routers must be set
556 543
         ex_net_id = (router['external_gateway_info'] or {}).get('network_id')
557 544
         if not ex_net_id and not self.conf.handle_internal_only_routers:
@@ -867,7 +854,6 @@ class L3NATAgentWithStateReport(L3NATAgent):
867 854
                 'agent_mode': self.conf.agent_mode,
868 855
                 'handle_internal_only_routers':
869 856
                 self.conf.handle_internal_only_routers,
870
-                'external_network_bridge': self.conf.external_network_bridge,
871 857
                 'gateway_external_network_id':
872 858
                 self.conf.gateway_external_network_id,
873 859
                 'interface_driver': self.conf.interface_driver,

+ 0
- 2
neutron/agent/l3/dvr_edge_router.py View File

@@ -95,7 +95,6 @@ class DvrEdgeRouter(dvr_local_router.DvrLocalRouter):
95 95
             return
96 96
 
97 97
         self.driver.unplug(interface_name,
98
-                           bridge=self.agent_conf.external_network_bridge,
99 98
                            namespace=self.snat_namespace.name,
100 99
                            prefix=router.EXTERNAL_DEV_PREFIX)
101 100
 
@@ -270,7 +269,6 @@ class DvrEdgeRouter(dvr_local_router.DvrLocalRouter):
270 269
                 LOG.debug('Deleting stale external router device: %s', d.name)
271 270
                 self.driver.unplug(
272 271
                     d.name,
273
-                    bridge=self.agent_conf.external_network_bridge,
274 272
                     namespace=self.snat_namespace.name,
275 273
                     prefix=router.EXTERNAL_DEV_PREFIX)
276 274
 

+ 0
- 14
neutron/agent/l3/dvr_fip_ns.py View File

@@ -163,19 +163,9 @@ class FipNamespace(namespaces.Namespace):
163 163
                          ex_gw_port['id'],
164 164
                          interface_name,
165 165
                          ex_gw_port['mac_address'],
166
-                         bridge=self.agent_conf.external_network_bridge,
167 166
                          namespace=ns_name,
168 167
                          prefix=FIP_EXT_DEV_PREFIX,
169 168
                          mtu=ex_gw_port.get('mtu'))
170
-        if self.agent_conf.external_network_bridge:
171
-            # NOTE(Swami): for OVS implementations remove the DEAD VLAN tag
172
-            # on ports. DEAD VLAN tag is added to each newly created port
173
-            # and should be removed by L2 agent but if
174
-            # external_network_bridge is set than external gateway port is
175
-            # created in this bridge and will not be touched by L2 agent.
176
-            # This is related to lp#1767422
177
-            self.driver.remove_vlan_tag(
178
-                self.agent_conf.external_network_bridge, interface_name)
179 169
         # Remove stale fg devices
180 170
         ip_wrapper = ip_lib.IPWrapper(namespace=ns_name)
181 171
         devices = ip_wrapper.get_devices()
@@ -183,9 +173,7 @@ class FipNamespace(namespaces.Namespace):
183 173
             name = device.name
184 174
             if name.startswith(FIP_EXT_DEV_PREFIX) and name != interface_name:
185 175
                 LOG.debug('DVR: unplug: %s', name)
186
-                ext_net_bridge = self.agent_conf.external_network_bridge
187 176
                 self.driver.unplug(name,
188
-                                   bridge=ext_net_bridge,
189 177
                                    namespace=ns_name,
190 178
                                    prefix=FIP_EXT_DEV_PREFIX)
191 179
 
@@ -232,9 +220,7 @@ class FipNamespace(namespaces.Namespace):
232 220
                 # single port from FIP NS to br-ext
233 221
                 # TODO(carl) Where does the port get deleted?
234 222
                 LOG.debug('DVR: unplug: %s', d.name)
235
-                ext_net_bridge = self.agent_conf.external_network_bridge
236 223
                 self.driver.unplug(d.name,
237
-                                   bridge=ext_net_bridge,
238 224
                                    namespace=self.name,
239 225
                                    prefix=FIP_EXT_DEV_PREFIX)
240 226
 

+ 0
- 1
neutron/agent/l3/dvr_snat_ns.py View File

@@ -53,7 +53,6 @@ class SnatNamespace(namespaces.Namespace):
53 53
             elif d.name.startswith(namespaces.EXTERNAL_DEV_PREFIX):
54 54
                 self.driver.unplug(
55 55
                     d.name,
56
-                    bridge=self.agent_conf.external_network_bridge,
57 56
                     namespace=self.name,
58 57
                     prefix=namespaces.EXTERNAL_DEV_PREFIX)
59 58
 

+ 0
- 1
neutron/agent/l3/ha_router.py View File

@@ -449,7 +449,6 @@ class HaRouter(router.RouterInfo):
449 449
         else:
450 450
             # We are not the master node, so no need to delete ip addresses.
451 451
             self.driver.unplug(interface_name,
452
-                               bridge=self.agent_conf.external_network_bridge,
453 452
                                namespace=self.ns_name,
454 453
                                prefix=router.EXTERNAL_DEV_PREFIX)
455 454
 

+ 0
- 1
neutron/agent/l3/namespaces.py View File

@@ -143,7 +143,6 @@ class RouterNamespace(Namespace):
143 143
             elif d.name.startswith(EXTERNAL_DEV_PREFIX):
144 144
                 self.driver.unplug(
145 145
                     d.name,
146
-                    bridge=self.agent_conf.external_network_bridge,
147 146
                     namespace=self.name,
148 147
                     prefix=EXTERNAL_DEV_PREFIX)
149 148
 

+ 0
- 12
neutron/agent/l3/router_info.py View File

@@ -661,19 +661,9 @@ class RouterInfo(object):
661 661
                          ex_gw_port['id'],
662 662
                          interface_name,
663 663
                          ex_gw_port['mac_address'],
664
-                         bridge=self.agent_conf.external_network_bridge,
665 664
                          namespace=ns_name,
666 665
                          prefix=EXTERNAL_DEV_PREFIX,
667 666
                          mtu=ex_gw_port.get('mtu'))
668
-        if self.agent_conf.external_network_bridge:
669
-            # NOTE(slaweq): for OVS implementations remove the DEAD VLAN tag
670
-            # on ports. DEAD VLAN tag is added to each newly created port
671
-            # and should be removed by L2 agent but if
672
-            # external_network_bridge is set than external gateway port is
673
-            # created in this bridge and will not be touched by L2 agent.
674
-            # This is related to lp#1767422
675
-            self.driver.remove_vlan_tag(
676
-                self.agent_conf.external_network_bridge, interface_name)
677 667
 
678 668
     def _get_external_gw_ips(self, ex_gw_port):
679 669
         gateway_ips = []
@@ -802,7 +792,6 @@ class RouterInfo(object):
802 792
                                                 ip_addr['ip_address'],
803 793
                                                 prefixlen))
804 794
         self.driver.unplug(interface_name,
805
-                           bridge=self.agent_conf.external_network_bridge,
806 795
                            namespace=self.ns_name,
807 796
                            prefix=EXTERNAL_DEV_PREFIX)
808 797
 
@@ -819,7 +808,6 @@ class RouterInfo(object):
819 808
             LOG.debug('Deleting stale external router device: %s', stale_dev)
820 809
             self.agent.pd.remove_gw_interface(self.router['id'])
821 810
             self.driver.unplug(stale_dev,
822
-                               bridge=self.agent_conf.external_network_bridge,
823 811
                                namespace=self.ns_name,
824 812
                                prefix=EXTERNAL_DEV_PREFIX)
825 813
 

+ 0
- 15
neutron/agent/linux/interface.py View File

@@ -238,17 +238,6 @@ class LinuxInterfaceDriver(object):
238 238
     def get_device_name(self, port):
239 239
         return (self.DEV_NAME_PREFIX + port.id)[:self.DEV_NAME_LEN]
240 240
 
241
-    def remove_vlan_tag(self, bridge, interface_name):
242
-        """Remove vlan tag from given interface.
243
-
244
-        This method is necessary only for the case when deprecated
245
-        option 'external_network_bridge' is used in L3 agent as
246
-        external gateway port is then created in this external bridge
247
-        directly and it will have DEAD_VLAN_TAG added by default.
248
-        """
249
-        # TODO(slaweq): remove it when external_network_bridge option will be
250
-        # removed
251
-
252 241
     @staticmethod
253 242
     def configure_ipv6_ra(namespace, dev_name, value):
254 243
         """Configure handling of IPv6 Router Advertisements on an
@@ -348,10 +337,6 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
348 337
         ovs = ovs_lib.OVSBridge(bridge)
349 338
         ovs.replace_port(device_name, *attrs)
350 339
 
351
-    def remove_vlan_tag(self, bridge, interface):
352
-        ovs = ovs_lib.OVSBridge(bridge)
353
-        ovs.clear_db_attribute("Port", interface, "tag")
354
-
355 340
     def plug_new(self, network_id, port_id, device_name, mac_address,
356 341
                  bridge=None, namespace=None, prefix=None, mtu=None):
357 342
         """Plug in the interface."""

+ 1
- 2
neutron/cmd/ovs_cleanup.py View File

@@ -60,8 +60,7 @@ def main():
60 60
 
61 61
 
62 62
 def do_main(conf):
63
-    configuration_bridges = set([conf.ovs_integration_bridge,
64
-                                 conf.external_network_bridge])
63
+    configuration_bridges = set([conf.ovs_integration_bridge])
65 64
     ovs = ovs_lib.BaseOVS()
66 65
     ovs_bridges = set(ovs.get_bridges())
67 66
     available_configuration_bridges = configuration_bridges & ovs_bridges

+ 0
- 11
neutron/conf/agent/common.py View File

@@ -154,17 +154,6 @@ AVAILABILITY_ZONE_OPTS = [
154 154
                help=_("Availability zone of this node")),
155 155
 ]
156 156
 
157
-EXT_NET_BRIDGE_OPTS = [
158
-    cfg.StrOpt('external_network_bridge', default='',
159
-               deprecated_for_removal=True,
160
-               help=_("Name of bridge used for external network "
161
-                      "traffic. When this parameter is set, the L3 agent will "
162
-                      "plug an interface directly into an external bridge "
163
-                      "which will not allow any wiring by the L2 agent. Using "
164
-                      "this will result in incorrect port statuses. This "
165
-                      "option is deprecated and will be removed in Ocata."))
166
-]
167
-
168 157
 
169 158
 def get_log_args(conf, log_file_name, **kwargs):
170 159
     cmd_args = []

+ 4
- 9
neutron/conf/agent/l3/config.py View File

@@ -18,7 +18,6 @@ from neutron_lib import constants
18 18
 from oslo_config import cfg
19 19
 
20 20
 from neutron._i18n import _
21
-from neutron.conf.agent import common as config
22 21
 
23 22
 
24 23
 OPTS = [
@@ -58,12 +57,10 @@ OPTS = [
58 57
                        "False for all agents if all routers must have an "
59 58
                        "external network gateway.")),
60 59
     cfg.StrOpt('gateway_external_network_id', default='',
61
-               help=_("When external_network_bridge is set, each L3 agent can "
62
-                      "be associated with no more than one external network. "
63
-                      "This value should be set to the UUID of that external "
64
-                      "network. To allow L3 agent support multiple external "
65
-                      "networks, both the external_network_bridge and "
66
-                      "gateway_external_network_id must be left empty."),
60
+               help=_("To allow the L3 agent to support multiple external "
61
+                      "networks, gateway_external_network_id must be left "
62
+                      "empty. Otherwise this value should be set to the UUID "
63
+                      "of the single external network to be used."),
67 64
                deprecated_for_removal=True),
68 65
     cfg.StrOpt('ipv6_gateway', default='',
69 66
                help=_("With IPv6, the network used for the external gateway "
@@ -103,8 +100,6 @@ OPTS = [
103 100
                       '0xffff so that only the lower 16 bits will be used.')),
104 101
 ]
105 102
 
106
-OPTS += config.EXT_NET_BRIDGE_OPTS
107
-
108 103
 
109 104
 def register_l3_agent_config_opts(opts, cfg=cfg.CONF):
110 105
     cfg.register_opts(opts)

+ 1
- 11
neutron/db/l3_db.py View File

@@ -303,13 +303,6 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
303 303
     def _check_router_needs_rescheduling(self, context, router_id, gw_info):
304 304
         """Checks whether router's l3 agent can handle the given network
305 305
 
306
-        When external_network_bridge is set, each L3 agent can be associated
307
-        with at most one external network. If router's new external gateway
308
-        is on other network then the router needs to be rescheduled to the
309
-        proper l3 agent.
310
-        If external_network_bridge is not set then the agent
311
-        can support multiple external networks and rescheduling is not needed
312
-
313 306
         :return: list of candidate agents if rescheduling needed,
314 307
         None otherwise; raises exception if there is no eligible l3 agent
315 308
         associated with target external network
@@ -344,10 +337,7 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
344 337
         for agent in cur_agents:
345 338
             ext_net_id = agent['configurations'].get(
346 339
                 'gateway_external_network_id')
347
-            ext_bridge = agent['configurations'].get(
348
-                'external_network_bridge', '')
349
-            if (ext_net_id == network_id or
350
-                    (not ext_net_id and not ext_bridge)):
340
+            if ext_net_id == network_id or not ext_net_id:
351 341
                 return
352 342
 
353 343
         # otherwise find l3 agent with matching gateway_external_network_id

+ 1
- 11
neutron/debug/debug_agent.py View File

@@ -43,9 +43,6 @@ class NeutronDebugAgent(object):
43 43
 
44 44
     def create_probe(self, network_id, device_owner='network'):
45 45
         network = self._get_network(network_id)
46
-        bridge = None
47
-        if network.external:
48
-            bridge = self.conf.external_network_bridge
49 46
 
50 47
         port = self._create_port(network, device_owner)
51 48
         interface_name = self.driver.get_device_name(port)
@@ -58,7 +55,6 @@ class NeutronDebugAgent(object):
58 55
                              port.id,
59 56
                              interface_name,
60 57
                              port.mac_address,
61
-                             bridge=bridge,
62 58
                              namespace=namespace)
63 59
         ip_cidrs = []
64 60
         for fixed_ip in port.fixed_ips:
@@ -94,22 +90,16 @@ class NeutronDebugAgent(object):
94 90
 
95 91
     def delete_probe(self, port_id):
96 92
         port = dhcp.DictModel(self.client.show_port(port_id)['port'])
97
-        network = self._get_network(port.network_id)
98
-        bridge = None
99
-        if network.external:
100
-            bridge = self.conf.external_network_bridge
101 93
         namespace = self._get_namespace(port)
102 94
         if ip_lib.network_namespace_exists(namespace):
103 95
             self.driver.unplug(self.driver.get_device_name(port),
104
-                               bridge=bridge,
105 96
                                namespace=namespace)
106 97
             try:
107 98
                 ip_lib.delete_network_namespace(namespace)
108 99
             except Exception:
109 100
                 LOG.warning('Failed to delete namespace %s', namespace)
110 101
         else:
111
-            self.driver.unplug(self.driver.get_device_name(port),
112
-                               bridge=bridge)
102
+            self.driver.unplug(self.driver.get_device_name(port))
113 103
         self.client.delete_port(port.id)
114 104
 
115 105
     def list_probes(self):

+ 0
- 1
neutron/debug/shell.py View File

@@ -71,7 +71,6 @@ class NeutronDebugShell(shell.NeutronShell):
71 71
                   " either --config-file or env[NEUTRON_TEST_CONFIG_FILE]"))
72 72
         client = self.client_manager.neutron
73 73
         config.register_interface_opts()
74
-        cfg.CONF.register_opts(config.EXT_NET_BRIDGE_OPTS)
75 74
         config.register_interface_driver_opts_helper(cfg.CONF)
76 75
         cfg.CONF(['--config-file', self.options.config_file])
77 76
         config.setup_logging()

+ 3
- 7
neutron/tests/common/helpers.py View File

@@ -58,8 +58,7 @@ class FakePlugin(common_db_mixin.CommonDbMixin,
58 58
 
59 59
 
60 60
 def _get_l3_agent_dict(host, agent_mode, internal_only=True,
61
-                       ext_net_id='', ext_bridge='',
62
-                       az=DEFAULT_AZ):
61
+                       ext_net_id='', az=DEFAULT_AZ):
63 62
     return {
64 63
         'agent_type': constants.AGENT_TYPE_L3,
65 64
         'binary': 'neutron-l3-agent',
@@ -68,7 +67,6 @@ def _get_l3_agent_dict(host, agent_mode, internal_only=True,
68 67
         'availability_zone': az,
69 68
         'configurations': {'agent_mode': agent_mode,
70 69
                            'handle_internal_only_routers': internal_only,
71
-                           'external_network_bridge': ext_bridge,
72 70
                            'gateway_external_network_id': ext_net_id}}
73 71
 
74 72
 
@@ -82,10 +80,8 @@ def _register_agent(agent, plugin=None):
82 80
 
83 81
 
84 82
 def register_l3_agent(host=HOST, agent_mode=constants.L3_AGENT_MODE_LEGACY,
85
-                      internal_only=True, ext_net_id='', ext_bridge='',
86
-                      az=DEFAULT_AZ):
87
-    agent = _get_l3_agent_dict(host, agent_mode, internal_only, ext_net_id,
88
-                               ext_bridge, az)
83
+                      internal_only=True, ext_net_id='', az=DEFAULT_AZ):
84
+    agent = _get_l3_agent_dict(host, agent_mode, internal_only, ext_net_id, az)
89 85
     return _register_agent(agent)
90 86
 
91 87
 

+ 13
- 0
neutron/tests/fullstack/base.py View File

@@ -23,6 +23,7 @@ from neutron.common import utils as common_utils
23 23
 from neutron.conf.agent import common as config
24 24
 from neutron.tests import base as tests_base
25 25
 from neutron.tests.common import helpers
26
+from neutron.tests.common import machine_fixtures
26 27
 from neutron.tests.common import net_helpers
27 28
 from neutron.tests.fullstack.resources import client as client_resource
28 29
 from neutron.tests import tools
@@ -137,3 +138,15 @@ class BaseFullStackTestCase(testlib_api.MySQLTestCaseMixin,
137 138
                     return available_ips
138 139
 
139 140
         self.fail("Cannot find enough free IP addresses.")
141
+
142
+    def _create_external_vm(self, network, subnet):
143
+        vm = self.useFixture(
144
+            machine_fixtures.FakeMachine(
145
+                self.environment.central_bridge,
146
+                common_utils.ip_to_cidr(subnet['gateway_ip'], 24)))
147
+        # NOTE(slaweq): as ext_net is 'vlan' network type external_vm needs to
148
+        # send packets with proper vlan also
149
+        vm.bridge.set_db_attribute(
150
+            "Port", vm.port.name,
151
+            "tag", network.get("provider:segmentation_id"))
152
+        return vm

+ 3
- 11
neutron/tests/fullstack/resources/config.py View File

@@ -166,11 +166,13 @@ class OVSConfigFixture(ConfigFixture):
166 166
             base_filename='openvswitch_agent.ini')
167 167
 
168 168
         self.tunneling_enabled = self.env_desc.tunneling_enabled
169
+        ext_dev = utils.get_rand_device_name(prefix='br-eth')
169 170
         self.config.update({
170 171
             'ovs': {
171 172
                 'local_ip': local_ip,
172 173
                 'integration_bridge': self._generate_integration_bridge(),
173 174
                 'of_interface': host_desc.of_interface,
175
+                'bridge_mappings': '%s:%s' % (PHYSICAL_NETWORK_NAME, ext_dev)
174 176
             },
175 177
             'securitygroup': {
176 178
                 'firewall_driver': host_desc.firewall_driver,
@@ -190,12 +192,9 @@ class OVSConfigFixture(ConfigFixture):
190 192
                 'int_peer_patch_port': self._generate_int_peer(),
191 193
                 'tun_peer_patch_port': self._generate_tun_peer()})
192 194
         else:
193
-            device = utils.get_rand_device_name(prefix='br-eth')
194
-            self.config['ovs']['bridge_mappings'] = '%s:%s' % (
195
-                    PHYSICAL_NETWORK_NAME, device)
196 195
             if env_desc.report_bandwidths:
197 196
                 self.config['ovs'][c_const.RP_BANDWIDTHS] = \
198
-                    '%s:%s:%s' % (device, MINIMUM_BANDWIDTH_EGRESS_KBPS,
197
+                    '%s:%s:%s' % (ext_dev, MINIMUM_BANDWIDTH_EGRESS_KBPS,
199 198
                                   MINIMUM_BANDWIDTH_INGRESS_KBPS)
200 199
 
201 200
         if env_desc.qos:
@@ -350,7 +349,6 @@ class L3ConfigFixture(ConfigFixture):
350 349
                 'interface_driver': ('neutron.agent.linux.interface.'
351 350
                                      'OVSInterfaceDriver'),
352 351
                 'ovs_integration_bridge': integration_bridge,
353
-                'external_network_bridge': self._generate_external_bridge(),
354 352
             }
355 353
         })
356 354
 
@@ -362,12 +360,6 @@ class L3ConfigFixture(ConfigFixture):
362 360
             }
363 361
         })
364 362
 
365
-    def _generate_external_bridge(self):
366
-        return utils.get_rand_device_name(prefix='br-ex')
367
-
368
-    def get_external_bridge(self):
369
-        return self.config.DEFAULT.external_network_bridge
370
-
371 363
 
372 364
 class DhcpConfigFixture(ConfigFixture):
373 365
 

+ 3
- 7
neutron/tests/fullstack/resources/environment.py View File

@@ -143,15 +143,15 @@ class Host(fixtures.Fixture):
143 143
             self.local_ip, test_name=self.test_name)
144 144
         self.useFixture(agent_cfg_fixture)
145 145
 
146
+        self.br_phys = self.useFixture(
147
+            net_helpers.OVSBridgeFixture(
148
+                agent_cfg_fixture.get_br_phys_name())).bridge
146 149
         if self.env_desc.tunneling_enabled:
147 150
             self.useFixture(
148 151
                 net_helpers.OVSBridgeFixture(
149 152
                     agent_cfg_fixture.get_br_tun_name())).bridge
150 153
             self.connect_to_central_network_via_tunneling()
151 154
         else:
152
-            self.br_phys = self.useFixture(
153
-                net_helpers.OVSBridgeFixture(
154
-                    agent_cfg_fixture.get_br_phys_name())).bridge
155 155
             self.connect_to_central_network_via_vlans(self.br_phys)
156 156
 
157 157
         self.ovs_agent = self.useFixture(
@@ -165,10 +165,6 @@ class Host(fixtures.Fixture):
165 165
                     self.env_desc, self.host_desc,
166 166
                     self.neutron_config.temp_dir,
167 167
                     self.ovs_agent.agent_cfg_fixture.get_br_int_name()))
168
-            br_ex = self.useFixture(
169
-                net_helpers.OVSBridgeFixture(
170
-                    self.l3_agent_cfg_fixture.get_external_bridge())).bridge
171
-            self.connect_to_central_network_via_vlans(br_ex)
172 168
 
173 169
         if self.host_desc.dhcp_agent:
174 170
             self.dhcp_agent_cfg_fixture = self.useFixture(

+ 4
- 14
neutron/tests/fullstack/test_l3_agent.py View File

@@ -25,7 +25,6 @@ from neutron.agent.l3 import namespaces
25 25
 from neutron.agent.linux import ip_lib
26 26
 from neutron.common import utils as common_utils
27 27
 from neutron.tests.common.exclusive_resources import ip_network
28
-from neutron.tests.common import machine_fixtures
29 28
 from neutron.tests.fullstack import base
30 29
 from neutron.tests.fullstack.resources import environment
31 30
 from neutron.tests.fullstack.resources import machine
@@ -80,10 +79,7 @@ class TestL3Agent(base.BaseFullStackTestCase):
80 79
     def _test_gateway_ip_changed(self):
81 80
         tenant_id = uuidutils.generate_uuid()
82 81
         ext_net, ext_sub = self._create_external_network_and_subnet(tenant_id)
83
-        external_vm = self.useFixture(
84
-            machine_fixtures.FakeMachine(
85
-                self.environment.central_bridge,
86
-                common_utils.ip_to_cidr(ext_sub['gateway_ip'], 24)))
82
+        external_vm = self._create_external_vm(ext_net, ext_sub)
87 83
 
88 84
         router = self.safe_client.create_router(tenant_id,
89 85
                                                 external_network=ext_net['id'])
@@ -209,10 +205,7 @@ class TestLegacyL3Agent(TestL3Agent):
209 205
         # 3. IPv6 ext connectivity: using ping6 from tenant vm to external_vm.
210 206
         tenant_id = uuidutils.generate_uuid()
211 207
         ext_net, ext_sub = self._create_external_network_and_subnet(tenant_id)
212
-        external_vm = self.useFixture(
213
-            machine_fixtures.FakeMachine(
214
-                self.environment.central_bridge,
215
-                common_utils.ip_to_cidr(ext_sub['gateway_ip'], 24)))
208
+        external_vm = self._create_external_vm(ext_net, ext_sub)
216 209
         # Create an IPv6 subnet in the external network
217 210
         v6network = self.useFixture(
218 211
             ip_network.ExclusiveIPNetwork(
@@ -278,7 +271,7 @@ class TestHAL3Agent(TestL3Agent):
278 271
             for _ in range(2)]
279 272
         env = environment.Environment(
280 273
             environment.EnvironmentDescription(
281
-                network_type='vxlan', l2_pop=True),
274
+                network_type='vlan', l2_pop=True),
282 275
             host_descriptions)
283 276
         super(TestHAL3Agent, self).setUp(env)
284 277
 
@@ -386,10 +379,7 @@ class TestHAL3Agent(TestL3Agent):
386 379
         router = self.safe_client.create_router(tenant_id, ha=True,
387 380
                                                 external_network=ext_net['id'])
388 381
 
389
-        external_vm = self.useFixture(
390
-            machine_fixtures.FakeMachine(
391
-                self.environment.central_bridge,
392
-                common_utils.ip_to_cidr(ext_sub['gateway_ip'], 24)))
382
+        external_vm = self._create_external_vm(ext_net, ext_sub)
393 383
 
394 384
         common_utils.wait_until_true(
395 385
             lambda:

+ 6
- 13
neutron/tests/functional/agent/l3/framework.py View File

@@ -79,9 +79,7 @@ class L3AgentTestFramework(base.BaseSudoTestCase):
79 79
         conf.set_override('interface_driver', self.INTERFACE_DRIVER)
80 80
 
81 81
         br_int = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
82
-        br_ex = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
83 82
         conf.set_override('ovs_integration_bridge', br_int.br_name)
84
-        conf.set_override('external_network_bridge', br_ex.br_name)
85 83
 
86 84
         temp_dir = self.get_new_temp_dir()
87 85
         get_temp_file_path = functools.partial(self.get_temp_file_path,
@@ -542,13 +540,8 @@ class L3AgentTestFramework(base.BaseSudoTestCase):
542 540
             self.assertIn(extra_subnet, routes)
543 541
 
544 542
     def _assert_interfaces_deleted_from_ovs(self):
545
-
546
-        def assert_ovs_bridge_empty(bridge_name):
547
-            bridge = ovs_lib.OVSBridge(bridge_name)
548
-            self.assertFalse(bridge.get_port_name_list())
549
-
550
-        assert_ovs_bridge_empty(self.agent.conf.ovs_integration_bridge)
551
-        assert_ovs_bridge_empty(self.agent.conf.external_network_bridge)
543
+        bridge = ovs_lib.OVSBridge(self.agent.conf.ovs_integration_bridge)
544
+        self.assertFalse(bridge.get_port_name_list())
552 545
 
553 546
     def floating_ips_configured(self, router):
554 547
         floating_ips = router.router[constants.FLOATINGIP_KEY]
@@ -594,7 +587,7 @@ class L3AgentTestFramework(base.BaseSudoTestCase):
594 587
         router1 = self._create_router(router_info, self.agent)
595 588
         self._add_fip(router1, '192.168.111.12')
596 589
 
597
-        r1_br = ip_lib.IPDevice(router1.driver.conf.external_network_bridge)
590
+        r1_br = ip_lib.IPDevice(router1.driver.conf.ovs_integration_bridge)
598 591
         r1_br.addr.add('19.4.4.1/24')
599 592
         r1_br.link.set_up()
600 593
 
@@ -604,7 +597,7 @@ class L3AgentTestFramework(base.BaseSudoTestCase):
604 597
                                             mac='22:22:22:22:22:22'))
605 598
         router2 = self._create_router(router_info_2, self.failover_agent)
606 599
 
607
-        r2_br = ip_lib.IPDevice(router2.driver.conf.external_network_bridge)
600
+        r2_br = ip_lib.IPDevice(router2.driver.conf.ovs_integration_bridge)
608 601
         r2_br.addr.add('19.4.4.1/24')
609 602
         r2_br.link.set_up()
610 603
 
@@ -642,12 +635,12 @@ class L3AgentTestFramework(base.BaseSudoTestCase):
642 635
 
643 636
     @staticmethod
644 637
     def fail_gw_router_port(router):
645
-        r_br = ip_lib.IPDevice(router.driver.conf.external_network_bridge)
638
+        r_br = ip_lib.IPDevice(router.driver.conf.ovs_integration_bridge)
646 639
         r_br.link.set_down()
647 640
 
648 641
     @staticmethod
649 642
     def restore_gw_router_port(router):
650
-        r_br = ip_lib.IPDevice(router.driver.conf.external_network_bridge)
643
+        r_br = ip_lib.IPDevice(router.driver.conf.ovs_integration_bridge)
651 644
         r_br.link.set_up()
652 645
 
653 646
     @classmethod

+ 6
- 10
neutron/tests/functional/agent/l3/test_dvr_router.py View File

@@ -149,9 +149,7 @@ class TestDvrRouter(framework.L3AgentTestFramework):
149 149
         self._validate_fips_for_external_network(
150 150
             router, router.fip_ns.get_name())
151 151
         # Now delete the fg- port that was created
152
-        ext_net_bridge = self.agent.conf.external_network_bridge
153 152
         router.fip_ns.driver.unplug(fg_port_name,
154
-                                    bridge=ext_net_bridge,
155 153
                                     namespace=router.fip_ns.name,
156 154
                                     prefix=dvr_fip_ns.FIP_EXT_DEV_PREFIX)
157 155
         # Now check if the fg- port is missing.
@@ -204,9 +202,7 @@ class TestDvrRouter(framework.L3AgentTestFramework):
204 202
         self._validate_fips_for_external_network(
205 203
             router, router.fip_ns.get_name())
206 204
         # Now delete the fg- port that was created
207
-        ext_net_bridge = self.agent.conf.external_network_bridge
208 205
         router.fip_ns.driver.unplug(fg_port_name,
209
-                                    bridge=ext_net_bridge,
210 206
                                     namespace=router.fip_ns.name,
211 207
                                     prefix=dvr_fip_ns.FIP_EXT_DEV_PREFIX)
212 208
         # Now check if the fg- port is missing.
@@ -2036,10 +2032,10 @@ class TestDvrRouter(framework.L3AgentTestFramework):
2036 2032
                       fixed_ip_address_scope='scope2')
2037 2033
         router.process()
2038 2034
 
2039
-        br_ex = framework.get_ovs_bridge(
2040
-            self.agent.conf.external_network_bridge)
2035
+        br_int = framework.get_ovs_bridge(
2036
+            self.agent.conf.ovs_integration_bridge)
2041 2037
         src_machine = self.useFixture(
2042
-            machine_fixtures.FakeMachine(br_ex, '19.4.4.12/24'))
2038
+            machine_fixtures.FakeMachine(br_int, '19.4.4.12/24'))
2043 2039
         # Floating ip should work no matter of address scope
2044 2040
         net_helpers.assert_ping(src_machine.namespace, fip_same_scope)
2045 2041
         net_helpers.assert_ping(src_machine.namespace, fip_diff_scope)
@@ -2051,11 +2047,11 @@ class TestDvrRouter(framework.L3AgentTestFramework):
2051 2047
 
2052 2048
         gw_port = router.get_ex_gw_port()
2053 2049
         gw_ip = self._port_first_ip_cidr(gw_port).partition('/')[0]
2054
-        br_ex = framework.get_ovs_bridge(
2055
-            self.agent.conf.external_network_bridge)
2050
+        br_int = framework.get_ovs_bridge(
2051
+            self.agent.conf.ovs_integration_bridge)
2056 2052
 
2057 2053
         src_machine = self.useFixture(
2058
-            machine_fixtures.FakeMachine(br_ex, '19.4.4.12/24', gw_ip))
2054
+            machine_fixtures.FakeMachine(br_int, '19.4.4.12/24', gw_ip))
2059 2055
         # For the internal networks that are in the same address scope as
2060 2056
         # external network, they can directly route to external network
2061 2057
         net_helpers.assert_ping(src_machine.namespace, machine_same_scope.ip)

+ 23
- 0
neutron/tests/functional/agent/l3/test_ha_router.py View File

@@ -19,6 +19,7 @@ import mock
19 19
 from neutron_lib import constants
20 20
 import testtools
21 21
 
22
+from neutron.agent.common import ovs_lib
22 23
 from neutron.agent.l3 import agent as neutron_l3_agent
23 24
 from neutron.agent.linux import ip_lib
24 25
 from neutron.common import ipv6_utils
@@ -381,6 +382,28 @@ class L3HATestFailover(framework.L3AgentTestFramework):
381 382
         br_int_1.add_port(veth1.name)
382 383
         br_int_2.add_port(veth2.name)
383 384
 
385
+    @staticmethod
386
+    def fail_gw_router_port(router):
387
+        # NOTE(slaweq): in HA failover tests there are two integration bridges
388
+        # connected with veth pair to each other. To stop traffic from router's
389
+        # namespace to gw ip (19.4.4.1) it needs to be blocked by openflow rule
390
+        # as simple setting ovs_integration_bridge device DOWN will not be
391
+        # enough because same IP address is also configured on
392
+        # ovs_integration_bridge device from second router and it will still
393
+        # respond to ping
394
+        r_br = ovs_lib.OVSBridge(router.driver.conf.ovs_integration_bridge)
395
+        external_port = router.get_ex_gw_port()
396
+        for subnet in external_port['subnets']:
397
+            r_br.add_flow(
398
+                proto='ip', nw_dst=subnet['gateway_ip'], actions='drop')
399
+
400
+    @staticmethod
401
+    def restore_gw_router_port(router):
402
+        r_br = ovs_lib.OVSBridge(router.driver.conf.ovs_integration_bridge)
403
+        external_port = router.get_ex_gw_port()
404
+        for subnet in external_port['subnets']:
405
+            r_br.delete_flows(proto='ip', nw_dst=subnet['gateway_ip'])
406
+
384 407
     def test_ha_router_failover(self):
385 408
         router1, router2 = self.create_ha_routers()
386 409
 

+ 6
- 33
neutron/tests/functional/agent/l3/test_legacy_router.py View File

@@ -156,33 +156,6 @@ class L3AgentTestCase(framework.L3AgentTestFramework):
156 156
         self.addCleanup(bridge.destroy)
157 157
         return bridge
158 158
 
159
-    def test_external_network_bridge_change(self):
160
-        bridge1, bridge2 = self._make_bridge(), self._make_bridge()
161
-        self.agent.conf.set_override('external_network_bridge',
162
-                                     bridge1.br_name)
163
-        router_info = self.generate_router_info(False)
164
-        router = self.manage_router(self.agent, router_info)
165
-        gw_port = router.router['gw_port']
166
-        gw_inf_name = router.get_external_device_name(gw_port['id'])
167
-
168
-        self.assertIn(gw_inf_name,
169
-                      [v.port_name for v in bridge1.get_vif_ports()])
170
-        # changeing the external_network_bridge should have no impact since
171
-        # the interface exists.
172
-        self.agent.conf.set_override('external_network_bridge',
173
-                                     bridge2.br_name)
174
-        self.manage_router(self.agent, router_info)
175
-        self.assertIn(gw_inf_name,
176
-                      [v.port_name for v in bridge1.get_vif_ports()])
177
-        self.assertNotIn(gw_inf_name,
178
-                         [v.port_name for v in bridge2.get_vif_ports()])
179
-        namespaces.Namespace.delete(router.router_namespace)
180
-        self.manage_router(self.agent, router_info)
181
-        self.assertIn(gw_inf_name,
182
-                      [v.port_name for v in bridge2.get_vif_ports()])
183
-        self.assertNotIn(gw_inf_name,
184
-                         [v.port_name for v in bridge1.get_vif_ports()])
185
-
186 159
     def test_legacy_router_ns_rebuild(self):
187 160
         router_info = self.generate_router_info(False)
188 161
         router = self.manage_router(self.agent, router_info)
@@ -420,10 +393,10 @@ class L3AgentTestCase(framework.L3AgentTestFramework):
420 393
                       fixed_ip_address_scope='scope2')
421 394
         router.process()
422 395
 
423
-        br_ex = framework.get_ovs_bridge(
424
-            self.agent.conf.external_network_bridge)
396
+        br_int = framework.get_ovs_bridge(
397
+            self.agent.conf.ovs_integration_bridge)
425 398
         src_machine = self.useFixture(
426
-            machine_fixtures.FakeMachine(br_ex, '19.4.4.12/24'))
399
+            machine_fixtures.FakeMachine(br_int, '19.4.4.12/24'))
427 400
         # Floating ip should work no matter of address scope
428 401
         net_helpers.assert_ping(src_machine.namespace, fip_same_scope)
429 402
         net_helpers.assert_ping(src_machine.namespace, fip_diff_scope)
@@ -434,11 +407,11 @@ class L3AgentTestCase(framework.L3AgentTestFramework):
434 407
 
435 408
         gw_port = router.get_ex_gw_port()
436 409
         gw_ip = self._port_first_ip_cidr(gw_port).partition('/')[0]
437
-        br_ex = framework.get_ovs_bridge(
438
-            self.agent.conf.external_network_bridge)
410
+        br_int = framework.get_ovs_bridge(
411
+            self.agent.conf.ovs_integration_bridge)
439 412
 
440 413
         src_machine = self.useFixture(
441
-            machine_fixtures.FakeMachine(br_ex, '19.4.4.12/24', gw_ip))
414
+            machine_fixtures.FakeMachine(br_int, '19.4.4.12/24', gw_ip))
442 415
         # For the internal networks that are in the same address scope as
443 416
         # external network, they can directly route to external network
444 417
         net_helpers.assert_ping(src_machine.namespace, machine_same_scope.ip)

+ 17
- 21
neutron/tests/functional/cmd/test_ovs_cleanup.py View File

@@ -34,26 +34,23 @@ class TestOVSCLIConfig(base.BaseOVSLinuxTestCase):
34 34
 
35 35
     def test_do_main_default_options(self):
36 36
         int_br = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
37
-        ext_br = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
38 37
         self.conf.set_override("ovs_integration_bridge", int_br.br_name)
39
-        self.conf.set_override("external_network_bridge", ext_br.br_name)
40 38
         self.conf.set_override("ovs_all_ports", False)
41 39
 
42 40
         noskip = collections.defaultdict(list)
43 41
         skip = collections.defaultdict(list)
44
-        # add two vifs, one skipped, and a non-vif port to int_br and ext_br
45
-        for br in (int_br, ext_br):
46
-            for collection in (noskip, skip):
47
-                collection[br].append(
48
-                    self.useFixture(net_helpers.OVSPortFixture(br)).port.name)
49
-            # set skippable vif to be skipped
50
-            br.ovsdb.db_set(
51
-                'Interface', skip[br][0],
52
-                ('external_ids', {constants.SKIP_CLEANUP: "True"})
53
-            ).execute(check_error=True)
54
-            device_name = utils.get_rand_name()
55
-            skip[br].append(device_name)
56
-            br.add_port(device_name, ('type', 'internal'))
42
+        # add two vifs, one skipped, and a non-vif port to int_br
43
+        for collection in (noskip, skip):
44
+            collection[int_br].append(
45
+                self.useFixture(net_helpers.OVSPortFixture(int_br)).port.name)
46
+        # set skippable vif to be skipped
47
+        int_br.ovsdb.db_set(
48
+            'Interface', skip[int_br][0],
49
+            ('external_ids', {constants.SKIP_CLEANUP: "True"})
50
+        ).execute(check_error=True)
51
+        device_name = utils.get_rand_name()
52
+        skip[int_br].append(device_name)
53
+        int_br.add_port(device_name, ('type', 'internal'))
57 54
         # sanity check
58 55
         for collection in (noskip, skip):
59 56
             for bridge, ports in collection.items():
@@ -61,9 +58,8 @@ class TestOVSCLIConfig(base.BaseOVSLinuxTestCase):
61 58
                 for port in ports:
62 59
                     self.assertIn(port, port_list)
63 60
         ovs_cleanup.do_main(self.conf)
64
-        for br in (int_br, ext_br):
65
-            ports = br.get_port_name_list()
66
-            for vif in noskip[br]:
67
-                self.assertNotIn(vif, ports)
68
-            for port in skip[br]:
69
-                self.assertIn(port, ports)
61
+        ports = int_br.get_port_name_list()
62
+        for vif in noskip[int_br]:
63
+            self.assertNotIn(vif, ports)
64
+        for port in skip[int_br]:
65
+            self.assertIn(port, ports)

+ 2
- 8
neutron/tests/unit/agent/l3/test_agent.py View File

@@ -750,7 +750,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
750 750
             if not router.get('distributed'):
751 751
                 self.mock_driver.unplug.assert_called_once_with(
752 752
                     interface_name,
753
-                    bridge=agent.conf.external_network_bridge,
754 753
                     namespace=mock.ANY,
755 754
                     prefix=mock.ANY)
756 755
             else:
@@ -934,7 +933,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
934 933
                 # snat namespace was deleted
935 934
                 self.mock_driver.unplug.assert_called_with(
936 935
                     interface_name,
937
-                    bridge=self.conf.external_network_bridge,
938 936
                     namespace=snat_ns_name,
939 937
                     prefix=namespaces.EXTERNAL_DEV_PREFIX)
940 938
         else:
@@ -2107,6 +2105,8 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
2107 2105
         ri.process = mock.Mock()
2108 2106
         ri.initialize = mock.Mock(side_effect=RuntimeError())
2109 2107
         agent._create_router = mock.Mock(return_value=ri)
2108
+        agent._fetch_external_net_id = mock.Mock(
2109
+            return_value=router['external_gateway_info']['network_id'])
2110 2110
         agent._process_router_update()
2111 2111
         log_exception.assert_has_calls(calls)
2112 2112
 
@@ -2355,7 +2355,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
2355 2355
 
2356 2356
         self.mock_driver.unplug.assert_called_with(
2357 2357
             stale_devnames[0],
2358
-            bridge="",
2359 2358
             namespace=ri.ns_name,
2360 2359
             prefix=namespaces.EXTERNAL_DEV_PREFIX)
2361 2360
 
@@ -2376,7 +2375,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
2376 2375
 
2377 2376
         self.mock_driver.unplug.assert_called_with(
2378 2377
             stale_devnames[0],
2379
-            bridge=agent.conf.external_network_bridge,
2380 2378
             namespace=ri.snat_namespace.name,
2381 2379
             prefix=namespaces.EXTERNAL_DEV_PREFIX)
2382 2380
 
@@ -2496,7 +2494,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
2496 2494
 
2497 2495
         ns.delete()
2498 2496
         calls = [mock.call('qg-aaaa',
2499
-                           bridge=agent.conf.external_network_bridge,
2500 2497
                            namespace=namespace,
2501 2498
                            prefix=namespaces.EXTERNAL_DEV_PREFIX),
2502 2499
                  mock.call('sg-aaaa',
@@ -2786,7 +2783,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
2786 2783
             self.assertFalse(chsfr.called)
2787 2784
 
2788 2785
     def test_process_router_if_compatible_with_no_ext_net_in_conf(self):
2789
-        self.conf.set_override('external_network_bridge', 'br-ex')
2790 2786
         agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
2791 2787
         self.plugin_api.get_external_network_id.return_value = 'aaa'
2792 2788
 
@@ -2815,7 +2811,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
2815 2811
         self.assertFalse(self.plugin_api.get_external_network_id.called)
2816 2812
 
2817 2813
     def test_process_router_if_compatible_with_stale_cached_ext_net(self):
2818
-        self.conf.set_override('external_network_bridge', 'br-ex')
2819 2814
         agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
2820 2815
         self.plugin_api.get_external_network_id.return_value = 'aaa'
2821 2816
         agent.target_ex_net_id = 'bbb'
@@ -2831,7 +2826,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
2831 2826
             agent.context)
2832 2827
 
2833 2828
     def test_process_router_if_compatible_w_no_ext_net_and_2_net_plugin(self):
2834
-        self.conf.set_override('external_network_bridge', 'br-ex')
2835 2829
         agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
2836 2830
 
2837 2831
         router = {'id': _uuid(),

+ 0
- 5
neutron/tests/unit/agent/l3/test_dvr_fip_ns.py View File

@@ -107,9 +107,6 @@ class TestDvrFipNs(base.BaseTestCase):
107 107
             self.fip_ns.create_or_update_gateway_port(agent_gw_port)
108 108
         self.assertTrue(fip_create.called)
109 109
         self.assertEqual(1, self.driver.plug.call_count)
110
-        ext_net_bridge = self.conf.external_network_bridge
111
-        if ext_net_bridge:
112
-            self.assertEqual(1, self.driver.remove_vlan_tag.call_count)
113 110
         self.assertEqual(1, self.driver.init_l3.call_count)
114 111
         interface_name = self.fip_ns.get_ext_device_name(agent_gw_port['id'])
115 112
         gw_cidrs = [sn['cidr'] for sn in agent_gw_port['subnets']
@@ -253,10 +250,8 @@ class TestDvrFipNs(base.BaseTestCase):
253 250
             exists.assert_called_once_with(self.fip_ns.name)
254 251
             delete.assert_called_once_with(self.fip_ns.name)
255 252
 
256
-        ext_net_bridge = self.conf.external_network_bridge
257 253
         ns_name = self.fip_ns.get_name()
258 254
         self.driver.unplug.assert_called_once_with('fg-aaaa',
259
-                                                   bridge=ext_net_bridge,
260 255
                                                    prefix='fg-',
261 256
                                                    namespace=ns_name)
262 257
         ip_wrapper.del_veth.assert_called_once_with('fpr-aaaa')

+ 4
- 4
neutron/tests/unit/agent/l3/test_dvr_local_router.py View File

@@ -564,9 +564,9 @@ class TestDvrRouterOperations(base.BaseTestCase):
564 564
                             'foo_router_id',
565 565
                             {'distributed': True, 'gw_port_host': HOSTNAME})
566 566
         ri = dvr_router.DvrLocalRouter(HOSTNAME, **self.ri_kwargs)
567
-        with mock.patch.object(l3_agent.ip_lib, 'IPDevice') as f:
568
-            ri._update_arp_entry(mock.ANY, mock.ANY, 'foo_subnet_id', 'add')
569
-        self.assertFalse(f.call_count)
567
+        ri.get_internal_device_name = mock.Mock()
568
+        ri._update_arp_entry(mock.ANY, mock.ANY, 'foo_subnet_id', 'add')
569
+        self.assertFalse(ri.get_internal_device_name.call_count)
570 570
 
571 571
     def _setup_test_for_arp_entry_cache(self):
572 572
         agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
@@ -581,7 +581,7 @@ class TestDvrRouterOperations(base.BaseTestCase):
581 581
     def test__update_arp_entry_calls_arp_cache_with_no_device(self):
582 582
         ri, subnet_id = self._setup_test_for_arp_entry_cache()
583 583
         state = True
584
-        with mock.patch.object(l3_agent.ip_lib, 'IPDevice') as rtrdev,\
584
+        with mock.patch('neutron.agent.linux.ip_lib.IPDevice') as rtrdev,\
585 585
                 mock.patch.object(ri, '_cache_arp_entry') as arp_cache:
586 586
             rtrdev.return_value.exists.return_value = False
587 587
             state = ri._update_arp_entry(

+ 3
- 15
neutron/tests/unit/debug/test_commands.py View File

@@ -37,7 +37,6 @@ class TestDebugCommands(base.BaseTestCase):
37 37
     def setUp(self):
38 38
         super(TestDebugCommands, self).setUp()
39 39
         config.register_interface_opts()
40
-        cfg.CONF.register_opts(config.EXT_NET_BRIDGE_OPTS)
41 40
         common_config.init([])
42 41
         config.register_interface_driver_opts_helper(cfg.CONF)
43 42
 
@@ -132,7 +131,6 @@ class TestDebugCommands(base.BaseTestCase):
132 131
                                                      'fake_port',
133 132
                                                      'tap12345678-12',
134 133
                                                      'aa:bb:cc:dd:ee:ffa',
135
-                                                     bridge=None,
136 134
                                                      namespace=namespace),
137 135
                                       mock.call.init_l3('tap12345678-12',
138 136
                                                         ['10.0.0.3/24'],
@@ -177,7 +175,6 @@ class TestDebugCommands(base.BaseTestCase):
177 175
                                                      'fake_port',
178 176
                                                      'tap12345678-12',
179 177
                                                      'aa:bb:cc:dd:ee:ffa',
180
-                                                     bridge='',
181 178
                                                      namespace=namespace),
182 179
                                       mock.call.init_l3('tap12345678-12',
183 180
                                                         ['10.0.0.3/24'],
@@ -200,13 +197,10 @@ class TestDebugCommands(base.BaseTestCase):
200 197
         cmd.run(parsed_args)
201 198
         namespace = 'qprobe-fake_port'
202 199
         self.client.assert_has_calls([mock.call.show_port('fake_port'),
203
-                                      mock.call.show_network('fake_net'),
204
-                                      mock.call.show_subnet('fake_subnet'),
205 200
                                       mock.call.delete_port('fake_port')])
206 201
         self.driver.assert_has_calls([mock.call.get_device_name(mock.ANY),
207 202
                                       mock.call.unplug('tap12345678-12',
208
-                                                       namespace=namespace,
209
-                                                       bridge=None)])
203
+                                                       namespace=namespace)])
210 204
 
211 205
     def test_delete_probe_external(self):
212 206
         fake_network = {'network': {'id': 'fake_net',
@@ -221,13 +215,10 @@ class TestDebugCommands(base.BaseTestCase):
221 215
         cmd.run(parsed_args)
222 216
         namespace = 'qprobe-fake_port'
223 217
         self.client.assert_has_calls([mock.call.show_port('fake_port'),
224
-                                      mock.call.show_network('fake_net'),
225
-                                      mock.call.show_subnet('fake_subnet'),
226 218
                                       mock.call.delete_port('fake_port')])
227 219
         self.driver.assert_has_calls([mock.call.get_device_name(mock.ANY),
228 220
                                       mock.call.unplug('tap12345678-12',
229
-                                                       namespace=namespace,
230
-                                                       bridge='')])
221
+                                                       namespace=namespace)])
231 222
 
232 223
     def test_list_probe(self):
233 224
         cmd = commands.ListProbe(self.app, None)
@@ -263,13 +254,10 @@ class TestDebugCommands(base.BaseTestCase):
263 254
                 device_owner=[debug_agent.DEVICE_OWNER_NETWORK_PROBE,
264 255
                               debug_agent.DEVICE_OWNER_COMPUTE_PROBE]),
265 256
              mock.call.show_port('fake_port'),
266
-             mock.call.show_network('fake_net'),
267
-             mock.call.show_subnet('fake_subnet'),
268 257
              mock.call.delete_port('fake_port')])
269 258
         self.driver.assert_has_calls([mock.call.get_device_name(mock.ANY),
270 259
                                       mock.call.unplug('tap12345678-12',
271
-                                                       namespace=namespace,
272
-                                                       bridge=None)])
260
+                                                       namespace=namespace)])
273 261
 
274 262
     def test_ping_all_with_ensure_port(self):
275 263
         fake_ports = self.fake_ports

+ 1
- 2
neutron/tests/unit/extensions/test_l3.py View File

@@ -4111,8 +4111,7 @@ class L3NatDBIntAgentSchedulingTestCase(L3BaseForIntTests,
4111 4111
                 host='host1',
4112 4112
                 ext_net_id=s1['subnet']['network_id'])
4113 4113
             helpers.register_l3_agent(
4114
-                host='host2', internal_only=False,
4115
-                ext_net_id='', ext_bridge='')
4114
+                host='host2', internal_only=False, ext_net_id='')
4116 4115
             l3_rpc_cb.get_router_ids(self.adminContext,
4117 4116
                                      host='host1')
4118 4117
             self._assert_router_on_agent(r['router']['id'], 'host1')

+ 6
- 0
releasenotes/notes/external_network_bridge-option-removed-bbf50fb803f04f82.yaml View File

@@ -0,0 +1,6 @@
1
+---
2
+upgrade:
3
+  - The ``external_network_bridge`` config option has been removed.
4
+    Existing users of this option will now have their router's gateway
5
+    interface created in the integration bridge and it will be wired by
6
+    the L2 agent.

Loading…
Cancel
Save