mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-01-25 02:21:45 +01:00
sw test tool: run_mininet: support Open vSwitch with OpenFlow 1.4
usage)
to use Open vSwitch with OpenFlow 1.4:
sudo ryu/tests/switch/run_mininet.py --swtich ovs14
to use Open vSwitch with OpenFlow 1.3:
sudo ryu/tests/switch/run_mininet.py --switch ovs13
or
sudo ryu/tests/switch/run_mininet.py --switch ovs
or
sudo ryu/tests/switch/run_mininet.py
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
2d173ad25c
commit
76da336bd5
@ -16,13 +16,15 @@ from ryu import version
|
||||
if '__main__' == __name__:
|
||||
|
||||
opts = [
|
||||
cfg.StrOpt('switch', default='ovs', help='test switch (ovs|cpqd)')
|
||||
cfg.StrOpt('switch', default='ovs',
|
||||
help='test switch (ovs|ovs13|ovs14|cpqd)')
|
||||
]
|
||||
conf = cfg.ConfigOpts()
|
||||
conf.register_cli_opts(opts)
|
||||
conf(project='ryu', version='run_mininet.py %s' % version)
|
||||
conf(sys.argv[1:])
|
||||
switch_type = {'ovs': OVSSwitch, 'cpqd': UserSwitch}
|
||||
switch_type = {'ovs': OVSSwitch, 'ovs13': OVSSwitch,
|
||||
'ovs14': OVSSwitch, 'cpqd': UserSwitch}
|
||||
switch = switch_type.get(conf.switch)
|
||||
if switch is None:
|
||||
raise ValueError('Invalid switch type. [%s]', conf.switch)
|
||||
@ -43,9 +45,12 @@ if '__main__' == __name__:
|
||||
s1.start([c0])
|
||||
s2.start([c0])
|
||||
|
||||
if conf.switch == 'ovs':
|
||||
if conf.switch in ['ovs', 'ovs13']:
|
||||
s1.cmd('ovs-vsctl set Bridge s1 protocols=OpenFlow13')
|
||||
s2.cmd('ovs-vsctl set Bridge s2 protocols=OpenFlow13')
|
||||
elif conf.switch == 'ovs14':
|
||||
s1.cmd('ovs-vsctl set Bridge s1 protocols=OpenFlow14')
|
||||
s2.cmd('ovs-vsctl set Bridge s2 protocols=OpenFlow14')
|
||||
|
||||
CLI(net)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user