plugin/ryu, linux/interface: remove ryu specific interface driver

Implements blueprint ryu-remove-ryu-specific-interface-driver
Since Ryu specific interface driver is not needed any more,
delete it.

Change-Id: Ic3336e8aac3076ddc949044d7ff25608bb7d297f
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
This commit is contained in:
Isaku Yamahata 2012-11-16 04:20:57 +09:00
parent 704c52490d
commit df54e34c6e
2 changed files with 0 additions and 109 deletions

View File

@ -39,9 +39,6 @@ OPTS = [
help='Uses veth for an interface or not'),
cfg.StrOpt('network_device_mtu',
help='MTU setting for device.'),
cfg.StrOpt('ryu_api_host',
default='127.0.0.1:8080',
help='Openflow Ryu REST API host:port'),
cfg.StrOpt('meta_flavor_driver_mappings',
help='Mapping between flavor and LinuxInterfaceDriver')
]
@ -244,33 +241,6 @@ class BridgeInterfaceDriver(LinuxInterfaceDriver):
device_name)
class RyuInterfaceDriver(OVSInterfaceDriver):
"""Driver for creating a Ryu OVS interface."""
def __init__(self, conf):
super(RyuInterfaceDriver, self).__init__(conf)
from ryu.app.client import OFPClient
LOG.debug('ryu rest host %s', self.conf.ryu_api_host)
self.ryu_client = OFPClient(self.conf.ryu_api_host)
def plug(self, network_id, port_id, device_name, mac_address,
bridge=None, namespace=None, prefix=None):
"""Plug in the interface."""
super(RyuInterfaceDriver, self).plug(network_id, port_id, device_name,
mac_address, bridge=bridge,
namespace=namespace,
prefix=prefix)
if not bridge:
bridge = self.conf.ovs_integration_bridge
self.check_bridge_exists(bridge)
ovs_br = ovs_lib.OVSBridge(bridge, self.conf.root_helper)
datapath_id = ovs_br.get_datapath_id()
port_no = ovs_br.get_port_ofport(device_name)
self.ryu_client.create_port(network_id, datapath_id, port_no)
class MetaInterfaceDriver(LinuxInterfaceDriver):
def __init__(self, conf):
super(MetaInterfaceDriver, self).__init__(conf)

View File

@ -351,85 +351,6 @@ class TestBridgeInterfaceDriver(TestBase):
mock.call().link.delete()])
class TestRyuInterfaceDriver(TestBase):
def setUp(self):
super(TestRyuInterfaceDriver, self).setUp()
self.ryu_mod = mock.Mock()
self.ryu_app_mod = self.ryu_mod.app
self.ryu_app_client = self.ryu_app_mod.client
self.ryu_mod_p = mock.patch.dict('sys.modules',
{'ryu': self.ryu_mod,
'ryu.app': self.ryu_app_mod,
'ryu.app.client':
self.ryu_app_client})
self.ryu_mod_p.start()
def tearDown(self):
self.ryu_mod_p.stop()
super(TestRyuInterfaceDriver, self).tearDown()
def test_plug_no_ns(self):
self._test_plug()
def test_plug_with_ns(self):
self._test_plug(namespace='01234567-1234-1234-99')
def test_plug_alt_bridge(self):
self._test_plug(bridge='br-foo')
def _test_plug(self, namespace=None, bridge=None):
if not bridge:
bridge = 'br-int'
def _device_exists(dev, root_helper=None, namespace=None):
return dev == bridge
vsctl_cmd_plug = ['ovs-vsctl', '--', '--may-exist', 'add-port',
bridge, 'tap0', '--', 'set', 'Interface', 'tap0',
'type=internal', '--', 'set', 'Interface', 'tap0',
'external-ids:iface-id=port-1234', '--', 'set',
'Interface', 'tap0',
'external-ids:iface-status=active', '--', 'set',
'Interface', 'tap0',
'external-ids:attached-mac=aa:bb:cc:dd:ee:ff']
vsctl_cmd_ofport = ['ovs-vsctl', '--timeout=2',
'get', 'Interface', 'tap0', 'ofport']
vsctl_cmd_dp = ['ovs-vsctl', '--timeout=2',
'get', 'Bridge', bridge, 'datapath_id']
with mock.patch.object(utils, 'execute') as execute:
self.device_exists.side_effect = _device_exists
ryu = interface.RyuInterfaceDriver(self.conf)
ryu.plug('01234567-1234-1234-99',
'port-1234',
'tap0',
'aa:bb:cc:dd:ee:ff',
bridge=bridge,
namespace=namespace)
execute.assert_has_calls([mock.call(vsctl_cmd_dp,
root_helper='sudo')])
execute.assert_has_calls([mock.call(vsctl_cmd_plug, 'sudo')])
execute.assert_has_calls([mock.call(vsctl_cmd_ofport,
root_helper='sudo')])
self.ryu_app_client.OFPClient.assert_called_once_with('127.0.0.1:8080')
expected = [
mock.call('sudo'),
mock.call().device('tap0'),
mock.call().device().link.set_address('aa:bb:cc:dd:ee:ff')]
if namespace:
expected.extend([
mock.call().ensure_namespace(namespace),
mock.call().ensure_namespace().add_device_to_namespace(
mock.ANY)])
expected.extend([mock.call().device().link.set_up()])
self.ip.assert_has_calls(expected)
class TestMetaInterfaceDriver(TestBase):
def setUp(self):
super(TestMetaInterfaceDriver, self).setUp()