Add compatibility for pyroute2>=0.4.15
Pyroute2 was updated, its change make some testcases failed. This patch fix the problem with pyroute2 update. Change-Id: I300f9830927a8babf9112f9aff265ef4b2e5e03e Closes-Bug: #1700469
This commit is contained in:
parent
7446bc47ae
commit
df421a9b2e
@ -17,7 +17,7 @@ from kuryr.lib.binding.drivers import utils
|
||||
|
||||
KIND = 'ipvlan'
|
||||
# We use L2 to allow broadcast frames
|
||||
IPVLAN_MODE_L2 = ifinfmsg.ifinfo.ipvlan_data.modes['IPVLAN_MODE_L2']
|
||||
IPVLAN_MODE_L2 = ifinfmsg.ifinfo.data_map['ipvlan'].modes['IPVLAN_MODE_L2']
|
||||
|
||||
|
||||
def port_bind(endpoint_id, port, subnets, network=None, vm_port=None,
|
||||
|
@ -28,9 +28,9 @@ class TestIpvlanDriver(base.TestCase):
|
||||
"""Unit tests for nested IPVLAN driver"""
|
||||
|
||||
@mock.patch('kuryr.lib.binding.drivers.utils._configure_container_iface')
|
||||
@mock.patch('pyroute2.ipdb.interface.InterfacesDict.__getattribute__',
|
||||
@mock.patch('pyroute2.ipdb.interfaces.InterfacesDict.__getattribute__',
|
||||
return_value=mock_create)
|
||||
@mock.patch('pyroute2.ipdb.interface.InterfacesDict.__getitem__',
|
||||
@mock.patch('pyroute2.ipdb.interfaces.InterfacesDict.__getitem__',
|
||||
return_value=mock_interface)
|
||||
def test_port_bind(self, mock_getitem, mock_getattribute,
|
||||
mock_configure_container_iface):
|
||||
|
@ -28,9 +28,9 @@ class TestMacvlanDriver(base.TestCase):
|
||||
"""Unit tests for nested MACVLAN driver"""
|
||||
|
||||
@mock.patch('kuryr.lib.binding.drivers.utils._configure_container_iface')
|
||||
@mock.patch('pyroute2.ipdb.interface.InterfacesDict.__getattribute__',
|
||||
@mock.patch('pyroute2.ipdb.interfaces.InterfacesDict.__getattribute__',
|
||||
return_value=mock_create)
|
||||
@mock.patch('pyroute2.ipdb.interface.InterfacesDict.__getitem__',
|
||||
@mock.patch('pyroute2.ipdb.interfaces.InterfacesDict.__getitem__',
|
||||
return_value=mock_interface)
|
||||
def test_port_bind(self, mock_getitem, mock_getattribute,
|
||||
mock_configure_container_iface):
|
||||
|
@ -13,7 +13,7 @@ import ddt
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
import pyroute2.ipdb.interface
|
||||
import pyroute2.ipdb.interfaces
|
||||
from pyroute2.netlink.rtnl import ifinfmsg
|
||||
|
||||
from kuryr.lib.binding.drivers import utils
|
||||
@ -104,7 +104,7 @@ class BindingDriversUtilsTest(base.TestCase):
|
||||
'tenant_id': '51b66b97a12f42a990452967d2c555ac',
|
||||
'updated_at': '2016-09-27T08:57:13'}]
|
||||
|
||||
fake_iface = mock.Mock(spec=pyroute2.ipdb.interface.Interface)
|
||||
fake_iface = mock.Mock(spec=pyroute2.ipdb.interfaces.Interface)
|
||||
_set_mtu = mock.Mock()
|
||||
_set_address = mock.Mock()
|
||||
fake_iface.attach_mock(_set_mtu, 'set_mtu')
|
||||
|
@ -30,9 +30,9 @@ class TestVethDriver(base.TestCase):
|
||||
@mock.patch('os.path.exists', return_value=True)
|
||||
@mock.patch('oslo_concurrency.processutils.execute',
|
||||
return_value=('fake_stdout', 'fake_stderr'))
|
||||
@mock.patch('pyroute2.ipdb.interface.InterfacesDict.__getattribute__',
|
||||
@mock.patch('pyroute2.ipdb.interfaces.InterfacesDict.__getattribute__',
|
||||
return_value=mock_create)
|
||||
@mock.patch('pyroute2.ipdb.interface.InterfacesDict.__getitem__',
|
||||
@mock.patch('pyroute2.ipdb.interfaces.InterfacesDict.__getitem__',
|
||||
return_value=mock_interface)
|
||||
def test_port_bind(self, mock_getitem, mock_getattribute,
|
||||
mock_execute, mock_path_exists):
|
||||
|
@ -28,9 +28,9 @@ class TestVlanDriver(base.TestCase):
|
||||
"""Unit tests for nested vlan driver"""
|
||||
|
||||
@mock.patch('kuryr.lib.binding.drivers.utils._configure_container_iface')
|
||||
@mock.patch('pyroute2.ipdb.interface.InterfacesDict.__getattribute__',
|
||||
@mock.patch('pyroute2.ipdb.interfaces.InterfacesDict.__getattribute__',
|
||||
return_value=mock_create)
|
||||
@mock.patch('pyroute2.ipdb.interface.InterfacesDict.__getitem__',
|
||||
@mock.patch('pyroute2.ipdb.interfaces.InterfacesDict.__getitem__',
|
||||
return_value=mock_interface)
|
||||
def test_port_bind(self, mock_getitem, mock_getattribute,
|
||||
mock_configure_container_iface):
|
||||
|
@ -11,6 +11,6 @@ oslo.i18n>=2.1.0 # Apache-2.0
|
||||
oslo.log>=3.22.0 # Apache-2.0
|
||||
oslo.utils>=3.20.0 # Apache-2.0
|
||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||
pyroute2>=0.4.12 # Apache-2.0 (+ dual licensed GPL2)
|
||||
pyroute2>=0.4.15 # Apache-2.0 (+ dual licensed GPL2)
|
||||
python-neutronclient>=5.1.0 # Apache-2.0
|
||||
six>=1.9.0 # MIT
|
||||
|
Loading…
Reference in New Issue
Block a user