prometheanfire    15/02/13 00:58:41

  Added:               
                        
0002-moving-vxlan-module-check-to-sanity-checks-and-makin.patch
                        
0003-fixes-error-logging-to-use-the-right-exception-paren.patch
                        0001-Fixes-bug-in-interface-handling-of-ip_lib.py.patch
  Log:
  backporting patches from kilo for better usage in juno
  
  (Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 
0x33ED3FD25AFC78BA)

Revision  Changes    Path
1.1                  
sys-cluster/neutron/files/0002-moving-vxlan-module-check-to-sanity-checks-and-makin.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/neutron/files/0002-moving-vxlan-module-check-to-sanity-checks-and-makin.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/neutron/files/0002-moving-vxlan-module-check-to-sanity-checks-and-makin.patch?rev=1.1&content-type=text/plain

Index: 0002-moving-vxlan-module-check-to-sanity-checks-and-makin.patch
===================================================================
>From d6d4b8171908ac08196e7f08395f451168ad19dc Mon Sep 17 00:00:00 2001
From: Matthew Thode <mth...@mthode.org>
Date: Wed, 10 Dec 2014 15:12:25 -0600
Subject: [PATCH 2/3] moving vxlan module check to sanity checks and making
 practical

Instead of checking via modinfo (which only checks if a module is
available) this checks actual usage, which is a more reliable way of
testing real world problems.

Change-Id: Ida78652ed50e2cb16fa0ab7194d8468714b99d61
Closes-Bug: 1339197
---
 neutron/cmd/sanity/checks.py                       | 10 ++++++++-
 neutron/cmd/sanity_check.py                        | 25 ++++++++++++++++++++--
 .../linuxbridge/agent/linuxbridge_neutron_agent.py | 11 ----------
 neutron/tests/functional/sanity/test_sanity.py     |  5 ++++-
 .../unit/linuxbridge/test_lb_neutron_agent.py      | 24 ++-------------------
 5 files changed, 38 insertions(+), 37 deletions(-)

diff --git a/neutron/cmd/sanity/checks.py b/neutron/cmd/sanity/checks.py
index da37663..4700668 100644
--- a/neutron/cmd/sanity/checks.py
+++ b/neutron/cmd/sanity/checks.py
@@ -25,13 +25,21 @@ from neutron.plugins.openvswitch.common import constants as 
ovs_const
 LOG = logging.getLogger(__name__)
 
 
-def vxlan_supported(root_helper, from_ip='192.0.2.1', to_ip='192.0.2.2'):
+def ovs_vxlan_supported(root_helper, from_ip='192.0.2.1', to_ip='192.0.2.2'):
     name = "vxlantest-" + utils.get_random_string(6)
     with ovs_lib.OVSBridge(name, root_helper) as br:
         port = br.add_tunnel_port(from_ip, to_ip, const.TYPE_VXLAN)
         return port != ovs_lib.INVALID_OFPORT
 
 
+def iproute2_vxlan_supported(root_helper):
+    ip = ip_lib.IPWrapper(root_helper)
+    name = "vxlantest-" + utils.get_random_string(4)
+    port = ip.add_vxlan(name, 3000)
+    ip.del_veth(name)
+    return name == port.name
+
+
 def patch_supported(root_helper):
     seed = utils.get_random_string(6)
     name = "patchtest-" + seed
diff --git a/neutron/cmd/sanity_check.py b/neutron/cmd/sanity_check.py
index 4b1be1b..90bf792 100644
--- a/neutron/cmd/sanity_check.py
+++ b/neutron/cmd/sanity_check.py
@@ -25,6 +25,13 @@ from oslo.config import cfg
 LOG = logging.getLogger(__name__)
 cfg.CONF.import_group('AGENT', 'neutron.plugins.openvswitch.common.config')
 cfg.CONF.import_group('OVS', 'neutron.plugins.openvswitch.common.config')
+<<<<<<< HEAD
+=======
+cfg.CONF.import_group('VXLAN', 'neutron.plugins.linuxbridge.common.config')
+cfg.CONF.import_group('ml2', 'neutron.plugins.ml2.config')
+cfg.CONF.import_group('ml2_sriov',
+                      'neutron.plugins.ml2.drivers.mech_sriov.mech_driver')
+>>>>>>> moving vxlan module check to sanity checks and making practical
 
 
 class BoolOptCallback(cfg.BoolOpt):
