summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2016-02-22 13:29:49 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-02-27 20:40:02 +0900
commit6b10a3b45a8507a54b69317cea25e267f11138bd (patch)
tree9dc5de5207e873728f3fb31e3d2175cf45643b9b
parent7b5d6bd24a59f3482c6303400049042a54335ac2 (diff)
run_mininet: Support protocols option of ovs-vsctl
To support user-specified OpenFlow version, this patch adds protocols option support into run_mininet script. Usage example) $ sudo python run_mininet.py --protocols OpenFlow13 Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rwxr-xr-xryu/tests/switch/run_mininet.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/ryu/tests/switch/run_mininet.py b/ryu/tests/switch/run_mininet.py
index a5acfdea..3a8c6aee 100755
--- a/ryu/tests/switch/run_mininet.py
+++ b/ryu/tests/switch/run_mininet.py
@@ -17,15 +17,16 @@ if '__main__' == __name__:
opts = [
cfg.StrOpt('switch', default='ovs',
- help='test switch (ovs|ovs13|ovs14|cpqd)')
+ help='test switch [ovs|cpqd]'),
+ cfg.StrOpt('protocols', default='OpenFlow13',
+ help='"protocols" option for ovs-vsctl (e.g. OpenFlow13)')
]
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, 'ovs13': OVSSwitch,
- 'ovs14': OVSSwitch, 'cpqd': UserSwitch}
- switch = switch_type.get(conf.switch)
+ switch_type = {'ovs': OVSSwitch, 'cpqd': UserSwitch}
+ switch = switch_type.get(conf.switch, None)
if switch is None:
raise ValueError('Invalid switch type. [%s]', conf.switch)
@@ -45,12 +46,9 @@ if '__main__' == __name__:
s1.start([c0])
s2.start([c0])
- 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')
+ if conf.switch == 'ovs':
+ s1.cmd('ovs-vsctl set Bridge s1 protocols=%s' % conf.protocols)
+ s2.cmd('ovs-vsctl set Bridge s2 protocols=%s' % conf.protocols)
CLI(net)