@@ -34,7 +41,7 @@ class BoolOptCallback(cfg.BoolOpt):
 
 
 def check_ovs_vxlan():
-    result = checks.vxlan_supported(root_helper=cfg.CONF.AGENT.root_helper)
+    result = checks.ovs_vxlan_supported(root_helper=cfg.CONF.AGENT.root_helper)
     if not result:
         LOG.error(_('Check for Open vSwitch VXLAN support failed. '
                     'Please ensure that the version of openvswitch '
@@ -42,6 +49,15 @@ def check_ovs_vxlan():
     return result
 
 
+def check_iproute2_vxlan():
+    result = checks.iproute2_vxlan_supported(
+                root_helper=cfg.CONF.AGENT.root_helper)
+    if not result:
+        LOG.error(_LE('Check for iproute2 VXLAN support failed. Please ensure '
+                      'that the iproute2 has VXLAN support.'))
+    return result
+
+
 def check_ovs_patch():
     result = checks.patch_supported(root_helper=cfg.CONF.AGENT.root_helper)
     if not result:
@@ -74,7 +90,9 @@ def check_arp_responder():
 # Define CLI opts to test specific features, with a calback for the test
 OPTS = [
     BoolOptCallback('ovs_vxlan', check_ovs_vxlan, default=False,
-                    help=_('Check for vxlan support')),
+                    help=_('Check for OVS vxlan support')),
+    BoolOptCallback('iproute2_vxlan', check_iproute2_vxlan, default=False,
+                    help=_('Check for iproute2 vxlan support')),
     BoolOptCallback('ovs_patch', check_ovs_patch, default=False,
                     help=_('Check for patch port support')),
     BoolOptCallback('nova_notify', check_nova_notify, default=False,
@@ -92,6 +110,9 @@ def enable_tests_from_config():
 
     if 'vxlan' in cfg.CONF.AGENT.tunnel_types:
         cfg.CONF.set_override('ovs_vxlan', True)
+    if ('vxlan' in cfg.CONF.ml2.type_drivers or
+            cfg.CONF.VXLAN.enable_vxlan):
+        cfg.CONF.set_override('iproute2_vxlan', True)
     if cfg.CONF.AGENT.tunnel_types:
         cfg.CONF.set_override('ovs_patch', True)
     if not cfg.CONF.OVS.use_veth_interconnection:
diff --git a/neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py 
b/neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
index d9f7f68..b540269 100755
--- a/neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
+++ b/neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
@@ -561,19 +561,8 @@ class LinuxBridgeManager:
             return False
         return True
 
-    def vxlan_module_supported(self):
-        try:
-            utils.execute(cmd=['modinfo', 'vxlan'], log_fail_as_error=False)
-            return True
-        except RuntimeError:
-            return False
-
     def check_vxlan_support(self):
         self.vxlan_mode = lconst.VXLAN_NONE
-        if not self.vxlan_module_supported():
-            LOG.error(_('Linux kernel vxlan module and iproute2 3.8 or above '
-                        'are required to enable VXLAN.'))
-            raise exceptions.VxlanNetworkUnsupported()
 
         if self.vxlan_ucast_supported():
             self.vxlan_mode = lconst.VXLAN_UCAST
diff --git a/neutron/tests/functional/sanity/test_sanity.py 
b/neutron/tests/functional/sanity/test_sanity.py
index bbe8911..b959138 100644
--- a/neutron/tests/functional/sanity/test_sanity.py
+++ b/neutron/tests/functional/sanity/test_sanity.py
@@ -45,7 +45,10 @@ class SanityTestCaseRoot(functional_base.BaseSudoTestCase):
         self.check_sudo_enabled()
 
     def test_ovs_vxlan_support_runs(self):
-        checks.vxlan_supported(self.root_helper)
+        checks.ovs_vxlan_supported(self.root_helper)
+
+    def test_iproute2_vxlan_support_runs(self):
+        checks.iproute2_vxlan_supported(self.root_helper)
 
     def test_ovs_patch_support_runs(self):
         checks.patch_supported(self.root_helper)
diff --git a/neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py 
b/neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py
index 1a2bbc4..09a5d78 100644
--- a/neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py
+++ b/neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py
@@ -829,11 +829,9 @@ class TestLinuxBridgeManager(base.BaseTestCase):
             self.lbm.delete_vlan("eth1.1")
             self.assertTrue(exec_fn.called)
 
-    def _check_vxlan_support(self, expected, vxlan_module_supported,
-                             vxlan_ucast_supported, vxlan_mcast_supported):
+    def _check_vxlan_support(self, expected, vxlan_ucast_supported,
+                             vxlan_mcast_supported):
         with contextlib.nested(
-            mock.patch.object(self.lbm, 'vxlan_module_supported',
-                              return_value=vxlan_module_supported),
             mock.patch.object(self.lbm, 'vxlan_ucast_supported',
                               return_value=vxlan_ucast_supported),
             mock.patch.object(self.lbm, 'vxlan_mcast_supported',
@@ -848,37 +846,19 @@ class TestLinuxBridgeManager(base.BaseTestCase):
 
     def test_check_vxlan_support(self):
         self._check_vxlan_support(expected=lconst.VXLAN_UCAST,
-                                  vxlan_module_supported=True,
                                   vxlan_ucast_supported=True,
                                   vxlan_mcast_supported=True)
         self._check_vxlan_support(expected=lconst.VXLAN_MCAST,
-                                  vxlan_module_supported=True,
                                   vxlan_ucast_supported=False,
                                   vxlan_mcast_supported=True)
 
         self._check_vxlan_support(expected=lconst.VXLAN_NONE,
-                                  vxlan_module_supported=False,
                                   vxlan_ucast_supported=False,
                                   vxlan_mcast_supported=False)
         self._check_vxlan_support(expected=lconst.VXLAN_NONE,
-                                  vxlan_module_supported=True,
                                   vxlan_ucast_supported=False,
                                   vxlan_mcast_supported=False)
 
-    def _check_vxlan_module_supported(self, expected, execute_side_effect):
-        with mock.patch.object(
-                utils, 'execute',
-                side_effect=execute_side_effect):
-            self.assertEqual(expected, self.lbm.vxlan_module_supported())
-
-    def test_vxlan_module_supported(self):
-        self._check_vxlan_module_supported(
-            expected=True,
-            execute_side_effect=None)
-        self._check_vxlan_module_supported(
-            expected=False,
-            execute_side_effect=RuntimeError())
-
     def _check_vxlan_ucast_supported(
             self, expected, l2_population, iproute_arg_supported, fdb_append):
         cfg.CONF.set_override('l2_population', l2_population, 'VXLAN')
-- 
2.0.5




1.1                  
sys-cluster/neutron/files/0003-fixes-error-logging-to-use-the-right-exception-paren.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/neutron/files/0003-fixes-error-logging-to-use-the-right-exception-paren.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/neutron/files/0003-fixes-error-logging-to-use-the-right-exception-paren.patch?rev=1.1&content-type=text/plain

Index: 0003-fixes-error-logging-to-use-the-right-exception-paren.patch
===================================================================
>From bda65afcedcbf44efda5f1e5fa430dd672ef5142 Mon Sep 17 00:00:00 2001
From: Matthew Thode <mth...@mthode.org>
Date: Sun, 1 Feb 2015 00:13:59 -0600
Subject: [PATCH 3/3] fixes error logging to use the right exception parent
 class

looks like this was missed

Closes-Bug: #1416798
Change-Id: If68c13b550d665dfa24b7380f53bee7f6fccdb23
---
 neutron/plugins/ml2/plugin.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py
index a41ffc2..c7c4c4c 100644
--- a/neutron/plugins/ml2/plugin.py
+++ b/neutron/plugins/ml2/plugin.py
@@ -1054,7 +1054,6 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
                            one())
             except sa_exc.NoResultFound:
                 return
-            except exc.MultipleResultsFound:
                 LOG.error(_("Multiple ports have port_id starting with %s"),
                           port_id)
                 return
-- 
2.0.5




1.1                  
sys-cluster/neutron/files/0001-Fixes-bug-in-interface-handling-of-ip_lib.py.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/neutron/files/0001-Fixes-bug-in-interface-handling-of-ip_lib.py.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/neutron/files/0001-Fixes-bug-in-interface-handling-of-ip_lib.py.patch?rev=1.1&content-type=text/plain

Index: 0001-Fixes-bug-in-interface-handling-of-ip_lib.py.patch
===================================================================
>From f3100ad343759ad32435766df33b0384cd15629d Mon Sep 17 00:00:00 2001
From: Matthew Thode <mth...@mthode.org>
Date: Mon, 9 Feb 2015 11:02:58 -0600
Subject: [PATCH 1/3] Fixes bug in interface handling of ip_lib.py

ip_lib was parsing tunnel links incorrectly, we know what to delimit on
when we see interfaces with @NONE in their name

@NONE is appended to the interface name by iproute2 when a tunnel is not
connected to it's remote endpoint, this patch adds allows for handling
that situation.

Change-Id: I07d1d297f07857d216649cccf717896574aac301
Closes-Bug: 1374663
---
 neutron/agent/linux/ip_lib.py           |  3 +++
 neutron/tests/unit/test_linux_ip_lib.py | 12 +++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/neutron/agent/linux/ip_lib.py b/neutron/agent/linux/ip_lib.py
index 1d32a54..b2264d2 100644
--- a/neutron/agent/linux/ip_lib.py
+++ b/neutron/agent/linux/ip_lib.py
@@ -109,6 +109,9 @@ class IPWrapper(SubProcessBase):
             if len(tokens) == 3:
                 if any(v in tokens[2] for v in VLAN_INTERFACE_DETAIL):
                     delimiter = '@'
+                # tunnel interfaces can have @NONE in their name as well
+                elif '@NONE' in tokens[1]:
+                    delimiter = '@'
                 else:
                     delimiter = ':'
                 name = tokens[1].rpartition(delimiter)[0].strip()
diff --git a/neutron/tests/unit/test_linux_ip_lib.py 
b/neutron/tests/unit/test_linux_ip_lib.py
index 2b9486d..41f9caa 100644
--- a/neutron/tests/unit/test_linux_ip_lib.py
+++ b/neutron/tests/unit/test_linux_ip_lib.py
@@ -70,7 +70,11 @@ LINK_SAMPLE = [
     '14: bar@bar:bar@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 '
     'qdisc mq state UP qlen 1000'
     '\    link/ether cc:dd:ee:ff:ab:cd brd ff:ff:ff:ff:ff:ff promiscuity 0'
-    '\    vlan protocol 802.1Q id 14 <REORDER_HDR>']
+    '\    vlan protocol 802.1Q id 14 <REORDER_HDR>',
+    '15: gre0@NONE: <NOARP> mtu 1476 qdisc noqueue state DOWN mode DEFAULT '
+    'group default '
+    '\    link/gre 0.0.0.0 brd 0.0.0.0 promiscuity 0 '
+    '\    gre remote any local any ttl inherit nopmtudisc']
 
 ADDR_SAMPLE = ("""
 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
@@ -221,7 +225,8 @@ class TestIpWrapper(base.BaseTestCase):
                           ip_lib.IPDevice('bar:bar'),
                           ip_lib.IPDevice('bar@bar'),
                           ip_lib.IPDevice('bar:bar@bar'),
-                          ip_lib.IPDevice('bar@bar:bar')])
+                          ip_lib.IPDevice('bar@bar:bar'),
+                          ip_lib.IPDevice('gre0')])
 
         self.execute.assert_called_once_with(['o', 'd'], 'link', ('list',),
                                              'sudo', None)
@@ -243,7 +248,8 @@ class TestIpWrapper(base.BaseTestCase):
                           ip_lib.IPDevice('bar:bar'),
                           ip_lib.IPDevice('bar@bar'),
                           ip_lib.IPDevice('bar:bar@bar'),
-                          ip_lib.IPDevice('bar@bar:bar')])
+                          ip_lib.IPDevice('bar@bar:bar'),
+                          ip_lib.IPDevice('gre0')])
 
         self.execute.assert_called_once_with(['o', 'd'], 'link', ('list',),
                                              'sudo', None)
-- 
2.0.5





Reply via email to